kitchen-simulator 1.1.1-test.49 → 1.1.1-test.50

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (358) hide show
  1. package/es/@history.js +2 -0
  2. package/es/AppContext.js +3 -0
  3. package/es/KitchenConfigurator.js +645 -0
  4. package/es/KitchenConfiguratorApp.js +480 -0
  5. package/es/actions/area-actions.js +14 -0
  6. package/es/actions/export.js +23 -0
  7. package/es/actions/groups-actions.js +89 -0
  8. package/es/actions/holes-actions.js +119 -0
  9. package/es/actions/items-actions.js +313 -0
  10. package/es/actions/lines-actions.js +81 -0
  11. package/es/actions/project-actions.js +281 -0
  12. package/es/actions/scene-actions.js +33 -0
  13. package/es/actions/vertices-actions.js +27 -0
  14. package/es/actions/viewer2d-actions.js +58 -0
  15. package/es/actions/viewer3d-actions.js +23 -0
  16. package/es/catalog/areas/area/planner-element.js +40 -0
  17. package/es/catalog/areas/area/textures/ceramic-tile.jpg +0 -0
  18. package/es/catalog/areas/area/textures/grass.jpg +0 -0
  19. package/es/catalog/areas/area/textures/parquet.jpg +0 -0
  20. package/es/catalog/areas/area/textures/strand-porcelain.jpg +0 -0
  21. package/es/catalog/areas/area/textures/tile1.jpg +0 -0
  22. package/es/catalog/catalog.js +277 -0
  23. package/es/catalog/envMap/nx.hdr +0 -0
  24. package/es/catalog/envMap/ny.hdr +0 -0
  25. package/es/catalog/envMap/nz.hdr +0 -0
  26. package/es/catalog/envMap/px.hdr +0 -0
  27. package/es/catalog/envMap/py.hdr +0 -0
  28. package/es/catalog/envMap/pz.hdr +0 -0
  29. package/es/catalog/factories/area-factory-3d.js +181 -0
  30. package/es/catalog/factories/area-factory.js +81 -0
  31. package/es/catalog/factories/export.js +7 -0
  32. package/es/catalog/factories/wall-factory-3d.js +202 -0
  33. package/es/catalog/factories/wall-factory.js +268 -0
  34. package/es/catalog/holes/door-closet/planner-element.js +222 -0
  35. package/es/catalog/holes/door-double/door_double.png +0 -0
  36. package/es/catalog/holes/door-double/planner-element.js +315 -0
  37. package/es/catalog/holes/door-exterior/planner-element.js +215 -0
  38. package/es/catalog/holes/door-interior/planner-element.js +227 -0
  39. package/es/catalog/holes/door-panic/panicDoor.png +0 -0
  40. package/es/catalog/holes/door-panic/planner-element.js +503 -0
  41. package/es/catalog/holes/door-panic-double/panicDoorDouble.png +0 -0
  42. package/es/catalog/holes/door-panic-double/planner-element.js +463 -0
  43. package/es/catalog/holes/door-sliding/planner-element.js +225 -0
  44. package/es/catalog/holes/doorway-framed/planner-element.js +145 -0
  45. package/es/catalog/holes/doorway-frameless/planner-element.js +104 -0
  46. package/es/catalog/holes/export.js +13 -0
  47. package/es/catalog/holes/gate/gate.jpg +0 -0
  48. package/es/catalog/holes/window-clear/planner-element.js +166 -0
  49. package/es/catalog/holes/window-clear/texture.png +0 -0
  50. package/es/catalog/holes/window-cross/planner-element.js +165 -0
  51. package/es/catalog/holes/window-cross/texture.png +0 -0
  52. package/es/catalog/holes/window-double-hung/planner-element.js +303 -0
  53. package/es/catalog/holes/window-double-hung/texture.png +0 -0
  54. package/es/catalog/holes/window-vertical/planner-element.js +276 -0
  55. package/es/catalog/holes/window-vertical/texture.png +0 -0
  56. package/es/catalog/lines/wall/planner-element.js +70 -0
  57. package/es/catalog/lines/wall/textures/bricks-normal.jpg +0 -0
  58. package/es/catalog/lines/wall/textures/bricks-normal2.jpg +0 -0
  59. package/es/catalog/lines/wall/textures/bricks.jpg +0 -0
  60. package/es/catalog/lines/wall/textures/bricks2.jpg +0 -0
  61. package/es/catalog/lines/wall/textures/bricks3.jpg +0 -0
  62. package/es/catalog/lines/wall/textures/morden-normal.jpg +0 -0
  63. package/es/catalog/lines/wall/textures/morden.jpg +0 -0
  64. package/es/catalog/lines/wall/textures/painted-normal.jpg +0 -0
  65. package/es/catalog/lines/wall/textures/painted.jpg +0 -0
  66. package/es/catalog/lines/wall/textures/plaster-normal.jpg +0 -0
  67. package/es/catalog/lines/wall/textures/plaster.jpg +0 -0
  68. package/es/catalog/lines/wall/wall.png +0 -0
  69. package/es/catalog/molding/molding-dcm/planner-element.js +28 -0
  70. package/es/catalog/molding/molding-dcm/texture.png +0 -0
  71. package/es/catalog/molding/molding-fbm/planner-element.js +28 -0
  72. package/es/catalog/molding/molding-fbm/texture.png +0 -0
  73. package/es/catalog/molding/molding-lrm/planner-element.js +28 -0
  74. package/es/catalog/molding/molding-lrm/texture.png +0 -0
  75. package/es/catalog/properties/export.js +21 -0
  76. package/es/catalog/properties/property-checkbox.js +116 -0
  77. package/es/catalog/properties/property-color.js +39 -0
  78. package/es/catalog/properties/property-enum.js +97 -0
  79. package/es/catalog/properties/property-hidden.js +19 -0
  80. package/es/catalog/properties/property-lenght-measure.js +101 -0
  81. package/es/catalog/properties/property-length-measure.js +134 -0
  82. package/es/catalog/properties/property-length-measure_hole.js +101 -0
  83. package/es/catalog/properties/property-number.js +48 -0
  84. package/es/catalog/properties/property-read-only.js +26 -0
  85. package/es/catalog/properties/property-string.js +48 -0
  86. package/es/catalog/properties/property-toggle.js +39 -0
  87. package/es/catalog/properties/shared-property-style.js +14 -0
  88. package/es/catalog/utils/FuseUtils.js +82 -0
  89. package/es/catalog/utils/exporter.js +148 -0
  90. package/es/catalog/utils/geom-utils.js +189 -0
  91. package/es/catalog/utils/item-loader.js +1521 -0
  92. package/es/catalog/utils/load-obj.js +91 -0
  93. package/es/catalog/utils/mtl-loader.js +358 -0
  94. package/es/catalog/utils/obj-loader.js +477 -0
  95. package/es/class/FuseUtils.js +82 -0
  96. package/es/class/area.js +145 -0
  97. package/es/class/export.js +24 -0
  98. package/es/class/group.js +440 -0
  99. package/es/class/guide.js +62 -0
  100. package/es/class/hole.js +929 -0
  101. package/es/class/item.js +1883 -0
  102. package/es/class/layer.js +667 -0
  103. package/es/class/line.js +1180 -0
  104. package/es/class/project.js +793 -0
  105. package/es/class/vertex.js +202 -0
  106. package/es/components/content.js +107 -0
  107. package/es/components/disclaimer/disclaimer.js +97 -0
  108. package/es/components/export.js +9 -0
  109. package/es/components/style/button.js +113 -0
  110. package/es/components/style/cancel-button.js +22 -0
  111. package/es/components/style/content-container.js +33 -0
  112. package/es/components/style/content-title.js +29 -0
  113. package/es/components/style/delete-button.js +25 -0
  114. package/es/components/style/export.js +31 -0
  115. package/es/components/style/form-block.js +24 -0
  116. package/es/components/style/form-color-input.js +27 -0
  117. package/es/components/style/form-label.js +26 -0
  118. package/es/components/style/form-number-input.js +213 -0
  119. package/es/components/style/form-number-input_2.js +206 -0
  120. package/es/components/style/form-select.js +68 -0
  121. package/es/components/style/form-slider.js +61 -0
  122. package/es/components/style/form-submit-button.js +26 -0
  123. package/es/components/style/form-text-input.js +95 -0
  124. package/es/components/viewer2d/area.js +81 -0
  125. package/es/components/viewer2d/export.js +31 -0
  126. package/es/components/viewer2d/grids/grid-horizontal-streak.js +37 -0
  127. package/es/components/viewer2d/grids/grid-streak.js +37 -0
  128. package/es/components/viewer2d/grids/grid-vertical-streak.js +37 -0
  129. package/es/components/viewer2d/grids/grids.js +35 -0
  130. package/es/components/viewer2d/group.js +53 -0
  131. package/es/components/viewer2d/item.js +513 -0
  132. package/es/components/viewer2d/layer.js +164 -0
  133. package/es/components/viewer2d/line.js +882 -0
  134. package/es/components/viewer2d/ruler.js +100 -0
  135. package/es/components/viewer2d/rulerDist.js +146 -0
  136. package/es/components/viewer2d/rulerX.js +151 -0
  137. package/es/components/viewer2d/rulerY.js +153 -0
  138. package/es/components/viewer2d/scene.js +140 -0
  139. package/es/components/viewer2d/snap.js +74 -0
  140. package/es/components/viewer2d/state.js +78 -0
  141. package/es/components/viewer2d/utils.js +198 -0
  142. package/es/components/viewer2d/vertex.js +65 -0
  143. package/es/components/viewer2d/viewer2d.js +1398 -0
  144. package/es/components/viewer3d/camera-controls-module/camera-controls.module.js +2592 -0
  145. package/es/components/viewer3d/dcm.js +401 -0
  146. package/es/components/viewer3d/fbm.js +414 -0
  147. package/es/components/viewer3d/front3D.js +66 -0
  148. package/es/components/viewer3d/grid-creator.js +25 -0
  149. package/es/components/viewer3d/grids/grid-horizontal-streak.js +36 -0
  150. package/es/components/viewer3d/grids/grid-streak.js +27 -0
  151. package/es/components/viewer3d/grids/grid-vertical-streak.js +36 -0
  152. package/es/components/viewer3d/libs/first-person-controls.js +67 -0
  153. package/es/components/viewer3d/libs/helvetiker_regular.typeface.js +1281 -0
  154. package/es/components/viewer3d/libs/mtl-loader.js +357 -0
  155. package/es/components/viewer3d/libs/obj-loader.js +462 -0
  156. package/es/components/viewer3d/libs/orbit-controls.js +699 -0
  157. package/es/components/viewer3d/libs/pointer-lock-controls.js +46 -0
  158. package/es/components/viewer3d/lrm.js +305 -0
  159. package/es/components/viewer3d/model.js +708 -0
  160. package/es/components/viewer3d/pointer-lock-navigation.js +115 -0
  161. package/es/components/viewer3d/ruler-utils/itemRect.js +61 -0
  162. package/es/components/viewer3d/ruler-utils/layer3D.js +495 -0
  163. package/es/components/viewer3d/ruler-utils/ruler3D.js +227 -0
  164. package/es/components/viewer3d/ruler-utils/scene3D.js +60 -0
  165. package/es/components/viewer3d/ruler-utils/state3D.js +18 -0
  166. package/es/components/viewer3d/scene-creator.js +3608 -0
  167. package/es/components/viewer3d/three-memory-cleaner.js +51 -0
  168. package/es/components/viewer3d/viewer3d-first-person.js +315 -0
  169. package/es/components/viewer3d/viewer3d.js +2527 -0
  170. package/es/constants.js +636 -0
  171. package/es/index.js +16 -0
  172. package/es/models.js +510 -0
  173. package/es/plugins/SVGLoader.js +1412 -0
  174. package/es/plugins/autosave.js +33 -0
  175. package/es/plugins/console-debugger.js +37 -0
  176. package/es/plugins/export.js +9 -0
  177. package/es/plugins/keyboard.js +101 -0
  178. package/es/reducers/areas-reducer.js +12 -0
  179. package/es/reducers/export.js +25 -0
  180. package/es/reducers/groups-reducer.js +38 -0
  181. package/es/reducers/holes-reducer.js +62 -0
  182. package/es/reducers/items-reducer.js +140 -0
  183. package/es/reducers/lines-reducer.js +45 -0
  184. package/es/reducers/project-reducer.js +129 -0
  185. package/es/reducers/reducer.js +19 -0
  186. package/es/reducers/scene-reducer.js +28 -0
  187. package/es/reducers/user-reducer.js +40 -0
  188. package/es/reducers/vertices-reducer.js +19 -0
  189. package/es/reducers/viewer2d-reducer.js +75 -0
  190. package/es/reducers/viewer3d-reducer.js +56 -0
  191. package/es/shared-style.js +66 -0
  192. package/es/styles/export.js +5 -0
  193. package/es/styles/tabs.css +40 -0
  194. package/es/translator/en.js +104 -0
  195. package/es/translator/it.js +79 -0
  196. package/es/translator/ru.js +79 -0
  197. package/es/translator/translator.js +84 -0
  198. package/es/utils/browser.js +33 -0
  199. package/es/utils/email-validator.js +4 -0
  200. package/es/utils/export.js +25 -0
  201. package/es/utils/geometry.js +2420 -0
  202. package/es/utils/get-edges-of-subgraphs.js +27 -0
  203. package/es/utils/graph-cycles.js +237 -0
  204. package/es/utils/graph-inner-cycles.js +46 -0
  205. package/es/utils/graph.js +150 -0
  206. package/es/utils/helper.js +268 -0
  207. package/es/utils/history.js +29 -0
  208. package/es/utils/id-broker.js +19 -0
  209. package/es/utils/logger.js +8 -0
  210. package/es/utils/math.js +50 -0
  211. package/es/utils/molding.js +871 -0
  212. package/es/utils/name-generator.js +18 -0
  213. package/es/utils/objects-utils.js +50 -0
  214. package/es/utils/phone-validator.js +4 -0
  215. package/es/utils/process-black-list.js +18 -0
  216. package/es/utils/react-if.js +18 -0
  217. package/es/utils/snap-scene.js +99 -0
  218. package/es/utils/snap.js +237 -0
  219. package/es/utils/summarizeCart.js +24 -0
  220. package/es/utils/threeCSG.es6.js +498 -0
  221. package/es/version.js +2 -0
  222. package/lib/catalog/properties/property-string.js +55 -0
  223. package/lib/catalog/properties/property-toggle.js +46 -0
  224. package/lib/catalog/properties/shared-property-style.js +20 -0
  225. package/lib/catalog/utils/FuseUtils.js +88 -0
  226. package/lib/catalog/utils/exporter.js +155 -0
  227. package/lib/catalog/utils/geom-utils.js +205 -0
  228. package/lib/catalog/utils/item-loader.js +1533 -0
  229. package/lib/catalog/utils/load-obj.js +99 -0
  230. package/lib/catalog/utils/mtl-loader.js +363 -0
  231. package/lib/catalog/utils/obj-loader.js +482 -0
  232. package/lib/class/FuseUtils.js +88 -0
  233. package/lib/class/area.js +150 -0
  234. package/lib/class/export.js +96 -0
  235. package/lib/class/group.js +445 -0
  236. package/lib/class/guide.js +67 -0
  237. package/lib/class/hole.js +934 -0
  238. package/lib/class/item.js +1889 -0
  239. package/lib/class/layer.js +672 -0
  240. package/lib/class/line.js +1186 -0
  241. package/lib/class/project.js +799 -0
  242. package/lib/class/vertex.js +207 -0
  243. package/lib/components/content.js +116 -0
  244. package/lib/components/disclaimer/disclaimer.js +105 -0
  245. package/lib/components/export.js +33 -0
  246. package/lib/components/style/button.js +120 -0
  247. package/lib/components/style/cancel-button.js +29 -0
  248. package/lib/components/style/content-container.js +40 -0
  249. package/lib/components/style/content-title.js +37 -0
  250. package/lib/components/style/delete-button.js +34 -0
  251. package/lib/components/style/export.js +121 -0
  252. package/lib/components/style/form-block.js +31 -0
  253. package/lib/components/style/form-color-input.js +34 -0
  254. package/lib/components/style/form-label.js +33 -0
  255. package/lib/components/style/form-number-input.js +220 -0
  256. package/lib/components/style/form-number-input_2.js +213 -0
  257. package/lib/components/style/form-select.js +75 -0
  258. package/lib/components/style/form-slider.js +68 -0
  259. package/lib/components/style/form-submit-button.js +35 -0
  260. package/lib/components/style/form-text-input.js +101 -0
  261. package/lib/components/viewer2d/area.js +88 -0
  262. package/lib/components/viewer2d/export.js +121 -0
  263. package/lib/components/viewer2d/grids/grid-horizontal-streak.js +44 -0
  264. package/lib/components/viewer2d/grids/grid-streak.js +44 -0
  265. package/lib/components/viewer2d/grids/grid-vertical-streak.js +44 -0
  266. package/lib/components/viewer2d/grids/grids.js +44 -0
  267. package/lib/components/viewer2d/group.js +62 -0
  268. package/lib/components/viewer2d/item.js +521 -0
  269. package/lib/components/viewer2d/layer.js +171 -0
  270. package/lib/components/viewer2d/line.js +892 -0
  271. package/lib/components/viewer2d/ruler.js +107 -0
  272. package/lib/components/viewer2d/rulerDist.js +153 -0
  273. package/lib/components/viewer2d/rulerX.js +158 -0
  274. package/lib/components/viewer2d/rulerY.js +160 -0
  275. package/lib/components/viewer2d/scene.js +147 -0
  276. package/lib/components/viewer2d/snap.js +83 -0
  277. package/lib/components/viewer2d/state.js +87 -0
  278. package/lib/components/viewer2d/utils.js +210 -0
  279. package/lib/components/viewer2d/vertex.js +74 -0
  280. package/lib/components/viewer2d/viewer2d.js +1405 -0
  281. package/lib/components/viewer3d/camera-controls-module/camera-controls.module.js +2597 -0
  282. package/lib/components/viewer3d/dcm.js +407 -0
  283. package/lib/components/viewer3d/fbm.js +420 -0
  284. package/lib/components/viewer3d/front3D.js +75 -0
  285. package/lib/components/viewer3d/grid-creator.js +34 -0
  286. package/lib/components/viewer3d/grids/grid-horizontal-streak.js +44 -0
  287. package/lib/components/viewer3d/grids/grid-streak.js +35 -0
  288. package/lib/components/viewer3d/grids/grid-vertical-streak.js +44 -0
  289. package/lib/components/viewer3d/libs/first-person-controls.js +74 -0
  290. package/lib/components/viewer3d/libs/helvetiker_regular.typeface.js +1287 -0
  291. package/lib/components/viewer3d/libs/mtl-loader.js +363 -0
  292. package/lib/components/viewer3d/libs/obj-loader.js +468 -0
  293. package/lib/components/viewer3d/libs/orbit-controls.js +705 -0
  294. package/lib/components/viewer3d/libs/pointer-lock-controls.js +52 -0
  295. package/lib/components/viewer3d/lrm.js +311 -0
  296. package/lib/components/viewer3d/model.js +714 -0
  297. package/lib/components/viewer3d/pointer-lock-navigation.js +122 -0
  298. package/lib/components/viewer3d/ruler-utils/itemRect.js +68 -0
  299. package/lib/components/viewer3d/ruler-utils/layer3D.js +502 -0
  300. package/lib/components/viewer3d/ruler-utils/ruler3D.js +234 -0
  301. package/lib/components/viewer3d/ruler-utils/scene3D.js +68 -0
  302. package/lib/components/viewer3d/ruler-utils/state3D.js +25 -0
  303. package/lib/components/viewer3d/scene-creator.js +3642 -0
  304. package/lib/components/viewer3d/three-memory-cleaner.js +60 -0
  305. package/lib/components/viewer3d/viewer3d-first-person.js +320 -0
  306. package/lib/components/viewer3d/viewer3d.js +2532 -0
  307. package/lib/constants.js +645 -0
  308. package/lib/index.js +96 -0
  309. package/lib/models.js +517 -0
  310. package/lib/plugins/SVGLoader.js +1417 -0
  311. package/lib/plugins/autosave.js +39 -0
  312. package/lib/plugins/console-debugger.js +44 -0
  313. package/lib/plugins/export.js +33 -0
  314. package/lib/plugins/keyboard.js +107 -0
  315. package/lib/reducers/areas-reducer.js +18 -0
  316. package/lib/reducers/export.js +97 -0
  317. package/lib/reducers/groups-reducer.js +44 -0
  318. package/lib/reducers/holes-reducer.js +68 -0
  319. package/lib/reducers/items-reducer.js +146 -0
  320. package/lib/reducers/lines-reducer.js +51 -0
  321. package/lib/reducers/project-reducer.js +135 -0
  322. package/lib/reducers/reducer.js +26 -0
  323. package/lib/reducers/scene-reducer.js +34 -0
  324. package/lib/reducers/user-reducer.js +46 -0
  325. package/lib/reducers/vertices-reducer.js +25 -0
  326. package/lib/reducers/viewer2d-reducer.js +82 -0
  327. package/lib/reducers/viewer3d-reducer.js +63 -0
  328. package/lib/shared-style.js +72 -0
  329. package/lib/styles/export.js +13 -0
  330. package/lib/translator/en.js +110 -0
  331. package/lib/translator/it.js +85 -0
  332. package/lib/translator/ru.js +85 -0
  333. package/lib/translator/translator.js +90 -0
  334. package/lib/utils/browser.js +40 -0
  335. package/lib/utils/email-validator.js +10 -0
  336. package/lib/utils/export.js +56 -0
  337. package/lib/utils/geometry.js +2516 -0
  338. package/lib/utils/get-edges-of-subgraphs.js +34 -0
  339. package/lib/utils/graph-cycles.js +240 -0
  340. package/lib/utils/graph-inner-cycles.js +54 -0
  341. package/lib/utils/graph.js +157 -0
  342. package/lib/utils/helper.js +291 -0
  343. package/lib/utils/history.js +36 -0
  344. package/lib/utils/id-broker.js +25 -0
  345. package/lib/utils/logger.js +14 -0
  346. package/lib/utils/math.js +57 -0
  347. package/lib/utils/molding.js +895 -0
  348. package/lib/utils/name-generator.js +23 -0
  349. package/lib/utils/objects-utils.js +60 -0
  350. package/lib/utils/phone-validator.js +10 -0
  351. package/lib/utils/process-black-list.js +24 -0
  352. package/lib/utils/react-if.js +24 -0
  353. package/lib/utils/snap-scene.js +105 -0
  354. package/lib/utils/snap.js +249 -0
  355. package/lib/utils/summarizeCart.js +30 -0
  356. package/lib/utils/threeCSG.es6.js +503 -0
  357. package/lib/version.js +8 -0
  358. package/package.json +3 -3
