not really known
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

268 lines
7.3 KiB

  1. //Copyright (c) 2013, Playful Invention Company.
  2. //Permission is hereby granted, free of charge, to any person obtaining a copy
  3. //of this software and associated documentation files (the "Software"), to deal
  4. //in the Software without restriction, including without limitation the rights
  5. //to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  6. //copies of the Software, and to permit persons to whom the Software is
  7. //furnished to do so, subject to the following conditions:
  8. //The above copyright notice and this permission notice shall be included in
  9. //all copies or substantial portions of the Software.
  10. //THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  11. //IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  12. //FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  13. //AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  14. //LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  15. //OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  16. //THE SOFTWARE.
  17. // -----
  18. // GridPaint has been kept extremely minimal as an explicit design choice.
  19. // If you want to add features please make a fork with a different name.
  20. // Thanks in advance
  21. var shapedefs = [
  22. [60,60,60,0,120,60],
  23. [60,60,120,60,60,120],
  24. [60,60,60,120,0,60],
  25. [60,60,0,60,60,0],
  26. [0,0,60,0,0,60],
  27. [120,0,120,60,60,0],
  28. [120,120,60,120,120,60],
  29. [0,120,0,60,60,120],
  30. [180,60,180,0,240,60],
  31. [180,60,240,60,180,120],
  32. [180,60,180,120,120,60],
  33. [180,60,120,60,180,0],
  34. [120,0,180,0,120,60],
  35. [240,0,240,60,180,0],
  36. [240,120,180,120,240,60],
  37. [120,120,120,60,180,120],
  38. [300,60,300,0,360,60],
  39. [300,60,360,60,300,120],
  40. [300,60,300,120,240,60],
  41. [300,60,240,60,300,0],
  42. [240,0,300,0,240,60],
  43. [360,0,360,60,300,0],
  44. [360,120,300,120,360,60],
  45. [240,120,240,60,300,120],
  46. [420,60,420,0,480,60],
  47. [420,60,480,60,420,120],
  48. [420,60,420,120,360,60],
  49. [420,60,360,60,420,0],
  50. [360,0,420,0,360,60],
  51. [480,0,480,60,420,0],
  52. [480,120,420,120,480,60],
  53. [360,120,360,60,420,120],
  54. [540,60,540,0,600,60],
  55. [540,60,600,60,540,120],
  56. [540,60,540,120,480,60],
  57. [540,60,480,60,540,0],
  58. [480,0,540,0,480,60],
  59. [600,0,600,60,540,0],
  60. [600,120,540,120,600,60],
  61. [480,120,480,60,540,120],
  62. [660,60,660,0,720,60],
  63. [660,60,720,60,660,120],
  64. [660,60,660,120,600,60],
  65. [660,60,600,60,660,0],
  66. [600,0,660,0,600,60],
  67. [720,0,720,60,660,0],
  68. [720,120,660,120,720,60],
  69. [600,120,600,60,660,120],
  70. [60,180,60,120,120,180],
  71. [60,180,120,180,60,240],
  72. [60,180,60,240,0,180],
  73. [60,180,0,180,60,120],
  74. [0,120,60,120,0,180],
  75. [120,120,120,180,60,120],
  76. [120,240,60,240,120,180],
  77. [0,240,0,180,60,240],
  78. [180,180,180,120,240,180],
  79. [180,180,240,180,180,240],
  80. [180,180,180,240,120,180],
  81. [180,180,120,180,180,120],
  82. [120,120,180,120,120,180],
  83. [240,120,240,180,180,120],
  84. [240,240,180,240,240,180],
  85. [120,240,120,180,180,240],
  86. [300,180,300,120,360,180],
  87. [300,180,360,180,300,240],
  88. [300,180,300,240,240,180],
  89. [300,180,240,180,300,120],
  90. [240,120,300,120,240,180],
  91. [360,120,360,180,300,120],
  92. [360,240,300,240,360,180],
  93. [240,240,240,180,300,240],
  94. [420,180,420,120,480,180],
  95. [420,180,480,180,420,240],
  96. [420,180,420,240,360,180],
  97. [420,180,360,180,420,120],
  98. [360,120,420,120,360,180],
  99. [480,120,480,180,420,120],
  100. [480,240,420,240,480,180],
  101. [360,240,360,180,420,240],
  102. [540,180,540,120,600,180],
  103. [540,180,600,180,540,240],
  104. [540,180,540,240,480,180],
  105. [540,180,480,180,540,120],
  106. [480,120,540,120,480,180],
  107. [600,120,600,180,540,120],
  108. [600,240,540,240,600,180],
  109. [480,240,480,180,540,240],
  110. [660,180,660,120,720,180],
  111. [660,180,720,180,660,240],
  112. [660,180,660,240,600,180],
  113. [660,180,600,180,660,120],
  114. [600,120,660,120,600,180],
  115. [720,120,720,180,660,120],
  116. [720,240,660,240,720,180],
  117. [600,240,600,180,660,240],
  118. [60,300,60,240,120,300],
  119. [60,300,120,300,60,360],
  120. [60,300,60,360,0,300],
  121. [60,300,0,300,60,240],
  122. [0,240,60,240,0,300],
  123. [120,240,120,300,60,240],
  124. [120,360,60,360,120,300],
  125. [0,360,0,300,60,360],
  126. [180,300,180,240,240,300],
  127. [180,300,240,300,180,360],
  128. [180,300,180,360,120,300],
  129. [180,300,120,300,180,240],
  130. [120,240,180,240,120,300],
  131. [240,240,240,300,180,240],
  132. [240,360,180,360,240,300],
  133. [120,360,120,300,180,360],
  134. [300,300,300,240,360,300],
  135. [300,300,360,300,300,360],
  136. [300,300,300,360,240,300],
  137. [300,300,240,300,300,240],
  138. [240,240,300,240,240,300],
  139. [360,240,360,300,300,240],
  140. [360,360,300,360,360,300],
  141. [240,360,240,300,300,360],
  142. [420,300,420,240,480,300],
  143. [420,300,480,300,420,360],
  144. [420,300,420,360,360,300],
  145. [420,300,360,300,420,240],
  146. [360,240,420,240,360,300],
  147. [480,240,480,300,420,240],
  148. [480,360,420,360,480,300],
  149. [360,360,360,300,420,360],
  150. [540,300,540,240,600,300],
  151. [540,300,600,300,540,360],
  152. [540,300,540,360,480,300],
  153. [540,300,480,300,540,240],
  154. [480,240,540,240,480,300],
  155. [600,240,600,300,540,240],
  156. [600,360,540,360,600,300],
  157. [480,360,480,300,540,360],
  158. [660,300,660,240,720,300],
  159. [660,300,720,300,660,360],
  160. [660,300,660,360,600,300],
  161. [660,300,600,300,660,240],
  162. [600,240,660,240,600,300],
  163. [720,240,720,300,660,240],
  164. [720,360,660,360,720,300],
  165. [600,360,600,300,660,360],
  166. [60,420,60,360,120,420],
  167. [60,420,120,420,60,480],
  168. [60,420,60,480,0,420],
  169. [60,420,0,420,60,360],
  170. [0,360,60,360,0,420],
  171. [120,360,120,420,60,360],
  172. [120,480,60,480,120,420],
  173. [0,480,0,420,60,480],
  174. [180,420,180,360,240,420],
  175. [180,420,240,420,180,480],
  176. [180,420,180,480,120,420],
  177. [180,420,120,420,180,360],
  178. [120,360,180,360,120,420],
  179. [240,360,240,420,180,360],
  180. [240,480,180,480,240,420],
  181. [120,480,120,420,180,480],
  182. [300,420,300,360,360,420],
  183. [300,420,360,420,300,480],
  184. [300,420,300,480,240,420],
  185. [300,420,240,420,300,360],
  186. [240,360,300,360,240,420],
  187. [360,360,360,420,300,360],
  188. [360,480,300,480,360,420],
  189. [240,480,240,420,300,480],
  190. [420,420,420,360,480,420],
  191. [420,420,480,420,420,480],
  192. [420,420,420,480,360,420],
  193. [420,420,360,420,420,360],
  194. [360,360,420,360,360,420],
  195. [480,360,480,420,420,360],
  196. [480,480,420,480,480,420],
  197. [360,480,360,420,420,480],
  198. [540,420,540,360,600,420],
  199. [540,420,600,420,540,480],
  200. [540,420,540,480,480,420],
  201. [540,420,480,420,540,360],
  202. [480,360,540,360,480,420],
  203. [600,360,600,420,540,360],
  204. [600,480,540,480,600,420],
  205. [480,480,480,420,540,480],
  206. [660,420,660,360,720,420],
  207. [660,420,720,420,660,480],
  208. [660,420,660,480,600,420],
  209. [660,420,600,420,660,360],
  210. [600,360,660,360,600,420],
  211. [720,360,720,420,660,360],
  212. [720,480,660,480,720,420],
  213. [600,480,600,420,660,480],
  214. [60,540,60,480,120,540],
  215. [60,540,120,540,60,600],
  216. [60,540,60,600,0,540],
  217. [60,540,0,540,60,480],
  218. [0,480,60,480,0,540],
  219. [120,480,120,540,60,480],
  220. [120,600,60,600,120,540],
  221. [0,600,0,540,60,600],
  222. [180,540,180,480,240,540],
  223. [180,540,240,540,180,600],
  224. [180,540,180,600,120,540],
  225. [180,540,120,540,180,480],
  226. [120,480,180,480,120,540],
  227. [240,480,240,540,180,480],
  228. [240,600,180,600,240,540],
  229. [120,600,120,540,180,600],
  230. [300,540,300,480,360,540],
  231. [300,540,360,540,300,600],
  232. [300,540,300,600,240,540],
  233. [300,540,240,540,300,480],
  234. [240,480,300,480,240,540],
  235. [360,480,360,540,300,480],
  236. [360,600,300,600,360,540],
  237. [240,600,240,540,300,600],
  238. [420,540,420,480,480,540],
  239. [420,540,480,540,420,600],
  240. [420,540,420,600,360,540],
  241. [420,540,360,540,420,480],
  242. [360,480,420,480,360,540],
  243. [480,480,480,540,420,480],
  244. [480,600,420,600,480,540],
  245. [360,600,360,540,420,600],
  246. [540,540,540,480,600,540],
  247. [540,540,600,540,540,600],
  248. [540,540,540,600,480,540],
  249. [540,540,480,540,540,480],
  250. [480,480,540,480,480,540],
  251. [600,480,600,540,540,480],
  252. [600,600,540,600,600,540],
  253. [480,600,480,540,540,600],
  254. [660,540,660,480,720,540],
  255. [660,540,720,540,660,600],
  256. [660,540,660,600,600,540],
  257. [660,540,600,540,660,480],
  258. [600,480,660,480,600,540],
  259. [720,480,720,540,660,480],
  260. [720,600,660,600,720,540],
  261. [600,600,600,540,660,600],
  262. ];