@@ -0,0 +1,503 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+ var THREE = _interopRequireWildcard(require("three"));
8
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
9
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
10
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
11
+ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
12
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
13
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
14
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /*jshint esversion: 6 */
15
+ var EPSILON = 1e-5,
16
+ COPLANAR = 0,
17
+ FRONT = 1,
18
+ BACK = 2,
19
+ SPANNING = 3;
20
+ var ThreeBSP = exports["default"] = /*#__PURE__*/function () {
21
+ function ThreeBSP(geometry) {
22
+ _classCallCheck(this, ThreeBSP);
23
+ // Convert THREE.Geometry to ThreeBSP
24
+ var i,
25
+ _length_i,
26
+ face,
27
+ vertex,
28
+ faceVertexUvs,
29
+ uvs,
30
+ polygon,
31
+ polygons = [],
32
+ tree;
33
+ this.Polygon = Polygon;
34
+ this.Vertex = Vertex;
35
+ this.Node = Node;
36
+ if (geometry instanceof THREE.BufferGeometry) {
37
+ this.matrix = new THREE.Matrix4();
38
+ } else if (geometry instanceof THREE.Mesh) {
39
+ // #todo: add hierarchy support
40
+ geometry.updateMatrix();
41
+ this.matrix = geometry.matrix.clone();
42
+ geometry = geometry.geometry;
43
+ } else if (geometry instanceof Node) {
44
+ this.tree = geometry;
45
+ this.matrix = new THREE.Matrix4();
46
+ return this;
47
+ } else {
48
+ throw 'ThreeBSP: Given geometry is unsupported';
49
+ }
50
+ // Retrieve attributes and indices
51
+ var positionAttribute = geometry.attributes.position;
52
+ var normalAttribute = geometry.attributes.normal;
53
+ var uvAttribute = geometry.attributes.uv;
54
+ var indexAttribute = geometry.index;
55
+ for (var _i = 0; _i < indexAttribute.count; _i += 3) {
56
+ polygon = new Polygon();
57
+ for (var j = 0; j < 3; j++) {
58
+ var index = indexAttribute.getX(_i + j);
59
+ var _vertex = new THREE.Vector3().fromBufferAttribute(positionAttribute, index);
60
+ var normal = new THREE.Vector3().fromBufferAttribute(normalAttribute, index);
61
+ var _uvs = uvAttribute ? new THREE.Vector2().fromBufferAttribute(uvAttribute, index) : null;
62
+ var vertexData = new Vertex(_vertex.x, _vertex.y, _vertex.z, normal, _uvs);
63
+ vertexData.applyMatrix4(this.matrix);
64
+ polygon.vertices.push(vertexData);
65
+ }
66
+ polygon.calculateProperties();
67
+ polygons.push(polygon);
68
+ }
69
+ this.tree = new Node(polygons);
70
+ }
71
+ return _createClass(ThreeBSP, [{
72
+ key: "subtract",
73
+ value: function subtract(other_tree) {
74
+ var a = this.tree.clone(),
75
+ b = other_tree.tree.clone();
76
+ a.invert();
77
+ a.clipTo(b);
78
+ b.clipTo(a);
79
+ b.invert();
80
+ b.clipTo(a);
81
+ b.invert();
82
+ a.build(b.allPolygons());
83
+ a.invert();
84
+ a = new ThreeBSP(a);
85
+ a.matrix = this.matrix;
86
+ return a;
87
+ }
88
+ }, {
89
+ key: "union",
90
+ value: function union(other_tree) {
91
+ var a = this.tree.clone(),
92
+ b = other_tree.tree.clone();
93
+ a.clipTo(b);
94
+ b.clipTo(a);
95
+ b.invert();
96
+ b.clipTo(a);
97
+ b.invert();
98
+ a.build(b.allPolygons());
99
+ a = new ThreeBSP(a);
100
+ a.matrix = this.matrix;
101
+ return a;
102
+ }
103
+ }, {
104
+ key: "intersect",
105
+ value: function intersect(other_tree) {
106
+ var a = this.tree.clone(),
107
+ b = other_tree.tree.clone();
108
+ a.invert();
109
+ b.clipTo(a);
110
+ b.invert();
111
+ a.clipTo(b);
112
+ b.clipTo(a);
113
+ a.build(b.allPolygons());
114
+ a.invert();
115
+ a = new ThreeBSP(a);
116
+ a.matrix = this.matrix;
117
+ return a;
118
+ }
119
+ }, {
120
+ key: "toGeometry",
121
+ value: function toGeometry() {
122
+ var matrix = new THREE.Matrix4().copy(this.matrix).invert();
123
+ var geometry = new THREE.BufferGeometry();
124
+ var polygons = this.tree.allPolygons();
125
+ var verticeDict = new Map();
126
+ var positions = [];
127
+ var normals = [];
128
+ var uvs = [];
129
+ var indices = [];
130
+ polygons.forEach(function (polygon) {
131
+ var polygonVertices = polygon.vertices;
132
+ var _loop = function _loop() {
133
+ var verts = [polygonVertices[0], polygonVertices[j - 1], polygonVertices[j]];
134
+ var verticeIndices = [];
135
+ verts.forEach(function (vertex) {
136
+ var vector = new THREE.Vector3(vertex.x, vertex.y, vertex.z).applyMatrix4(matrix);
137
+ var verticeIndex = positions.length / 3;
138
+ verticeIndices.push(verticeIndex);
139
+ positions.push(vector.x, vector.y, vector.z);
140
+ normals.push(vertex.normal.x, vertex.normal.y, vertex.normal.z);
141
+ uvs.push(vertex.uv.x, vertex.uv.y);
142
+ });
143
+ indices.push(verticeIndices[0], verticeIndices[1], verticeIndices[2]);
144
+ };
145
+ for (var j = 2; j < polygonVertices.length; j++) {
146
+ _loop();
147
+ }
148
+ });
149
+ geometry.setAttribute('position', new THREE.Float32BufferAttribute(positions, 3));
150
+ geometry.setAttribute('normal', new THREE.Float32BufferAttribute(normals, 3));
151
+ geometry.setAttribute('uv', new THREE.Float32BufferAttribute(uvs, 2));
152
+ geometry.setIndex(indices);
153
+ return geometry;
154
+ }
155
+ }, {
156
+ key: "toMesh",
157
+ value: function toMesh(material) {
158
+ var geometry = this.toGeometry(),
159
+ mesh = new THREE.Mesh(geometry, material);
160
+ mesh.position.setFromMatrixPosition(this.matrix);
161
+ mesh.rotation.setFromRotationMatrix(this.matrix);
162
+ return mesh;
163
+ }
164
+ }]);
165
+ }();
166
+ var Polygon = /*#__PURE__*/function () {
167
+ function Polygon(vertices, normal, w) {
168
+ _classCallCheck(this, Polygon);
169
+ if (!(vertices instanceof Array)) {
170
+ vertices = [];
171
+ }
172
+ this.vertices = vertices;
173
+ if (vertices.length > 0) {
174
+ this.calculateProperties();
175
+ } else {
176
+ this.normal = this.w = undefined;
177
+ }
178
+ }
179
+ return _createClass(Polygon, [{
180
+ key: "calculateProperties",
181
+ value: function calculateProperties() {
182
+ var a = this.vertices[0],
183
+ b = this.vertices[1],
184
+ c = this.vertices[2];
185
+ this.normal = b.clone().subtract(a).cross(c.clone().subtract(a)).normalize();
186
+ this.w = this.normal.clone().dot(a);
187
+ return this;
188
+ }
189
+ }, {
190
+ key: "clone",
191
+ value: function clone() {
192
+ var i,
193
+ vertice_count,
194
+ polygon = new Polygon();
195
+ for (i = 0, vertice_count = this.vertices.length; i < vertice_count; i++) {
196
+ polygon.vertices.push(this.vertices[i].clone());
197
+ }
198
+ polygon.calculateProperties();
199
+ return polygon;
200
+ }
201
+ }, {
202
+ key: "flip",
203
+ value: function flip() {
204
+ var i,
205
+ vertices = [];
206
+ this.normal.multiplyScalar(-1);
207
+ this.w *= -1;
208
+ for (i = this.vertices.length - 1; i >= 0; i--) {
209
+ vertices.push(this.vertices[i]);
210
+ }
211
+ this.vertices = vertices;
212
+ return this;
213
+ }
214
+ }, {
215
+ key: "classifyVertex",
216
+ value: function classifyVertex(vertex) {
217
+ var side_value = this.normal.dot(vertex) - this.w;
218
+ if (side_value < -EPSILON) {
219
+ return BACK;
220
+ } else if (side_value > EPSILON) {
221
+ return FRONT;
222
+ } else {
223
+ return COPLANAR;
224
+ }
225
+ }
226
+ }, {
227
+ key: "classifySide",
228
+ value: function classifySide(polygon) {
229
+ var i,
230
+ vertex,
231
+ classification,
232
+ num_positive = 0,
233
+ num_negative = 0,
234
+ vertice_count = polygon.vertices.length;
235
+ for (i = 0; i < vertice_count; i++) {
236
+ vertex = polygon.vertices[i];
237
+ classification = this.classifyVertex(vertex);
238
+ if (classification === FRONT) {
239
+ num_positive++;
240
+ } else if (classification === BACK) {
241
+ num_negative++;
242
+ }
243
+ }
244
+ if (num_positive > 0 && num_negative === 0) {
245
+ return FRONT;
246
+ } else if (num_positive === 0 && num_negative > 0) {
247
+ return BACK;
248
+ } else if (num_positive === 0 && num_negative === 0) {
249
+ return COPLANAR;
250
+ } else {
251
+ return SPANNING;
252
+ }
253
+ }
254
+ }, {
255
+ key: "splitPolygon",
256
+ value: function splitPolygon(polygon, coplanar_front, coplanar_back, front, back) {
257
+ var classification = this.classifySide(polygon);
258
+ if (classification === COPLANAR) {
259
+ (this.normal.dot(polygon.normal) > 0 ? coplanar_front : coplanar_back).push(polygon);
260
+ } else if (classification === FRONT) {
261
+ front.push(polygon);
262
+ } else if (classification === BACK) {
263
+ back.push(polygon);
264
+ } else {
265
+ var vertice_count,
266
+ i,
267
+ j,
268
+ ti,
269
+ tj,
270
+ vi,
271
+ vj,
272
+ t,
273
+ v,
274
+ f = [],
275
+ b = [];
276
+ for (i = 0, vertice_count = polygon.vertices.length; i < vertice_count; i++) {
277
+ j = (i + 1) % vertice_count;
278
+ vi = polygon.vertices[i];
279
+ vj = polygon.vertices[j];
280
+ ti = this.classifyVertex(vi);
281
+ tj = this.classifyVertex(vj);
282
+ if (ti != BACK) f.push(vi);
283
+ if (ti != FRONT) b.push(vi);
284
+ if ((ti | tj) === SPANNING) {
285
+ t = (this.w - this.normal.dot(vi)) / this.normal.dot(vj.clone().subtract(vi));
286
+ v = vi.interpolate(vj, t);
287
+ f.push(v);
288
+ b.push(v);
289
+ }
290
+ }
291
+ if (f.length >= 3) front.push(new Polygon(f).calculateProperties());
292
+ if (b.length >= 3) back.push(new Polygon(b).calculateProperties());
293
+ }
294
+ }
295
+ }]);
296
+ }();
297
+ var Vertex = /*#__PURE__*/function () {
298
+ function Vertex(x, y, z, normal, uv) {
299
+ _classCallCheck(this, Vertex);
300
+ this.x = x;
301
+ this.y = y;
302
+ this.z = z;
303
+ this.normal = normal || new THREE.Vector3();
304
+ this.uv = uv || new THREE.Vector2();
305
+ }
306
+ return _createClass(Vertex, [{
307
+ key: "clone",
308
+ value: function clone() {
309
+ return new Vertex(this.x, this.y, this.z, this.normal.clone(), this.uv.clone());
310
+ }
311
+ }, {
312
+ key: "add",
313
+ value: function add(vertex) {
314
+ this.x += vertex.x;
315
+ this.y += vertex.y;
316
+ this.z += vertex.z;
317
+ return this;
318
+ }
319
+ }, {
320
+ key: "subtract",
321
+ value: function subtract(vertex) {
322
+ this.x -= vertex.x;
323
+ this.y -= vertex.y;
324
+ this.z -= vertex.z;
325
+ return this;
326
+ }
327
+ }, {
328
+ key: "multiplyScalar",
329
+ value: function multiplyScalar(scalar) {
330
+ this.x *= scalar;
331
+ this.y *= scalar;
332
+ this.z *= scalar;
333
+ return this;
334
+ }
335
+ }, {
336
+ key: "cross",
337
+ value: function cross(vertex) {
338
+ var x = this.x,
339
+ y = this.y,
340
+ z = this.z;
341
+ this.x = y * vertex.z - z * vertex.y;
342
+ this.y = z * vertex.x - x * vertex.z;
343
+ this.z = x * vertex.y - y * vertex.x;
344
+ return this;
345
+ }
346
+ }, {
347
+ key: "normalize",
348
+ value: function normalize() {
349
+ var length = Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z);
350
+ this.x /= length;
351
+ this.y /= length;
352
+ this.z /= length;
353
+ return this;
354
+ }
355
+ }, {
356
+ key: "dot",
357
+ value: function dot(vertex) {
358
+ return this.x * vertex.x + this.y * vertex.y + this.z * vertex.z;
359
+ }
360
+ }, {
361
+ key: "lerp",
362
+ value: function lerp(a, t) {
363
+ this.add(a.clone().subtract(this).multiplyScalar(t));
364
+ this.normal.add(a.normal.clone().sub(this.normal).multiplyScalar(t));
365
+ this.uv.add(a.uv.clone().sub(this.uv).multiplyScalar(t));
366
+ return this;
367
+ }
368
+ }, {
369
+ key: "interpolate",
370
+ value: function interpolate(other, t) {
371
+ return this.clone().lerp(other, t);
372
+ }
373
+ }, {
374
+ key: "applyMatrix4",
375
+ value: function applyMatrix4(m) {
376
+ // input: THREE.Matrix4 affine matrix
377
+
378
+ var x = this.x,
379
+ y = this.y,
380
+ z = this.z;
381
+ var e = m.elements;
382
+ this.x = e[0] * x + e[4] * y + e[8] * z + e[12];
383
+ this.y = e[1] * x + e[5] * y + e[9] * z + e[13];
384
+ this.z = e[2] * x + e[6] * y + e[10] * z + e[14];
385
+ return this;
386
+ }
387
+ }]);
388
+ }();
389
+ var Node = /*#__PURE__*/function () {
390
+ function Node(polygons) {
391
+ _classCallCheck(this, Node);
392
+ var i,
393
+ polygon_count,
394
+ front = [],
395
+ back = [];
396
+ this.polygons = [];
397
+ this.front = this.back = undefined;
398
+ if (!(polygons instanceof Array) || polygons.length === 0) return;
399
+ this.divider = polygons[0].clone();
400
+ for (i = 0, polygon_count = polygons.length; i < polygon_count; i++) {
401
+ this.divider.splitPolygon(polygons[i], this.polygons, this.polygons, front, back);
402
+ }
403
+ if (front.length > 0) {
404
+ this.front = new Node(front);
405
+ }
406
+ if (back.length > 0) {
407
+ this.back = new Node(back);
408
+ }
409
+ }
410
+ return _createClass(Node, [{
411
+ key: "isConvex",
412
+ value: function isConvex(polygons) {
413
+ var i, j;
414
+ for (i = 0; i < polygons.length; i++) {
415
+ for (j = 0; j < polygons.length; j++) {
416
+ if (i !== j && polygons[i].classifySide(polygons[j]) !== BACK) {
417
+ return false;
418
+ }
419
+ }
420
+ }
421
+ return true;
422
+ }
423
+ }, {
424
+ key: "build",
425
+ value: function build(polygons) {
426
+ var i,
427
+ polygon_count,
428
+ front = [],
429
+ back = [];
430
+ if (!this.divider) {
431
+ this.divider = polygons[0].clone();
432
+ }
433
+ for (i = 0, polygon_count = polygons.length; i < polygon_count; i++) {
434
+ this.divider.splitPolygon(polygons[i], this.polygons, this.polygons, front, back);
435
+ }
436
+ if (front.length > 0) {
437
+ if (!this.front) this.front = new Node();
438
+ this.front.build(front);
439
+ }
440
+ if (back.length > 0) {
441
+ if (!this.back) this.back = new Node();
442
+ this.back.build(back);
443
+ }
444
+ }
445
+ }, {
446
+ key: "allPolygons",
447
+ value: function allPolygons() {
448
+ var polygons = this.polygons.slice();
449
+ if (this.front) polygons = polygons.concat(this.front.allPolygons());
450
+ if (this.back) polygons = polygons.concat(this.back.allPolygons());
451
+ return polygons;
452
+ }
453
+ }, {
454
+ key: "clone",
455
+ value: function clone() {
456
+ var node = new Node();
457
+ node.divider = this.divider.clone();
458
+ node.polygons = this.polygons.map(function (polygon) {
459
+ return polygon.clone();
460
+ });
461
+ node.front = this.front && this.front.clone();
462
+ node.back = this.back && this.back.clone();
463
+ return node;
464
+ }
465
+ }, {
466
+ key: "invert",
467
+ value: function invert() {
468
+ var i, polygon_count, temp;
469
+ for (i = 0, polygon_count = this.polygons.length; i < polygon_count; i++) {
470
+ this.polygons[i].flip();
471
+ }
472
+ this.divider.flip();
473
+ if (this.front) this.front.invert();
474
+ if (this.back) this.back.invert();
475
+ temp = this.front;
476
+ this.front = this.back;
477
+ this.back = temp;
478
+ return this;
479
+ }
480
+ }, {
481
+ key: "clipPolygons",
482
+ value: function clipPolygons(polygons) {
483
+ var i, polygon_count, front, back;
484
+ if (!this.divider) return polygons.slice();
485
+ front = [];
486
+ back = [];
487
+ for (i = 0, polygon_count = polygons.length; i < polygon_count; i++) {
488
+ this.divider.splitPolygon(polygons[i], front, back, front, back);
489
+ }
490
+ if (this.front) front = this.front.clipPolygons(front);
491
+ if (this.back) back = this.back.clipPolygons(back);else back = [];
492
+ return front.concat(back);
493
+ }
494
+ }, {
495
+ key: "clipTo",
496
+ value: function clipTo(node) {
497
+ this.polygons = node.clipPolygons(this.polygons);
498
+ if (this.front) this.front.clipTo(node);
499
+ if (this.back) this.back.clipTo(node);
500
+ }
501
+ }]);
502
+ }();
503
+ window.ThreeBSP = ThreeBSP;
package/lib/version.js ADDED
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.VERSION = void 0;
7
+ // THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
8
+ var VERSION = exports.VERSION = '0.0.1';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kitchen-simulator",
3
- "version": "1.1.1-test.49",
3
+ "version": "1.1.1-test.50",
4
4
  "description": "It is a kitchen simulator.",
5
5
  "license": "MIT",
6
6
  "main": "lib/index.js",
@@ -84,7 +84,8 @@
84
84
  "react-redux": "5.0.7",
85
85
  "react-svg-pan-zoom": "^3.13.1",
86
86
  "redux": "4.0.1",
87
- "stream-browserify": "^3.0.0"
87
+ "stream-browserify": "^3.0.0",
88
+ "three": "0.166.0"
88
89
  },
89
90
  "devDependencies": {
90
91
  "@babel/cli": "^7.28.3",
@@ -113,7 +114,6 @@
113
114
  "react-dom": "16.9.0",
114
115
  "rimraf": "^2.6.3",
115
116
  "style-loader": "*",
116
- "three": "0.166.0",
117
117
  "webpack": "5.92.1",
118
118
  "webpack-cli": "5.1.4",
119
119
  "webpack-dev-server": "5.0.4"