kitchen-simulator 5.0.0-test.1 → 5.0.0-test.10

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 (1619) hide show
  1. package/package.json +45 -51
  2. package/src/KitchenConfigurator.jsx +1 -1
  3. package/src/components/export.js +16 -23
  4. package/src/components/viewer3d/scene-creator.js +23 -26
  5. package/src/components/viewer3d/viewer3d.js +18 -18
  6. package/src/index.js +1 -4
  7. package/es/@history.js +0 -3
  8. package/es/@history.js.map +0 -1
  9. package/es/AppContext.js +0 -4
  10. package/es/AppContext.js.map +0 -1
  11. package/es/KitchenConfigurator.js +0 -1345
  12. package/es/KitchenConfigurator.js.map +0 -1
  13. package/es/KitchenConfiguratorApp.js +0 -532
  14. package/es/KitchenConfiguratorApp.js.map +0 -1
  15. package/es/actions/area-actions.js +0 -15
  16. package/es/actions/area-actions.js.map +0 -1
  17. package/es/actions/export.js +0 -26
  18. package/es/actions/export.js.map +0 -1
  19. package/es/actions/groups-actions.js +0 -90
  20. package/es/actions/groups-actions.js.map +0 -1
  21. package/es/actions/holes-actions.js +0 -120
  22. package/es/actions/holes-actions.js.map +0 -1
  23. package/es/actions/items-actions.js +0 -314
  24. package/es/actions/items-actions.js.map +0 -1
  25. package/es/actions/lines-actions.js +0 -83
  26. package/es/actions/lines-actions.js.map +0 -1
  27. package/es/actions/project-actions.js +0 -282
  28. package/es/actions/project-actions.js.map +0 -1
  29. package/es/actions/scene-actions.js +0 -34
  30. package/es/actions/scene-actions.js.map +0 -1
  31. package/es/actions/user-actions.js +0 -59
  32. package/es/actions/user-actions.js.map +0 -1
  33. package/es/actions/vertices-actions.js +0 -28
  34. package/es/actions/vertices-actions.js.map +0 -1
  35. package/es/actions/viewer2d-actions.js +0 -59
  36. package/es/actions/viewer2d-actions.js.map +0 -1
  37. package/es/actions/viewer3d-actions.js +0 -24
  38. package/es/actions/viewer3d-actions.js.map +0 -1
  39. package/es/catalog/areas/area/planner-element.js +0 -41
  40. package/es/catalog/areas/area/planner-element.js.map +0 -1
  41. package/es/catalog/areas/area/textures/ceramic-tile.jpg +0 -0
  42. package/es/catalog/areas/area/textures/grass.jpg +0 -0
  43. package/es/catalog/areas/area/textures/parquet.jpg +0 -0
  44. package/es/catalog/areas/area/textures/strand-porcelain.jpg +0 -0
  45. package/es/catalog/areas/area/textures/tile1.jpg +0 -0
  46. package/es/catalog/back.png +0 -0
  47. package/es/catalog/catalog.js +0 -278
  48. package/es/catalog/catalog.js.map +0 -1
  49. package/es/catalog/doors.png +0 -0
  50. package/es/catalog/doorways.png +0 -0
  51. package/es/catalog/envMap/nx.hdr +0 -0
  52. package/es/catalog/envMap/ny.hdr +0 -0
  53. package/es/catalog/envMap/nz.hdr +0 -0
  54. package/es/catalog/envMap/px.hdr +0 -0
  55. package/es/catalog/envMap/py.hdr +0 -0
  56. package/es/catalog/envMap/pz.hdr +0 -0
  57. package/es/catalog/factories/area-factory-3d.js +0 -183
  58. package/es/catalog/factories/area-factory-3d.js.map +0 -1
  59. package/es/catalog/factories/area-factory.js +0 -82
  60. package/es/catalog/factories/area-factory.js.map +0 -1
  61. package/es/catalog/factories/export.js +0 -8
  62. package/es/catalog/factories/export.js.map +0 -1
  63. package/es/catalog/factories/wall-factory-3d.js +0 -203
  64. package/es/catalog/factories/wall-factory-3d.js.map +0 -1
  65. package/es/catalog/factories/wall-factory.js +0 -269
  66. package/es/catalog/factories/wall-factory.js.map +0 -1
  67. package/es/catalog/holes/door-closet/planner-element.js +0 -223
  68. package/es/catalog/holes/door-closet/planner-element.js.map +0 -1
  69. package/es/catalog/holes/door-double/door_double.png +0 -0
  70. package/es/catalog/holes/door-double/planner-element.js +0 -316
  71. package/es/catalog/holes/door-double/planner-element.js.map +0 -1
  72. package/es/catalog/holes/door-exterior/planner-element.js +0 -216
  73. package/es/catalog/holes/door-exterior/planner-element.js.map +0 -1
  74. package/es/catalog/holes/door-interior/planner-element.js +0 -228
  75. package/es/catalog/holes/door-interior/planner-element.js.map +0 -1
  76. package/es/catalog/holes/door-panic/panicDoor.png +0 -0
  77. package/es/catalog/holes/door-panic/planner-element.js +0 -504
  78. package/es/catalog/holes/door-panic/planner-element.js.map +0 -1
  79. package/es/catalog/holes/door-panic-double/panicDoorDouble.png +0 -0
  80. package/es/catalog/holes/door-panic-double/planner-element.js +0 -464
  81. package/es/catalog/holes/door-panic-double/planner-element.js.map +0 -1
  82. package/es/catalog/holes/door-sliding/planner-element.js +0 -226
  83. package/es/catalog/holes/door-sliding/planner-element.js.map +0 -1
  84. package/es/catalog/holes/doorway-framed/planner-element.js +0 -146
  85. package/es/catalog/holes/doorway-framed/planner-element.js.map +0 -1
  86. package/es/catalog/holes/doorway-frameless/planner-element.js +0 -105
  87. package/es/catalog/holes/doorway-frameless/planner-element.js.map +0 -1
  88. package/es/catalog/holes/gate/gate.jpg +0 -0
  89. package/es/catalog/holes/window-clear/planner-element.js +0 -167
  90. package/es/catalog/holes/window-clear/planner-element.js.map +0 -1
  91. package/es/catalog/holes/window-clear/texture.png +0 -0
  92. package/es/catalog/holes/window-cross/planner-element.js +0 -166
  93. package/es/catalog/holes/window-cross/planner-element.js.map +0 -1
  94. package/es/catalog/holes/window-cross/texture.png +0 -0
  95. package/es/catalog/holes/window-double-hung/planner-element.js +0 -304
  96. package/es/catalog/holes/window-double-hung/planner-element.js.map +0 -1
  97. package/es/catalog/holes/window-double-hung/texture.png +0 -0
  98. package/es/catalog/holes/window-vertical/planner-element.js +0 -277
  99. package/es/catalog/holes/window-vertical/planner-element.js.map +0 -1
  100. package/es/catalog/holes/window-vertical/texture.png +0 -0
  101. package/es/catalog/lines/wall/planner-element.js +0 -71
  102. package/es/catalog/lines/wall/planner-element.js.map +0 -1
  103. package/es/catalog/lines/wall/textures/bricks-normal.jpg +0 -0
  104. package/es/catalog/lines/wall/textures/bricks-normal2.jpg +0 -0
  105. package/es/catalog/lines/wall/textures/bricks.jpg +0 -0
  106. package/es/catalog/lines/wall/textures/bricks2.jpg +0 -0
  107. package/es/catalog/lines/wall/textures/bricks3.jpg +0 -0
  108. package/es/catalog/lines/wall/textures/morden-normal.jpg +0 -0
  109. package/es/catalog/lines/wall/textures/morden.jpg +0 -0
  110. package/es/catalog/lines/wall/textures/painted-normal.jpg +0 -0
  111. package/es/catalog/lines/wall/textures/painted.jpg +0 -0
  112. package/es/catalog/lines/wall/textures/plaster-normal.jpg +0 -0
  113. package/es/catalog/lines/wall/textures/plaster.jpg +0 -0
  114. package/es/catalog/lines/wall/wall.png +0 -0
  115. package/es/catalog/molding/molding-dcm/planner-element.js +0 -30
  116. package/es/catalog/molding/molding-dcm/planner-element.js.map +0 -1
  117. package/es/catalog/molding/molding-dcm/texture.png +0 -0
  118. package/es/catalog/molding/molding-fbm/planner-element.js +0 -30
  119. package/es/catalog/molding/molding-fbm/planner-element.js.map +0 -1
  120. package/es/catalog/molding/molding-fbm/texture.png +0 -0
  121. package/es/catalog/molding/molding-lrm/planner-element.js +0 -30
  122. package/es/catalog/molding/molding-lrm/planner-element.js.map +0 -1
  123. package/es/catalog/molding/molding-lrm/texture.png +0 -0
  124. package/es/catalog/properties/export.js +0 -22
  125. package/es/catalog/properties/export.js.map +0 -1
  126. package/es/catalog/properties/property-checkbox.js +0 -72
  127. package/es/catalog/properties/property-checkbox.js.map +0 -1
  128. package/es/catalog/properties/property-color.js +0 -40
  129. package/es/catalog/properties/property-color.js.map +0 -1
  130. package/es/catalog/properties/property-enum.js +0 -56
  131. package/es/catalog/properties/property-enum.js.map +0 -1
  132. package/es/catalog/properties/property-hidden.js +0 -20
  133. package/es/catalog/properties/property-hidden.js.map +0 -1
  134. package/es/catalog/properties/property-lenght-measure.js +0 -102
  135. package/es/catalog/properties/property-lenght-measure.js.map +0 -1
  136. package/es/catalog/properties/property-length-measure.js +0 -86
  137. package/es/catalog/properties/property-length-measure.js.map +0 -1
  138. package/es/catalog/properties/property-length-measure_hole.js +0 -102
  139. package/es/catalog/properties/property-length-measure_hole.js.map +0 -1
  140. package/es/catalog/properties/property-number.js +0 -49
  141. package/es/catalog/properties/property-number.js.map +0 -1
  142. package/es/catalog/properties/property-read-only.js +0 -27
  143. package/es/catalog/properties/property-read-only.js.map +0 -1
  144. package/es/catalog/properties/property-string.js +0 -49
  145. package/es/catalog/properties/property-string.js.map +0 -1
  146. package/es/catalog/properties/property-toggle.js +0 -40
  147. package/es/catalog/properties/property-toggle.js.map +0 -1
  148. package/es/catalog/properties/shared-property-style.js +0 -15
  149. package/es/catalog/properties/shared-property-style.js.map +0 -1
  150. package/es/catalog/utils/FuseUtils.js +0 -83
  151. package/es/catalog/utils/FuseUtils.js.map +0 -1
  152. package/es/catalog/utils/exporter.js +0 -149
  153. package/es/catalog/utils/exporter.js.map +0 -1
  154. package/es/catalog/utils/geom-utils.js +0 -190
  155. package/es/catalog/utils/geom-utils.js.map +0 -1
  156. package/es/catalog/utils/item-loader.js +0 -1522
  157. package/es/catalog/utils/item-loader.js.map +0 -1
  158. package/es/catalog/utils/load-obj.js +0 -92
  159. package/es/catalog/utils/load-obj.js.map +0 -1
  160. package/es/catalog/utils/mtl-loader.js +0 -358
  161. package/es/catalog/utils/mtl-loader.js.map +0 -1
  162. package/es/catalog/utils/obj-loader.js +0 -477
  163. package/es/catalog/utils/obj-loader.js.map +0 -1
  164. package/es/catalog/windows.png +0 -0
  165. package/es/class/FuseUtils.js +0 -83
  166. package/es/class/FuseUtils.js.map +0 -1
  167. package/es/class/area.js +0 -146
  168. package/es/class/area.js.map +0 -1
  169. package/es/class/export.js +0 -25
  170. package/es/class/export.js.map +0 -1
  171. package/es/class/group.js +0 -441
  172. package/es/class/group.js.map +0 -1
  173. package/es/class/guide.js +0 -63
  174. package/es/class/guide.js.map +0 -1
  175. package/es/class/hole.js +0 -931
  176. package/es/class/hole.js.map +0 -1
  177. package/es/class/item.js +0 -1888
  178. package/es/class/item.js.map +0 -1
  179. package/es/class/layer.js +0 -668
  180. package/es/class/layer.js.map +0 -1
  181. package/es/class/line.js +0 -1290
  182. package/es/class/line.js.map +0 -1
  183. package/es/class/project.js +0 -823
  184. package/es/class/project.js.map +0 -1
  185. package/es/class/vertex.js +0 -267
  186. package/es/class/vertex.js.map +0 -1
  187. package/es/components/atoms/Snackbar/index.js +0 -50
  188. package/es/components/atoms/Snackbar/index.js.map +0 -1
  189. package/es/components/atoms/radio-button/index.js +0 -26
  190. package/es/components/atoms/radio-button/index.js.map +0 -1
  191. package/es/components/atoms/radio-button/styles.js +0 -5
  192. package/es/components/atoms/radio-button/styles.js.map +0 -1
  193. package/es/components/button/MainButton.js +0 -92
  194. package/es/components/button/MainButton.js.map +0 -1
  195. package/es/components/button/ToggleMeasureButton.js +0 -56
  196. package/es/components/button/ToggleMeasureButton.js.map +0 -1
  197. package/es/components/catalog-view/catalog-breadcrumb.js +0 -53
  198. package/es/components/catalog-view/catalog-breadcrumb.js.map +0 -1
  199. package/es/components/catalog-view/catalog-item.js +0 -226
  200. package/es/components/catalog-view/catalog-item.js.map +0 -1
  201. package/es/components/catalog-view/catalog-list.js +0 -182
  202. package/es/components/catalog-view/catalog-list.js.map +0 -1
  203. package/es/components/catalog-view/catalog-page-item.js +0 -130
  204. package/es/components/catalog-view/catalog-page-item.js.map +0 -1
  205. package/es/components/catalog-view/catalog-turn-back-page-item.js +0 -106
  206. package/es/components/catalog-view/catalog-turn-back-page-item.js.map +0 -1
  207. package/es/components/configurator/custom-configurator.js +0 -94
  208. package/es/components/configurator/custom-configurator.js.map +0 -1
  209. package/es/components/configurator/project-configurator.js +0 -131
  210. package/es/components/configurator/project-configurator.js.map +0 -1
  211. package/es/components/content.js +0 -123
  212. package/es/components/content.js.map +0 -1
  213. package/es/components/export.js +0 -24
  214. package/es/components/export.js.map +0 -1
  215. package/es/components/firstsetting/button/styles.js +0 -27
  216. package/es/components/firstsetting/button/styles.js.map +0 -1
  217. package/es/components/firstsetting/export.js +0 -9
  218. package/es/components/firstsetting/export.js.map +0 -1
  219. package/es/components/firstsetting/firstsetting-content-button.js +0 -217
  220. package/es/components/firstsetting/firstsetting-content-button.js.map +0 -1
  221. package/es/components/firstsetting/firstsetting-toggle-button.js +0 -126
  222. package/es/components/firstsetting/firstsetting-toggle-button.js.map +0 -1
  223. package/es/components/firstsetting/firstsetting.js +0 -626
  224. package/es/components/firstsetting/firstsetting.js.map +0 -1
  225. package/es/components/footerbar/button/ControlButton.js +0 -72
  226. package/es/components/footerbar/button/ControlButton.js.map +0 -1
  227. package/es/components/footerbar/button/DirectionButton.js +0 -69
  228. package/es/components/footerbar/button/DirectionButton.js.map +0 -1
  229. package/es/components/footerbar/button/DirectionPanSpinButton.js +0 -50
  230. package/es/components/footerbar/button/DirectionPanSpinButton.js.map +0 -1
  231. package/es/components/footerbar/button/ToggleButton.js +0 -76
  232. package/es/components/footerbar/button/ToggleButton.js.map +0 -1
  233. package/es/components/footerbar/button/ToggleConvertButton.js +0 -73
  234. package/es/components/footerbar/button/ToggleConvertButton.js.map +0 -1
  235. package/es/components/footerbar/button/ToggleMeasureButton.js +0 -52
  236. package/es/components/footerbar/button/ToggleMeasureButton.js.map +0 -1
  237. package/es/components/footerbar/button/styles.js +0 -22
  238. package/es/components/footerbar/button/styles.js.map +0 -1
  239. package/es/components/footerbar/export.js +0 -9
  240. package/es/components/footerbar/export.js.map +0 -1
  241. package/es/components/footerbar/footer-content-button.js +0 -217
  242. package/es/components/footerbar/footer-content-button.js.map +0 -1
  243. package/es/components/footerbar/footer-toggle-button.js +0 -126
  244. package/es/components/footerbar/footer-toggle-button.js.map +0 -1
  245. package/es/components/footerbar/footerbar.js +0 -801
  246. package/es/components/footerbar/footerbar.js.map +0 -1
  247. package/es/components/footerbar/styles.js +0 -34
  248. package/es/components/footerbar/styles.js.map +0 -1
  249. package/es/components/header/button/MenuButton.js +0 -70
  250. package/es/components/header/button/MenuButton.js.map +0 -1
  251. package/es/components/header/button/SaveButton.js +0 -48
  252. package/es/components/header/button/SaveButton.js.map +0 -1
  253. package/es/components/header/button/styles.js +0 -59
  254. package/es/components/header/button/styles.js.map +0 -1
  255. package/es/components/header/export.js +0 -5
  256. package/es/components/header/export.js.map +0 -1
  257. package/es/components/header/header.js +0 -550
  258. package/es/components/header/header.js.map +0 -1
  259. package/es/components/header/header.style.css +0 -47
  260. package/es/components/header/styles.js +0 -41
  261. package/es/components/header/styles.js.map +0 -1
  262. package/es/components/login/Login.js +0 -86
  263. package/es/components/login/Login.js.map +0 -1
  264. package/es/components/login/LoginForm/index.js +0 -132
  265. package/es/components/login/LoginForm/index.js.map +0 -1
  266. package/es/components/login/Register.js +0 -96
  267. package/es/components/login/Register.js.map +0 -1
  268. package/es/components/login/RegisterForm/index.js +0 -230
  269. package/es/components/login/RegisterForm/index.js.map +0 -1
  270. package/es/components/login/jwtService.js +0 -232
  271. package/es/components/login/jwtService.js.map +0 -1
  272. package/es/components/login/style.css +0 -158
  273. package/es/components/login/style.scss +0 -260
  274. package/es/components/molecules/slider/index.js +0 -13
  275. package/es/components/molecules/slider/index.js.map +0 -1
  276. package/es/components/molecules/slider/styles.js +0 -2
  277. package/es/components/molecules/slider/styles.js.map +0 -1
  278. package/es/components/molecules/slider/styles.scss +0 -3
  279. package/es/components/myprojects/export.js +0 -5
  280. package/es/components/myprojects/export.js.map +0 -1
  281. package/es/components/myprojects/index.js +0 -446
  282. package/es/components/myprojects/index.js.map +0 -1
  283. package/es/components/myprojects/styles.js +0 -24
  284. package/es/components/myprojects/styles.js.map +0 -1
  285. package/es/components/sidebar/custom-accordion.js +0 -38
  286. package/es/components/sidebar/custom-accordion.js.map +0 -1
  287. package/es/components/sidebar/export.js +0 -14
  288. package/es/components/sidebar/export.js.map +0 -1
  289. package/es/components/sidebar/panel-element-editor/attributes-editor/attributes-editor.js +0 -65
  290. package/es/components/sidebar/panel-element-editor/attributes-editor/attributes-editor.js.map +0 -1
  291. package/es/components/sidebar/panel-element-editor/attributes-editor/confirm-popup.js +0 -116
  292. package/es/components/sidebar/panel-element-editor/attributes-editor/confirm-popup.js.map +0 -1
  293. package/es/components/sidebar/panel-element-editor/attributes-editor/hole-attributes-editor.js +0 -126
  294. package/es/components/sidebar/panel-element-editor/attributes-editor/hole-attributes-editor.js.map +0 -1
  295. package/es/components/sidebar/panel-element-editor/attributes-editor/item-attributes-editor.js +0 -251
  296. package/es/components/sidebar/panel-element-editor/attributes-editor/item-attributes-editor.js.map +0 -1
  297. package/es/components/sidebar/panel-element-editor/attributes-editor/line-attributes-editor.js +0 -75
  298. package/es/components/sidebar/panel-element-editor/attributes-editor/line-attributes-editor.js.map +0 -1
  299. package/es/components/sidebar/panel-element-editor/element-editor.js +0 -878
  300. package/es/components/sidebar/panel-element-editor/element-editor.js.map +0 -1
  301. package/es/components/sidebar/panel-element-editor/multi-elements-editor.js +0 -2
  302. package/es/components/sidebar/panel-element-editor/multi-elements-editor.js.map +0 -1
  303. package/es/components/sidebar/panel-element-editor/panel-element-editor.js +0 -49
  304. package/es/components/sidebar/panel-element-editor/panel-element-editor.js.map +0 -1
  305. package/es/components/sidebar/panel-element-editor/panel-multi-elements-editor.js +0 -118
  306. package/es/components/sidebar/panel-element-editor/panel-multi-elements-editor.js.map +0 -1
  307. package/es/components/sidebar/panel-group-editor.js +0 -211
  308. package/es/components/sidebar/panel-group-editor.js.map +0 -1
  309. package/es/components/sidebar/panel-groups.js +0 -267
  310. package/es/components/sidebar/panel-groups.js.map +0 -1
  311. package/es/components/sidebar/panel-guides.js +0 -185
  312. package/es/components/sidebar/panel-guides.js.map +0 -1
  313. package/es/components/sidebar/panel-layer-elements.js +0 -251
  314. package/es/components/sidebar/panel-layer-elements.js.map +0 -1
  315. package/es/components/sidebar/panel-layers.js +0 -340
  316. package/es/components/sidebar/panel-layers.js.map +0 -1
  317. package/es/components/sidebar/panel.js +0 -103
  318. package/es/components/sidebar/panel.js.map +0 -1
  319. package/es/components/sidebar/sidebar.js +0 -109
  320. package/es/components/sidebar/sidebar.js.map +0 -1
  321. package/es/components/sidebar/toolbar-panel.js +0 -164
  322. package/es/components/sidebar/toolbar-panel.js.map +0 -1
  323. package/es/components/sign/export.js +0 -6
  324. package/es/components/sign/export.js.map +0 -1
  325. package/es/components/sign/main/index.js +0 -560
  326. package/es/components/sign/main/index.js.map +0 -1
  327. package/es/components/sign/main/styles.js +0 -20
  328. package/es/components/sign/main/styles.js.map +0 -1
  329. package/es/components/style/button.js +0 -114
  330. package/es/components/style/button.js.map +0 -1
  331. package/es/components/style/cancel-button.js +0 -23
  332. package/es/components/style/cancel-button.js.map +0 -1
  333. package/es/components/style/content-container.js +0 -34
  334. package/es/components/style/content-container.js.map +0 -1
  335. package/es/components/style/content-title.js +0 -30
  336. package/es/components/style/content-title.js.map +0 -1
  337. package/es/components/style/delete-button.js +0 -26
  338. package/es/components/style/delete-button.js.map +0 -1
  339. package/es/components/style/export.js +0 -32
  340. package/es/components/style/export.js.map +0 -1
  341. package/es/components/style/form-block.js +0 -25
  342. package/es/components/style/form-block.js.map +0 -1
  343. package/es/components/style/form-color-input.js +0 -28
  344. package/es/components/style/form-color-input.js.map +0 -1
  345. package/es/components/style/form-label.js +0 -27
  346. package/es/components/style/form-label.js.map +0 -1
  347. package/es/components/style/form-number-input.js +0 -190
  348. package/es/components/style/form-number-input.js.map +0 -1
  349. package/es/components/style/form-number-input_2.js +0 -207
  350. package/es/components/style/form-number-input_2.js.map +0 -1
  351. package/es/components/style/form-select.js +0 -21
  352. package/es/components/style/form-select.js.map +0 -1
  353. package/es/components/style/form-slider.js +0 -46
  354. package/es/components/style/form-slider.js.map +0 -1
  355. package/es/components/style/form-submit-button.js +0 -27
  356. package/es/components/style/form-submit-button.js.map +0 -1
  357. package/es/components/style/form-text-input.js +0 -77
  358. package/es/components/style/form-text-input.js.map +0 -1
  359. package/es/components/toolbar/button/ControlButton.js +0 -69
  360. package/es/components/toolbar/button/ControlButton.js.map +0 -1
  361. package/es/components/toolbar/button/DirectionButton.js +0 -50
  362. package/es/components/toolbar/button/DirectionButton.js.map +0 -1
  363. package/es/components/toolbar/button/RightButton.js +0 -133
  364. package/es/components/toolbar/button/RightButton.js.map +0 -1
  365. package/es/components/toolbar/button/ToggleButton.js +0 -59
  366. package/es/components/toolbar/button/ToggleButton.js.map +0 -1
  367. package/es/components/toolbar/button/index.js +0 -88
  368. package/es/components/toolbar/button/index.js.map +0 -1
  369. package/es/components/toolbar/button/styles.js +0 -14
  370. package/es/components/toolbar/button/styles.js.map +0 -1
  371. package/es/components/toolbar/components/DoorStyleMenu.js +0 -105
  372. package/es/components/toolbar/components/DoorStyleMenu.js.map +0 -1
  373. package/es/components/toolbar/components/Pricing.js +0 -101
  374. package/es/components/toolbar/components/Pricing.js.map +0 -1
  375. package/es/components/toolbar/components/ReviewForQuote.js +0 -476
  376. package/es/components/toolbar/components/ReviewForQuote.js.map +0 -1
  377. package/es/components/toolbar/export.js +0 -14
  378. package/es/components/toolbar/export.js.map +0 -1
  379. package/es/components/toolbar/main/Alert.js +0 -125
  380. package/es/components/toolbar/main/Alert.js.map +0 -1
  381. package/es/components/toolbar/main/TakePictureModal.js +0 -100
  382. package/es/components/toolbar/main/TakePictureModal.js.map +0 -1
  383. package/es/components/toolbar/main/confirm-popup.js +0 -88
  384. package/es/components/toolbar/main/confirm-popup.js.map +0 -1
  385. package/es/components/toolbar/main/index.js +0 -4612
  386. package/es/components/toolbar/main/index.js.map +0 -1
  387. package/es/components/toolbar/main/lShaped.json +0 -311
  388. package/es/components/toolbar/main/longNarrow.json +0 -238
  389. package/es/components/toolbar/main/myComponents.js +0 -118
  390. package/es/components/toolbar/main/myComponents.js.map +0 -1
  391. package/es/components/toolbar/main/oRectangle.json +0 -220
  392. package/es/components/toolbar/main/rectangle.json +0 -238
  393. package/es/components/toolbar/main/style.css +0 -107
  394. package/es/components/toolbar/main/styles.js +0 -64
  395. package/es/components/toolbar/main/styles.js.map +0 -1
  396. package/es/components/toolbar/plugin-item.js +0 -150
  397. package/es/components/toolbar/plugin-item.js.map +0 -1
  398. package/es/components/toolbar/popup/appliance/appliance-category/index.js +0 -77
  399. package/es/components/toolbar/popup/appliance/appliance-category/index.js.map +0 -1
  400. package/es/components/toolbar/popup/appliance/choose-appliance/index.js +0 -76
  401. package/es/components/toolbar/popup/appliance/choose-appliance/index.js.map +0 -1
  402. package/es/components/toolbar/popup/appliance/index.js +0 -81
  403. package/es/components/toolbar/popup/appliance/index.js.map +0 -1
  404. package/es/components/toolbar/popup/autosaveprompt/index.js +0 -91
  405. package/es/components/toolbar/popup/autosaveprompt/index.js.map +0 -1
  406. package/es/components/toolbar/popup/autosaveprompt/styles.css +0 -64
  407. package/es/components/toolbar/popup/autosaveprompt/styles.js +0 -9
  408. package/es/components/toolbar/popup/autosaveprompt/styles.js.map +0 -1
  409. package/es/components/toolbar/popup/cabinet/cabinet-category/index.js +0 -77
  410. package/es/components/toolbar/popup/cabinet/cabinet-category/index.js.map +0 -1
  411. package/es/components/toolbar/popup/cabinet/choose-product/index.js +0 -98
  412. package/es/components/toolbar/popup/cabinet/choose-product/index.js.map +0 -1
  413. package/es/components/toolbar/popup/cabinet/index.js +0 -83
  414. package/es/components/toolbar/popup/cabinet/index.js.map +0 -1
  415. package/es/components/toolbar/popup/doorStyle/choose-style/index.js +0 -50
  416. package/es/components/toolbar/popup/doorStyle/choose-style/index.js.map +0 -1
  417. package/es/components/toolbar/popup/doorStyle/index.js +0 -61
  418. package/es/components/toolbar/popup/doorStyle/index.js.map +0 -1
  419. package/es/components/toolbar/popup/doorStyle/style-category/index.js +0 -143
  420. package/es/components/toolbar/popup/doorStyle/style-category/index.js.map +0 -1
  421. package/es/components/toolbar/popup/downloadsummary/downloadSummaryContext.js +0 -3
  422. package/es/components/toolbar/popup/downloadsummary/downloadSummaryContext.js.map +0 -1
  423. package/es/components/toolbar/popup/downloadsummary/downloadSummaryTemp.js +0 -119
  424. package/es/components/toolbar/popup/downloadsummary/downloadSummaryTemp.js.map +0 -1
  425. package/es/components/toolbar/popup/downloadsummary/index.js +0 -564
  426. package/es/components/toolbar/popup/downloadsummary/index.js.map +0 -1
  427. package/es/components/toolbar/popup/downloadsummary/show2D/show2DView.js +0 -51
  428. package/es/components/toolbar/popup/downloadsummary/show2D/show2DView.js.map +0 -1
  429. package/es/components/toolbar/popup/downloadsummary/show2D/viewer2DDownLoad.js +0 -191
  430. package/es/components/toolbar/popup/downloadsummary/show2D/viewer2DDownLoad.js.map +0 -1
  431. package/es/components/toolbar/popup/downloadsummary/show3D/show3DView.js +0 -245
  432. package/es/components/toolbar/popup/downloadsummary/show3D/show3DView.js.map +0 -1
  433. package/es/components/toolbar/popup/downloadsummary/show3D/viewer3DDownLoad.js +0 -1758
  434. package/es/components/toolbar/popup/downloadsummary/show3D/viewer3DDownLoad.js.map +0 -1
  435. package/es/components/toolbar/popup/downloadsummary/showCabinetInfo.js +0 -87
  436. package/es/components/toolbar/popup/downloadsummary/showCabinetInfo.js.map +0 -1
  437. package/es/components/toolbar/popup/downloadsummary/showElevation/showElevationView.js +0 -116
  438. package/es/components/toolbar/popup/downloadsummary/showElevation/showElevationView.js.map +0 -1
  439. package/es/components/toolbar/popup/downloadsummary/showElevation/viewer3DElevationDownload.js +0 -1710
  440. package/es/components/toolbar/popup/downloadsummary/showElevation/viewer3DElevationDownload.js.map +0 -1
  441. package/es/components/toolbar/popup/downloadsummary/showElevation/viewerElevationDownload.js +0 -175
  442. package/es/components/toolbar/popup/downloadsummary/showElevation/viewerElevationDownload.js.map +0 -1
  443. package/es/components/toolbar/popup/downloadsummary/showWarranty.js +0 -106
  444. package/es/components/toolbar/popup/downloadsummary/showWarranty.js.map +0 -1
  445. package/es/components/toolbar/popup/downloadsummary/styles.css +0 -177
  446. package/es/components/toolbar/popup/downloadsummary/styles.js +0 -40
  447. package/es/components/toolbar/popup/downloadsummary/styles.js.map +0 -1
  448. package/es/components/toolbar/popup/finishingtouch/category/index.js +0 -35
  449. package/es/components/toolbar/popup/finishingtouch/category/index.js.map +0 -1
  450. package/es/components/toolbar/popup/finishingtouch/index.js +0 -47
  451. package/es/components/toolbar/popup/finishingtouch/index.js.map +0 -1
  452. package/es/components/toolbar/popup/finishingtouch/material-edit.js +0 -156
  453. package/es/components/toolbar/popup/finishingtouch/material-edit.js.map +0 -1
  454. package/es/components/toolbar/popup/finishingtouch/product/index.js +0 -56
  455. package/es/components/toolbar/popup/finishingtouch/product/index.js.map +0 -1
  456. package/es/components/toolbar/popup/floorplan/choose-floor/confirm-popup.js +0 -116
  457. package/es/components/toolbar/popup/floorplan/choose-floor/confirm-popup.js.map +0 -1
  458. package/es/components/toolbar/popup/floorplan/choose-floor/index.js +0 -246
  459. package/es/components/toolbar/popup/floorplan/choose-floor/index.js.map +0 -1
  460. package/es/components/toolbar/popup/floorplan/choose-floor/lShaped.json +0 -311
  461. package/es/components/toolbar/popup/floorplan/choose-floor/longNarrow.json +0 -238
  462. package/es/components/toolbar/popup/floorplan/choose-floor/oRectangle.json +0 -220
  463. package/es/components/toolbar/popup/floorplan/choose-floor/rectangle.json +0 -238
  464. package/es/components/toolbar/popup/floorplan/choose-floor/styles.js +0 -11
  465. package/es/components/toolbar/popup/floorplan/choose-floor/styles.js.map +0 -1
  466. package/es/components/toolbar/popup/floorplan/floor-category/index.js +0 -90
  467. package/es/components/toolbar/popup/floorplan/floor-category/index.js.map +0 -1
  468. package/es/components/toolbar/popup/floorplan/index.js +0 -49
  469. package/es/components/toolbar/popup/floorplan/index.js.map +0 -1
  470. package/es/components/toolbar/popup/index.js +0 -188
  471. package/es/components/toolbar/popup/index.js.map +0 -1
  472. package/es/components/toolbar/popup/newproject/index.js +0 -67
  473. package/es/components/toolbar/popup/newproject/index.js.map +0 -1
  474. package/es/components/toolbar/popup/newproject/styles.css +0 -64
  475. package/es/components/toolbar/popup/newproject/styles.js +0 -9
  476. package/es/components/toolbar/popup/newproject/styles.js.map +0 -1
  477. package/es/components/toolbar/popup/product/appliance.js +0 -65
  478. package/es/components/toolbar/popup/product/appliance.js.map +0 -1
  479. package/es/components/toolbar/popup/product/cabinetproduct.js +0 -25
  480. package/es/components/toolbar/popup/product/cabinetproduct.js.map +0 -1
  481. package/es/components/toolbar/popup/product/doorstyle.js +0 -50
  482. package/es/components/toolbar/popup/product/doorstyle.js.map +0 -1
  483. package/es/components/toolbar/popup/product/doorstyleproduct.js +0 -51
  484. package/es/components/toolbar/popup/product/doorstyleproduct.js.map +0 -1
  485. package/es/components/toolbar/popup/product/floor.js +0 -52
  486. package/es/components/toolbar/popup/product/floor.js.map +0 -1
  487. package/es/components/toolbar/popup/product/floorproduct.js +0 -61
  488. package/es/components/toolbar/popup/product/floorproduct.js.map +0 -1
  489. package/es/components/toolbar/popup/product/index.js +0 -52
  490. package/es/components/toolbar/popup/product/index.js.map +0 -1
  491. package/es/components/toolbar/popup/product/primary.js +0 -63
  492. package/es/components/toolbar/popup/product/primary.js.map +0 -1
  493. package/es/components/toolbar/popup/product/productline.js +0 -120
  494. package/es/components/toolbar/popup/product/productline.js.map +0 -1
  495. package/es/components/toolbar/popup/product/reviewItem.js +0 -338
  496. package/es/components/toolbar/popup/product/reviewItem.js.map +0 -1
  497. package/es/components/toolbar/popup/product/reviewMolding.js +0 -282
  498. package/es/components/toolbar/popup/product/reviewMolding.js.map +0 -1
  499. package/es/components/toolbar/popup/product/style.css +0 -54
  500. package/es/components/toolbar/popup/product/styles.js +0 -71
  501. package/es/components/toolbar/popup/product/styles.js.map +0 -1
  502. package/es/components/toolbar/popup/savedesign/FullPictureForm.js +0 -161
  503. package/es/components/toolbar/popup/savedesign/FullPictureForm.js.map +0 -1
  504. package/es/components/toolbar/popup/savedesign/index.js +0 -508
  505. package/es/components/toolbar/popup/savedesign/index.js.map +0 -1
  506. package/es/components/toolbar/popup/savedesign/savedesign.style.css +0 -16
  507. package/es/components/toolbar/popup/savedesign/styles.js +0 -19
  508. package/es/components/toolbar/popup/savedesign/styles.js.map +0 -1
  509. package/es/components/toolbar/popup/setDoorStyleOption/index.js +0 -57
  510. package/es/components/toolbar/popup/setDoorStyleOption/index.js.map +0 -1
  511. package/es/components/toolbar/popup/styles.js +0 -98
  512. package/es/components/toolbar/popup/styles.js.map +0 -1
  513. package/es/components/toolbar/popup/submitforquote/AddToCartOptions.js +0 -157
  514. package/es/components/toolbar/popup/submitforquote/AddToCartOptions.js.map +0 -1
  515. package/es/components/toolbar/popup/submitforquote/CustomerRequestsForm.js +0 -85
  516. package/es/components/toolbar/popup/submitforquote/CustomerRequestsForm.js.map +0 -1
  517. package/es/components/toolbar/popup/submitforquote/SkipDesignerReview.js +0 -36
  518. package/es/components/toolbar/popup/submitforquote/SkipDesignerReview.js.map +0 -1
  519. package/es/components/toolbar/popup/submitforquote/StepDots.js +0 -33
  520. package/es/components/toolbar/popup/submitforquote/StepDots.js.map +0 -1
  521. package/es/components/toolbar/popup/submitforquote/cart-choice.js +0 -132
  522. package/es/components/toolbar/popup/submitforquote/cart-choice.js.map +0 -1
  523. package/es/components/toolbar/popup/submitforquote/doorstyle-menus.js +0 -43
  524. package/es/components/toolbar/popup/submitforquote/doorstyle-menus.js.map +0 -1
  525. package/es/components/toolbar/popup/submitforquote/index.js +0 -690
  526. package/es/components/toolbar/popup/submitforquote/index.js.map +0 -1
  527. package/es/components/toolbar/popup/submitforquote/styles.css +0 -105
  528. package/es/components/toolbar/popup/submitforquote/styles.js +0 -31
  529. package/es/components/toolbar/popup/submitforquote/styles.js.map +0 -1
  530. package/es/components/toolbar/popup/submitprompt/index.js +0 -71
  531. package/es/components/toolbar/popup/submitprompt/index.js.map +0 -1
  532. package/es/components/toolbar/popup/submitprompt/styles.css +0 -64
  533. package/es/components/toolbar/popup/submitprompt/styles.js +0 -9
  534. package/es/components/toolbar/popup/submitprompt/styles.js.map +0 -1
  535. package/es/components/toolbar/toolbar-button.js +0 -105
  536. package/es/components/toolbar/toolbar-button.js.map +0 -1
  537. package/es/components/toolbar/toolbar-load-button.js +0 -29
  538. package/es/components/toolbar/toolbar-load-button.js.map +0 -1
  539. package/es/components/toolbar/toolbar-save-button.js +0 -27
  540. package/es/components/toolbar/toolbar-save-button.js.map +0 -1
  541. package/es/components/tutorial-view/Modal.js +0 -498
  542. package/es/components/tutorial-view/Modal.js.map +0 -1
  543. package/es/components/tutorial-view/style.css +0 -111
  544. package/es/components/tutorial-view/styles.js +0 -6
  545. package/es/components/tutorial-view/styles.js.map +0 -1
  546. package/es/components/viewer2d/area.js +0 -83
  547. package/es/components/viewer2d/area.js.map +0 -1
  548. package/es/components/viewer2d/export.js +0 -32
  549. package/es/components/viewer2d/export.js.map +0 -1
  550. package/es/components/viewer2d/grids/grid-horizontal-streak.js +0 -38
  551. package/es/components/viewer2d/grids/grid-horizontal-streak.js.map +0 -1
  552. package/es/components/viewer2d/grids/grid-streak.js +0 -38
  553. package/es/components/viewer2d/grids/grid-streak.js.map +0 -1
  554. package/es/components/viewer2d/grids/grid-vertical-streak.js +0 -38
  555. package/es/components/viewer2d/grids/grid-vertical-streak.js.map +0 -1
  556. package/es/components/viewer2d/grids/grids.js +0 -36
  557. package/es/components/viewer2d/grids/grids.js.map +0 -1
  558. package/es/components/viewer2d/group.js +0 -54
  559. package/es/components/viewer2d/group.js.map +0 -1
  560. package/es/components/viewer2d/item.js +0 -514
  561. package/es/components/viewer2d/item.js.map +0 -1
  562. package/es/components/viewer2d/layer.js +0 -165
  563. package/es/components/viewer2d/layer.js.map +0 -1
  564. package/es/components/viewer2d/line.js +0 -889
  565. package/es/components/viewer2d/line.js.map +0 -1
  566. package/es/components/viewer2d/ruler.js +0 -101
  567. package/es/components/viewer2d/ruler.js.map +0 -1
  568. package/es/components/viewer2d/rulerDist.js +0 -147
  569. package/es/components/viewer2d/rulerDist.js.map +0 -1
  570. package/es/components/viewer2d/rulerX.js +0 -152
  571. package/es/components/viewer2d/rulerX.js.map +0 -1
  572. package/es/components/viewer2d/rulerY.js +0 -154
  573. package/es/components/viewer2d/rulerY.js.map +0 -1
  574. package/es/components/viewer2d/scene.js +0 -141
  575. package/es/components/viewer2d/scene.js.map +0 -1
  576. package/es/components/viewer2d/snap.js +0 -75
  577. package/es/components/viewer2d/snap.js.map +0 -1
  578. package/es/components/viewer2d/state.js +0 -79
  579. package/es/components/viewer2d/state.js.map +0 -1
  580. package/es/components/viewer2d/utils.js +0 -163
  581. package/es/components/viewer2d/utils.js.map +0 -1
  582. package/es/components/viewer2d/vertex.js +0 -67
  583. package/es/components/viewer2d/vertex.js.map +0 -1
  584. package/es/components/viewer2d/viewer2d.js +0 -1402
  585. package/es/components/viewer2d/viewer2d.js.map +0 -1
  586. package/es/components/viewer3d/camera-controls-module/camera-controls.module.js +0 -2593
  587. package/es/components/viewer3d/camera-controls-module/camera-controls.module.js.map +0 -1
  588. package/es/components/viewer3d/dcm.js +0 -402
  589. package/es/components/viewer3d/dcm.js.map +0 -1
  590. package/es/components/viewer3d/fbm.js +0 -415
  591. package/es/components/viewer3d/fbm.js.map +0 -1
  592. package/es/components/viewer3d/front3D.js +0 -67
  593. package/es/components/viewer3d/front3D.js.map +0 -1
  594. package/es/components/viewer3d/grid-creator.js +0 -26
  595. package/es/components/viewer3d/grid-creator.js.map +0 -1
  596. package/es/components/viewer3d/grids/grid-horizontal-streak.js +0 -37
  597. package/es/components/viewer3d/grids/grid-horizontal-streak.js.map +0 -1
  598. package/es/components/viewer3d/grids/grid-streak.js +0 -28
  599. package/es/components/viewer3d/grids/grid-streak.js.map +0 -1
  600. package/es/components/viewer3d/grids/grid-vertical-streak.js +0 -37
  601. package/es/components/viewer3d/grids/grid-vertical-streak.js.map +0 -1
  602. package/es/components/viewer3d/libs/first-person-controls.js +0 -68
  603. package/es/components/viewer3d/libs/first-person-controls.js.map +0 -1
  604. package/es/components/viewer3d/libs/helvetiker_regular.typeface.js +0 -1282
  605. package/es/components/viewer3d/libs/helvetiker_regular.typeface.js.map +0 -1
  606. package/es/components/viewer3d/libs/mtl-loader.js +0 -358
  607. package/es/components/viewer3d/libs/mtl-loader.js.map +0 -1
  608. package/es/components/viewer3d/libs/obj-loader.js +0 -463
  609. package/es/components/viewer3d/libs/obj-loader.js.map +0 -1
  610. package/es/components/viewer3d/libs/orbit-controls.js +0 -699
  611. package/es/components/viewer3d/libs/orbit-controls.js.map +0 -1
  612. package/es/components/viewer3d/libs/pointer-lock-controls.js +0 -46
  613. package/es/components/viewer3d/libs/pointer-lock-controls.js.map +0 -1
  614. package/es/components/viewer3d/lrm.js +0 -306
  615. package/es/components/viewer3d/lrm.js.map +0 -1
  616. package/es/components/viewer3d/model.js +0 -709
  617. package/es/components/viewer3d/model.js.map +0 -1
  618. package/es/components/viewer3d/pointer-lock-navigation.js +0 -116
  619. package/es/components/viewer3d/pointer-lock-navigation.js.map +0 -1
  620. package/es/components/viewer3d/ruler-utils/itemRect.js +0 -62
  621. package/es/components/viewer3d/ruler-utils/itemRect.js.map +0 -1
  622. package/es/components/viewer3d/ruler-utils/layer3D.js +0 -496
  623. package/es/components/viewer3d/ruler-utils/layer3D.js.map +0 -1
  624. package/es/components/viewer3d/ruler-utils/ruler3D.js +0 -228
  625. package/es/components/viewer3d/ruler-utils/ruler3D.js.map +0 -1
  626. package/es/components/viewer3d/ruler-utils/scene3D.js +0 -62
  627. package/es/components/viewer3d/ruler-utils/scene3D.js.map +0 -1
  628. package/es/components/viewer3d/ruler-utils/state3D.js +0 -19
  629. package/es/components/viewer3d/ruler-utils/state3D.js.map +0 -1
  630. package/es/components/viewer3d/scene-creator.js +0 -3607
  631. package/es/components/viewer3d/scene-creator.js.map +0 -1
  632. package/es/components/viewer3d/three-memory-cleaner.js +0 -52
  633. package/es/components/viewer3d/three-memory-cleaner.js.map +0 -1
  634. package/es/components/viewer3d/viewer3d-first-person.js +0 -316
  635. package/es/components/viewer3d/viewer3d-first-person.js.map +0 -1
  636. package/es/components/viewer3d/viewer3d.js +0 -2504
  637. package/es/components/viewer3d/viewer3d.js.map +0 -1
  638. package/es/components/wizardstep/button/styles.js +0 -60
  639. package/es/components/wizardstep/button/styles.js.map +0 -1
  640. package/es/components/wizardstep/export.js +0 -5
  641. package/es/components/wizardstep/export.js.map +0 -1
  642. package/es/components/wizardstep/index.js +0 -971
  643. package/es/components/wizardstep/index.js.map +0 -1
  644. package/es/components/wizardstep/styles.js +0 -61
  645. package/es/components/wizardstep/styles.js.map +0 -1
  646. package/es/components/wizardstep/wizardstep-content-button.js +0 -217
  647. package/es/components/wizardstep/wizardstep-content-button.js.map +0 -1
  648. package/es/components/wizardstep/wizardstep-toggle-button.js +0 -126
  649. package/es/components/wizardstep/wizardstep-toggle-button.js.map +0 -1
  650. package/es/constants.js +0 -637
  651. package/es/constants.js.map +0 -1
  652. package/es/hooks/useCheckCart.js +0 -53
  653. package/es/hooks/useCheckCart.js.map +0 -1
  654. package/es/hooks/useGetPricesBySku.js +0 -74
  655. package/es/hooks/useGetPricesBySku.js.map +0 -1
  656. package/es/hooks/useValidateToken.js +0 -201
  657. package/es/hooks/useValidateToken.js.map +0 -1
  658. package/es/index.js +0 -18
  659. package/es/index.js.map +0 -1
  660. package/es/models.js +0 -511
  661. package/es/models.js.map +0 -1
  662. package/es/plugins/SVGLoader.js +0 -1413
  663. package/es/plugins/SVGLoader.js.map +0 -1
  664. package/es/plugins/autosave.js +0 -34
  665. package/es/plugins/autosave.js.map +0 -1
  666. package/es/plugins/console-debugger.js +0 -38
  667. package/es/plugins/console-debugger.js.map +0 -1
  668. package/es/plugins/export.js +0 -10
  669. package/es/plugins/export.js.map +0 -1
  670. package/es/plugins/keyboard.js +0 -102
  671. package/es/plugins/keyboard.js.map +0 -1
  672. package/es/reducers/areas-reducer.js +0 -13
  673. package/es/reducers/areas-reducer.js.map +0 -1
  674. package/es/reducers/export.js +0 -26
  675. package/es/reducers/export.js.map +0 -1
  676. package/es/reducers/groups-reducer.js +0 -39
  677. package/es/reducers/groups-reducer.js.map +0 -1
  678. package/es/reducers/holes-reducer.js +0 -63
  679. package/es/reducers/holes-reducer.js.map +0 -1
  680. package/es/reducers/items-reducer.js +0 -144
  681. package/es/reducers/items-reducer.js.map +0 -1
  682. package/es/reducers/lines-reducer.js +0 -46
  683. package/es/reducers/lines-reducer.js.map +0 -1
  684. package/es/reducers/project-reducer.js +0 -130
  685. package/es/reducers/project-reducer.js.map +0 -1
  686. package/es/reducers/reducer.js +0 -20
  687. package/es/reducers/reducer.js.map +0 -1
  688. package/es/reducers/scene-reducer.js +0 -29
  689. package/es/reducers/scene-reducer.js.map +0 -1
  690. package/es/reducers/user-reducer.js +0 -42
  691. package/es/reducers/user-reducer.js.map +0 -1
  692. package/es/reducers/vertices-reducer.js +0 -20
  693. package/es/reducers/vertices-reducer.js.map +0 -1
  694. package/es/reducers/viewer2d-reducer.js +0 -76
  695. package/es/reducers/viewer2d-reducer.js.map +0 -1
  696. package/es/reducers/viewer3d-reducer.js +0 -57
  697. package/es/reducers/viewer3d-reducer.js.map +0 -1
  698. package/es/shared-style.js +0 -67
  699. package/es/shared-style.js.map +0 -1
  700. package/es/styles/export.js +0 -6
  701. package/es/styles/export.js.map +0 -1
  702. package/es/styles/tabs.css +0 -40
  703. package/es/translator/en.js +0 -105
  704. package/es/translator/en.js.map +0 -1
  705. package/es/translator/it.js +0 -80
  706. package/es/translator/it.js.map +0 -1
  707. package/es/translator/ru.js +0 -80
  708. package/es/translator/ru.js.map +0 -1
  709. package/es/translator/translator.js +0 -85
  710. package/es/translator/translator.js.map +0 -1
  711. package/es/utils/browser.js +0 -34
  712. package/es/utils/browser.js.map +0 -1
  713. package/es/utils/email-validator.js +0 -5
  714. package/es/utils/email-validator.js.map +0 -1
  715. package/es/utils/export.js +0 -26
  716. package/es/utils/export.js.map +0 -1
  717. package/es/utils/geometry.js +0 -2237
  718. package/es/utils/geometry.js.map +0 -1
  719. package/es/utils/get-edges-of-subgraphs.js +0 -27
  720. package/es/utils/get-edges-of-subgraphs.js.map +0 -1
  721. package/es/utils/graph-cycles.js +0 -239
  722. package/es/utils/graph-cycles.js.map +0 -1
  723. package/es/utils/graph-inner-cycles.js +0 -47
  724. package/es/utils/graph-inner-cycles.js.map +0 -1
  725. package/es/utils/graph.js +0 -150
  726. package/es/utils/graph.js.map +0 -1
  727. package/es/utils/helper.js +0 -337
  728. package/es/utils/helper.js.map +0 -1
  729. package/es/utils/history.js +0 -30
  730. package/es/utils/history.js.map +0 -1
  731. package/es/utils/id-broker.js +0 -20
  732. package/es/utils/id-broker.js.map +0 -1
  733. package/es/utils/logger.js +0 -9
  734. package/es/utils/logger.js.map +0 -1
  735. package/es/utils/math.js +0 -51
  736. package/es/utils/math.js.map +0 -1
  737. package/es/utils/molding.js +0 -840
  738. package/es/utils/molding.js.map +0 -1
  739. package/es/utils/name-generator.js +0 -19
  740. package/es/utils/name-generator.js.map +0 -1
  741. package/es/utils/objects-utils.js +0 -51
  742. package/es/utils/objects-utils.js.map +0 -1
  743. package/es/utils/phone-validator.js +0 -5
  744. package/es/utils/phone-validator.js.map +0 -1
  745. package/es/utils/process-black-list.js +0 -19
  746. package/es/utils/process-black-list.js.map +0 -1
  747. package/es/utils/react-if.js +0 -19
  748. package/es/utils/react-if.js.map +0 -1
  749. package/es/utils/snap-scene.js +0 -100
  750. package/es/utils/snap-scene.js.map +0 -1
  751. package/es/utils/snap.js +0 -238
  752. package/es/utils/snap.js.map +0 -1
  753. package/es/utils/threeCSG.es6.js +0 -499
  754. package/es/utils/threeCSG.es6.js.map +0 -1
  755. package/es/version.js +0 -2
  756. package/es/version.js.map +0 -1
  757. package/lib/@history.js +0 -11
  758. package/lib/@history.js.map +0 -1
  759. package/lib/AppContext.js +0 -11
  760. package/lib/AppContext.js.map +0 -1
  761. package/lib/KitchenConfigurator.js +0 -1353
  762. package/lib/KitchenConfigurator.js.map +0 -1
  763. package/lib/KitchenConfiguratorApp.js +0 -539
  764. package/lib/KitchenConfiguratorApp.js.map +0 -1
  765. package/lib/actions/area-actions.js +0 -22
  766. package/lib/actions/area-actions.js.map +0 -1
  767. package/lib/actions/export.js +0 -44
  768. package/lib/actions/export.js.map +0 -1
  769. package/lib/actions/groups-actions.js +0 -108
  770. package/lib/actions/groups-actions.js.map +0 -1
  771. package/lib/actions/holes-actions.js +0 -141
  772. package/lib/actions/holes-actions.js.map +0 -1
  773. package/lib/actions/items-actions.js +0 -365
  774. package/lib/actions/items-actions.js.map +0 -1
  775. package/lib/actions/lines-actions.js +0 -98
  776. package/lib/actions/lines-actions.js.map +0 -1
  777. package/lib/actions/project-actions.js +0 -333
  778. package/lib/actions/project-actions.js.map +0 -1
  779. package/lib/actions/scene-actions.js +0 -44
  780. package/lib/actions/scene-actions.js.map +0 -1
  781. package/lib/actions/user-actions.js +0 -69
  782. package/lib/actions/user-actions.js.map +0 -1
  783. package/lib/actions/vertices-actions.js +0 -36
  784. package/lib/actions/vertices-actions.js.map +0 -1
  785. package/lib/actions/viewer2d-actions.js +0 -74
  786. package/lib/actions/viewer2d-actions.js.map +0 -1
  787. package/lib/actions/viewer3d-actions.js +0 -33
  788. package/lib/actions/viewer3d-actions.js.map +0 -1
  789. package/lib/catalog/areas/area/planner-element.js +0 -47
  790. package/lib/catalog/areas/area/planner-element.js.map +0 -1
  791. package/lib/catalog/catalog.js +0 -283
  792. package/lib/catalog/catalog.js.map +0 -1
  793. package/lib/catalog/factories/area-factory-3d.js +0 -192
  794. package/lib/catalog/factories/area-factory-3d.js.map +0 -1
  795. package/lib/catalog/factories/area-factory.js +0 -90
  796. package/lib/catalog/factories/area-factory.js.map +0 -1
  797. package/lib/catalog/factories/export.js +0 -26
  798. package/lib/catalog/factories/export.js.map +0 -1
  799. package/lib/catalog/factories/wall-factory-3d.js +0 -213
  800. package/lib/catalog/factories/wall-factory-3d.js.map +0 -1
  801. package/lib/catalog/factories/wall-factory.js +0 -279
  802. package/lib/catalog/factories/wall-factory.js.map +0 -1
  803. package/lib/catalog/holes/door-closet/planner-element.js +0 -232
  804. package/lib/catalog/holes/door-closet/planner-element.js.map +0 -1
  805. package/lib/catalog/holes/door-double/planner-element.js +0 -325
  806. package/lib/catalog/holes/door-double/planner-element.js.map +0 -1
  807. package/lib/catalog/holes/door-exterior/planner-element.js +0 -225
  808. package/lib/catalog/holes/door-exterior/planner-element.js.map +0 -1
  809. package/lib/catalog/holes/door-interior/planner-element.js +0 -237
  810. package/lib/catalog/holes/door-interior/planner-element.js.map +0 -1
  811. package/lib/catalog/holes/door-panic/planner-element.js +0 -513
  812. package/lib/catalog/holes/door-panic/planner-element.js.map +0 -1
  813. package/lib/catalog/holes/door-panic-double/planner-element.js +0 -473
  814. package/lib/catalog/holes/door-panic-double/planner-element.js.map +0 -1
  815. package/lib/catalog/holes/door-sliding/planner-element.js +0 -235
  816. package/lib/catalog/holes/door-sliding/planner-element.js.map +0 -1
  817. package/lib/catalog/holes/doorway-framed/planner-element.js +0 -155
  818. package/lib/catalog/holes/doorway-framed/planner-element.js.map +0 -1
  819. package/lib/catalog/holes/doorway-frameless/planner-element.js +0 -114
  820. package/lib/catalog/holes/doorway-frameless/planner-element.js.map +0 -1
  821. package/lib/catalog/holes/window-clear/planner-element.js +0 -176
  822. package/lib/catalog/holes/window-clear/planner-element.js.map +0 -1
  823. package/lib/catalog/holes/window-cross/planner-element.js +0 -175
  824. package/lib/catalog/holes/window-cross/planner-element.js.map +0 -1
  825. package/lib/catalog/holes/window-double-hung/planner-element.js +0 -313
  826. package/lib/catalog/holes/window-double-hung/planner-element.js.map +0 -1
  827. package/lib/catalog/holes/window-vertical/planner-element.js +0 -286
  828. package/lib/catalog/holes/window-vertical/planner-element.js.map +0 -1
  829. package/lib/catalog/lines/wall/planner-element.js +0 -77
  830. package/lib/catalog/lines/wall/planner-element.js.map +0 -1
  831. package/lib/catalog/molding/molding-dcm/planner-element.js +0 -39
  832. package/lib/catalog/molding/molding-dcm/planner-element.js.map +0 -1
  833. package/lib/catalog/molding/molding-fbm/planner-element.js +0 -39
  834. package/lib/catalog/molding/molding-fbm/planner-element.js.map +0 -1
  835. package/lib/catalog/molding/molding-lrm/planner-element.js +0 -39
  836. package/lib/catalog/molding/molding-lrm/planner-element.js.map +0 -1
  837. package/lib/catalog/properties/export.js +0 -82
  838. package/lib/catalog/properties/export.js.map +0 -1
  839. package/lib/catalog/properties/property-checkbox.js +0 -79
  840. package/lib/catalog/properties/property-checkbox.js.map +0 -1
  841. package/lib/catalog/properties/property-color.js +0 -47
  842. package/lib/catalog/properties/property-color.js.map +0 -1
  843. package/lib/catalog/properties/property-enum.js +0 -63
  844. package/lib/catalog/properties/property-enum.js.map +0 -1
  845. package/lib/catalog/properties/property-hidden.js +0 -27
  846. package/lib/catalog/properties/property-hidden.js.map +0 -1
  847. package/lib/catalog/properties/property-lenght-measure.js +0 -109
  848. package/lib/catalog/properties/property-lenght-measure.js.map +0 -1
  849. package/lib/catalog/properties/property-length-measure.js +0 -93
  850. package/lib/catalog/properties/property-length-measure.js.map +0 -1
  851. package/lib/catalog/properties/property-length-measure_hole.js +0 -109
  852. package/lib/catalog/properties/property-length-measure_hole.js.map +0 -1
  853. package/lib/catalog/properties/property-number.js +0 -56
  854. package/lib/catalog/properties/property-number.js.map +0 -1
  855. package/lib/catalog/properties/property-read-only.js +0 -34
  856. package/lib/catalog/properties/property-read-only.js.map +0 -1
  857. package/lib/catalog/properties/property-string.js +0 -56
  858. package/lib/catalog/properties/property-string.js.map +0 -1
  859. package/lib/catalog/properties/property-toggle.js +0 -47
  860. package/lib/catalog/properties/property-toggle.js.map +0 -1
  861. package/lib/catalog/properties/shared-property-style.js +0 -21
  862. package/lib/catalog/properties/shared-property-style.js.map +0 -1
  863. package/lib/catalog/utils/FuseUtils.js +0 -89
  864. package/lib/catalog/utils/FuseUtils.js.map +0 -1
  865. package/lib/catalog/utils/exporter.js +0 -156
  866. package/lib/catalog/utils/exporter.js.map +0 -1
  867. package/lib/catalog/utils/geom-utils.js +0 -206
  868. package/lib/catalog/utils/geom-utils.js.map +0 -1
  869. package/lib/catalog/utils/item-loader.js +0 -1534
  870. package/lib/catalog/utils/item-loader.js.map +0 -1
  871. package/lib/catalog/utils/load-obj.js +0 -100
  872. package/lib/catalog/utils/load-obj.js.map +0 -1
  873. package/lib/catalog/utils/mtl-loader.js +0 -360
  874. package/lib/catalog/utils/mtl-loader.js.map +0 -1
  875. package/lib/catalog/utils/obj-loader.js +0 -479
  876. package/lib/catalog/utils/obj-loader.js.map +0 -1
  877. package/lib/class/FuseUtils.js +0 -89
  878. package/lib/class/FuseUtils.js.map +0 -1
  879. package/lib/class/area.js +0 -151
  880. package/lib/class/area.js.map +0 -1
  881. package/lib/class/export.js +0 -97
  882. package/lib/class/export.js.map +0 -1
  883. package/lib/class/group.js +0 -446
  884. package/lib/class/group.js.map +0 -1
  885. package/lib/class/guide.js +0 -68
  886. package/lib/class/guide.js.map +0 -1
  887. package/lib/class/hole.js +0 -935
  888. package/lib/class/hole.js.map +0 -1
  889. package/lib/class/item.js +0 -1894
  890. package/lib/class/item.js.map +0 -1
  891. package/lib/class/layer.js +0 -673
  892. package/lib/class/layer.js.map +0 -1
  893. package/lib/class/line.js +0 -1296
  894. package/lib/class/line.js.map +0 -1
  895. package/lib/class/project.js +0 -829
  896. package/lib/class/project.js.map +0 -1
  897. package/lib/class/vertex.js +0 -272
  898. package/lib/class/vertex.js.map +0 -1
  899. package/lib/components/atoms/Snackbar/index.js +0 -57
  900. package/lib/components/atoms/Snackbar/index.js.map +0 -1
  901. package/lib/components/atoms/radio-button/index.js +0 -33
  902. package/lib/components/atoms/radio-button/index.js.map +0 -1
  903. package/lib/components/atoms/radio-button/styles.js +0 -12
  904. package/lib/components/atoms/radio-button/styles.js.map +0 -1
  905. package/lib/components/button/MainButton.js +0 -98
  906. package/lib/components/button/MainButton.js.map +0 -1
  907. package/lib/components/button/ToggleMeasureButton.js +0 -63
  908. package/lib/components/button/ToggleMeasureButton.js.map +0 -1
  909. package/lib/components/catalog-view/catalog-breadcrumb.js +0 -61
  910. package/lib/components/catalog-view/catalog-breadcrumb.js.map +0 -1
  911. package/lib/components/catalog-view/catalog-item.js +0 -233
  912. package/lib/components/catalog-view/catalog-item.js.map +0 -1
  913. package/lib/components/catalog-view/catalog-list.js +0 -189
  914. package/lib/components/catalog-view/catalog-list.js.map +0 -1
  915. package/lib/components/catalog-view/catalog-page-item.js +0 -137
  916. package/lib/components/catalog-view/catalog-page-item.js.map +0 -1
  917. package/lib/components/catalog-view/catalog-turn-back-page-item.js +0 -113
  918. package/lib/components/catalog-view/catalog-turn-back-page-item.js.map +0 -1
  919. package/lib/components/configurator/custom-configurator.js +0 -101
  920. package/lib/components/configurator/custom-configurator.js.map +0 -1
  921. package/lib/components/configurator/project-configurator.js +0 -138
  922. package/lib/components/configurator/project-configurator.js.map +0 -1
  923. package/lib/components/content.js +0 -132
  924. package/lib/components/content.js.map +0 -1
  925. package/lib/components/export.js +0 -90
  926. package/lib/components/export.js.map +0 -1
  927. package/lib/components/firstsetting/button/styles.js +0 -34
  928. package/lib/components/firstsetting/button/styles.js.map +0 -1
  929. package/lib/components/firstsetting/export.js +0 -16
  930. package/lib/components/firstsetting/export.js.map +0 -1
  931. package/lib/components/firstsetting/firstsetting-content-button.js +0 -224
  932. package/lib/components/firstsetting/firstsetting-content-button.js.map +0 -1
  933. package/lib/components/firstsetting/firstsetting-toggle-button.js +0 -133
  934. package/lib/components/firstsetting/firstsetting-toggle-button.js.map +0 -1
  935. package/lib/components/firstsetting/firstsetting.js +0 -633
  936. package/lib/components/firstsetting/firstsetting.js.map +0 -1
  937. package/lib/components/footerbar/button/ControlButton.js +0 -79
  938. package/lib/components/footerbar/button/ControlButton.js.map +0 -1
  939. package/lib/components/footerbar/button/DirectionButton.js +0 -76
  940. package/lib/components/footerbar/button/DirectionButton.js.map +0 -1
  941. package/lib/components/footerbar/button/DirectionPanSpinButton.js +0 -57
  942. package/lib/components/footerbar/button/DirectionPanSpinButton.js.map +0 -1
  943. package/lib/components/footerbar/button/ToggleButton.js +0 -83
  944. package/lib/components/footerbar/button/ToggleButton.js.map +0 -1
  945. package/lib/components/footerbar/button/ToggleConvertButton.js +0 -80
  946. package/lib/components/footerbar/button/ToggleConvertButton.js.map +0 -1
  947. package/lib/components/footerbar/button/ToggleMeasureButton.js +0 -59
  948. package/lib/components/footerbar/button/ToggleMeasureButton.js.map +0 -1
  949. package/lib/components/footerbar/button/styles.js +0 -29
  950. package/lib/components/footerbar/button/styles.js.map +0 -1
  951. package/lib/components/footerbar/export.js +0 -16
  952. package/lib/components/footerbar/export.js.map +0 -1
  953. package/lib/components/footerbar/footer-content-button.js +0 -224
  954. package/lib/components/footerbar/footer-content-button.js.map +0 -1
  955. package/lib/components/footerbar/footer-toggle-button.js +0 -133
  956. package/lib/components/footerbar/footer-toggle-button.js.map +0 -1
  957. package/lib/components/footerbar/footerbar.js +0 -808
  958. package/lib/components/footerbar/footerbar.js.map +0 -1
  959. package/lib/components/footerbar/styles.js +0 -41
  960. package/lib/components/footerbar/styles.js.map +0 -1
  961. package/lib/components/header/button/MenuButton.js +0 -77
  962. package/lib/components/header/button/MenuButton.js.map +0 -1
  963. package/lib/components/header/button/SaveButton.js +0 -57
  964. package/lib/components/header/button/SaveButton.js.map +0 -1
  965. package/lib/components/header/button/styles.js +0 -68
  966. package/lib/components/header/button/styles.js.map +0 -1
  967. package/lib/components/header/export.js +0 -12
  968. package/lib/components/header/export.js.map +0 -1
  969. package/lib/components/header/header.js +0 -556
  970. package/lib/components/header/header.js.map +0 -1
  971. package/lib/components/header/styles.js +0 -47
  972. package/lib/components/header/styles.js.map +0 -1
  973. package/lib/components/login/Login.js +0 -94
  974. package/lib/components/login/Login.js.map +0 -1
  975. package/lib/components/login/LoginForm/index.js +0 -140
  976. package/lib/components/login/LoginForm/index.js.map +0 -1
  977. package/lib/components/login/Register.js +0 -104
  978. package/lib/components/login/Register.js.map +0 -1
  979. package/lib/components/login/RegisterForm/index.js +0 -237
  980. package/lib/components/login/RegisterForm/index.js.map +0 -1
  981. package/lib/components/login/jwtService.js +0 -239
  982. package/lib/components/login/jwtService.js.map +0 -1
  983. package/lib/components/molecules/slider/index.js +0 -22
  984. package/lib/components/molecules/slider/index.js.map +0 -1
  985. package/lib/components/molecules/slider/styles.js +0 -2
  986. package/lib/components/molecules/slider/styles.js.map +0 -1
  987. package/lib/components/myprojects/export.js +0 -12
  988. package/lib/components/myprojects/export.js.map +0 -1
  989. package/lib/components/myprojects/index.js +0 -453
  990. package/lib/components/myprojects/index.js.map +0 -1
  991. package/lib/components/myprojects/styles.js +0 -31
  992. package/lib/components/myprojects/styles.js.map +0 -1
  993. package/lib/components/sidebar/custom-accordion.js +0 -45
  994. package/lib/components/sidebar/custom-accordion.js.map +0 -1
  995. package/lib/components/sidebar/export.js +0 -50
  996. package/lib/components/sidebar/export.js.map +0 -1
  997. package/lib/components/sidebar/panel-element-editor/attributes-editor/attributes-editor.js +0 -74
  998. package/lib/components/sidebar/panel-element-editor/attributes-editor/attributes-editor.js.map +0 -1
  999. package/lib/components/sidebar/panel-element-editor/attributes-editor/confirm-popup.js +0 -124
  1000. package/lib/components/sidebar/panel-element-editor/attributes-editor/confirm-popup.js.map +0 -1
  1001. package/lib/components/sidebar/panel-element-editor/attributes-editor/hole-attributes-editor.js +0 -135
  1002. package/lib/components/sidebar/panel-element-editor/attributes-editor/hole-attributes-editor.js.map +0 -1
  1003. package/lib/components/sidebar/panel-element-editor/attributes-editor/item-attributes-editor.js +0 -260
  1004. package/lib/components/sidebar/panel-element-editor/attributes-editor/item-attributes-editor.js.map +0 -1
  1005. package/lib/components/sidebar/panel-element-editor/attributes-editor/line-attributes-editor.js +0 -84
  1006. package/lib/components/sidebar/panel-element-editor/attributes-editor/line-attributes-editor.js.map +0 -1
  1007. package/lib/components/sidebar/panel-element-editor/element-editor.js +0 -884
  1008. package/lib/components/sidebar/panel-element-editor/element-editor.js.map +0 -1
  1009. package/lib/components/sidebar/panel-element-editor/multi-elements-editor.js +0 -2
  1010. package/lib/components/sidebar/panel-element-editor/multi-elements-editor.js.map +0 -1
  1011. package/lib/components/sidebar/panel-element-editor/panel-element-editor.js +0 -56
  1012. package/lib/components/sidebar/panel-element-editor/panel-element-editor.js.map +0 -1
  1013. package/lib/components/sidebar/panel-element-editor/panel-multi-elements-editor.js +0 -125
  1014. package/lib/components/sidebar/panel-element-editor/panel-multi-elements-editor.js.map +0 -1
  1015. package/lib/components/sidebar/panel-group-editor.js +0 -218
  1016. package/lib/components/sidebar/panel-group-editor.js.map +0 -1
  1017. package/lib/components/sidebar/panel-groups.js +0 -274
  1018. package/lib/components/sidebar/panel-groups.js.map +0 -1
  1019. package/lib/components/sidebar/panel-guides.js +0 -192
  1020. package/lib/components/sidebar/panel-guides.js.map +0 -1
  1021. package/lib/components/sidebar/panel-layer-elements.js +0 -258
  1022. package/lib/components/sidebar/panel-layer-elements.js.map +0 -1
  1023. package/lib/components/sidebar/panel-layers.js +0 -347
  1024. package/lib/components/sidebar/panel-layers.js.map +0 -1
  1025. package/lib/components/sidebar/panel.js +0 -110
  1026. package/lib/components/sidebar/panel.js.map +0 -1
  1027. package/lib/components/sidebar/sidebar.js +0 -117
  1028. package/lib/components/sidebar/sidebar.js.map +0 -1
  1029. package/lib/components/sidebar/toolbar-panel.js +0 -171
  1030. package/lib/components/sidebar/toolbar-panel.js.map +0 -1
  1031. package/lib/components/sign/export.js +0 -18
  1032. package/lib/components/sign/export.js.map +0 -1
  1033. package/lib/components/sign/main/index.js +0 -567
  1034. package/lib/components/sign/main/index.js.map +0 -1
  1035. package/lib/components/sign/main/styles.js +0 -27
  1036. package/lib/components/sign/main/styles.js.map +0 -1
  1037. package/lib/components/style/button.js +0 -121
  1038. package/lib/components/style/button.js.map +0 -1
  1039. package/lib/components/style/cancel-button.js +0 -30
  1040. package/lib/components/style/cancel-button.js.map +0 -1
  1041. package/lib/components/style/content-container.js +0 -41
  1042. package/lib/components/style/content-container.js.map +0 -1
  1043. package/lib/components/style/content-title.js +0 -38
  1044. package/lib/components/style/content-title.js.map +0 -1
  1045. package/lib/components/style/delete-button.js +0 -35
  1046. package/lib/components/style/delete-button.js.map +0 -1
  1047. package/lib/components/style/export.js +0 -122
  1048. package/lib/components/style/export.js.map +0 -1
  1049. package/lib/components/style/form-block.js +0 -32
  1050. package/lib/components/style/form-block.js.map +0 -1
  1051. package/lib/components/style/form-color-input.js +0 -35
  1052. package/lib/components/style/form-color-input.js.map +0 -1
  1053. package/lib/components/style/form-label.js +0 -34
  1054. package/lib/components/style/form-label.js.map +0 -1
  1055. package/lib/components/style/form-number-input.js +0 -197
  1056. package/lib/components/style/form-number-input.js.map +0 -1
  1057. package/lib/components/style/form-number-input_2.js +0 -214
  1058. package/lib/components/style/form-number-input_2.js.map +0 -1
  1059. package/lib/components/style/form-select.js +0 -30
  1060. package/lib/components/style/form-select.js.map +0 -1
  1061. package/lib/components/style/form-slider.js +0 -53
  1062. package/lib/components/style/form-slider.js.map +0 -1
  1063. package/lib/components/style/form-submit-button.js +0 -36
  1064. package/lib/components/style/form-submit-button.js.map +0 -1
  1065. package/lib/components/style/form-text-input.js +0 -84
  1066. package/lib/components/style/form-text-input.js.map +0 -1
  1067. package/lib/components/toolbar/button/ControlButton.js +0 -76
  1068. package/lib/components/toolbar/button/ControlButton.js.map +0 -1
  1069. package/lib/components/toolbar/button/DirectionButton.js +0 -57
  1070. package/lib/components/toolbar/button/DirectionButton.js.map +0 -1
  1071. package/lib/components/toolbar/button/RightButton.js +0 -140
  1072. package/lib/components/toolbar/button/RightButton.js.map +0 -1
  1073. package/lib/components/toolbar/button/ToggleButton.js +0 -66
  1074. package/lib/components/toolbar/button/ToggleButton.js.map +0 -1
  1075. package/lib/components/toolbar/button/index.js +0 -94
  1076. package/lib/components/toolbar/button/index.js.map +0 -1
  1077. package/lib/components/toolbar/button/styles.js +0 -21
  1078. package/lib/components/toolbar/button/styles.js.map +0 -1
  1079. package/lib/components/toolbar/components/DoorStyleMenu.js +0 -112
  1080. package/lib/components/toolbar/components/DoorStyleMenu.js.map +0 -1
  1081. package/lib/components/toolbar/components/Pricing.js +0 -110
  1082. package/lib/components/toolbar/components/Pricing.js.map +0 -1
  1083. package/lib/components/toolbar/components/ReviewForQuote.js +0 -485
  1084. package/lib/components/toolbar/components/ReviewForQuote.js.map +0 -1
  1085. package/lib/components/toolbar/export.js +0 -50
  1086. package/lib/components/toolbar/export.js.map +0 -1
  1087. package/lib/components/toolbar/main/Alert.js +0 -132
  1088. package/lib/components/toolbar/main/Alert.js.map +0 -1
  1089. package/lib/components/toolbar/main/TakePictureModal.js +0 -109
  1090. package/lib/components/toolbar/main/TakePictureModal.js.map +0 -1
  1091. package/lib/components/toolbar/main/confirm-popup.js +0 -95
  1092. package/lib/components/toolbar/main/confirm-popup.js.map +0 -1
  1093. package/lib/components/toolbar/main/index.js +0 -4619
  1094. package/lib/components/toolbar/main/index.js.map +0 -1
  1095. package/lib/components/toolbar/main/myComponents.js +0 -125
  1096. package/lib/components/toolbar/main/myComponents.js.map +0 -1
  1097. package/lib/components/toolbar/main/styles.js +0 -73
  1098. package/lib/components/toolbar/main/styles.js.map +0 -1
  1099. package/lib/components/toolbar/plugin-item.js +0 -156
  1100. package/lib/components/toolbar/plugin-item.js.map +0 -1
  1101. package/lib/components/toolbar/popup/appliance/appliance-category/index.js +0 -86
  1102. package/lib/components/toolbar/popup/appliance/appliance-category/index.js.map +0 -1
  1103. package/lib/components/toolbar/popup/appliance/choose-appliance/index.js +0 -85
  1104. package/lib/components/toolbar/popup/appliance/choose-appliance/index.js.map +0 -1
  1105. package/lib/components/toolbar/popup/appliance/index.js +0 -89
  1106. package/lib/components/toolbar/popup/appliance/index.js.map +0 -1
  1107. package/lib/components/toolbar/popup/autosaveprompt/index.js +0 -99
  1108. package/lib/components/toolbar/popup/autosaveprompt/index.js.map +0 -1
  1109. package/lib/components/toolbar/popup/autosaveprompt/styles.js +0 -16
  1110. package/lib/components/toolbar/popup/autosaveprompt/styles.js.map +0 -1
  1111. package/lib/components/toolbar/popup/cabinet/cabinet-category/index.js +0 -86
  1112. package/lib/components/toolbar/popup/cabinet/cabinet-category/index.js.map +0 -1
  1113. package/lib/components/toolbar/popup/cabinet/choose-product/index.js +0 -107
  1114. package/lib/components/toolbar/popup/cabinet/choose-product/index.js.map +0 -1
  1115. package/lib/components/toolbar/popup/cabinet/index.js +0 -91
  1116. package/lib/components/toolbar/popup/cabinet/index.js.map +0 -1
  1117. package/lib/components/toolbar/popup/doorStyle/choose-style/index.js +0 -59
  1118. package/lib/components/toolbar/popup/doorStyle/choose-style/index.js.map +0 -1
  1119. package/lib/components/toolbar/popup/doorStyle/index.js +0 -68
  1120. package/lib/components/toolbar/popup/doorStyle/index.js.map +0 -1
  1121. package/lib/components/toolbar/popup/doorStyle/style-category/index.js +0 -152
  1122. package/lib/components/toolbar/popup/doorStyle/style-category/index.js.map +0 -1
  1123. package/lib/components/toolbar/popup/downloadsummary/downloadSummaryContext.js +0 -9
  1124. package/lib/components/toolbar/popup/downloadsummary/downloadSummaryContext.js.map +0 -1
  1125. package/lib/components/toolbar/popup/downloadsummary/downloadSummaryTemp.js +0 -128
  1126. package/lib/components/toolbar/popup/downloadsummary/downloadSummaryTemp.js.map +0 -1
  1127. package/lib/components/toolbar/popup/downloadsummary/index.js +0 -572
  1128. package/lib/components/toolbar/popup/downloadsummary/index.js.map +0 -1
  1129. package/lib/components/toolbar/popup/downloadsummary/show2D/show2DView.js +0 -60
  1130. package/lib/components/toolbar/popup/downloadsummary/show2D/show2DView.js.map +0 -1
  1131. package/lib/components/toolbar/popup/downloadsummary/show2D/viewer2DDownLoad.js +0 -200
  1132. package/lib/components/toolbar/popup/downloadsummary/show2D/viewer2DDownLoad.js.map +0 -1
  1133. package/lib/components/toolbar/popup/downloadsummary/show3D/show3DView.js +0 -254
  1134. package/lib/components/toolbar/popup/downloadsummary/show3D/show3DView.js.map +0 -1
  1135. package/lib/components/toolbar/popup/downloadsummary/show3D/viewer3DDownLoad.js +0 -1762
  1136. package/lib/components/toolbar/popup/downloadsummary/show3D/viewer3DDownLoad.js.map +0 -1
  1137. package/lib/components/toolbar/popup/downloadsummary/showCabinetInfo.js +0 -96
  1138. package/lib/components/toolbar/popup/downloadsummary/showCabinetInfo.js.map +0 -1
  1139. package/lib/components/toolbar/popup/downloadsummary/showElevation/showElevationView.js +0 -125
  1140. package/lib/components/toolbar/popup/downloadsummary/showElevation/showElevationView.js.map +0 -1
  1141. package/lib/components/toolbar/popup/downloadsummary/showElevation/viewer3DElevationDownload.js +0 -1713
  1142. package/lib/components/toolbar/popup/downloadsummary/showElevation/viewer3DElevationDownload.js.map +0 -1
  1143. package/lib/components/toolbar/popup/downloadsummary/showElevation/viewerElevationDownload.js +0 -184
  1144. package/lib/components/toolbar/popup/downloadsummary/showElevation/viewerElevationDownload.js.map +0 -1
  1145. package/lib/components/toolbar/popup/downloadsummary/showWarranty.js +0 -115
  1146. package/lib/components/toolbar/popup/downloadsummary/showWarranty.js.map +0 -1
  1147. package/lib/components/toolbar/popup/downloadsummary/styles.js +0 -47
  1148. package/lib/components/toolbar/popup/downloadsummary/styles.js.map +0 -1
  1149. package/lib/components/toolbar/popup/finishingtouch/category/index.js +0 -44
  1150. package/lib/components/toolbar/popup/finishingtouch/category/index.js.map +0 -1
  1151. package/lib/components/toolbar/popup/finishingtouch/index.js +0 -54
  1152. package/lib/components/toolbar/popup/finishingtouch/index.js.map +0 -1
  1153. package/lib/components/toolbar/popup/finishingtouch/material-edit.js +0 -163
  1154. package/lib/components/toolbar/popup/finishingtouch/material-edit.js.map +0 -1
  1155. package/lib/components/toolbar/popup/finishingtouch/product/index.js +0 -65
  1156. package/lib/components/toolbar/popup/finishingtouch/product/index.js.map +0 -1
  1157. package/lib/components/toolbar/popup/floorplan/choose-floor/confirm-popup.js +0 -124
  1158. package/lib/components/toolbar/popup/floorplan/choose-floor/confirm-popup.js.map +0 -1
  1159. package/lib/components/toolbar/popup/floorplan/choose-floor/index.js +0 -255
  1160. package/lib/components/toolbar/popup/floorplan/choose-floor/index.js.map +0 -1
  1161. package/lib/components/toolbar/popup/floorplan/choose-floor/styles.js +0 -20
  1162. package/lib/components/toolbar/popup/floorplan/choose-floor/styles.js.map +0 -1
  1163. package/lib/components/toolbar/popup/floorplan/floor-category/index.js +0 -99
  1164. package/lib/components/toolbar/popup/floorplan/floor-category/index.js.map +0 -1
  1165. package/lib/components/toolbar/popup/floorplan/index.js +0 -56
  1166. package/lib/components/toolbar/popup/floorplan/index.js.map +0 -1
  1167. package/lib/components/toolbar/popup/index.js +0 -195
  1168. package/lib/components/toolbar/popup/index.js.map +0 -1
  1169. package/lib/components/toolbar/popup/newproject/index.js +0 -75
  1170. package/lib/components/toolbar/popup/newproject/index.js.map +0 -1
  1171. package/lib/components/toolbar/popup/newproject/styles.js +0 -16
  1172. package/lib/components/toolbar/popup/newproject/styles.js.map +0 -1
  1173. package/lib/components/toolbar/popup/product/appliance.js +0 -73
  1174. package/lib/components/toolbar/popup/product/appliance.js.map +0 -1
  1175. package/lib/components/toolbar/popup/product/cabinetproduct.js +0 -33
  1176. package/lib/components/toolbar/popup/product/cabinetproduct.js.map +0 -1
  1177. package/lib/components/toolbar/popup/product/doorstyle.js +0 -59
  1178. package/lib/components/toolbar/popup/product/doorstyle.js.map +0 -1
  1179. package/lib/components/toolbar/popup/product/doorstyleproduct.js +0 -59
  1180. package/lib/components/toolbar/popup/product/doorstyleproduct.js.map +0 -1
  1181. package/lib/components/toolbar/popup/product/floor.js +0 -59
  1182. package/lib/components/toolbar/popup/product/floor.js.map +0 -1
  1183. package/lib/components/toolbar/popup/product/floorproduct.js +0 -68
  1184. package/lib/components/toolbar/popup/product/floorproduct.js.map +0 -1
  1185. package/lib/components/toolbar/popup/product/index.js +0 -59
  1186. package/lib/components/toolbar/popup/product/index.js.map +0 -1
  1187. package/lib/components/toolbar/popup/product/primary.js +0 -71
  1188. package/lib/components/toolbar/popup/product/primary.js.map +0 -1
  1189. package/lib/components/toolbar/popup/product/productline.js +0 -128
  1190. package/lib/components/toolbar/popup/product/productline.js.map +0 -1
  1191. package/lib/components/toolbar/popup/product/reviewItem.js +0 -346
  1192. package/lib/components/toolbar/popup/product/reviewItem.js.map +0 -1
  1193. package/lib/components/toolbar/popup/product/reviewMolding.js +0 -291
  1194. package/lib/components/toolbar/popup/product/reviewMolding.js.map +0 -1
  1195. package/lib/components/toolbar/popup/product/styles.js +0 -79
  1196. package/lib/components/toolbar/popup/product/styles.js.map +0 -1
  1197. package/lib/components/toolbar/popup/savedesign/FullPictureForm.js +0 -169
  1198. package/lib/components/toolbar/popup/savedesign/FullPictureForm.js.map +0 -1
  1199. package/lib/components/toolbar/popup/savedesign/index.js +0 -516
  1200. package/lib/components/toolbar/popup/savedesign/index.js.map +0 -1
  1201. package/lib/components/toolbar/popup/savedesign/styles.js +0 -26
  1202. package/lib/components/toolbar/popup/savedesign/styles.js.map +0 -1
  1203. package/lib/components/toolbar/popup/setDoorStyleOption/index.js +0 -64
  1204. package/lib/components/toolbar/popup/setDoorStyleOption/index.js.map +0 -1
  1205. package/lib/components/toolbar/popup/styles.js +0 -104
  1206. package/lib/components/toolbar/popup/styles.js.map +0 -1
  1207. package/lib/components/toolbar/popup/submitforquote/AddToCartOptions.js +0 -166
  1208. package/lib/components/toolbar/popup/submitforquote/AddToCartOptions.js.map +0 -1
  1209. package/lib/components/toolbar/popup/submitforquote/CustomerRequestsForm.js +0 -93
  1210. package/lib/components/toolbar/popup/submitforquote/CustomerRequestsForm.js.map +0 -1
  1211. package/lib/components/toolbar/popup/submitforquote/SkipDesignerReview.js +0 -45
  1212. package/lib/components/toolbar/popup/submitforquote/SkipDesignerReview.js.map +0 -1
  1213. package/lib/components/toolbar/popup/submitforquote/StepDots.js +0 -40
  1214. package/lib/components/toolbar/popup/submitforquote/StepDots.js.map +0 -1
  1215. package/lib/components/toolbar/popup/submitforquote/cart-choice.js +0 -141
  1216. package/lib/components/toolbar/popup/submitforquote/cart-choice.js.map +0 -1
  1217. package/lib/components/toolbar/popup/submitforquote/doorstyle-menus.js +0 -50
  1218. package/lib/components/toolbar/popup/submitforquote/doorstyle-menus.js.map +0 -1
  1219. package/lib/components/toolbar/popup/submitforquote/index.js +0 -698
  1220. package/lib/components/toolbar/popup/submitforquote/index.js.map +0 -1
  1221. package/lib/components/toolbar/popup/submitforquote/styles.js +0 -38
  1222. package/lib/components/toolbar/popup/submitforquote/styles.js.map +0 -1
  1223. package/lib/components/toolbar/popup/submitprompt/index.js +0 -79
  1224. package/lib/components/toolbar/popup/submitprompt/index.js.map +0 -1
  1225. package/lib/components/toolbar/popup/submitprompt/styles.js +0 -16
  1226. package/lib/components/toolbar/popup/submitprompt/styles.js.map +0 -1
  1227. package/lib/components/toolbar/toolbar-button.js +0 -111
  1228. package/lib/components/toolbar/toolbar-button.js.map +0 -1
  1229. package/lib/components/toolbar/toolbar-load-button.js +0 -36
  1230. package/lib/components/toolbar/toolbar-load-button.js.map +0 -1
  1231. package/lib/components/toolbar/toolbar-save-button.js +0 -34
  1232. package/lib/components/toolbar/toolbar-save-button.js.map +0 -1
  1233. package/lib/components/tutorial-view/Modal.js +0 -503
  1234. package/lib/components/tutorial-view/Modal.js.map +0 -1
  1235. package/lib/components/tutorial-view/styles.js +0 -13
  1236. package/lib/components/tutorial-view/styles.js.map +0 -1
  1237. package/lib/components/viewer2d/area.js +0 -90
  1238. package/lib/components/viewer2d/area.js.map +0 -1
  1239. package/lib/components/viewer2d/export.js +0 -122
  1240. package/lib/components/viewer2d/export.js.map +0 -1
  1241. package/lib/components/viewer2d/grids/grid-horizontal-streak.js +0 -45
  1242. package/lib/components/viewer2d/grids/grid-horizontal-streak.js.map +0 -1
  1243. package/lib/components/viewer2d/grids/grid-streak.js +0 -45
  1244. package/lib/components/viewer2d/grids/grid-streak.js.map +0 -1
  1245. package/lib/components/viewer2d/grids/grid-vertical-streak.js +0 -45
  1246. package/lib/components/viewer2d/grids/grid-vertical-streak.js.map +0 -1
  1247. package/lib/components/viewer2d/grids/grids.js +0 -45
  1248. package/lib/components/viewer2d/grids/grids.js.map +0 -1
  1249. package/lib/components/viewer2d/group.js +0 -63
  1250. package/lib/components/viewer2d/group.js.map +0 -1
  1251. package/lib/components/viewer2d/item.js +0 -522
  1252. package/lib/components/viewer2d/item.js.map +0 -1
  1253. package/lib/components/viewer2d/layer.js +0 -172
  1254. package/lib/components/viewer2d/layer.js.map +0 -1
  1255. package/lib/components/viewer2d/line.js +0 -899
  1256. package/lib/components/viewer2d/line.js.map +0 -1
  1257. package/lib/components/viewer2d/ruler.js +0 -108
  1258. package/lib/components/viewer2d/ruler.js.map +0 -1
  1259. package/lib/components/viewer2d/rulerDist.js +0 -154
  1260. package/lib/components/viewer2d/rulerDist.js.map +0 -1
  1261. package/lib/components/viewer2d/rulerX.js +0 -159
  1262. package/lib/components/viewer2d/rulerX.js.map +0 -1
  1263. package/lib/components/viewer2d/rulerY.js +0 -161
  1264. package/lib/components/viewer2d/rulerY.js.map +0 -1
  1265. package/lib/components/viewer2d/scene.js +0 -148
  1266. package/lib/components/viewer2d/scene.js.map +0 -1
  1267. package/lib/components/viewer2d/snap.js +0 -84
  1268. package/lib/components/viewer2d/snap.js.map +0 -1
  1269. package/lib/components/viewer2d/state.js +0 -88
  1270. package/lib/components/viewer2d/state.js.map +0 -1
  1271. package/lib/components/viewer2d/utils.js +0 -174
  1272. package/lib/components/viewer2d/utils.js.map +0 -1
  1273. package/lib/components/viewer2d/vertex.js +0 -76
  1274. package/lib/components/viewer2d/vertex.js.map +0 -1
  1275. package/lib/components/viewer2d/viewer2d.js +0 -1409
  1276. package/lib/components/viewer2d/viewer2d.js.map +0 -1
  1277. package/lib/components/viewer3d/camera-controls-module/camera-controls.module.js +0 -2598
  1278. package/lib/components/viewer3d/camera-controls-module/camera-controls.module.js.map +0 -1
  1279. package/lib/components/viewer3d/dcm.js +0 -408
  1280. package/lib/components/viewer3d/dcm.js.map +0 -1
  1281. package/lib/components/viewer3d/fbm.js +0 -421
  1282. package/lib/components/viewer3d/fbm.js.map +0 -1
  1283. package/lib/components/viewer3d/front3D.js +0 -76
  1284. package/lib/components/viewer3d/front3D.js.map +0 -1
  1285. package/lib/components/viewer3d/grid-creator.js +0 -35
  1286. package/lib/components/viewer3d/grid-creator.js.map +0 -1
  1287. package/lib/components/viewer3d/grids/grid-horizontal-streak.js +0 -45
  1288. package/lib/components/viewer3d/grids/grid-horizontal-streak.js.map +0 -1
  1289. package/lib/components/viewer3d/grids/grid-streak.js +0 -36
  1290. package/lib/components/viewer3d/grids/grid-streak.js.map +0 -1
  1291. package/lib/components/viewer3d/grids/grid-vertical-streak.js +0 -45
  1292. package/lib/components/viewer3d/grids/grid-vertical-streak.js.map +0 -1
  1293. package/lib/components/viewer3d/libs/first-person-controls.js +0 -75
  1294. package/lib/components/viewer3d/libs/first-person-controls.js.map +0 -1
  1295. package/lib/components/viewer3d/libs/helvetiker_regular.typeface.js +0 -1288
  1296. package/lib/components/viewer3d/libs/helvetiker_regular.typeface.js.map +0 -1
  1297. package/lib/components/viewer3d/libs/mtl-loader.js +0 -360
  1298. package/lib/components/viewer3d/libs/mtl-loader.js.map +0 -1
  1299. package/lib/components/viewer3d/libs/obj-loader.js +0 -465
  1300. package/lib/components/viewer3d/libs/obj-loader.js.map +0 -1
  1301. package/lib/components/viewer3d/libs/orbit-controls.js +0 -701
  1302. package/lib/components/viewer3d/libs/orbit-controls.js.map +0 -1
  1303. package/lib/components/viewer3d/libs/pointer-lock-controls.js +0 -48
  1304. package/lib/components/viewer3d/libs/pointer-lock-controls.js.map +0 -1
  1305. package/lib/components/viewer3d/lrm.js +0 -312
  1306. package/lib/components/viewer3d/lrm.js.map +0 -1
  1307. package/lib/components/viewer3d/model.js +0 -715
  1308. package/lib/components/viewer3d/model.js.map +0 -1
  1309. package/lib/components/viewer3d/pointer-lock-navigation.js +0 -123
  1310. package/lib/components/viewer3d/pointer-lock-navigation.js.map +0 -1
  1311. package/lib/components/viewer3d/ruler-utils/itemRect.js +0 -69
  1312. package/lib/components/viewer3d/ruler-utils/itemRect.js.map +0 -1
  1313. package/lib/components/viewer3d/ruler-utils/layer3D.js +0 -503
  1314. package/lib/components/viewer3d/ruler-utils/layer3D.js.map +0 -1
  1315. package/lib/components/viewer3d/ruler-utils/ruler3D.js +0 -235
  1316. package/lib/components/viewer3d/ruler-utils/ruler3D.js.map +0 -1
  1317. package/lib/components/viewer3d/ruler-utils/scene3D.js +0 -70
  1318. package/lib/components/viewer3d/ruler-utils/scene3D.js.map +0 -1
  1319. package/lib/components/viewer3d/ruler-utils/state3D.js +0 -26
  1320. package/lib/components/viewer3d/ruler-utils/state3D.js.map +0 -1
  1321. package/lib/components/viewer3d/scene-creator.js +0 -3641
  1322. package/lib/components/viewer3d/scene-creator.js.map +0 -1
  1323. package/lib/components/viewer3d/three-memory-cleaner.js +0 -61
  1324. package/lib/components/viewer3d/three-memory-cleaner.js.map +0 -1
  1325. package/lib/components/viewer3d/viewer3d-first-person.js +0 -321
  1326. package/lib/components/viewer3d/viewer3d-first-person.js.map +0 -1
  1327. package/lib/components/viewer3d/viewer3d.js +0 -2508
  1328. package/lib/components/viewer3d/viewer3d.js.map +0 -1
  1329. package/lib/components/wizardstep/button/styles.js +0 -67
  1330. package/lib/components/wizardstep/button/styles.js.map +0 -1
  1331. package/lib/components/wizardstep/export.js +0 -12
  1332. package/lib/components/wizardstep/export.js.map +0 -1
  1333. package/lib/components/wizardstep/index.js +0 -978
  1334. package/lib/components/wizardstep/index.js.map +0 -1
  1335. package/lib/components/wizardstep/styles.js +0 -68
  1336. package/lib/components/wizardstep/styles.js.map +0 -1
  1337. package/lib/components/wizardstep/wizardstep-content-button.js +0 -224
  1338. package/lib/components/wizardstep/wizardstep-content-button.js.map +0 -1
  1339. package/lib/components/wizardstep/wizardstep-toggle-button.js +0 -133
  1340. package/lib/components/wizardstep/wizardstep-toggle-button.js.map +0 -1
  1341. package/lib/constants.js +0 -646
  1342. package/lib/constants.js.map +0 -1
  1343. package/lib/hooks/useCheckCart.js +0 -60
  1344. package/lib/hooks/useCheckCart.js.map +0 -1
  1345. package/lib/hooks/useGetPricesBySku.js +0 -81
  1346. package/lib/hooks/useGetPricesBySku.js.map +0 -1
  1347. package/lib/hooks/useValidateToken.js +0 -207
  1348. package/lib/hooks/useValidateToken.js.map +0 -1
  1349. package/lib/index.js +0 -108
  1350. package/lib/index.js.map +0 -1
  1351. package/lib/models.js +0 -518
  1352. package/lib/models.js.map +0 -1
  1353. package/lib/plugins/SVGLoader.js +0 -1418
  1354. package/lib/plugins/SVGLoader.js.map +0 -1
  1355. package/lib/plugins/autosave.js +0 -40
  1356. package/lib/plugins/autosave.js.map +0 -1
  1357. package/lib/plugins/console-debugger.js +0 -45
  1358. package/lib/plugins/console-debugger.js.map +0 -1
  1359. package/lib/plugins/export.js +0 -34
  1360. package/lib/plugins/export.js.map +0 -1
  1361. package/lib/plugins/keyboard.js +0 -108
  1362. package/lib/plugins/keyboard.js.map +0 -1
  1363. package/lib/reducers/areas-reducer.js +0 -19
  1364. package/lib/reducers/areas-reducer.js.map +0 -1
  1365. package/lib/reducers/export.js +0 -98
  1366. package/lib/reducers/export.js.map +0 -1
  1367. package/lib/reducers/groups-reducer.js +0 -45
  1368. package/lib/reducers/groups-reducer.js.map +0 -1
  1369. package/lib/reducers/holes-reducer.js +0 -69
  1370. package/lib/reducers/holes-reducer.js.map +0 -1
  1371. package/lib/reducers/items-reducer.js +0 -147
  1372. package/lib/reducers/items-reducer.js.map +0 -1
  1373. package/lib/reducers/lines-reducer.js +0 -52
  1374. package/lib/reducers/lines-reducer.js.map +0 -1
  1375. package/lib/reducers/project-reducer.js +0 -136
  1376. package/lib/reducers/project-reducer.js.map +0 -1
  1377. package/lib/reducers/reducer.js +0 -27
  1378. package/lib/reducers/reducer.js.map +0 -1
  1379. package/lib/reducers/scene-reducer.js +0 -35
  1380. package/lib/reducers/scene-reducer.js.map +0 -1
  1381. package/lib/reducers/user-reducer.js +0 -48
  1382. package/lib/reducers/user-reducer.js.map +0 -1
  1383. package/lib/reducers/vertices-reducer.js +0 -26
  1384. package/lib/reducers/vertices-reducer.js.map +0 -1
  1385. package/lib/reducers/viewer2d-reducer.js +0 -83
  1386. package/lib/reducers/viewer2d-reducer.js.map +0 -1
  1387. package/lib/reducers/viewer3d-reducer.js +0 -64
  1388. package/lib/reducers/viewer3d-reducer.js.map +0 -1
  1389. package/lib/shared-style.js +0 -73
  1390. package/lib/shared-style.js.map +0 -1
  1391. package/lib/styles/export.js +0 -14
  1392. package/lib/styles/export.js.map +0 -1
  1393. package/lib/translator/en.js +0 -111
  1394. package/lib/translator/en.js.map +0 -1
  1395. package/lib/translator/it.js +0 -86
  1396. package/lib/translator/it.js.map +0 -1
  1397. package/lib/translator/ru.js +0 -86
  1398. package/lib/translator/ru.js.map +0 -1
  1399. package/lib/translator/translator.js +0 -91
  1400. package/lib/translator/translator.js.map +0 -1
  1401. package/lib/utils/browser.js +0 -41
  1402. package/lib/utils/browser.js.map +0 -1
  1403. package/lib/utils/email-validator.js +0 -11
  1404. package/lib/utils/email-validator.js.map +0 -1
  1405. package/lib/utils/export.js +0 -57
  1406. package/lib/utils/export.js.map +0 -1
  1407. package/lib/utils/geometry.js +0 -2329
  1408. package/lib/utils/geometry.js.map +0 -1
  1409. package/lib/utils/get-edges-of-subgraphs.js +0 -29
  1410. package/lib/utils/get-edges-of-subgraphs.js.map +0 -1
  1411. package/lib/utils/graph-cycles.js +0 -241
  1412. package/lib/utils/graph-cycles.js.map +0 -1
  1413. package/lib/utils/graph-inner-cycles.js +0 -55
  1414. package/lib/utils/graph-inner-cycles.js.map +0 -1
  1415. package/lib/utils/graph.js +0 -152
  1416. package/lib/utils/graph.js.map +0 -1
  1417. package/lib/utils/helper.js +0 -360
  1418. package/lib/utils/helper.js.map +0 -1
  1419. package/lib/utils/history.js +0 -37
  1420. package/lib/utils/history.js.map +0 -1
  1421. package/lib/utils/id-broker.js +0 -26
  1422. package/lib/utils/id-broker.js.map +0 -1
  1423. package/lib/utils/logger.js +0 -15
  1424. package/lib/utils/logger.js.map +0 -1
  1425. package/lib/utils/math.js +0 -58
  1426. package/lib/utils/math.js.map +0 -1
  1427. package/lib/utils/molding.js +0 -864
  1428. package/lib/utils/molding.js.map +0 -1
  1429. package/lib/utils/name-generator.js +0 -24
  1430. package/lib/utils/name-generator.js.map +0 -1
  1431. package/lib/utils/objects-utils.js +0 -61
  1432. package/lib/utils/objects-utils.js.map +0 -1
  1433. package/lib/utils/phone-validator.js +0 -11
  1434. package/lib/utils/phone-validator.js.map +0 -1
  1435. package/lib/utils/process-black-list.js +0 -25
  1436. package/lib/utils/process-black-list.js.map +0 -1
  1437. package/lib/utils/react-if.js +0 -25
  1438. package/lib/utils/react-if.js.map +0 -1
  1439. package/lib/utils/snap-scene.js +0 -106
  1440. package/lib/utils/snap-scene.js.map +0 -1
  1441. package/lib/utils/snap.js +0 -250
  1442. package/lib/utils/snap.js.map +0 -1
  1443. package/lib/utils/threeCSG.es6.js +0 -504
  1444. package/lib/utils/threeCSG.es6.js.map +0 -1
  1445. package/lib/version.js +0 -8
  1446. package/lib/version.js.map +0 -1
  1447. package/src/components/catalog-view/catalog-breadcrumb.jsx +0 -53
  1448. package/src/components/catalog-view/catalog-item.jsx +0 -229
  1449. package/src/components/catalog-view/catalog-list.jsx +0 -173
  1450. package/src/components/catalog-view/catalog-page-item.jsx +0 -110
  1451. package/src/components/catalog-view/catalog-turn-back-page-item.jsx +0 -80
  1452. package/src/components/configurator/custom-configurator.jsx +0 -77
  1453. package/src/components/configurator/project-configurator.jsx +0 -120
  1454. package/src/components/firstsetting/button/styles.js +0 -223
  1455. package/src/components/firstsetting/export.js +0 -9
  1456. package/src/components/firstsetting/firstsetting-content-button.jsx +0 -198
  1457. package/src/components/firstsetting/firstsetting-toggle-button.jsx +0 -101
  1458. package/src/components/firstsetting/firstsetting.jsx +0 -814
  1459. package/src/components/footerbar/button/ControlButton.jsx +0 -43
  1460. package/src/components/footerbar/button/DirectionButton.jsx +0 -54
  1461. package/src/components/footerbar/button/DirectionPanSpinButton.jsx +0 -36
  1462. package/src/components/footerbar/button/ToggleButton.jsx +0 -58
  1463. package/src/components/footerbar/button/ToggleConvertButton.jsx +0 -48
  1464. package/src/components/footerbar/button/ToggleMeasureButton.jsx +0 -33
  1465. package/src/components/footerbar/button/styles.js +0 -217
  1466. package/src/components/footerbar/export.js +0 -9
  1467. package/src/components/footerbar/footer-content-button.jsx +0 -198
  1468. package/src/components/footerbar/footer-toggle-button.jsx +0 -101
  1469. package/src/components/footerbar/footerbar.jsx +0 -1103
  1470. package/src/components/footerbar/styles.js +0 -263
  1471. package/src/components/header/button/MenuButton.jsx +0 -46
  1472. package/src/components/header/button/SaveButton.jsx +0 -54
  1473. package/src/components/header/button/styles.js +0 -181
  1474. package/src/components/header/export.js +0 -5
  1475. package/src/components/header/header.jsx +0 -631
  1476. package/src/components/header/header.style.css +0 -47
  1477. package/src/components/header/styles.js +0 -320
  1478. package/src/components/login/Login.js +0 -77
  1479. package/src/components/login/LoginForm/index.js +0 -108
  1480. package/src/components/login/Register.js +0 -83
  1481. package/src/components/login/RegisterForm/index.js +0 -171
  1482. package/src/components/login/jwtService.js +0 -201
  1483. package/src/components/login/style.css +0 -158
  1484. package/src/components/login/style.scss +0 -260
  1485. package/src/components/myprojects/export.js +0 -5
  1486. package/src/components/myprojects/index.jsx +0 -445
  1487. package/src/components/myprojects/styles.js +0 -241
  1488. package/src/components/sidebar/custom-accordion.jsx +0 -48
  1489. package/src/components/sidebar/export.js +0 -15
  1490. package/src/components/sidebar/panel-element-editor/attributes-editor/attributes-editor.jsx +0 -73
  1491. package/src/components/sidebar/panel-element-editor/attributes-editor/confirm-popup.jsx +0 -101
  1492. package/src/components/sidebar/panel-element-editor/attributes-editor/hole-attributes-editor.jsx +0 -149
  1493. package/src/components/sidebar/panel-element-editor/attributes-editor/item-attributes-editor.jsx +0 -316
  1494. package/src/components/sidebar/panel-element-editor/attributes-editor/line-attributes-editor.jsx +0 -108
  1495. package/src/components/sidebar/panel-element-editor/element-editor.jsx +0 -1070
  1496. package/src/components/sidebar/panel-element-editor/multi-elements-editor.jsx +0 -0
  1497. package/src/components/sidebar/panel-element-editor/panel-element-editor.jsx +0 -104
  1498. package/src/components/sidebar/panel-element-editor/panel-multi-elements-editor.jsx +0 -155
  1499. package/src/components/sidebar/panel-group-editor.jsx +0 -272
  1500. package/src/components/sidebar/panel-groups.jsx +0 -310
  1501. package/src/components/sidebar/panel-guides.jsx +0 -192
  1502. package/src/components/sidebar/panel-layer-elements.jsx +0 -298
  1503. package/src/components/sidebar/panel-layers.jsx +0 -381
  1504. package/src/components/sidebar/panel.jsx +0 -71
  1505. package/src/components/sidebar/sidebar.jsx +0 -106
  1506. package/src/components/sidebar/toolbar-panel.jsx +0 -139
  1507. package/src/components/sign/export.js +0 -7
  1508. package/src/components/sign/main/index.jsx +0 -523
  1509. package/src/components/sign/main/styles.js +0 -163
  1510. package/src/components/toolbar/button/ControlButton.jsx +0 -41
  1511. package/src/components/toolbar/button/DirectionButton.jsx +0 -34
  1512. package/src/components/toolbar/button/RightButton.jsx +0 -103
  1513. package/src/components/toolbar/button/ToggleButton.jsx +0 -41
  1514. package/src/components/toolbar/button/index.jsx +0 -55
  1515. package/src/components/toolbar/button/styles.js +0 -127
  1516. package/src/components/toolbar/components/DoorStyleMenu.jsx +0 -103
  1517. package/src/components/toolbar/components/Pricing.jsx +0 -126
  1518. package/src/components/toolbar/components/ReviewForQuote.jsx +0 -635
  1519. package/src/components/toolbar/export.js +0 -21
  1520. package/src/components/toolbar/main/Alert.js +0 -122
  1521. package/src/components/toolbar/main/TakePictureModal.jsx +0 -104
  1522. package/src/components/toolbar/main/confirm-popup.jsx +0 -99
  1523. package/src/components/toolbar/main/index.jsx +0 -5687
  1524. package/src/components/toolbar/main/lShaped.json +0 -311
  1525. package/src/components/toolbar/main/longNarrow.json +0 -238
  1526. package/src/components/toolbar/main/myComponents.js +0 -123
  1527. package/src/components/toolbar/main/oRectangle.json +0 -220
  1528. package/src/components/toolbar/main/rectangle.json +0 -238
  1529. package/src/components/toolbar/main/style.css +0 -107
  1530. package/src/components/toolbar/main/styles.js +0 -696
  1531. package/src/components/toolbar/plugin-item.jsx +0 -123
  1532. package/src/components/toolbar/popup/appliance/appliance-category/index.jsx +0 -73
  1533. package/src/components/toolbar/popup/appliance/choose-appliance/index.jsx +0 -102
  1534. package/src/components/toolbar/popup/appliance/index.jsx +0 -83
  1535. package/src/components/toolbar/popup/autosaveprompt/index.jsx +0 -150
  1536. package/src/components/toolbar/popup/autosaveprompt/styles.css +0 -64
  1537. package/src/components/toolbar/popup/autosaveprompt/styles.js +0 -40
  1538. package/src/components/toolbar/popup/cabinet/cabinet-category/index.jsx +0 -73
  1539. package/src/components/toolbar/popup/cabinet/choose-product/index.jsx +0 -119
  1540. package/src/components/toolbar/popup/cabinet/index.jsx +0 -85
  1541. package/src/components/toolbar/popup/doorStyle/choose-style/index.jsx +0 -63
  1542. package/src/components/toolbar/popup/doorStyle/index.jsx +0 -71
  1543. package/src/components/toolbar/popup/doorStyle/style-category/index.jsx +0 -139
  1544. package/src/components/toolbar/popup/downloadsummary/downloadSummaryContext.js +0 -2
  1545. package/src/components/toolbar/popup/downloadsummary/downloadSummaryTemp.jsx +0 -157
  1546. package/src/components/toolbar/popup/downloadsummary/index.jsx +0 -643
  1547. package/src/components/toolbar/popup/downloadsummary/show2D/show2DView.jsx +0 -51
  1548. package/src/components/toolbar/popup/downloadsummary/show2D/viewer2DDownLoad.jsx +0 -175
  1549. package/src/components/toolbar/popup/downloadsummary/show3D/show3DView.jsx +0 -283
  1550. package/src/components/toolbar/popup/downloadsummary/show3D/viewer3DDownLoad.jsx +0 -2257
  1551. package/src/components/toolbar/popup/downloadsummary/showCabinetInfo.js +0 -93
  1552. package/src/components/toolbar/popup/downloadsummary/showElevation/showElevationView.jsx +0 -132
  1553. package/src/components/toolbar/popup/downloadsummary/showElevation/viewer3DElevationDownload.jsx +0 -2198
  1554. package/src/components/toolbar/popup/downloadsummary/showElevation/viewerElevationDownload.jsx +0 -152
  1555. package/src/components/toolbar/popup/downloadsummary/showWarranty.jsx +0 -149
  1556. package/src/components/toolbar/popup/downloadsummary/styles.css +0 -177
  1557. package/src/components/toolbar/popup/downloadsummary/styles.js +0 -453
  1558. package/src/components/toolbar/popup/finishingtouch/category/index.jsx +0 -34
  1559. package/src/components/toolbar/popup/finishingtouch/index.jsx +0 -58
  1560. package/src/components/toolbar/popup/finishingtouch/material-edit.jsx +0 -112
  1561. package/src/components/toolbar/popup/finishingtouch/product/index.jsx +0 -116
  1562. package/src/components/toolbar/popup/floorplan/choose-floor/confirm-popup.jsx +0 -101
  1563. package/src/components/toolbar/popup/floorplan/choose-floor/index.jsx +0 -254
  1564. package/src/components/toolbar/popup/floorplan/choose-floor/lShaped.json +0 -311
  1565. package/src/components/toolbar/popup/floorplan/choose-floor/longNarrow.json +0 -238
  1566. package/src/components/toolbar/popup/floorplan/choose-floor/oRectangle.json +0 -220
  1567. package/src/components/toolbar/popup/floorplan/choose-floor/rectangle.json +0 -238
  1568. package/src/components/toolbar/popup/floorplan/choose-floor/styles.js +0 -86
  1569. package/src/components/toolbar/popup/floorplan/floor-category/index.jsx +0 -109
  1570. package/src/components/toolbar/popup/floorplan/index.jsx +0 -60
  1571. package/src/components/toolbar/popup/index.jsx +0 -241
  1572. package/src/components/toolbar/popup/newproject/index.jsx +0 -59
  1573. package/src/components/toolbar/popup/newproject/styles.css +0 -64
  1574. package/src/components/toolbar/popup/newproject/styles.js +0 -41
  1575. package/src/components/toolbar/popup/product/appliance.jsx +0 -54
  1576. package/src/components/toolbar/popup/product/cabinetproduct.jsx +0 -15
  1577. package/src/components/toolbar/popup/product/doorstyle.jsx +0 -58
  1578. package/src/components/toolbar/popup/product/doorstyleproduct.jsx +0 -47
  1579. package/src/components/toolbar/popup/product/floor.jsx +0 -36
  1580. package/src/components/toolbar/popup/product/floorproduct.jsx +0 -42
  1581. package/src/components/toolbar/popup/product/index.jsx +0 -36
  1582. package/src/components/toolbar/popup/product/primary.jsx +0 -77
  1583. package/src/components/toolbar/popup/product/productline.jsx +0 -93
  1584. package/src/components/toolbar/popup/product/reviewItem.jsx +0 -427
  1585. package/src/components/toolbar/popup/product/reviewMolding.jsx +0 -310
  1586. package/src/components/toolbar/popup/product/style.css +0 -54
  1587. package/src/components/toolbar/popup/product/styles.js +0 -260
  1588. package/src/components/toolbar/popup/savedesign/FullPictureForm.jsx +0 -146
  1589. package/src/components/toolbar/popup/savedesign/index.jsx +0 -495
  1590. package/src/components/toolbar/popup/savedesign/savedesign.style.css +0 -16
  1591. package/src/components/toolbar/popup/savedesign/styles.js +0 -151
  1592. package/src/components/toolbar/popup/setDoorStyleOption/index.jsx +0 -87
  1593. package/src/components/toolbar/popup/styles.js +0 -909
  1594. package/src/components/toolbar/popup/submitforquote/AddToCartOptions.jsx +0 -192
  1595. package/src/components/toolbar/popup/submitforquote/CustomerRequestsForm.jsx +0 -96
  1596. package/src/components/toolbar/popup/submitforquote/SkipDesignerReview.jsx +0 -54
  1597. package/src/components/toolbar/popup/submitforquote/StepDots.jsx +0 -25
  1598. package/src/components/toolbar/popup/submitforquote/cart-choice.jsx +0 -116
  1599. package/src/components/toolbar/popup/submitforquote/doorstyle-menus.js +0 -38
  1600. package/src/components/toolbar/popup/submitforquote/index.jsx +0 -698
  1601. package/src/components/toolbar/popup/submitforquote/styles.css +0 -105
  1602. package/src/components/toolbar/popup/submitforquote/styles.js +0 -294
  1603. package/src/components/toolbar/popup/submitprompt/index.jsx +0 -89
  1604. package/src/components/toolbar/popup/submitprompt/styles.css +0 -64
  1605. package/src/components/toolbar/popup/submitprompt/styles.js +0 -42
  1606. package/src/components/toolbar/toolbar-button.jsx +0 -90
  1607. package/src/components/toolbar/toolbar-load-button.jsx +0 -36
  1608. package/src/components/toolbar/toolbar-save-button.jsx +0 -32
  1609. package/src/components/wizardstep/button/styles.js +0 -677
  1610. package/src/components/wizardstep/export.js +0 -5
  1611. package/src/components/wizardstep/index.jsx +0 -1372
  1612. package/src/components/wizardstep/styles.js +0 -688
  1613. package/src/components/wizardstep/wizardstep-content-button.jsx +0 -198
  1614. package/src/components/wizardstep/wizardstep-toggle-button.jsx +0 -101
  1615. package/src/hooks/useCheckCart.js +0 -38
  1616. package/src/hooks/useGetPricesBySku.js +0 -59
  1617. package/src/hooks/useValidateToken.js +0 -181
  1618. package/src/styles/export.js +0 -7
  1619. package/src/styles/tabs.css +0 -40
@@ -1,3641 +0,0 @@
1
- "use strict";
2
-
3
- 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); }
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.addMolding = addMolding;
8
- exports.addWarningBox = addWarningBox;
9
- exports.checkCabinetOverlap = checkCabinetOverlap;
10
- exports.createBacksplash = createBacksplash;
11
- exports.createMDFromItem = createMDFromItem;
12
- exports.createWarningObject = createWarningObject;
13
- exports.deleteAllMolding = deleteAllMolding;
14
- exports.deleteCountertop = deleteCountertop;
15
- exports.deleteMGMesh = deleteMGMesh;
16
- exports.deleteSpecifiedMeshObjects = deleteSpecifiedMeshObjects;
17
- exports.fVLine = void 0;
18
- exports.getDistanceBetweenLineSegment = getDistanceBetweenLineSegment;
19
- exports.getDistances = getDistances;
20
- exports.getIntersectPoint = getIntersectPoint;
21
- exports.getMeshesFromScene = getMeshesFromScene;
22
- exports.getTotalDistance = getTotalDistance;
23
- exports.parseData = parseData;
24
- exports.removeItem = removeItem;
25
- exports.removeSelItemMesh = removeSelItemMesh;
26
- exports.sameSign = sameSign;
27
- exports.showYelloBox = showYelloBox;
28
- exports.threedfabs = threedfabs;
29
- exports.tryAdjacentMD = tryAdjacentMD;
30
- exports.updateDoorHandleMesh = updateDoorHandleMesh;
31
- exports.updateMoldingGroupArray = updateMoldingGroupArray;
32
- exports.updateScene = updateScene;
33
- exports.visibleTransformBox = visibleTransformBox;
34
- var _three = _interopRequireWildcard(require("three"));
35
- var Three = _three;
36
- var _gridCreator = _interopRequireDefault(require("./grid-creator"));
37
- var _threeMemoryCleaner = require("./three-memory-cleaner");
38
- var _util = require("util");
39
- var _constants = require("../../constants");
40
- var _export = require("../../utils/export");
41
- var _convertUnits = _interopRequireDefault(require("convert-units"));
42
- var _geometry2 = require("../../utils/geometry");
43
- var GeomUtils = _interopRequireWildcard(require("../../../demo/src/catalog/utils/geom-utils"));
44
- var _itemLoader = require("../../../demo/src/catalog/utils/item-loader");
45
- var _utils = require("../viewer2d/utils");
46
- var _helper = require("../../../src/utils/helper");
47
- var _math = require("../../utils/math");
48
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
49
- 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); }
50
- function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
51
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
52
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
53
- function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
54
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
55
- 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); }
56
- function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
57
- function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
58
- function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
59
- function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
60
- function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
61
- function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
62
- var transformBox;
63
- var fVLine = exports.fVLine = [];
64
- var scene_mode = null;
65
- function parseData(sceneData, actions, catalog, camera, renderer, mode) {
66
- var planData = {
67
- catalog: catalog,
68
- sceneData: sceneData
69
- };
70
- window.planData = planData;
71
- planData.sceneGraph = {
72
- unit: sceneData.unit,
73
- layers: {},
74
- busyResources: {
75
- layers: {}
76
- },
77
- width: sceneData.width,
78
- height: sceneData.height,
79
- LODs: {}
80
- };
81
- planData.plan = new Three.Object3D();
82
- planData.plan.name = 'plan';
83
- planData.cam = new Three.Object3D();
84
- planData.cam.name = 'cam';
85
-
86
- // Add a grid to the plan
87
- planData.grid = (0, _gridCreator["default"])(sceneData);
88
- planData.grid.name = 'grid';
89
- planData.boundingBox = new Three.Box3().setFromObject(planData.grid);
90
- planData.boundingBox.name = 'boundingBox';
91
- var promises = [];
92
- sceneData.layers.forEach(function (layer) {
93
- if (layer.id === sceneData.selectedLayer || layer.visible) {
94
- promises = promises.concat(createLayerObjects(layer, planData, sceneData, actions, catalog, mode, camera, renderer));
95
- }
96
- });
97
- var p1 = new Promise(function (resolve) {
98
- Promise.all(promises).then(function (value) {
99
- if (planData.plan.parent !== null && planData.plan.children.length !== 0) {
100
- updateBoundingBox(planData, false, mode);
101
-
102
- // if mode is elevation, build elevation scene
103
- if ((0, _helper.isElevationView)(mode)) buildElevationScene(planData, mode);
104
- }
105
- resolve('success');
106
- });
107
- });
108
- return {
109
- promise: p1,
110
- planData: planData
111
- };
112
-
113
- // return planData;
114
- }
115
- function visibleTransformBox(flag) {
116
- // if (transformBox instanceof Three.Mesh)
117
- // transformBox.visible = flag;
118
- }
119
- var buildElevationScene = function buildElevationScene(planData, mode) {
120
- var scene = planData.plan.parent;
121
- scene.updateMatrixWorld();
122
- var ELEV_GRP = 'ELEV_GRP';
123
- var oldElevationGroup = scene.getObjectByName(ELEV_GRP);
124
- if (oldElevationGroup) oldElevationGroup.parent.remove(oldElevationGroup);
125
- var elevationGroup = new Three.Group();
126
- scene.traverse(function (obj) {
127
- if (obj.name == 'MainObject') {
128
- var clone = obj.clone();
129
- clone.name = '';
130
- clone.visible = obj.parent.visible;
131
- clone.applyMatrix4(obj.parent.matrixWorld);
132
- elevationGroup.add(clone);
133
- }
134
- });
135
- elevationGroup.name = ELEV_GRP;
136
- elevationGroup.visible = false;
137
- planData.elevationGroup = elevationGroup;
138
- scene.traverse(function (obj) {
139
- if (obj.name == 'MainObject') {
140
- (0, _helper.replaceMeshesWithLineSegments)(obj);
141
- }
142
- });
143
- scene.add(elevationGroup);
144
- };
145
- function createLayerObjects(layer, planData, sceneData, actions, catalog, mode, camera, renderer) {
146
- var promises = [];
147
- var moldingGroups = _export.MoldingUtils.getAllMoldingGroups(layer);
148
- planData.sceneGraph.layers[layer.id] = {
149
- id: layer.id,
150
- lines: {},
151
- holes: {},
152
- areas: {},
153
- items: {},
154
- countertops: [],
155
- moldingGroups: moldingGroups,
156
- backsplashes: [],
157
- visible: layer.visible,
158
- altitude: layer.altitude
159
- };
160
- planData.sceneGraph.busyResources.layers[layer.id] = {
161
- id: layer.id,
162
- lines: {},
163
- holes: {},
164
- areas: {},
165
- items: {},
166
- moldingGroups: {}
167
- };
168
- // Import lines
169
- layer.lines.forEach(function (line) {
170
- promises.push(addLine(sceneData, planData, layer, line.id, catalog, actions.linesActions, mode));
171
- line.holes.forEach(function (holeID) {
172
- promises.push(addHole(sceneData, planData, layer, holeID, catalog, actions.holesActions, mode));
173
- });
174
- });
175
-
176
- // Import areas
177
- layer.areas.forEach(function (area) {
178
- promises.push(addArea(sceneData, planData, layer, area.id, catalog, actions.areaActions, mode));
179
- });
180
- // Import items
181
- layer.items.forEach(function (item) {
182
- promises.push(addItem(sceneData, planData, layer, item.id, catalog, actions.itemsActions, mode, null, null
183
- // false
184
- ));
185
- });
186
- return promises;
187
- }
188
- var canvas = document.createElement('canvas');
189
- canvas.width = 50;
190
- canvas.height = 100;
191
- canvas.style.width = 50 + 'px';
192
- canvas.style.height = 100 + 'px';
193
- var ctx = canvas.getContext('2d');
194
- ctx.fillStyle = '#FFFFFF';
195
- ctx.strokeStyle = '#ff7400';
196
- ctx.beginPath();
197
- ctx.arc(25, 25, 20, 0, 2 * Math.PI);
198
- ctx.fill();
199
- ctx.stroke();
200
- var img1 = new Image();
201
- img1.crossOrigin = 'anonymous';
202
- img1.src = '/assets/img/svg/3d_item_warning_info.svg';
203
- img1.onload = function () {
204
- ctx.drawImage(img1, 0, 0, 50, 50);
205
- };
206
- ctx.lineWidth = 4;
207
- ctx.beginPath();
208
- ctx.arc(25, 75, 20, 0, 2 * Math.PI);
209
- ctx.fill();
210
- ctx.stroke();
211
- var img2 = new Image();
212
- img2.crossOrigin = 'anonymous';
213
- img2.src = '/assets/img/svg/3d_item_warning_edit.svg';
214
- img2.onload = function () {
215
- ctx.drawImage(img2, 8, 58, 34, 34);
216
- };
217
- function createWarningObject() {
218
- var warningTexture = new Three.Texture(canvas);
219
- warningTexture.needsUpdate = true;
220
- var warningObj = new Three.Sprite(new Three.SpriteMaterial({
221
- map: warningTexture,
222
- sizeAttenuation: true
223
- }));
224
- warningObj.material.transparent = true;
225
- warningObj.material.depthTest = false;
226
- warningObj.scale.set(20, 40, 20);
227
- warningObj.renderOrder = 3;
228
- warningObj.name = 'warningObj';
229
- return warningObj;
230
- }
231
- function updateScene(planData, sceneData, oldSceneData, diffArray, actions, catalog) {
232
- var _draggingItem$toJS, _filteredDiffs, _filteredDiffs2;
233
- var mode = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : null;
234
- var toolObj = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : null;
235
- var angleObj = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : null;
236
- var draggingItem = arguments.length > 9 && arguments[9] !== undefined ? arguments[9] : null;
237
- var result = [];
238
- if (mode != null) {
239
- scene_mode = mode;
240
- }
241
- var splitted = diffArray.map(function (el) {
242
- return {
243
- op: el.op,
244
- path: el.path.split('/'),
245
- value: el.value
246
- };
247
- });
248
- var filteredDiffs = filterDiffs(splitted, sceneData, oldSceneData);
249
- //***testing additional filter***
250
- filteredDiffs = filteredDiffs.filter(function (_ref) {
251
- var path = _ref.path;
252
- return path[3] !== 'selected';
253
- });
254
- filteredDiffs = filteredDiffs.filter(function (_ref2) {
255
- var path = _ref2.path;
256
- return path[1] !== 'groups';
257
- });
258
- //*******************************
259
- //This is executed when dragging item is end and performs the updateing filteredDiffs.
260
- if ((sceneData === null || sceneData === void 0 ? void 0 : sceneData.isEndDragging) === true && draggingItem && !(0, _helper.isEmpty)((_draggingItem$toJS = draggingItem.toJS) === null || _draggingItem$toJS === void 0 ? void 0 : _draggingItem$toJS.call(draggingItem)) && ((_filteredDiffs = filteredDiffs) === null || _filteredDiffs === void 0 || (_filteredDiffs = _filteredDiffs[0]) === null || _filteredDiffs === void 0 || (_filteredDiffs = _filteredDiffs.path) === null || _filteredDiffs === void 0 ? void 0 : _filteredDiffs.length) < _constants.DIFFERENT_VALUES_PATH_LENGTH && (_filteredDiffs2 = filteredDiffs) !== null && _filteredDiffs2 !== void 0 && (_filteredDiffs2 = _filteredDiffs2[0]) !== null && _filteredDiffs2 !== void 0 && (_filteredDiffs2 = _filteredDiffs2.path) !== null && _filteredDiffs2 !== void 0 && _filteredDiffs2.includes('showfg')) {
261
- var _draggingItem$getIn, _draggingItem$getIn2;
262
- var layerID = (_draggingItem$getIn = draggingItem.getIn) === null || _draggingItem$getIn === void 0 ? void 0 : _draggingItem$getIn.call(draggingItem, ['layerID']);
263
- var itemID = (_draggingItem$getIn2 = draggingItem.getIn) === null || _draggingItem$getIn2 === void 0 ? void 0 : _draggingItem$getIn2.call(draggingItem, ['itemID']);
264
- if (layerID && itemID) {
265
- var _sceneData$getIn, _sceneData$getIn$toJS, _selLayer$items;
266
- filteredDiffs[0].path = ['', 'layers', layerID, 'items', itemID, 'distArray'];
267
- var selLayer = (_sceneData$getIn = sceneData.getIn) === null || _sceneData$getIn === void 0 || (_sceneData$getIn = _sceneData$getIn.call(sceneData, ['layers', layerID])) === null || _sceneData$getIn === void 0 || (_sceneData$getIn$toJS = _sceneData$getIn.toJS) === null || _sceneData$getIn$toJS === void 0 ? void 0 : _sceneData$getIn$toJS.call(_sceneData$getIn);
268
- var distArray = selLayer === null || selLayer === void 0 || (_selLayer$items = selLayer.items) === null || _selLayer$items === void 0 || (_selLayer$items = _selLayer$items[itemID]) === null || _selLayer$items === void 0 ? void 0 : _selLayer$items.distArray;
269
- filteredDiffs[0].value = distArray;
270
- }
271
- }
272
-
273
- // Check to see if diffs includes changes associated with doorStyle and global molding simultaneously.
274
- var isSettingDoorStyle = false; // If it includes any doorStyle change
275
- var isUpdateMolding = false; // If it includes any global molding change
276
- filteredDiffs.forEach(function (_ref3) {
277
- var path = _ref3.path;
278
- /**
279
- * Every 'doorStyle' change has a 'door_style_id' change.
280
- * So, if door_style_id changes, it indicates 'doorStyle' change.
281
- */
282
- if (['id'].includes(path[path.length - 1])) isSettingDoorStyle = true;
283
-
284
- // If there are any molding change of layer
285
- if (path[1] === 'layers' && path[3] === 'molding') isUpdateMolding = true;
286
- });
287
- if (isSettingDoorStyle && isUpdateMolding)
288
- /**
289
- * If so, any other changes could be ignored.
290
- * Because the molding change of layer invokes 'createLayerObject()'
291
- * and that function re-renders an whole layer.
292
- */
293
- filteredDiffs = filteredDiffs.filter(function (_ref4) {
294
- var path = _ref4.path;
295
- return path[1] === 'layers' && path[3] === 'molding';
296
- });
297
- filteredDiffs.forEach(function (_ref5) {
298
- var op = _ref5.op,
299
- path = _ref5.path,
300
- value = _ref5.value;
301
- /* First of all I need to find the object I need to update */
302
- if (path[1] === 'layers') {
303
- var layer = sceneData.getIn(['layers', path[2]]);
304
- if (path.length === 3 && op === 'remove') {
305
- removeLayer(path[2], planData);
306
- } else if (path.length > 3) {
307
- if (path.length > 5) if (path[5] === 'submodule' || path[5] === 'doorStyle' || path[5] === 'properties') op = 'replace';
308
- switch (op) {
309
- case 'replace':
310
- var promiseValue = replaceObject(path, layer, planData, actions, sceneData, oldSceneData, catalog, mode, value);
311
- if (promiseValue !== undefined) {
312
- result.push(promiseValue.promise);
313
- }
314
- break;
315
- case 'add':
316
- addObject(path, layer, planData, actions, sceneData, oldSceneData, catalog, mode, toolObj);
317
- break;
318
- case 'remove':
319
- if (angleObj) planData.plan.parent.remove(angleObj);
320
- if (toolObj) planData.plan.parent.remove(toolObj);
321
- deleteSpecifiedMeshObjects('WarningBox' + path[4]);
322
- deleteSpecifiedMeshObjects('backsplash' + path[4]);
323
- var item = oldSceneData.getIn(['layers', path[2]]).getIn(['items', path[4]]);
324
- deleteCountertop(planData.sceneGraph.layers[layer.id].countertops, item, planData, layer);
325
- removeObject(path, layer, planData, actions, sceneData, oldSceneData, catalog);
326
- break;
327
- }
328
- }
329
- } else if (path[1] === 'selectedLayer') {
330
- var layerSelectedID = value;
331
- var layerSelected = sceneData.getIn(['layers', layerSelectedID]);
332
- // First of all I check if the new selected layer is not visible
333
- if (!layerSelected.visible) {
334
- // I need to create the objects for this layer
335
- var promises = createLayerObjects(layerSelected, planData, sceneData, actions, catalog, mode);
336
- Promise.all(promises).then(function () {
337
- return updateBoundingBox(planData, false, mode);
338
- });
339
- }
340
- var layerGraph = planData.sceneGraph.layers[oldSceneData.selectedLayer];
341
- if (layerGraph) {
342
- if (!layerGraph.visible) {
343
- // I need to remove the objects for this layer
344
- for (var lineID in layerGraph.lines) removeLine(planData, layerGraph.id, lineID);
345
- for (var areaID in layerGraph.areas) removeArea(planData, layerGraph.id, areaID);
346
- for (var _itemID in layerGraph.items) removeItem(planData, layerGraph.id, _itemID);
347
- for (var holeID in layerGraph.holes) removeHole(planData, layerGraph.id, holeID);
348
- }
349
- }
350
- }
351
- });
352
- var p1 = new Promise(function (resolve) {
353
- Promise.all(result).then(function (replaceValue) {
354
- // if mode is elevation, build elevation scene
355
- // When scene is updated, replaceValue is not empty.
356
- if ((0, _helper.isElevationView)(mode) && !(0, _helper.isEmpty)(replaceValue)) buildElevationScene(planData, mode);
357
- resolve('successPromise');
358
- });
359
- });
360
- return {
361
- promise: p1,
362
- planData: planData
363
- };
364
- }
365
- var animate_objects = {};
366
- function myAnimRotate(obj, open_doors, item, isCorner) {
367
- var animateStep = animate_objects[obj.name].animateStep;
368
-
369
- // if open the door, animateStep increases to ANIMATE_STEP_MAX and if close the door, animateStep decreases to ANIMATE_STEP_MIN
370
- animateStep = open_doors ? animateStep + 1 : animateStep - 1;
371
-
372
- // clear interval when the opening or closing door is ended.
373
- if (animateStep > _constants.ANIMATE_STEP_MAX || animateStep < _constants.ANIMATE_STEP_MIN) {
374
- clearInterval(animate_objects[obj.name].animate_intervalID);
375
- return;
376
- }
377
- animate_objects[obj.name].animateStep = animateStep;
378
- (0, _helper.animateDoor)(animate_objects[obj.name].offset, obj, open_doors, item, isCorner, 'Opened3D');
379
- }
380
- function myAnimTranslate(obj, open_doors, item) {
381
- var animateStep = animate_objects[obj.name].animateStep;
382
- animateStep = open_doors ? animateStep + 1 : animateStep - 1;
383
- if (animateStep > _constants.ANIMATE_STEP_MAX || animateStep < _constants.ANIMATE_STEP_MIN) {
384
- clearInterval(animate_objects[obj.name].animate_intervalID);
385
- return;
386
- }
387
- animate_objects[obj.name].animateStep = animateStep;
388
- (0, _helper.translateDrawer)(item, obj, open_doors, 'Opened3D');
389
- }
390
- function replaceObject(modifiedPath, layer, planData, actions, sceneData, oldSceneData, catalog) {
391
- var mode = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : null;
392
- var value = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : null;
393
- var promises = [];
394
- var matchStr = /\d_(door[^LR1-9]*)(_[LR])?(_[1-9])?$/;
395
- switch (modifiedPath[3]) {
396
- case 'vertices':
397
- if (modifiedPath[5] !== 'selected') {
398
- var vertex = layer.getIn(['vertices', modifiedPath[4]]);
399
- if (modifiedPath[5] === 'x' || modifiedPath[5] === 'y') {
400
- vertex.lines.forEach(function (lineID) {
401
- var lineHoles = oldSceneData.getIn(['layers', layer.id, 'lines', lineID, 'holes']);
402
- if (lineHoles) lineHoles.forEach(function (holeID) {
403
- replaceObject([0, 0, 0, 'holes', holeID, 'selected'], layer, planData, actions, sceneData, oldSceneData, catalog, mode);
404
- });
405
- return replaceObject([0, 0, 0, 'lines', lineID], layer, planData, actions, sceneData, oldSceneData, catalog, mode);
406
- });
407
- vertex.areas.forEach(function (areaID) {
408
- return replaceObject([0, 0, 0, 'areas', areaID], layer, planData, actions, sceneData, oldSceneData, catalog, mode);
409
- });
410
- }
411
- if (modifiedPath[5] === 'areas') {
412
- var areaID = vertex.getIn(['areas', ~~modifiedPath[6]]);
413
- replaceObject([0, 0, 0, 'areas', areaID], layer, planData, actions, sceneData, oldSceneData, catalog, mode);
414
- }
415
- }
416
- break;
417
- case 'holes':
418
- var newHoleData = layer.getIn(['holes', modifiedPath[4]]);
419
- if (catalog.getElement(newHoleData.type).updateRender3D) {
420
- promises.push(updateHole(sceneData, oldSceneData, planData, layer, modifiedPath[4], modifiedPath.slice(5), catalog, actions.holesActions, function () {
421
- return removeHole(planData, layer.id, newHoleData.id);
422
- }, function () {
423
- return addHole(sceneData, planData, layer, newHoleData.id, catalog, actions.holesActions, mode);
424
- }));
425
- } else {
426
- var lineID = newHoleData.line;
427
- if (modifiedPath[5] === 'selected' || scene_mode === 'MODE_DRAWING_HOLE_3D' || scene_mode === 'MODE_DRAGGING_HOLE_3D') {
428
- // I remove only the hole without removing the wall
429
- removeHole(planData, layer.id, newHoleData.id);
430
- promises.push(addHole(sceneData, planData, layer, newHoleData.id, catalog, actions.holesActions, mode));
431
- } else {
432
- layer.getIn(['lines', lineID, 'holes']).forEach(function (holeID) {
433
- removeHole(planData, layer.id, holeID);
434
- });
435
- removeLine(planData, layer.id, lineID);
436
- promises.push(addLine(sceneData, planData, layer, lineID, catalog, actions.linesActions));
437
- layer.getIn(['lines', lineID, 'holes']).forEach(function (holeID) {
438
- promises.push(addHole(sceneData, planData, layer, holeID, catalog, actions.holesActions, mode));
439
- });
440
- }
441
- }
442
- break;
443
- case 'lines':
444
- var line = layer.getIn(['lines', modifiedPath[4]]);
445
- if (catalog.getElement(line.type).updateRender3D) {
446
- promises.push(updateLine(sceneData, oldSceneData, planData, layer, modifiedPath[4], modifiedPath.slice(5), catalog, actions.linesActions, function () {
447
- return removeLine(planData, layer.id, modifiedPath[4]);
448
- }, function () {
449
- return addLine(sceneData, planData, layer, modifiedPath[4], catalog, actions.linesActions);
450
- }));
451
- } else {
452
- removeLine(planData, layer.id, modifiedPath[4]);
453
- promises.push(addLine(sceneData, planData, layer, modifiedPath[4], catalog, actions.linesActions));
454
- }
455
- break;
456
- case 'areas':
457
- var area = layer.getIn(['areas', modifiedPath[4]]);
458
- if (catalog.getElement(area.type).updateRender3D) {
459
- promises.push(updateArea(sceneData, oldSceneData, planData, layer, modifiedPath[4], modifiedPath.slice(5), catalog, actions.areaActions, function () {
460
- return removeArea(planData, layer.id, modifiedPath[4]);
461
- }, function () {
462
- return addArea(sceneData, planData, layer, modifiedPath[4], catalog, actions.areaActions);
463
- }));
464
- } else {
465
- if (planData.sceneGraph.layers[layer.id].areas[modifiedPath[4]]) {
466
- removeArea(planData, layer.id, modifiedPath[4]);
467
- }
468
- promises.push(addArea(sceneData, planData, layer, modifiedPath[4], catalog, actions.areaActions));
469
- }
470
- break;
471
- case 'items':
472
- var item = layer.getIn(['items', modifiedPath[4]]);
473
- deleteCountertop(planData.sceneGraph.layers[layer.id].countertops, item, planData, layer);
474
- var tmpMoldings = _toConsumableArray(planData.sceneGraph.layers[layer.id].moldingGroups);
475
- if (catalog.getElement(item.type).updateRender3D) {
476
- promises.push(updateItem(sceneData, oldSceneData, planData, layer, modifiedPath[4], modifiedPath.slice(5), catalog, actions.itemsActions, function () {
477
- return removeItem(planData, layer.id, modifiedPath[4], oldSceneData.getIn(['layers', layer.id]), layer);
478
- }, function () {
479
- return addItem(sceneData, planData, layer, modifiedPath[4], catalog, actions.itemsActions, mode);
480
- }));
481
- } else {
482
- var item3D = null;
483
- try {
484
- item3D = planData.sceneGraph.layers[layer.id].items[modifiedPath[4]];
485
- } catch (err) {
486
- console.log('modifiedPath: ', modifiedPath, '\nError: ', err);
487
- return;
488
- }
489
- if (!item3D) return;
490
- var keyIndex = modifiedPath.length - 1;
491
- if (modifiedPath[keyIndex] == 'rotation') {
492
- item3D.rotation.set(0, value * Math.PI / 180 + Math.PI, 0);
493
- setTimeout(function () {
494
- getDistances(layer);
495
- }, 50);
496
- removeSelItemMesh(tmpMoldings, item, planData, mode);
497
- } else if (modifiedPath[keyIndex] == 'x') {
498
- item3D.position.x = value;
499
- setTimeout(function () {
500
- getDistances(layer);
501
- }, 50);
502
- removeSelItemMesh(tmpMoldings, item, planData, mode);
503
- } else if (modifiedPath[keyIndex] == 'y') {
504
- item3D.position.z = -value;
505
- setTimeout(function () {
506
- getDistances(layer);
507
- }, 50);
508
- removeSelItemMesh(tmpMoldings, item, planData, mode);
509
- } else if (modifiedPath[keyIndex] == 'selected') {
510
- var itemType = !!catalog.elements[item.type] ? catalog.elements[item.type].type : catalog.elements[(0, _utils.returnReplaceableDeepSearchType)(item.type)].type;
511
- if (value == false) {
512
- item3D.children[0].children = item3D.children[0].children.filter(function (item3DElement) {
513
- return item3DElement.name !== 'TransformBox' && item3DElement.name !== 'TransformGizmo';
514
- });
515
- if (item3D) {
516
- if (item3D.children.length > 1) {
517
- item3D.children.pop();
518
- }
519
- var mBoxColor = 0x99c3fb;
520
- var _item = item.toJS();
521
- if (_item.doorStyle.doorStyles !== undefined && _item.doorStyle.doorStyles.cds) {
522
- if (showYelloBox(_item)) {
523
- mBoxColor = 'rgba(232,187,47,1)';
524
- var mBox = GeomUtils.makeMBoxfromObject(item3D, mBoxColor);
525
- var warningObj = createWarningObject();
526
- warningObj.position.set(0, item.properties.get('height').get('length') / 3, 0);
527
- if (mBox) {
528
- mBox.add(warningObj);
529
- item3D.add(mBox);
530
- }
531
- }
532
- }
533
- }
534
- var temp_MGArray = planData.sceneGraph.layers[layer.id].moldingGroups;
535
- } else {
536
- if (item3D.name !== 'pivot' && item3D.children[0].children[item3D.children[0].children.length - 1].name == 'TransformGizmo') return;
537
- if (item3D.children[0].children[item3D.children[0].children.length - 1].name == 'TransformGizmo') {
538
- item3D.children[0].children.pop();
539
- }
540
- var object = item3D.children[0].clone();
541
- if (item3D.children.length > 1) {
542
- item3D.children.pop();
543
- }
544
- item3D.children.pop();
545
- var altitude = item.properties.get('altitude').get('length');
546
- var scalevec = new Three.Vector3(object.scale.x, object.scale.y, object.scale.z);
547
- var posVec = new Three.Vector3(object.position.x, object.position.y, object.position.z);
548
- var newAltitude = item.properties.get('altitude').get('_length');
549
- var newUnit = item.properties.get('altitude').get('_unit') || 'in';
550
- newAltitude = (0, _convertUnits["default"])(newAltitude).from(newUnit).to(sceneData.unit);
551
- var newWidth = item.properties.get('width').get('_length');
552
- var newWidthUnit = item.properties.get('width').get('_unit') || 'in';
553
- newWidth = (0, _convertUnits["default"])(newWidth).from(newWidthUnit).to('in');
554
- var newHeight = item.properties.get('height').get('_length');
555
- var newHeightUnit = item.properties.get('height').get('_unit') || 'in';
556
- newHeight = (0, _convertUnits["default"])(newHeight).from(newHeightUnit).to('in');
557
- var newDepth = item.properties.get('depth').get('_length');
558
- var newDepthUnit = item.properties.get('depth').get('_unit') || 'in';
559
- newDepth = (0, _convertUnits["default"])(newDepth).from(newDepthUnit).to('in');
560
- var sizeinfo = !!catalog.elements[item.type] ? catalog.elements[item.type].info.sizeinfo : catalog.elements[(0, _utils.returnReplaceableDeepSearchType)(item.type)].info.sizeinfo;
561
- object.scale.set(1 * newWidth / sizeinfo.width, 1 * newHeight / sizeinfo.height, 1 * newDepth / sizeinfo.depth);
562
- object.position.set(0, 0, 0);
563
- object.rotation.set(0, 0, 0);
564
- var box = GeomUtils.baseBoxHelper(object, 0xffffff);
565
- box.material.lineWidth = 0.01;
566
- var boundingBox = GeomUtils.baseBox3FromObject(object);
567
- var max = boundingBox.max;
568
- var min = boundingBox.min;
569
- var radius = Math.sqrt((boundingBox.max.x - boundingBox.min.x) * (boundingBox.max.x - boundingBox.min.x) + (boundingBox.max.z - boundingBox.min.z) * (boundingBox.max.z - boundingBox.min.z)) / 2;
570
- var moveBox = new Three.BoxGeometry(max.x - min.x, max.y - min.y, max.z - min.z);
571
-
572
- // translate Object
573
- var controlGeom = GeomUtils.controlGeom();
574
-
575
- // rotate Object //////////
576
- var rotGeom = GeomUtils.rotGeoms(radius + 0.05);
577
- // //////////////////////////////////
578
- // upwards Geometry///////////
579
- var upwardsGeom = GeomUtils.upwardsGeom();
580
- var vLineGeom = new Three.BufferGeometry();
581
- var vertices = [(max.x - min.x) / 2 + min.x, 0, max.z, (max.x - min.x) / 2 + min.x, 0, max.z + 1.3];
582
- vLineGeom.setAttribute('position', new Three.BufferAttribute(new Float32Array(vertices), 3));
583
- vLineGeom.attributes.position.needsUpdate = true;
584
- var vLineGeom1 = new Three.BufferGeometry();
585
- var vertices1 = [(max.x - min.x) / 2 + min.x, 0, min.z, (max.x - min.x) / 2 + min.x, 0, min.z - 1.3];
586
- vLineGeom1.setAttribute('position', new Three.BufferAttribute(new Float32Array(vertices1), 3));
587
- vLineGeom1.attributes.position.needsUpdate = true;
588
- var vLineGeom2 = new Three.BufferGeometry();
589
- var vertices2 = [max.x, 0, max.z - (max.z - min.z) / 2, max.x + 1.3, 0, max.z - (max.z - min.z) / 2];
590
- vLineGeom2.setAttribute('position', new Three.BufferAttribute(new Float32Array(vertices2), 3));
591
- var vLineGeom3 = new Three.BufferGeometry();
592
- var vertices3 = [min.x, 0, max.z - (max.z - min.z) / 2, min.x - 1.3, 0, max.z - (max.z - min.z) / 2];
593
- vLineGeom3.setAttribute('position', new Three.BufferAttribute(new Float32Array(vertices3), 3));
594
- // ///////////////////////////////////////
595
-
596
- // set names of transform object
597
- var rotFillObj = new Three.Mesh(rotGeom.rotFill, new Three.MeshPhongMaterial({
598
- color: 0x000000,
599
- side: Three.DoubleSide,
600
- colorWrite: true
601
- }));
602
- var rotStrokeObj = new Three.Line(rotGeom.rotStroke, new Three.LineBasicMaterial({
603
- color: 0xffffff,
604
- colorWrite: true
605
- }));
606
- rotFillObj.name = 'rotate';
607
- var upObj = new Three.Mesh(upwardsGeom, new Three.MeshBasicMaterial({
608
- color: 0x000000,
609
- side: Three.DoubleSide
610
- }));
611
- // let upLine = new Three.Line(upwardsGeom, new Three.LineBasicMaterial({ color: 0x000000 }));
612
- // upLine.name = "transUp";
613
- // upObj.add(upLine);
614
- upObj.name = 'transUp';
615
- var upwardbox = new Three.BoxHelper(upObj, 0x326780);
616
- upwardbox.material.lineWidth = 0.01;
617
- exports.fVLine = fVLine = [];
618
- // let obj = new Three.Mesh(controlGeom, new Three.MeshPhongMaterial({ color: 0xffffff, side: Three.DoubleSide, colorWrite: true }));
619
- // obj.name = "translateX";
620
- var color = _constants.SHADE_DARK_PURPLE_COLOR;
621
- var _mBox = new Three.Mesh(moveBox, new Three.MeshBasicMaterial({
622
- color: 0xdd6699,
623
- side: Three.DoubleSide,
624
- transparent: true,
625
- opacity: 0.4
626
- }));
627
- var vLine = new Three.Line(vLineGeom, new Three.LineBasicMaterial({
628
- color: color
629
- }));
630
- var vLine1 = new Three.Line(vLineGeom1, new Three.LineBasicMaterial({
631
- color: color
632
- }));
633
- var vLine2 = new Three.Line(vLineGeom2, new Three.LineBasicMaterial({
634
- color: color
635
- }));
636
- var vLine3 = new Three.Line(vLineGeom3, new Three.LineBasicMaterial({
637
- color: color
638
- }));
639
- fVLine.push(vLine);
640
- fVLine.push(vLine1);
641
- fVLine.push(vLine2);
642
- fVLine.push(vLine3);
643
- vLine.renderOrder = 1;
644
- vLine1.renderOrder = 1;
645
- vLine2.renderOrder = 1;
646
- vLine3.renderOrder = 1;
647
- vLine.material.transparent = true;
648
- vLine1.material.transparent = true;
649
- vLine2.material.transparent = true;
650
- vLine3.material.transparent = true;
651
- vLine.material.depthTest = false;
652
- vLine1.material.depthTest = false;
653
- vLine2.material.depthTest = false;
654
- vLine3.material.depthTest = false;
655
- var uVec = new Three.Vector3(-posVec.x / scalevec.x, -posVec.y / scalevec.y, -posVec.z / scalevec.z);
656
- var blLighting = item.type.includes('Light');
657
- vLine.translateY(blLighting ? 1.6 : 0.1);
658
- vLine1.translateY(blLighting ? 1.6 : 0.1);
659
- vLine2.translateY(blLighting ? 1.6 : 0.1);
660
- vLine3.translateY(blLighting ? 1.6 : 0.1);
661
- upObj.translateOnAxis(uVec, 1);
662
- upObj.translateY(max.y - min.y);
663
- _mBox.name = 'TransformBox';
664
- _mBox.translateOnAxis(new Three.Vector3(uVec.x, uVec.y + (max.y - min.y) / 2, uVec.z), 1);
665
- _mBox.scale.set(1.01, 1.01, 1.01);
666
- var rotFillObj1 = rotFillObj.clone();
667
- var rotStrokeObj1 = rotStrokeObj.clone();
668
- rotFillObj1.rotateY(Math.PI);
669
- rotStrokeObj1.rotateY(Math.PI);
670
- var asrtObj = new Three.Group();
671
- // let asrtObj1 = new Three.Group();
672
- // asrtObj.add(obj);
673
- // asrtObj.add(obj1);
674
- rotFillObj.translateY(blLighting ? 1.6 : 0.1);
675
- rotFillObj1.translateY(blLighting ? 1.6 : 0.1);
676
- rotStrokeObj.translateY(blLighting ? 1.6 : 0.1);
677
- rotStrokeObj1.translateY(blLighting ? 1.6 : 0.1);
678
- upObj.translateY(posVec.y / scalevec.y);
679
- upObj.add(upwardbox);
680
- //asrtObj.add(upObj);
681
- // vLine.translateY(posVec.y / scalevec.y);
682
- // vLine1.translateY(posVec.y / scalevec.y);
683
- // vLine2.translateY(posVec.y / scalevec.y);
684
- // vLine3.translateY(posVec.y / scalevec.y);
685
-
686
- _mBox.translateY(posVec.y / scalevec.y);
687
- // asrtObj.add(rotFillObj);
688
- // asrtObj.add(rotFillObj1);
689
- // asrtObj.add(rotStrokeObj);
690
- // asrtObj.add(rotStrokeObj1);
691
- asrtObj.add(vLine);
692
- asrtObj.add(vLine1);
693
- asrtObj.add(vLine2);
694
- asrtObj.add(vLine3);
695
- asrtObj.add(box);
696
- asrtObj.scale.set(1 / object.scale.x, object.scale.y, 1 / object.scale.z);
697
- _mBox.visible = false;
698
- // transformBox = mBox;
699
- // asrtObj.add(mBox);
700
- asrtObj.name = 'TransformGizmo';
701
- object.add(asrtObj);
702
- object.position.x = posVec.x;
703
- object.position.y = posVec.y;
704
- object.position.z = posVec.z;
705
- // object.rotation.y = Math.PI;
706
- object.scale.set(scalevec.x, scalevec.y, scalevec.z);
707
- item3D.add(object);
708
- if (item3D) {
709
- var _mBoxColor = 0x99c3fb;
710
- var _item2 = item.toJS();
711
- if (_item2.doorStyle.doorStyles !== undefined && _item2.doorStyle.doorStyles.cds) {
712
- if (showYelloBox(_item2)) {
713
- _mBoxColor = 'rgba(232,187,47,1)';
714
- var _mBox2 = GeomUtils.makeMBoxfromObject(item3D, _mBoxColor);
715
- var _warningObj = createWarningObject();
716
- _warningObj.position.set(0, item.properties.get('height').get('length') / 3, 0);
717
- if (_mBox2) {
718
- _mBox2.add(_warningObj);
719
- item3D.add(_mBox2);
720
- }
721
- }
722
- }
723
- }
724
- applyInteract(item3D, function () {
725
- // closes the setting dialog
726
- document.getElementById('setting_dialog').style.display = 'none';
727
- return actions.itemsActions.selectItem(layer.id, modifiedPath[4]);
728
- });
729
- setTimeout(function () {
730
- getDistances(layer);
731
- }, 100);
732
- }
733
- } else if (modifiedPath[keyIndex] == 'length') {
734
- var _object = item3D.children[0];
735
- var prevPos = _object.position;
736
- _object.position.set(prevPos.x, value, prevPos.z);
737
- } else if (modifiedPath[keyIndex] == 'flip_doorhandle') {
738
- updateDoorHandleMesh(item, item3D, value);
739
- var _object2 = item3D.children[0];
740
- var door_animate_offset = _object2.userData.door_animate_offset;
741
- var _loop = function _loop(it) {
742
- if (_object2.children.filter(function (elem) {
743
- return elem.name === it;
744
- }).length) {
745
- var door_match = it.match(matchStr);
746
- var rotate_match_text = item.properties.toJS().flip_doorhandle ? 'rotate_L' : 'rotate_R';
747
- if (door_match[2] === '_L') {
748
- rotate_match_text = item.properties.toJS().flip_doorhandle ? 'rotate_R' : 'rotate_L';
749
- }
750
- _object2.children.filter(function (elem) {
751
- return elem.name === it;
752
- })[0].children[0].children.forEach(function (child) {
753
- if (child.name.endsWith(rotate_match_text)) {
754
- door_animate_offset[it] = {
755
- x: child.position.x,
756
- y: child.position.y,
757
- z: child.position.z
758
- };
759
- }
760
- });
761
- }
762
- };
763
- for (var it in door_animate_offset) {
764
- _loop(it);
765
- }
766
- _object2.userData.door_animate_offset = door_animate_offset;
767
- } else if (modifiedPath[keyIndex] == 'animValue') {
768
- return;
769
- } else if (modifiedPath[keyIndex] == 'open_doors') {
770
- var _object3 = item3D.children[0];
771
- var userData = item3D.children[0].userData;
772
- var moveObjectChildrens = [];
773
- var selectedItem = layer.getIn(['items', layer.selected.toJS().items[0]]).toJS();
774
- _object3.children.forEach(function (child, idx) {
775
- var object_match = child.name.match(/\d_(interior_drawer[^LR1-9]*)(_[LR1-9])?$/) || child.name.match(matchStr);
776
- if (object_match && object_match.length > 2) {
777
- moveObjectChildrens.push({
778
- type: object_match[1],
779
- obj: child
780
- });
781
- animate_objects[child.name] = animate_objects[child.name] || {};
782
- }
783
- });
784
- var temp = moveObjectChildrens.filter(function (item) {
785
- var _object3$userData$doo;
786
- return (_object3$userData$doo = _object3.userData.door_animate_offset[item.obj.name]) === null || _object3$userData$doo === void 0 ? void 0 : _object3$userData$doo.isCorner;
787
- });
788
- var isCorner = temp.length > 0;
789
- moveObjectChildrens.forEach(function (element) {
790
- var _animate_objects$elem, _animate_objects$elem2;
791
- if (((_animate_objects$elem = animate_objects[element.obj.name]) === null || _animate_objects$elem === void 0 ? void 0 : _animate_objects$elem.animateStep) === undefined) {
792
- animate_objects[element.obj.name].animateStep = selectedItem.properties.open_doors ? _constants.ANIMATE_STEP_MIN : _constants.ANIMATE_STEP_MAX;
793
- }
794
-
795
- // clear origin Interval.
796
- if ((_animate_objects$elem2 = animate_objects[element.obj.name]) !== null && _animate_objects$elem2 !== void 0 && _animate_objects$elem2.animate_intervalID) {
797
- var _animate_objects$elem3;
798
- clearInterval((_animate_objects$elem3 = animate_objects[element.obj.name]) === null || _animate_objects$elem3 === void 0 ? void 0 : _animate_objects$elem3.animate_intervalID);
799
- }
800
- if (element.type === 'door') {
801
- var _userData$door_animat, _element$obj;
802
- // This is excuted when item has door.
803
- var offset = userData === null || userData === void 0 || (_userData$door_animat = userData.door_animate_offset) === null || _userData$door_animat === void 0 ? void 0 : _userData$door_animat[element === null || element === void 0 || (_element$obj = element.obj) === null || _element$obj === void 0 ? void 0 : _element$obj.name];
804
- if (offset) {
805
- var _offset$x, _offset$y, _offset$z;
806
- animate_objects[element.obj.name].offset = {
807
- x: (_offset$x = offset.x) !== null && _offset$x !== void 0 ? _offset$x : 0,
808
- y: (_offset$y = offset.y) !== null && _offset$y !== void 0 ? _offset$y : 0,
809
- z: (_offset$z = offset.z) !== null && _offset$z !== void 0 ? _offset$z : 0
810
- };
811
- } else {
812
- var _element$obj2;
813
- console.warn('⚠ Missing door_animate_offset for', element === null || element === void 0 || (_element$obj2 = element.obj) === null || _element$obj2 === void 0 ? void 0 : _element$obj2.name);
814
- animate_objects[element.obj.name].offset = {
815
- x: 0,
816
- y: 0,
817
- z: 0
818
- };
819
- }
820
-
821
- // Set the interval ID to new interval ID
822
- animate_objects[element.obj.name].animate_intervalID = setInterval(function () {
823
- myAnimRotate(element.obj, selectedItem.properties.open_doors, selectedItem, isCorner);
824
- }, 30);
825
- } else {
826
- // This is excuted when item has drawer box
827
- // Set the interval ID to new interval ID
828
- animate_objects[element.obj.name].animate_intervalID = setInterval(function () {
829
- myAnimTranslate(element.obj, selectedItem.properties.open_doors, selectedItem);
830
- }, 30);
831
- }
832
- });
833
- } else if (['_length', 'doorStyle', 'cabinet_door_style_id', 'counterTop', 'texture', 'drawer_door_handle_1_gltf'].includes(modifiedPath[keyIndex])) {
834
- var rItem = planData.sceneGraph.layers[layer.id].items[modifiedPath[4]];
835
- if (rItem) {
836
- if (rItem.children.length > 1) {
837
- rItem.children.pop();
838
- }
839
- var _mBoxColor2 = 0x99c3fb;
840
- var _item3 = item.toJS();
841
- if (_item3.doorStyle.doorStyles !== undefined && _item3.doorStyle.doorStyles.cds) {
842
- if (showYelloBox(_item3)) {
843
- _mBoxColor2 = 'rgba(232,187,47,1)';
844
- }
845
- }
846
- rItem.children[0].children.forEach(function (rItemElement) {
847
- rItemElement.visible = false;
848
- });
849
- var _mBox3 = GeomUtils.makeMBoxfromObject(rItem, _mBoxColor2);
850
- if (_mBox3) {
851
- //rItem.add (mBox);
852
- }
853
- }
854
- if (rItem != null) {
855
- removeItemWithoutItem(planData, layer.id, modifiedPath[4]);
856
- promises.push(addItem(sceneData, planData, layer, modifiedPath[4], catalog, actions.itemsActions, mode, null, rItem));
857
- setTimeout(function () {
858
- getDistances(layer);
859
- }, 100);
860
- }
861
- break;
862
- }
863
- }
864
- item = layer.getIn(['items', modifiedPath[4]]);
865
- addCountertop(planData.sceneGraph.layers[layer.id].countertops, item, planData, layer);
866
- // Toggle selection should not update molding
867
- if (item.category === 'cabinet' && modifiedPath[modifiedPath.length - 1] !== 'selected') {
868
- planData.sceneGraph.layers[layer.id].moldingGroups = addMolding(tmpMoldings, item, planData, layer, actions.itemsActions, mode) || _toConsumableArray(tmpMoldings);
869
- }
870
- break;
871
- case 'visible':
872
- if (!layer.visible) {
873
- var _layerGraph = planData.sceneGraph.layers[layer.id];
874
- for (var _lineID in _layerGraph.lines) removeLine(planData, layer.id, _lineID);
875
- for (var _areaID in _layerGraph.areas) removeArea(planData, layer.id, _areaID);
876
- for (var itemID in _layerGraph.items) removeItem(planData, layer.id, itemID);
877
- for (var holeID in _layerGraph.holes) removeHole(planData, layer.id, holeID);
878
- } else {
879
- promises = promises.concat(createLayerObjects(layer, planData, sceneData, actions, catalog, mode));
880
- }
881
- break;
882
- case 'unit':
883
- case 'ceilHeight':
884
- case 'opacity':
885
- case 'altitude':
886
- case 'molding':
887
- var layerGraph = planData.sceneGraph.layers[layer.id];
888
- for (var _lineID2 in layerGraph.lines) removeLine(planData, layer.id, _lineID2);
889
- for (var _areaID2 in layerGraph.areas) removeArea(planData, layer.id, _areaID2);
890
- for (var _itemID2 in layerGraph.items) removeItem(planData, layer.id, _itemID2);
891
- for (var _holeID in layerGraph.holes) removeHole(planData, layer.id, _holeID);
892
- promises = promises.concat(createLayerObjects(layer, planData, sceneData, actions, catalog, mode));
893
- }
894
- var p1 = new Promise(function (resolve) {
895
- Promise.all(promises).then(function (values) {
896
- updateBoundingBox(planData, true, mode);
897
- resolve('replaceObject');
898
- });
899
- });
900
- return {
901
- promise: p1
902
- };
903
- }
904
- function getDistances(layer, isCalcWall) {
905
- fVLine.forEach(function (line, index) {
906
- getLineDistance(line, layer, isCalcWall === undefined ? false : isCalcWall, index);
907
- });
908
- }
909
- function getLineDistance(obj, layer, isCalcWall, index) {
910
- if (obj === undefined) return;
911
- var positionAttribute = obj.geometry.attributes.position;
912
- if (positionAttribute === undefined) return;
913
- var wPoint0 = new Three.Vector3().fromBufferAttribute(positionAttribute, 0).applyMatrix4(obj.matrixWorld);
914
- var wPoint1 = new Three.Vector3().fromBufferAttribute(positionAttribute, 1).applyMatrix4(obj.matrixWorld);
915
- var raycaster = new Three.Raycaster(wPoint0, new Three.Vector3(wPoint1.x - wPoint0.x, wPoint1.y - wPoint0.y, wPoint1.z - wPoint0.z));
916
- var rayDirection = raycaster.ray.direction;
917
- raycaster.camera = new Three.Camera();
918
- rayDirection.normalize();
919
- var meshes = [];
920
- planData.plan.traverse(function (child) {
921
- if (child.isMesh && child.geometry) {
922
- meshes.push(child);
923
- }
924
- });
925
- var intersects = raycaster.intersectObjects(meshes, true);
926
- var lx = wPoint0.x - wPoint1.x;
927
- var ly = wPoint0.y - wPoint1.y;
928
- var lz = wPoint0.z - wPoint1.z;
929
- var length = Math.sqrt(lx * lx + ly * ly + lz * lz);
930
- var scale = 1;
931
- var extrudeSettings = {
932
- steps: 2,
933
- depth: 0.01,
934
- bevelEnabled: false
935
- };
936
- var w = 0.2;
937
- var h = w * (Math.sqrt(3) / 2);
938
- var shape = new Three.Shape();
939
- shape.moveTo(0, 0);
940
- shape.lineTo(-w / 4, h / 2);
941
- shape.lineTo(w / 4, h / 2);
942
- var geom = new Three.ExtrudeGeometry(shape, extrudeSettings);
943
- geom.center();
944
- if (!isCalcWall) {
945
- for (var i = 0; i < intersects.length; i++) {
946
- if (intersects[i].object.name != 'TransformBox' && !intersects[i].object.name.includes('WarningBox') && intersects[i].object.type != 'Line' && intersects[i].object.name != 'rotate' && intersects[i].object.name != 'lineText' && intersects[i].object.type != 'BoxHelper' && !intersects[i].object.name.includes('molding') && intersects[i].object.name != 'soul') {
947
- scale = intersects[i].distance / length;
948
- if (intersects[i].distance <= 0.1) {
949
- scale = 0.1 / length;
950
- }
951
- obj.userData.distance = intersects[i].distance;
952
- obj.userData.target = intersects[i].object;
953
- var originPoint = obj.geometry.attributes.position.array.slice(0, 3);
954
- var _lx = obj.geometry.attributes.position.array[3] - obj.geometry.attributes.position.array[0];
955
- var _ly = obj.geometry.attributes.position.array[4] - obj.geometry.attributes.position.array[1];
956
- var _lz = obj.geometry.attributes.position.array[5] - obj.geometry.attributes.position.array[2];
957
- var newVec = new Three.Vector3(originPoint[0] + _lx * scale, originPoint[1] + _ly * scale, originPoint[2] + _lz * scale);
958
- obj.geometry.attributes.position.array[3] = newVec.x;
959
- obj.geometry.attributes.position.array[4] = newVec.y;
960
- obj.geometry.attributes.position.array[5] = newVec.z;
961
- obj.geometry.attributes.position.needsUpdate = true;
962
- obj.geometry.computeBoundingSphere();
963
- obj.geometry.computeBoundingBox();
964
- var dist = (0, _math.formatNumber)((0, _convertUnits["default"])(intersects[i].distance).from('cm').to('in'), _constants.DECIMAL_PLACES_2);
965
- if (dist > 3) {
966
- var _canvas = getTextCanvas(dist);
967
- var wid = _canvas.width / window.innerWidth * 30;
968
- var hei = _canvas.height / window.innerHeight * 30;
969
- var texture = new Three.Texture(_canvas);
970
- texture.minFilter = Three.LinearFilter;
971
- texture.needsUpdate = true;
972
- var geometry = new Three.PlaneGeometry(wid / 5, hei / 5);
973
- geometry.computeBoundingBox();
974
- var material = new Three.MeshBasicMaterial({
975
- map: texture,
976
- side: Three.DoubleSide
977
- });
978
- var textMesh = new Three.Mesh(geometry, material);
979
- for (; obj.children.length != 0;) {
980
- var temp = obj.children.pop();
981
- (0, _threeMemoryCleaner.disposeObject)(temp);
982
- }
983
- textMesh.rotation.set(Math.PI / 2, Math.PI, 0);
984
- // obj.add(textMesh);
985
- textMesh.position.set((obj.geometry.attributes.position.array[0] + obj.geometry.attributes.position.array[3]) / 2, 0.01, (obj.geometry.attributes.position.array[2] + obj.geometry.attributes.position.array[5]) / 2);
986
- textMesh.name = 'lineText';
987
- textMesh.renderOrder = 2;
988
- textMesh.material.depthTest = false;
989
- textMesh.material.transparent = true;
990
- var sprite1 = new Three.Sprite(new Three.SpriteMaterial({
991
- map: texture
992
- }));
993
- sprite1.position.set((obj.geometry.attributes.position.array[0] + obj.geometry.attributes.position.array[3]) / 2, 0.01, (obj.geometry.attributes.position.array[2] + obj.geometry.attributes.position.array[5]) / 2);
994
- sprite1.name = 'lineText';
995
- sprite1.renderOrder = 2;
996
- sprite1.scale.set(0.2, 0.1, 0.2);
997
- sprite1.layers.set(1);
998
- obj.add(sprite1);
999
- if (obj.parent != null) {
1000
- // is not lighting
1001
- var item3D = obj.parent.parent.parent;
1002
- var max = item3D.children[0].userData.max;
1003
- var min = item3D.children[0].userData.min;
1004
- var objW = (max.x - min.x) / 100,
1005
- objL = (max.z - min.z) / 100;
1006
- var triangle = new Three.Mesh(geom, new Three.MeshBasicMaterial({
1007
- color: _constants.SHADE_DARK_PURPLE_COLOR
1008
- }));
1009
- var triangle1 = new Three.Mesh(geom, new Three.MeshBasicMaterial({
1010
- color: _constants.SHADE_DARK_PURPLE_COLOR
1011
- }));
1012
- triangle.position.set((index < 2 ? 0 : Math.sin((index === 2 ? 1 : -1) * Math.PI / 2)) * (obj.geometry.attributes.position.array[0] + h / 4 + (index % 2 === 0 ? 0 : objW)), newVec.y, (index < 2 ? Math.cos(index * Math.PI) : 0) * (obj.geometry.attributes.position.array[2] + h / 4 + (index % 2 === 0 ? 0 : objL)));
1013
- triangle1.position.set(newVec.x - (index < 2 ? 0 : Math.sin((index === 2 ? 1 : -1) * Math.PI / 2)) * h / 4, newVec.y, newVec.z - (index < 2 ? Math.cos(index * Math.PI) : 0) * h / 4);
1014
- if (index < 2) {
1015
- triangle.rotation.x = Math.cos(index * Math.PI) * Math.PI / 2;
1016
- triangle1.rotation.x = -Math.cos(index * Math.PI) * Math.PI / 2;
1017
- } else {
1018
- triangle.rotation.x = -Math.PI / 2;
1019
- triangle.rotation.z = -(index === 2 ? 1 : -1) * Math.PI / 2;
1020
- triangle1.rotation.x = Math.PI / 2;
1021
- triangle1.rotation.z = (index === 2 ? 1 : -1) * Math.PI / 2;
1022
- }
1023
- triangle.name = 'lineText';
1024
- triangle1.name = 'lineText';
1025
- triangle.renderOrder = 2;
1026
- triangle1.renderOrder = 2;
1027
- triangle.material.transparent = true;
1028
- triangle1.material.transparent = true;
1029
- triangle.material.depthTest = false;
1030
- triangle1.material.depthTest = false;
1031
- obj.add(triangle);
1032
- obj.add(triangle1);
1033
- }
1034
- }
1035
-
1036
- // if (obj.userData.distance <= 50 && obj.userData.distance >= 0.5) {
1037
- var real_target = obj.userData.target;
1038
- for (; real_target.name != 'pivot';) {
1039
- if (real_target.parent == null) break;
1040
- real_target = real_target.parent;
1041
- }
1042
- // let item3D = obj.parent.parent.parent;
1043
- // let origin = obj.geometry.vertices[0].clone().applyMatrix4(obj.matrixWorld);
1044
- // let target = obj.geometry.vertices[1].clone().applyMatrix4(obj.matrixWorld);
1045
- // let uVec = new Three.Vector3(target.x - origin.x - 0.2, target.y - origin.y - 0.2, target.z - origin.z - 0.2);
1046
- obj.visible = true;
1047
- if (dist < 3) obj.visible = false;
1048
- return obj;
1049
- }
1050
- }
1051
- }
1052
- var tX = wPoint0.x - planData.plan.position.x;
1053
- var tZ = wPoint0.z - planData.plan.position.z;
1054
- tZ = -tZ;
1055
- var tX1 = wPoint1.x - planData.plan.position.x;
1056
- var tZ1 = wPoint1.z - planData.plan.position.z;
1057
- tZ1 = -tZ1;
1058
- if (!layer) return;
1059
- layer.lines.forEach(function (data) {
1060
- var px = [];
1061
- var py = [];
1062
- var opX = [tX, tX1];
1063
- var opY = [tZ, tZ1];
1064
- data.vertices.forEach(function (vec) {
1065
- var vertices = layer.vertices.get(vec);
1066
- px.push(vertices.x);
1067
- py.push(vertices.y);
1068
- });
1069
- var distance = getIntersectPoint(opX, opY, px, py);
1070
- if (distance != null) {
1071
- obj.userData.distance = distance;
1072
- obj.userData.target = planData.sceneGraph.layers[layer.id].lines[data.get('id')];
1073
- scale = distance / length;
1074
- if (distance <= 0.1) {
1075
- scale = 0.1 / length;
1076
- }
1077
- var _originPoint = obj.geometry.attributes.position.array.slice(0, 3);
1078
- lx = obj.geometry.attributes.position.array[3] - obj.geometry.attributes.position.array[0];
1079
- ly = obj.geometry.attributes.position.array[4] - obj.geometry.attributes.position.array[1];
1080
- lz = obj.geometry.attributes.position.array[5] - obj.geometry.attributes.position.array[2];
1081
- var _newVec = new Three.Vector3(_originPoint.x + lx * scale, _originPoint.y + ly * scale, _originPoint.z + lz * scale);
1082
- obj.geometry.attributes.position.array[3] = _newVec.x;
1083
- obj.geometry.attributes.position.array[4] = _newVec.y;
1084
- obj.geometry.attributes.position.array[5] = _newVec.z;
1085
- obj.geometry.attributes.position.needsUpdate = true;
1086
- var _dist = (0, _math.formatNumber)(distance, _constants.DECIMAL_PLACES_2);
1087
- if (_dist > 3) {
1088
- var _canvas2 = getTextCanvas(_dist);
1089
- var _wid = _canvas2.width / window.innerWidth * 30;
1090
- var _hei = _canvas2.height / window.innerHeight * 30;
1091
- var _texture = new Three.Texture(_canvas2);
1092
- _texture.needsUpdate = true;
1093
- var _geometry = new Three.PlaneGeometry(_wid / 2, _hei / 2);
1094
- _geometry.computeBoundingBox();
1095
- var _material = new Three.MeshBasicMaterial({
1096
- map: _texture,
1097
- side: Three.DoubleSide
1098
- });
1099
- var _textMesh = new Three.Mesh(_geometry, _material);
1100
- for (; obj.children.length != 0;) {
1101
- var _temp = obj.children.pop();
1102
- (0, _threeMemoryCleaner.disposeObject)(_temp);
1103
- }
1104
- _textMesh.rotation.set(Math.PI / 2, Math.PI, 0);
1105
- // obj.add(textMesh);
1106
- _textMesh.position.set((obj.geometry.attributes.position.array[0] + obj.geometry.attributes.position.array[3]) / 2, 0.01, (obj.geometry.attributes.position.array[2] + obj.geometry.attributes.position.array[5]) / 2);
1107
- _textMesh.name = 'lineText';
1108
- _textMesh.renderOrder = 2;
1109
- _textMesh.material.depthTest = false;
1110
- _textMesh.material.transparent = true;
1111
- var _sprite = new Three.Sprite(new Three.SpriteMaterial({
1112
- map: _texture
1113
- }));
1114
- _sprite.position.set((obj.geometry.attributes.position.array[0] + obj.geometry.attributes.position.array[3]) / 2, 0.01, (obj.geometry.attributes.position.array[2] + obj.geometry.attributes.position.array[5]) / 2);
1115
- _sprite.name = 'lineText';
1116
- _sprite.scale.set(0.2, 0.1, 0.2);
1117
- _sprite.layers.set(1);
1118
- obj.add(_sprite);
1119
- var _item3D = obj.parent.parent.parent;
1120
- var _max = _item3D.children[0].userData.max;
1121
- var _min = _item3D.children[0].userData.min;
1122
- var _objW = (_max.x - _min.x) / 100,
1123
- _objL = (_max.z - _min.z) / 100;
1124
- var triangle = new Three.Mesh(geom, new Three.MeshBasicMaterial({
1125
- color: _constants.SHADE_DARK_PURPLE_COLOR
1126
- }));
1127
- var triangle1 = new Three.Mesh(geom, new Three.MeshBasicMaterial({
1128
- color: _constants.SHADE_DARK_PURPLE_COLOR
1129
- }));
1130
- triangle.position.set((index < 2 ? 0 : Math.sin((index === 2 ? 1 : -1) * Math.PI / 2)) * (obj.geometry.attributes.position.array[0] + h / 4 + (index % 2 === 0 ? 0 : _objW)), _newVec.y, (index < 2 ? Math.cos(index * Math.PI) : 0) * (obj.geometry.attributes.position.array[2] + h / 4 + (index % 2 === 0 ? 0 : _objL)) - 0.02);
1131
- triangle1.position.set(_newVec.x - (index < 2 ? 0 : Math.sin((index === 2 ? 1 : -1) * Math.PI / 2)) * h / 4, _newVec.y, _newVec.z - (index < 2 ? Math.cos(index * Math.PI) : 0) * h / 4);
1132
- if (index < 2) {
1133
- triangle.rotation.x = Math.cos(index * Math.PI) * Math.PI / 2;
1134
- triangle1.rotation.x = -Math.cos(index * Math.PI) * Math.PI / 2;
1135
- } else {
1136
- triangle.rotation.x = -Math.PI / 2;
1137
- triangle.rotation.z = -(index === 2 ? 1 : -1) * Math.PI / 2;
1138
- triangle1.rotation.x = Math.PI / 2;
1139
- triangle1.rotation.z = (index === 2 ? 1 : -1) * Math.PI / 2;
1140
- }
1141
- triangle.name = 'lineText';
1142
- triangle1.name = 'lineText';
1143
- triangle.renderOrder = 2;
1144
- triangle1.renderOrder = 2;
1145
- triangle.material.transparent = true;
1146
- triangle1.material.transparent = true;
1147
- triangle.material.depthTest = false;
1148
- triangle1.material.depthTest = false;
1149
- obj.add(triangle);
1150
- obj.add(triangle1);
1151
- }
1152
- // if (obj.userData.distance <= 50 && obj.userData.distance >= 0.5) {
1153
- // let item3D = obj.parent.parent.parent;
1154
- // let pos = item3D.position.clone();
1155
- // let origin = obj.geometry.vertices[0].clone().applyMatrix4(obj.matrixWorld);
1156
- // let target = obj.geometry.vertices[1].clone().applyMatrix4(obj.matrixWorld);
1157
- // let uVec = new Three.Vector3(target.x - origin.x - 0.2, target.y - origin.y - 0.2, target.z - origin.z - 0.2);
1158
- obj.visible = true;
1159
- if (_dist > 3) obj.visible = false;
1160
- return obj;
1161
- // itemsActions.updateDraggingItemChanged(pos.x - uVec.x, -pos.z + uVec.z);
1162
- // }
1163
- }
1164
- });
1165
- obj.visible = false;
1166
- return obj;
1167
- }
1168
- function getIntersectPoint(opX, opY, pX, pY) {
1169
- var oA;
1170
- if (opX[1] == opX[0]) oA = null;else oA = (opY[1] - opY[0]) / (opX[1] - opX[0]);
1171
- var A;
1172
- if (pX[1] == pX[0]) A = null;else A = (pY[1] - pY[0]) / (pX[1] - pX[0]);
1173
- if (oA == A) return null;
1174
- if (oA != null && A != null) {
1175
- var oB = opY[0] - oA * opX[0];
1176
- var B = pY[0] - A * pX[0];
1177
- var iX = (B - oB) / (oA - A);
1178
- if (pX[0] <= iX && iX <= pX[1] || pX[0] >= iX && iX >= pX[1]) {
1179
- if (opX[0] <= opX[1] && opX[0] <= iX || opX[0] >= opX[1] && opX[0] >= iX) {
1180
- var iY = pY[0] + A * (iX - pX[0]);
1181
- var distance = Math.sqrt((opX[0] - iX) * (opX[0] - iX) + (opY[0] - iY) * (opY[0] - iY));
1182
- return distance;
1183
- }
1184
- return null;
1185
- }
1186
- }
1187
- if (oA == null) {
1188
- var _iX = opX[0];
1189
- if (A != null) {
1190
- if (pX[0] <= _iX && _iX <= pX[1] || pX[0] >= _iX && _iX >= pX[1]) {
1191
- var _iY = pY[0] + A * (_iX - pX[0]);
1192
- if (opY[0] <= _iY && opY[0] <= opY[1] || opY[0] >= _iY && opY[0] >= opY[1]) {
1193
- var _distance = Math.sqrt((opX[0] - _iX) * (opX[0] - _iX) + (opY[0] - _iY) * (opY[0] - _iY));
1194
- return _distance;
1195
- }
1196
- }
1197
- }
1198
- }
1199
- if (A == null) {
1200
- var _iX2 = pX[0];
1201
- if (oA != null) {
1202
- var _iY2 = _iX2 * oA + opY[0] - oA * opX[0];
1203
- if (pY[0] <= _iY2 && _iY2 <= pY[1] || pY[0] >= _iY2 && _iY2 >= pY[1]) {
1204
- if (opY[0] <= _iY2 && opY[0] <= opY[1] || opY[0] >= _iY2 && opY[0] >= opY[1]) {
1205
- var _distance2 = Math.sqrt((opX[0] - _iX2) * (opX[0] - _iX2) + (opY[0] - _iY2) * (opY[0] - _iY2));
1206
- return _distance2;
1207
- }
1208
- }
1209
- }
1210
- }
1211
- return null;
1212
- }
1213
- function gcd(a, b) {
1214
- return a % b ? gcd(b, a % b) : b;
1215
- }
1216
- function getTextCanvas(text) {
1217
- var parameters = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1218
- var canvas = document.createElement('canvas');
1219
- var ctx = canvas.getContext('2d');
1220
- var fontSize = 16;
1221
- var integral = String(text) + "''";
1222
- parameters.fontName = parameters.fontName || _constants.ARROW_TEXT_FONTFACE;
1223
-
1224
- // Prepare the font to be able to measure
1225
- ctx.font = "".concat(fontSize, "px ") + parameters.fontName;
1226
- if (parameters.italic) {
1227
- ctx.font = "italic ".concat(fontSize, "px ") + parameters.fontName;
1228
- }
1229
- if (parameters.bold) {
1230
- ctx.font = "bold ".concat(fontSize, "px ") + parameters.fontName;
1231
- }
1232
- if (parameters.bold && parameters.italic) {
1233
- ctx.font = "italic bold ".concat(fontSize, "px ") + parameters.fontName;
1234
- }
1235
- var textMetrics = ctx.measureText(integral);
1236
- var width = 70;
1237
- var height = fontSize + 20;
1238
-
1239
- // Resize canvas to match text size
1240
- canvas.width = width;
1241
- canvas.height = height;
1242
- canvas.style.width = width + 'px';
1243
- canvas.style.height = height + 'px';
1244
-
1245
- // Re-apply font since canvas is resized.
1246
- ctx.font = "".concat(fontSize, "px ") + parameters.fontName;
1247
- if (parameters.italic) {
1248
- ctx.font = "italic ".concat(fontSize, "px ") + parameters.fontName;
1249
- }
1250
- if (parameters.bold) {
1251
- ctx.font = "bold ".concat(fontSize, "px ") + parameters.fontName;
1252
- }
1253
- if (parameters.bold && parameters.italic) {
1254
- ctx.font = "italic bold ".concat(fontSize, "px ") + parameters.fontName;
1255
- }
1256
- //ctx.textAlign = parameters.align || "center";
1257
- ctx.textBaseline = parameters.baseline || 'middle';
1258
- var r = 10;
1259
- // Make the canvas transparent for simplicity
1260
- ctx.fillStyle = _constants.ARROW_TEXT_BACKCOLOR;
1261
- // ctx.fillRect(0, 0, ctx.canvas.width, ctx.canvas.height);
1262
- var w = ctx.canvas.width;
1263
- var h = ctx.canvas.height;
1264
- ctx.beginPath();
1265
- ctx.moveTo(r, 0);
1266
- ctx.lineTo(w - r, 0);
1267
- ctx.arcTo(w, 0, w, r, r);
1268
- ctx.lineTo(w, h - r);
1269
- ctx.arcTo(w, h, w - r, h, r);
1270
- ctx.lineTo(r, h);
1271
- ctx.arcTo(0, h, 0, h - r, r);
1272
- ctx.lineTo(0, r);
1273
- ctx.arcTo(0, 0, r, 0, r);
1274
- // ctx.arcTo(w+r, h+2*r, w+r, 0, r);
1275
- ctx.fill();
1276
- ctx.fillStyle = parameters.fillColor || _constants.ARROW_TEXT_FORECOLOR;
1277
- ctx.fillText(integral, (width - textMetrics.width) / 2, height / 2);
1278
- ctx.strokeStyle = parameters.strokeColor || _constants.ARROW_TEXT_FORECOLOR;
1279
- ctx.strokeText(integral, (width - textMetrics.width) / 2, height / 2);
1280
-
1281
- // ctx.font = `${fontSize - 5}px ` + parameters.fontName;
1282
- // const denoMetrics = ctx.measureText(deno);
1283
- // const numoMetrics = ctx.measureText(numo);
1284
- // ctx.fillStyle = ARROW_TEXT_FORECOLOR;
1285
- // ctx.fillRect(
1286
- // ctx.canvas.width / 2 + 3,
1287
- // ctx.canvas.height / 2 - 2,
1288
- // denoMetrics.width,
1289
- // 1
1290
- // );
1291
-
1292
- // const denoMetrics = ctx.measureText(deno);
1293
- // ctx.fillStyle = ARROW_TEXT_FORECOLOR;
1294
- // ctx.fillRect(
1295
- // ctx.canvas.width / 2 + 3,
1296
- // ctx.canvas.height / 2 - 2,
1297
- // denoMetrics.width,
1298
- // 1
1299
- // );
1300
-
1301
- // ctx.fillStyle = parameters.fillColor || ARROW_TEXT_FORECOLOR;
1302
- // ctx.fillText(
1303
- // numo,
1304
- // ctx.canvas.width / 2 + 3 + (denoMetrics.width - numoMetrics.width) / 2,
1305
- // height / 2 - 8
1306
- // );
1307
- // ctx.font = `${fontSize}px ` + parameters.fontName;
1308
- // ctx.fillText(
1309
- // "''",
1310
- // ctx.canvas.width / 2 + 4 + denoMetrics.width,
1311
- // height / 2 - 7
1312
- // );
1313
- // ctx.font = `${fontSize - 5}px ` + parameters.fontName;
1314
-
1315
- // ctx.strokeStyle = parameters.strokeColor || ARROW_TEXT_FORECOLOR;
1316
- // ctx.strokeText(
1317
- // numo,
1318
- // ctx.canvas.width / 2 + 3 + (denoMetrics.width - numoMetrics.width) / 2,
1319
- // height / 2 - 8
1320
- // );
1321
-
1322
- // ctx.fillStyle = parameters.fillColor || ARROW_TEXT_FORECOLOR;
1323
- // ctx.fillText(deno, ctx.canvas.width / 2 + 3, height / 2 + 8);
1324
- // ctx.strokeStyle = parameters.strokeColor || ARROW_TEXT_FORECOLOR;
1325
- // ctx.strokeText(deno, ctx.canvas.width / 2 + 3, height / 2 + 8);
1326
- return canvas;
1327
- }
1328
- function removeObject(modifiedPath, layer, planData, actions, sceneData, oldSceneData, catalog) {
1329
- var promises = [];
1330
- switch (modifiedPath[3]) {
1331
- case 'lines':
1332
- // Here I remove the line with all its holes
1333
- var lineID = modifiedPath[4];
1334
- oldSceneData.getIn(['layers', layer.id, 'lines', lineID, 'holes']).forEach(function (holeID) {
1335
- removeHole(planData, layer.id, holeID);
1336
- });
1337
- removeLine(planData, layer.id, lineID);
1338
- var mode = oldSceneData.mode;
1339
- if (_constants.ARRAY_3D_MODES.includes(mode)) mode = _constants.MODE_IDLE_3D;else mode = _constants.MODE_IDLE;
1340
- if (modifiedPath.length > 5) {
1341
- // I removed an hole, so I should add the new line
1342
- promises.push(addLine(sceneData, planData, layer, lineID, catalog, actions.linesActions));
1343
- layer.getIn(['lines', lineID, 'holes']).forEach(function (holeID) {
1344
- promises.push(addHole(sceneData, planData, layer, holeID, catalog, actions.holesActions, mode));
1345
- });
1346
- }
1347
- break;
1348
- case 'areas':
1349
- if (modifiedPath.length === 5) {
1350
- // I am removing an entire area
1351
- removeArea(planData, layer.id, modifiedPath[4]);
1352
- }
1353
- break;
1354
- case 'items':
1355
- if (modifiedPath.length === 5) {
1356
- // I am removing an item
1357
- removeItem(planData, layer.id, modifiedPath[4], oldSceneData.getIn(['layers', layer.id]), layer);
1358
- }
1359
- break;
1360
- }
1361
- Promise.all(promises).then(function (values) {
1362
- return updateBoundingBox(planData);
1363
- });
1364
- }
1365
- function removeLayer(layerId, planData) {
1366
- var layerGraph = planData.sceneGraph.layers[layerId];
1367
- for (var lineID in layerGraph.lines) removeLine(planData, layerId, lineID);
1368
- for (var areaID in layerGraph.areas) removeArea(planData, layerId, areaID);
1369
- for (var itemID in layerGraph.items) removeItem(planData, layerId, itemID);
1370
- for (var holeID in layerGraph.holes) removeHole(planData, layerId, holeID);
1371
- delete planData.sceneGraph.layers[layerId];
1372
- }
1373
- function removeHole(planData, layerId, holeID) {
1374
- if (planData.sceneGraph.busyResources.layers[layerId].holes[holeID]) {
1375
- setTimeout(function () {
1376
- return removeHole(planData, layerId, holeID);
1377
- }, 100);
1378
- return;
1379
- }
1380
- planData.sceneGraph.busyResources.layers[layerId].holes[holeID] = true;
1381
- var hole3D = planData.sceneGraph.layers[layerId].holes[holeID];
1382
- if (hole3D) {
1383
- planData.plan.remove(hole3D);
1384
- (0, _threeMemoryCleaner.disposeObject)(hole3D);
1385
- delete planData.sceneGraph.layers[layerId].holes[holeID];
1386
- delete planData.sceneGraph.LODs[holeID];
1387
- hole3D = null;
1388
- updateBoundingBox(planData, true);
1389
- }
1390
- planData.sceneGraph.busyResources.layers[layerId].holes[holeID] = false;
1391
- }
1392
- function removeLine(planData, layerId, lineID) {
1393
- if (planData.sceneGraph.busyResources.layers[layerId].lines[lineID]) {
1394
- setTimeout(function () {
1395
- return removeLine(planData, layerId, lineID);
1396
- }, 100);
1397
- return;
1398
- }
1399
- planData.sceneGraph.busyResources.layers[layerId].lines[lineID] = true;
1400
- var line3D = planData.sceneGraph.layers[layerId].lines[lineID];
1401
- if (line3D) {
1402
- planData.plan.remove(line3D);
1403
- (0, _threeMemoryCleaner.disposeObject)(line3D);
1404
- delete planData.sceneGraph.layers[layerId].lines[lineID];
1405
- delete planData.sceneGraph.LODs[lineID];
1406
- line3D = null;
1407
- updateBoundingBox(planData, true);
1408
- }
1409
- planData.sceneGraph.busyResources.layers[layerId].lines[lineID] = false;
1410
- }
1411
- function removeArea(planData, layerId, areaID) {
1412
- if (planData.sceneGraph.busyResources.layers[layerId].areas[areaID]) {
1413
- setTimeout(function () {
1414
- return removeArea(planData, layerId, areaID);
1415
- }, 100);
1416
- return;
1417
- }
1418
- planData.sceneGraph.busyResources.layers[layerId].areas[areaID] = true;
1419
- var area3D = planData.sceneGraph.layers[layerId].areas[areaID];
1420
- if (area3D) {
1421
- planData.plan.remove(area3D);
1422
- (0, _threeMemoryCleaner.disposeObject)(area3D);
1423
- delete planData.sceneGraph.layers[layerId].areas[areaID];
1424
- delete planData.sceneGraph.LODs[areaID];
1425
- area3D = null;
1426
- updateBoundingBox(planData, true);
1427
- }
1428
- planData.sceneGraph.busyResources.layers[layerId].areas[areaID] = false;
1429
- }
1430
- function removeItem(planData, layerId, itemID) {
1431
- var oldSceneLayer = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
1432
- var newSceneLayer = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : null;
1433
- if (planData.sceneGraph.busyResources.layers[layerId].items[itemID]) {
1434
- setTimeout(function () {
1435
- return removeItem(planData, layerId, itemID, oldSceneLayer, newSceneLayer);
1436
- }, 100);
1437
- return;
1438
- }
1439
- planData.sceneGraph.busyResources.layers[layerId].items[itemID] = true;
1440
-
1441
- // The layer variable is layer that contains the deleted item.
1442
- var layer = oldSceneLayer ? oldSceneLayer : planData.sceneData.getIn(['layers', layerId]);
1443
- var item = layer.getIn(['items', itemID]); // deleted item.
1444
- deleteCountertop(planData.sceneGraph.layers[layerId].countertops, item, planData, layer);
1445
- planData.sceneGraph.layers[layerId].moldingGroups = deleteAllMolding(planData.sceneGraph.layers[layerId].moldingGroups, item, planData, layer, newSceneLayer);
1446
- var item3D = planData.sceneGraph.layers[layerId].items[itemID];
1447
- if (item3D) {
1448
- planData.plan.remove(item3D);
1449
- (0, _threeMemoryCleaner.disposeObject)(item3D);
1450
- delete planData.sceneGraph.layers[layerId].items[itemID];
1451
- delete planData.sceneGraph.LODs[itemID];
1452
- item3D = null;
1453
- updateBoundingBox(planData, true);
1454
- }
1455
- planData.sceneGraph.busyResources.layers[layerId].items[itemID] = false;
1456
- }
1457
- function removeItemWithoutItem(planData, layerId, itemID) {
1458
- if (planData.sceneGraph.busyResources.layers[layerId].items[itemID]) {
1459
- setTimeout(function () {
1460
- return removeItemWithoutItem(planData, layerId, itemID);
1461
- }, 100);
1462
- return;
1463
- }
1464
- planData.sceneGraph.busyResources.layers[layerId].items[itemID] = true;
1465
- var layer = planData.sceneData.getIn(['layers', layerId]);
1466
- var item = layer.getIn(['items', itemID]);
1467
- deleteCountertop(planData.sceneGraph.layers[layerId].countertops, item, planData, layer);
1468
- var item3D = planData.sceneGraph.layers[layerId].items[itemID];
1469
- if (item3D) {
1470
- planData.plan.remove(item3D);
1471
- (0, _threeMemoryCleaner.disposeObject)(item3D);
1472
- item3D = null;
1473
- updateBoundingBox(planData);
1474
- delete planData.sceneGraph.layers[layerId].items[itemID];
1475
- delete planData.sceneGraph.LODs[itemID];
1476
- }
1477
- planData.sceneGraph.busyResources.layers[layerId].items[itemID] = false;
1478
- }
1479
-
1480
- //TODO generate an area's replace if vertex has been changed
1481
- function addObject(modifiedPath, layer, planData, actions, sceneData, oldSceneData, catalog, mode, toolObj) {
1482
- if (modifiedPath.length >= 5) {
1483
- var addPromise = null,
1484
- addAction = null;
1485
- switch (modifiedPath[3]) {
1486
- case 'lines':
1487
- if (modifiedPath[5] === 'holes' && scene_mode !== 'MODE_DRAWING_HOLE_3D' && scene_mode !== 'MODE_DRAGGING_HOLE_3D') {
1488
- removeLine(planData, layer.id, modifiedPath[4]);
1489
- }
1490
- if (scene_mode !== 'MODE_DRAWING_HOLE_3D' && scene_mode !== 'MODE_DRAGGING_HOLE_3D') {
1491
- addPromise = addLine;
1492
- }
1493
- addAction = actions.linesActions;
1494
- break;
1495
- case 'areas':
1496
- addPromise = addArea;
1497
- addAction = actions.areaActions;
1498
- break;
1499
- case 'items':
1500
- addPromise = addItem;
1501
- addAction = actions.itemsActions;
1502
- break;
1503
- case 'holes':
1504
- addPromise = addHole;
1505
- addAction = actions.holesActions;
1506
- break;
1507
- }
1508
- if (addPromise) {
1509
- // if( addPromise(sceneData, planData, layer, modifiedPath[4], catalog, addAction) === undefined ) {
1510
- // return;
1511
- // }
1512
- addPromise(sceneData, planData, layer, modifiedPath[4], catalog, addAction, mode, toolObj).then(function () {
1513
- return updateBoundingBox(planData);
1514
- });
1515
- }
1516
- }
1517
- }
1518
- function addHole(sceneData, planData, layer, holeID, catalog, holesActions, mode) {
1519
- var toolObj = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : null;
1520
- var holeData = layer.getIn(['holes', holeID]);
1521
-
1522
- // Create the hole object
1523
- return holeData === undefined ? '' : catalog.getElement(holeData.type).render3D(holeData, layer, sceneData).then(function (object) {
1524
- if (object instanceof Three.LOD) {
1525
- planData.sceneGraph.LODs[holeID] = object;
1526
- }
1527
- object.children.forEach(function (item) {
1528
- var name = item.name;
1529
- item.castShadow = true;
1530
- var texture;
1531
- if (name.includes('_wood')) {
1532
- texture = (0, _itemLoader.loadTexture)('/assets/img/texture/white1px.jpg');
1533
- } else if (name.includes('_glass')) {
1534
- var material = new Three.MeshPhysicalMaterial({
1535
- roughness: 0.5,
1536
- transmission: 1,
1537
- thickness: 0.5,
1538
- // Add refraction!
1539
- transparency: 0.6
1540
- });
1541
- item.material = material;
1542
- return item;
1543
- } else if (name.includes('_steel')) {
1544
- texture = (0, _itemLoader.loadTexture)('/assets/img/texture/steel.jpg');
1545
- } else if (name.includes('_glass')) {
1546
- var _material2 = new Three.MeshPhysicalMaterial({
1547
- roughness: 0.5,
1548
- transmission: 1,
1549
- thickness: 0.5,
1550
- // Add refraction!
1551
- transparency: 0.6
1552
- });
1553
- item.material = _material2;
1554
- return item;
1555
- }
1556
- });
1557
- if (holeData.selected) {
1558
- // if object is drawing in 3d mode and selected
1559
- if (holeData.type === 'FrameLess Doorway') {
1560
- var x, y, z;
1561
- x = holeData.getIn(['properties', 'width', 'length']) || 0;
1562
- y = holeData.getIn(['properties', 'height', 'length']) || 0;
1563
- z = holeData.getIn(['properties', 'thickness', 'length']) || 0;
1564
- var moveBox = new Three.BoxGeometry(x, y, z);
1565
- var mBox = new Three.Mesh(moveBox, new Three.MeshBasicMaterial({
1566
- color: 0x99c3fb,
1567
- side: Three.DoubleSide,
1568
- transparent: true,
1569
- opacity: 0.4
1570
- }));
1571
- mBox.name = 'FrameLessDoormBox';
1572
- mBox.renderOrder = 1;
1573
- if (mBox !== undefined) {
1574
- object.add(mBox);
1575
- }
1576
- } else {
1577
- var _boundingBox = GeomUtils.baseBox3FromObject(object);
1578
- if (_boundingBox === undefined) return;
1579
- var max = _boundingBox.max;
1580
- if (!Number.isFinite(max.x)) return;
1581
- var transGroup = new Three.Group();
1582
- var extrudeSettings = {
1583
- depth: 1,
1584
- bevelEnabled: true,
1585
- bevelSegments: 2,
1586
- steps: 2,
1587
- bevelSize: 1,
1588
- bevelThickness: 1
1589
- };
1590
- var triangleShape = new Three.Shape().moveTo(max.x, 15) // A
1591
- .lineTo(max.x + 6, 15) // B
1592
- .lineTo(max.x + 6, 30) // C
1593
- .lineTo(max.x + 16, 0) // D
1594
- .lineTo(max.x + 6, -29) // E
1595
- .lineTo(max.x + 6, -15) // F
1596
- .lineTo(max.x, -15) // G
1597
- .lineTo(max.x, 15); // close path
1598
- var transHole_Right = GeomUtils.addShape(triangleShape, extrudeSettings, scene_mode !== 'MODE_DRAGGING_HOLE_3D' ? 0x000000 : 0x99c3fb, 0, 0, 0, 0, 0, 0, 1);
1599
- transHole_Right.name = 'transHole_Right';
1600
- transGroup.add(transHole_Right);
1601
- triangleShape = new Three.Shape().moveTo(-max.x, 15) // A
1602
- .lineTo(-(max.x + 6), 15) // B
1603
- .lineTo(-(max.x + 6), 30) // C
1604
- .lineTo(-(max.x + 16), 0) // D
1605
- .lineTo(-(max.x + 6), -29) // E
1606
- .lineTo(-(max.x + 6), -15) // F
1607
- .lineTo(-max.x, -15) // G
1608
- .lineTo(-max.x, 15); // close path
1609
- var transHole_Left = GeomUtils.addShape(triangleShape, extrudeSettings, scene_mode !== 'MODE_DRAGGING_HOLE_3D' ? 0x000000 : 0x99c3fb, 0, 0, 0, 0, 0, 0, 1);
1610
- transHole_Left.name = 'transHole_Left';
1611
- transGroup.add(transHole_Left);
1612
- transGroup.scale.set(1 / object.scale.x, 1 / object.scale.y, 1 / object.scale.z);
1613
- object.add(transGroup);
1614
- }
1615
- }
1616
- var pivot = new Three.Object3D();
1617
- pivot.name = 'pivot';
1618
- if ((0, _helper.isElevationView)(mode)) {
1619
- var lineID = holeData.getIn(['line']);
1620
- if (planData.sceneGraph.layers['layer-1'].lines[lineID].visible) {
1621
- pivot.visible = true;
1622
- } else {
1623
- pivot.visible = false;
1624
- }
1625
- object.traverse(function (obj) {
1626
- (0, _helper.replaceMeshesWithLineSegments)(obj);
1627
- });
1628
- }
1629
- pivot.add(object);
1630
- var line = layer.getIn(['lines', holeData.line]);
1631
-
1632
- // First of all I need to find the vertices of this line
1633
- var vertex0 = layer.vertices.get(line.vertices.get(0));
1634
- var vertex1 = layer.vertices.get(line.vertices.get(1));
1635
- var offset = holeData.offset;
1636
- if (vertex0.x > vertex1.x) {
1637
- var tmp = vertex0;
1638
- vertex0 = vertex1;
1639
- vertex1 = tmp;
1640
- offset = 1 - offset;
1641
- }
1642
- var distance = Math.sqrt(Math.pow(vertex0.x - vertex1.x, 2) + Math.pow(vertex0.y - vertex1.y, 2));
1643
- var alpha = Math.asin((vertex1.y - vertex0.y) / distance);
1644
- var boundingBox = new Three.Box3().setFromObject(pivot);
1645
- var center = [(boundingBox.max.x - boundingBox.min.x) / 2 + boundingBox.min.x, (boundingBox.max.y - boundingBox.min.y) / 2 + boundingBox.min.y, (boundingBox.max.z - boundingBox.min.z) / 2 + boundingBox.min.z];
1646
- var holeAltitude = holeData.properties.getIn(['altitude', 'length']);
1647
- var holeHeight = holeData.properties.getIn(['height', 'length']);
1648
- pivot.rotation.y = alpha;
1649
- pivot.position.x = vertex0.x + distance * offset * Math.cos(alpha) - center[0] * Math.cos(alpha) - center[2] * Math.sin(alpha);
1650
- pivot.position.y = holeAltitude + holeHeight / 2 - center[1] + layer.altitude;
1651
- pivot.position.z = -vertex0.y - distance * offset * Math.sin(alpha) - center[2] * Math.cos(alpha) + center[0] * Math.sin(alpha);
1652
- pivot.userData.type = 'hole';
1653
- pivot.userData.layerId = layer.id;
1654
- pivot.userData.holeId = holeData.id;
1655
-
1656
- // if holeId is existing, remove it first
1657
- var childLen = planData.plan.children.length;
1658
- var children = [];
1659
- for (var i = 0; i < childLen; i++) {
1660
- if (planData.plan.children[i].userData.holeId != holeData.id) children.push(planData.plan.children[i]);
1661
- }
1662
- planData.plan.children = children;
1663
- planData.plan.add(pivot);
1664
- planData.sceneGraph.layers[layer.id].holes[holeData.id] = pivot;
1665
- applyInteract(pivot, function () {
1666
- document.getElementById('setting_dialog').style.display = 'none';
1667
- return holesActions.selectHole(layer.id, holeData.id);
1668
- });
1669
- var opacity = layer.opacity;
1670
- if (holeData.selected) {
1671
- opacity = 1;
1672
- }
1673
- applyOpacity(pivot, opacity);
1674
- });
1675
- }
1676
- function updateHole(sceneData, oldSceneData, planData, layer, holeID, differences, catalog, holesActions, selfDestroy, selfBuild) {
1677
- var hole = layer.getIn(['holes', holeID]);
1678
- var oldHole = oldSceneData.getIn(['layers', layer.id, 'holes', holeID]);
1679
- var mesh = planData.sceneGraph.layers[layer.id].holes[holeID];
1680
- if (!mesh) return null;
1681
- return catalog.getElement(hole.type).updateRender3D(hole, layer, sceneData, mesh, oldHole, differences, selfDestroy, selfBuild);
1682
- }
1683
- function addLine(sceneData, planData, layer, lineID, catalog, linesActions) {
1684
- var mode = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : null;
1685
- var toolObj = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : null;
1686
- if (planData.sceneGraph.busyResources.layers[layer.id].lines[lineID]) {
1687
- setTimeout(function () {
1688
- return addLine(sceneData, planData, layer, lineID, catalog, linesActions, mode);
1689
- }, 100);
1690
- return;
1691
- }
1692
- planData.sceneGraph.busyResources.layers[layer.id].lines[lineID] = true;
1693
- var line = layer.getIn(['lines', lineID]);
1694
- line.userData.stateMode = scene_mode;
1695
-
1696
- // First of all I need to find the vertices of this line
1697
- var vertex0 = layer.vertices.get(line.vertices.get(0));
1698
- var vertex1 = layer.vertices.get(line.vertices.get(1));
1699
- if (vertex0.x > vertex1.x) {
1700
- var tmp = vertex0;
1701
- vertex0 = vertex1;
1702
- vertex1 = tmp;
1703
- }
1704
- return catalog.getElement(line.type).render3D(line, layer, sceneData, mode).then(function (line3D) {
1705
- if (line3D === null) {
1706
- return;
1707
- }
1708
- if (line3D instanceof Three.LOD) {
1709
- planData.sceneGraph.LODs[line.id] = line3D;
1710
- }
1711
- var pivot = new Three.Object3D();
1712
- pivot.name = 'pivot';
1713
- pivot.add(line3D);
1714
- pivot.position.x = (vertex0.x + vertex1.x) / 2;
1715
- pivot.position.y = layer.altitude;
1716
- pivot.position.z = -(vertex0.y + vertex1.y) / 2;
1717
- pivot.userData.type = 'line';
1718
-
1719
- // In elevation view, show(visible = true) just selected wall pivot. If not, hidden(visible = false)
1720
- if ((0, _helper.isElevationView)(mode)) {
1721
- var lineVisible;
1722
- if (line.selected) {
1723
- pivot.traverse(function (obj) {
1724
- (0, _helper.replaceMeshesWithLineSegments)(obj);
1725
- });
1726
- lineVisible = true;
1727
- } else {
1728
- lineVisible = false;
1729
- }
1730
- pivot.visible = lineVisible;
1731
- }
1732
- pivot.userData.layerId = layer.id;
1733
- pivot.userData.lineId = lineID;
1734
- planData.plan.add(pivot);
1735
- planData.sceneGraph.layers[layer.id].lines[lineID] = pivot;
1736
- applyInteract(pivot, function () {
1737
- document.getElementById('setting_dialog').style.display = 'none';
1738
- return linesActions.selectLine(layer.id, line.id);
1739
- });
1740
- var opacity = layer.opacity;
1741
- if (line.selected) {
1742
- opacity = 1;
1743
- }
1744
- applyOpacity(pivot, opacity);
1745
- planData.sceneGraph.busyResources.layers[layer.id].lines[lineID] = false;
1746
- });
1747
- }
1748
- function updateLine(sceneData, oldSceneData, planData, layer, lineID, differences, catalog, linesActions, selfDestroy, selfBuild) {
1749
- var line = layer.getIn(['lines', lineID]);
1750
- var oldLine = oldSceneData.getIn(['layers', layer.id, 'lines', lineID]);
1751
- var mesh = planData.sceneGraph.layers[layer.id].lines[lineID];
1752
- if (!mesh) return null;
1753
- return catalog.getElement(line.type).updateRender3D(line, layer, sceneData, mesh, oldLine, differences, selfDestroy, selfBuild);
1754
- }
1755
- function addArea(sceneData, planData, layer, areaID, catalog, areaActions, mode) {
1756
- var toolObj = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : null;
1757
- if (planData.sceneGraph.busyResources.layers[layer.id].areas[areaID]) {
1758
- setTimeout(function () {
1759
- return addArea(sceneData, planData, layer, areaID, catalog, areaActions, mode);
1760
- }, 100);
1761
- return;
1762
- }
1763
- planData.sceneGraph.busyResources.layers[layer.id].areas[areaID] = true;
1764
- var area = layer.getIn(['areas', areaID]);
1765
- var interactFunction = function interactFunction() {
1766
- return areaActions.selectArea(layer.id, areaID);
1767
- };
1768
- return catalog.getElement(area.type).render3D(area, layer, sceneData).then(function (area3D) {
1769
- if (area3D instanceof Three.LOD) {
1770
- planData.sceneGraph.LODs[areaID] = area3D;
1771
- }
1772
- var pivot = new Three.Object3D();
1773
- var floorSupport = area3D.userData.floorSupport;
1774
- floorSupport.onBeforeRender = function (renderer, scene, camera, geometry, material, group) {
1775
- var floorMesh = this.parent.getObjectByName('floor');
1776
- if (geometry.attributes.normal === undefined) return floorMesh.visible = false;
1777
- geometry.computeVertexNormals();
1778
- var normals = geometry.attributes.normal.array;
1779
- var pos = new Three.Vector4(0, 0, 0, 1);
1780
- pos = pos.applyMatrix4(this.matrixWorld);
1781
- pos = pos.applyMatrix4(camera.matrixWorldInverse);
1782
- var normal = new Three.Vector4(normals[0], normals[1], normals[2], 0);
1783
- normal = normal.applyMatrix4(this.matrixWorld);
1784
- normal = normal.applyMatrix4(camera.matrixWorldInverse);
1785
- if (floorMesh) {
1786
- if (normal.dot(pos) <= 0) {
1787
- floorMesh.visible = true;
1788
- } else {
1789
- floorMesh.visible = false;
1790
- }
1791
- }
1792
- };
1793
- var ceil = area3D.userData.floorSupport.clone();
1794
- var ceilMaterial = new Three.MeshStandardMaterial({
1795
- color: 0xdfdfdf,
1796
- side: Three.BackSide,
1797
- roughness: 0.3,
1798
- metalness: 0.4
1799
- });
1800
- ceil.name = 'ceil';
1801
- ceil.material = ceilMaterial;
1802
- var vertices = [];
1803
- var lines = [];
1804
- var height = 100;
1805
- area.vertices.forEach(function (data) {
1806
- vertices.push(data);
1807
- });
1808
- layer.lines.forEach(function (data) {
1809
- lines.push(data);
1810
- });
1811
- var _loop2 = function _loop2() {
1812
- var data = lines[i];
1813
- var realVec = [];
1814
- data.vertices.forEach(function (vec) {
1815
- realVec.push(vec);
1816
- });
1817
- if (vertices.includes(realVec[0]) && vertices.includes(realVec[1])) {
1818
- height = (0, _convertUnits["default"])(layer.ceilHeight).from(layer.unit).to(_constants.UNIT_CENTIMETER);
1819
- // height = data.properties.getIn(["height", "length"]);
1820
- return 1; // break
1821
- }
1822
- };
1823
- for (var i = 0; i < lines.length; i++) {
1824
- if (_loop2()) break;
1825
- }
1826
- ceil.translateZ((0, _convertUnits["default"])(layer.ceilHeight).from(layer.unit).to(_constants.UNIT_CENTIMETER));
1827
- pivot.name = 'pivot';
1828
- pivot.add(area3D);
1829
- pivot.add(area3D.userData.floorSupport);
1830
- pivot.add(ceil);
1831
- pivot.position.y = layer.altitude;
1832
-
1833
- // if elevation view, show just wall - not show floor and ceil
1834
- if ((0, _helper.isElevationView)(mode)) pivot.visible = false;
1835
- planData.plan.add(pivot);
1836
- planData.sceneGraph.layers[layer.id].areas[areaID] = pivot;
1837
- document.getElementById('setting_dialog').style.display = 'none';
1838
- applyInteract(pivot, interactFunction);
1839
- var opacity = layer.opacity;
1840
- if (area.selected) {
1841
- opacity = 1;
1842
- }
1843
- applyOpacity(pivot, opacity);
1844
- planData.sceneGraph.busyResources.layers[layer.id].areas[areaID] = false;
1845
- });
1846
- }
1847
- function updateArea(sceneData, oldSceneData, planData, layer, areaID, differences, catalog, areaActions, selfDestroy, selfBuild) {
1848
- var area = layer.getIn(['areas', areaID]);
1849
- var oldArea = oldSceneData.getIn(['layers', layer.id, 'areas', areaID]);
1850
- var mesh = planData.sceneGraph.layers[layer.id].areas[areaID];
1851
- if (!mesh) return null;
1852
- return catalog.getElement(area.type).updateRender3D(area, layer, sceneData, mesh, oldArea, differences, selfDestroy, selfBuild);
1853
- }
1854
- function addItem(sceneData, planData, layer, itemID, catalog, itemsActions) {
1855
- var mode = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : null;
1856
- var toolObj = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : null;
1857
- var rItem = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : null;
1858
- var bAddMolding = arguments.length > 9 && arguments[9] !== undefined ? arguments[9] : true;
1859
- if (planData.sceneGraph.busyResources.layers[layer.id].items[itemID]) {
1860
- setTimeout(function () {
1861
- return addItem(sceneData, planData, layer, itemID, catalog, itemsActions, mode, toolObj, rItem, bAddMolding);
1862
- }, 100);
1863
- return;
1864
- }
1865
- var item = layer.getIn(['items', itemID]);
1866
- if (item.doorStyle === null) {
1867
- console.log(item.name + 's doorStyle is null!');
1868
- return;
1869
- }
1870
- if (!sceneData.loadFlag && scene_mode == _constants.MODE_DRAWING_ITEM_3D) {
1871
- itemsActions.toggleLoadingCabinet();
1872
- }
1873
- var catalogElement = catalog.getElement(item.type);
1874
- if (!catalogElement) catalogElement = catalog.getElement((0, _utils.returnReplaceableDeepSearchType)(item.type));
1875
- if (!catalogElement) return false;
1876
- return catalogElement.render3D(item, layer, sceneData, mode).then(function (item3D) {
1877
- if (item3D instanceof Three.LOD) {
1878
- planData.sceneGraph.LODs[itemID] = item3D;
1879
- }
1880
- if (rItem !== null) {
1881
- planData.plan.remove(rItem);
1882
- (0, _threeMemoryCleaner.disposeObject)(rItem);
1883
- rItem = null;
1884
- }
1885
- var pivot = new Three.Object3D();
1886
- pivot.name = 'pivot';
1887
- pivot.add(item3D);
1888
- if (pivot) {
1889
- var mBoxColor = 0x99c3fb;
1890
- var _item = item.toJS();
1891
- if (_item.doorStyle.doorStyles !== undefined && _item.doorStyle.doorStyles.cds) {
1892
- if (showYelloBox(_item)) {
1893
- mBoxColor = 'rgba(232,187,47,1)';
1894
- } else {
1895
- pivot.children[0].children.forEach(function (pivotElement) {
1896
- pivotElement.visible = false;
1897
- });
1898
- }
1899
- var mBox = GeomUtils.makeMBoxfromObject(pivot, mBoxColor);
1900
- var warningObj = createWarningObject();
1901
- warningObj.position.set(0, item.properties.get('height').get('length') / 3, 0);
1902
- if (mBox) {
1903
- mBox.add(warningObj);
1904
- pivot.add(mBox);
1905
- }
1906
- }
1907
- }
1908
- if (item.selected) {
1909
- var tranformControl = item3D.children[item3D.children.length - 1];
1910
- transformBox = tranformControl.children[tranformControl.children.length - 1];
1911
- }
1912
- pivot.rotation.y = item.rotation * Math.PI / 180 + Math.PI;
1913
- // pivot.rotation.y = item.rotation;
1914
- pivot.position.x = item.x;
1915
- pivot.position.y = layer.altitude;
1916
- pivot.position.z = -item.y;
1917
- applyInteract(item3D, function () {
1918
- // closes the setting dialog
1919
- document.getElementById('setting_dialog').style.display = 'none';
1920
- return itemsActions.selectItem(layer.id, item.id);
1921
- });
1922
- var opacity = layer.opacity;
1923
- if (item.selected) {
1924
- opacity = 1;
1925
- exports.fVLine = fVLine = [];
1926
- var TransformGizmo = item3D.children[item3D.children.length - 1];
1927
- TransformGizmo.children.forEach(function (child) {
1928
- if (child.type === 'Line' && child.geometry.attributes !== undefined) fVLine.push(child);
1929
- });
1930
- setTimeout(function () {
1931
- getDistances();
1932
- }, 50);
1933
- }
1934
- applyOpacity(pivot, opacity);
1935
- pivot.userData.type = 'item';
1936
- pivot.userData.layerId = layer.id;
1937
- pivot.userData.itemId = item.id;
1938
-
1939
- /**
1940
- *
1941
- * @param {array} itemRect Array of item's 4 side lines
1942
- * @returns {boolean} true (if item is snapped into wall) or false (if item is not snapped into wall)
1943
- */
1944
- //////////////////
1945
- ///// wall ///////
1946
- // 3 ***** 2
1947
- // * *
1948
- // * item *
1949
- // * *
1950
- // 0 ***** 1
1951
-
1952
- var getItemVisible = function getItemVisible(itemRect) {
1953
- var selectedLine = layer.lines.get(layer.selected.lines.toJS()[0]);
1954
- var itemVisible = false;
1955
- var vertex0 = layer.vertices.get(selectedLine.vertices.get(0));
1956
- var vertex1 = layer.vertices.get(selectedLine.vertices.get(1));
1957
- var l0 = {
1958
- x: vertex0.x,
1959
- y: vertex0.y
1960
- };
1961
- var l1 = {
1962
- x: vertex1.x,
1963
- y: vertex1.y
1964
- };
1965
- var r0 = itemRect.rect[0];
1966
- var r1 = itemRect.rect[1];
1967
- var r2 = itemRect.rect[2];
1968
- var r3 = itemRect.rect[3];
1969
-
1970
- // it doesn't need consider distance between item's line01 (frontside - it has door) and wall
1971
- var delta12 = _export.GeometryUtils.distancePointFromLineSegment(l0, l1, (r1.x + r2.x) / 2, (r1.y + r2.y) / 2); // distance between item's line12 and wall
1972
- var delta23 = _export.GeometryUtils.distancePointFromLineSegment(l0, l1, (r2.x + r3.x) / 2, (r2.y + r3.y) / 2); // distance between item's line23 and wall
1973
- var delta30 = _export.GeometryUtils.distancePointFromLineSegment(l0, l1, (r3.x + r0.x) / 2, (r3.y + r0.y) / 2); // distance between item's line30 and wall
1974
-
1975
- if (delta12 < _constants.DISTANCE_EPSILON || delta23 < _constants.DISTANCE_EPSILON || delta30 < _constants.DISTANCE_EPSILON) {
1976
- itemVisible = true;
1977
- }
1978
- return itemVisible;
1979
- };
1980
- var val = {
1981
- pos: {
1982
- x: item.x,
1983
- y: item.y
1984
- },
1985
- rotRad: item.rotation / 180 * Math.PI
1986
- };
1987
- var catid = item.type;
1988
- var cat = catalog.elements[catid];
1989
- if (!cat) cat = catalog.elements[(0, _utils.returnReplaceableDeepSearchType)(catid)];
1990
- var width = (0, _convertUnits["default"])(item.properties.getIn(['width', '_length'])).from('in').to(sceneData.unit);
1991
- var height = (0, _convertUnits["default"])(item.properties.getIn(['height', '_length'])).from('in').to(sceneData.unit);
1992
- var depth = (0, _convertUnits["default"])(item.properties.getIn(['depth', '_length'])).from('in').to(sceneData.unit);
1993
- val.size = {
1994
- width: width,
1995
- height: height,
1996
- depth: depth
1997
- };
1998
- val.layoutpos = cat.info.layoutpos;
1999
- val.is_corner = cat.info.is_corner;
2000
- val.item = item;
2001
- var calcrect = _export.GeometryUtils.getCalcRectFromItem3D(val);
2002
-
2003
- // In elevation view, determin if item show or not
2004
- if ((0, _helper.isElevationView)(mode)) pivot.visible = getItemVisible(calcrect);
2005
- planData.plan.add(pivot);
2006
- planData.sceneGraph.layers[layer.id].items[item.id] = pivot;
2007
- //In a 3D view, merge each couterTop of equal height into a single conuterTop.
2008
- if (!(0, _helper.isElevationView)(mode)) {
2009
- addCountertop(planData.sceneGraph.layers[layer.id].countertops, item, planData, layer);
2010
- }
2011
- if (bAddMolding && item.category === 'cabinet' && ((0, _helper.isElevationView)(mode) && getItemVisible(calcrect) || !(0, _helper.isElevationView)(mode))) {
2012
- planData.sceneGraph.layers[layer.id].moldingGroups = addMolding(planData.sceneGraph.layers[layer.id].moldingGroups, item, planData, layer, itemsActions, mode) || planData.sceneGraph.layers[layer.id].moldingGroups;
2013
- }
2014
- if (pivot) {
2015
- // update the tool object's position to selected object's position
2016
- var selectedItem = planData.sceneGraph.layers[sceneData.selectedLayer].items[itemID];
2017
- var itemPos = selectedItem.position.clone();
2018
- if (!(0, _helper.isEmpty)(toolObj)) {
2019
- toolObj.position.set(planData.plan.position.x + itemPos.x, selectedItem.category === 'lighting' ? -planData.plan.position.y - selectedItem.properties.get('height').get('length') : planData.plan.position.y + selectedItem.children[0].position.y, planData.plan.position.z + itemPos.z);
2020
- }
2021
- pivot.children[0].children.forEach(function (pivotElement) {
2022
- pivotElement.visible = true;
2023
- });
2024
- if (pivot.children.length > 1) {
2025
- var _item4 = item.toJS();
2026
- if (_item4.doorStyle.doorStyles !== undefined) {
2027
- if (_item4.category === 'cabinet') {
2028
- if (_item4.doorStyle.doorStyles.cds.some(function (element) {
2029
- return element.itemID === item.itemID;
2030
- })) {
2031
- pivot.children.pop();
2032
- }
2033
- } else {
2034
- pivot.children.pop();
2035
- }
2036
- }
2037
- }
2038
- }
2039
- applyInteract(pivot, function () {
2040
- document.getElementById('setting_dialog').style.display = 'none';
2041
- return itemsActions.selectItem(layer.id, item.id);
2042
- });
2043
- setTimeout(function () {
2044
- return getDistances(layer);
2045
- }, 100);
2046
- if (!sceneData.loadFlag && scene_mode == _constants.MODE_DRAWING_ITEM_3D) {
2047
- itemsActions.endLoading();
2048
- itemsActions.toggleLoadingCabinet();
2049
- }
2050
- });
2051
- }
2052
- function updateItem(sceneData, oldSceneData, planData, layer, itemID, differences, catalog, itemsActions, selfDestroy, selfBuild) {
2053
- var item = layer.getIn(['items', itemID]);
2054
- var oldItem = oldSceneData.getIn(['layers', layer.id, 'items', itemID]);
2055
- var mesh = planData.sceneGraph.layers[layer.id].items[itemID];
2056
- if (!mesh) return null;
2057
- return catalog.getElement(item.type).updateRender3D(item, layer, sceneData, mesh, oldItem, differences, selfDestroy, selfBuild);
2058
- }
2059
-
2060
- // Apply interact function to children of an Object3D
2061
- function applyInteract(object, interactFunction) {
2062
- document.getElementById('setting_dialog').style.display = 'none';
2063
- object.traverse(function (child) {
2064
- if (child instanceof Three.Mesh) {
2065
- child.interact = interactFunction;
2066
- }
2067
- });
2068
- }
2069
-
2070
- // Apply opacity to children of an Object3D
2071
- function applyOpacity(object, opacity) {
2072
- object.traverse(function (child) {
2073
- if (child instanceof Three.Mesh) {
2074
- if (child.material && !Array.isArray(child.material)) {
2075
- // child.material.materials.forEach(materialChild => {
2076
- // materialChild.transparent = true;
2077
- // if (materialChild.maxOpacity) {
2078
- // materialChild.opacity = Math.min(materialChild.maxOpacity, opacity);
2079
- // } else if (materialChild.opacity && materialChild.opacity > opacity) {
2080
- // materialChild.maxOpacity = materialChild.opacity;
2081
- // materialChild.opacity = opacity;
2082
- // }
2083
- // });
2084
- } else if (child.material instanceof Array) {
2085
- child.material.forEach(function (material) {
2086
- material.transparent = true;
2087
- if (material.maxOpacity) {
2088
- material.opacity = Math.min(material.maxOpacity, opacity);
2089
- } else if (material.opacity && material.opacity > opacity) {
2090
- material.maxOpacity = material.opacity;
2091
- material.opacity = opacity;
2092
- }
2093
- });
2094
- } else {
2095
- child.material.transparent = true;
2096
- if (child.material.maxOpacity) {
2097
- child.material.opacity = Math.min(child.material.maxOpacity, opacity);
2098
- } else if (child.material.opacity && child.material.opacity > opacity) {
2099
- child.material.maxOpacity = child.material.opacity;
2100
- child.material.opacity = opacity;
2101
- }
2102
- }
2103
- }
2104
- });
2105
- }
2106
- function updateBoundingBox(planData) {
2107
- var flag = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
2108
- var mode = arguments.length > 2 ? arguments[2] : undefined;
2109
- if (scene_mode == _constants.MODE_DRAWING_ITEM_3D) return;
2110
- var newBoundingBox = new Three.Box3().setFromObject(planData.plan);
2111
- if (isFinite(newBoundingBox.max.x) && isFinite(newBoundingBox.min.x) && isFinite(newBoundingBox.max.y) && isFinite(newBoundingBox.min.y) && isFinite(newBoundingBox.max.z) && isFinite(newBoundingBox.min.z)) {
2112
- var newCenter = new Three.Vector3((newBoundingBox.max.x - newBoundingBox.min.x) / 2 + newBoundingBox.min.x, (newBoundingBox.max.y - newBoundingBox.min.y) / 2 + newBoundingBox.min.y, (newBoundingBox.max.z - newBoundingBox.min.z) / 2 + newBoundingBox.min.z);
2113
- if (!flag) {
2114
- planData.plan.position.sub(newCenter);
2115
- planData.grid.position.sub(newCenter);
2116
- if ((0, _helper.isElevationView)(mode)) {
2117
- planData.cam.position.sub(newCenter);
2118
- }
2119
- }
2120
- newBoundingBox.min.sub(newCenter);
2121
- newBoundingBox.max.sub(newCenter);
2122
- planData.boundingBox = newBoundingBox;
2123
- }
2124
- }
2125
-
2126
- /**
2127
- * Filter the array of diffs
2128
- * @param diffArray
2129
- * @param sceneData
2130
- * @param oldSceneData
2131
- * @returns {Array}
2132
- */
2133
- function filterDiffs(diffArray, sceneData, oldSceneData) {
2134
- return minimizeRemoveDiffsWhenSwitchingLayers(minimizeChangePropertiesAfterSelectionsDiffs(minimizeChangePropertiesDiffs(diffArray, sceneData, oldSceneData), sceneData, oldSceneData), sceneData, oldSceneData);
2135
- }
2136
-
2137
- /**
2138
- * Reduces the number of remove diffs when switching an hidden layer
2139
- * @param diffArray the array of the diffs
2140
- * @param sceneData
2141
- * @param oldSceneData
2142
- * @returns {Array}
2143
- */
2144
- function minimizeRemoveDiffsWhenSwitchingLayers(diffArray, sceneData, oldSceneData) {
2145
- var foundDiff;
2146
- var i;
2147
- for (i = 0; i < diffArray.length && !foundDiff; i++) {
2148
- if (diffArray[i].path[1] === 'selectedLayer') {
2149
- foundDiff = diffArray[i];
2150
- }
2151
- }
2152
- if (foundDiff) {
2153
- if (!sceneData.getIn(['layers', oldSceneData.selectedLayer, 'visible'])) {
2154
- return diffArray.filter(function (_ref6) {
2155
- var op = _ref6.op,
2156
- path = _ref6.path;
2157
- return !(path[path.length - 1] === 'selected' && path[1] === 'layers' && path[2] === oldSceneData.selectedLayer) && !(op === 'remove' && path.indexOf(oldSceneData.selectedLayer) !== -1);
2158
- });
2159
- }
2160
- }
2161
- return diffArray;
2162
- }
2163
-
2164
- /**
2165
- * Reduces the number of change properties diffs for selected elements
2166
- * @param diffArray the array of the diffs
2167
- * @param sceneData
2168
- * @param oldSceneData
2169
- * @returns {Array}
2170
- */
2171
- function minimizeChangePropertiesAfterSelectionsDiffs(diffArray, sceneData, oldSceneData) {
2172
- var idsFound = {};
2173
- diffArray.forEach(function (_ref7) {
2174
- var path = _ref7.path;
2175
- if (path[5] === 'selected') {
2176
- idsFound[path[4]] = path[4];
2177
- }
2178
- });
2179
- return diffArray.filter(function (_ref8) {
2180
- var path = _ref8.path;
2181
- if (path[5] === 'properties') {
2182
- return idsFound[path[4]] ? false : true;
2183
- }
2184
- return true;
2185
- });
2186
- }
2187
-
2188
- /**
2189
- * Reduces the number of change properties diffs
2190
- * @param diffArray the array of the diffs
2191
- * @param sceneData
2192
- * @param oldSceneData
2193
- * @returns {Array}
2194
- */
2195
- function minimizeChangePropertiesDiffs(diffArray, sceneData, oldSceneData) {
2196
- var idsFound = {};
2197
- return diffArray.filter(function (_ref9) {
2198
- var path = _ref9.path;
2199
- if (path[5] === 'properties') {
2200
- return idsFound[path[4]] ? false : idsFound[path[4]] = true;
2201
- } else if (path[5] === 'misc') {
2202
- // Remove misc changes
2203
- return false;
2204
- }
2205
- return true;
2206
- });
2207
- }
2208
-
2209
- // countertops:
2210
- // o id:
2211
- // o items: [itemid]
2212
- // o ct3d: 3d object
2213
- // o catid
2214
- // o pos
2215
- // o rotRad
2216
- // o size
2217
- function createCTFromItem(item, unit, catalog) {
2218
- return createCTFromItems([item], unit, catalog);
2219
- }
2220
- function createCTFromItems(items, unit, catalog) {
2221
- var item0 = items[0];
2222
- var item1 = items[items.length - 1];
2223
- var CTId = _export.IDBroker.acquireID();
2224
- var ct3d = null;
2225
- var catid = item0.type;
2226
- var pos = {
2227
- x: (item0.x + item1.x) / 2,
2228
- y: (item0.y + item1.y) / 2
2229
- };
2230
- var rotRad = item0.rotation / 180 * Math.PI;
2231
- var cat = catalog.elements[catid];
2232
- // let width = convert(item0.properties.getIn(['width', '_length'])).from('in').to('cm');
2233
- // let depth = convert(item0.properties.getIn(['depth', '_length'])).from('in').to('cm');
2234
- // let height = convert(item0.properties.getIn(['height', '_length'])).from('in').to('cm');
2235
- var width = item0.properties.get('width').get('_length');
2236
- var widthUnit = item0.properties.get('width').get('_unit') || 'cm';
2237
- width = (0, _convertUnits["default"])(width).from(widthUnit).to('cm');
2238
- var depth = item0.properties.get('depth').get('_length');
2239
- var depthUnit = item0.properties.get('depth').get('_unit') || 'cm';
2240
- depth = (0, _convertUnits["default"])(depth).from(depthUnit).to('cm');
2241
- var height = item0.properties.get('height').get('_length');
2242
- var heightUnit = item0.properties.get('height').get('_unit') || 'cm';
2243
- height = (0, _convertUnits["default"])(height).from(heightUnit).to('cm');
2244
- var size = {
2245
- width: width * items.length,
2246
- depth: depth,
2247
- height: height
2248
- };
2249
- return {
2250
- id: CTId,
2251
- items: items,
2252
- ct3d: ct3d,
2253
- catid: catid,
2254
- pos: pos,
2255
- rotRad: rotRad,
2256
- size: size
2257
- };
2258
- }
2259
- function createMDFromItem(item, lines, molding) {
2260
- var MDId = _export.IDBroker.acquireID();
2261
- var z = item.properties.get('altitude').get('_length');
2262
- var zUnit = item.properties.get('altitude').get('_unit') || 'cm';
2263
- z = (0, _convertUnits["default"])(z).from(zUnit).to('cm');
2264
- var height = item.properties.get('height').get('_length');
2265
- var heightUnit = item.properties.get('height').get('_unit') || 'cm';
2266
- height = (0, _convertUnits["default"])(height).from(heightUnit).to('cm');
2267
- switch (molding.location_type) {
2268
- case _constants.TOP_MOLDING_LOCATION:
2269
- z += height;
2270
- break;
2271
- case _constants.MIDDLE_MOLDING_LOCATION:
2272
- z += height / 2;
2273
- break;
2274
- case _constants.BOTTOM_MOLDING_LOCATION:
2275
- z += 0;
2276
- break;
2277
- default:
2278
- break;
2279
- }
2280
- return {
2281
- id: MDId,
2282
- items: [item],
2283
- meshes: [],
2284
- pos: {
2285
- x: 0,
2286
- y: 0,
2287
- z: z
2288
- },
2289
- size: {
2290
- width: 0,
2291
- depth: 0,
2292
- height: 0
2293
- },
2294
- lines: lines,
2295
- molding: molding,
2296
- pointGroups: []
2297
- };
2298
- }
2299
- function tryAdjacent(ct1, ct2) {
2300
- if (ct1.catid.includes('Dishwasher') && ct1.catid.includes('BF')) {
2301
- var temp = ct1;
2302
- ct1 = ct2;
2303
- ct2 = temp;
2304
- }
2305
- log('----tryAdjacent', ct1.id, ct2.id);
2306
- if (!ct2.catid.includes('Dishwasher') && !ct2.catid.includes('BF') && ct1.catid != ct2.catid) return false;
2307
- if (ct1.rotRad != ct2.rotRad) return false;
2308
- log('ct1', ct1.pos.x, ct1.pos.y, ct1.size.width);
2309
- log('ct2', ct2.pos.x, ct2.pos.y, ct2.size.width);
2310
- var dist = _export.GeometryUtils.verticesDistance(ct1.pos, ct2.pos);
2311
- var totalwidth = ct1.size.width + ct2.size.width;
2312
- log('epsilon', dist, totalwidth, Math.abs(2 * dist - totalwidth));
2313
- if (Math.abs(2 * dist - totalwidth) / totalwidth > 1e-3) return false;
2314
- log('----success');
2315
- var newpos = {
2316
- x: (ct1.pos.x * ct1.size.width + ct2.pos.x * ct2.size.width) / totalwidth,
2317
- y: (ct1.pos.y * ct1.size.width + ct2.pos.y * ct2.size.width) / totalwidth
2318
- };
2319
- var newsize = {
2320
- width: totalwidth,
2321
- depth: ct1.size.depth,
2322
- height: ct1.size.height
2323
- };
2324
- var CTId = _export.IDBroker.acquireID();
2325
- var items = _export.GeometryUtils.compareVertices(ct1.pos, ct2.pos) > 0 ? [].concat(_toConsumableArray(ct1.items), _toConsumableArray(ct2.items)) : [].concat(_toConsumableArray(ct2.items), _toConsumableArray(ct1.items));
2326
- var ct3d = null;
2327
- var catid = ct1.catid;
2328
- return {
2329
- id: CTId,
2330
- items: items,
2331
- ct3d: ct3d,
2332
- catid: catid,
2333
- pos: newpos,
2334
- rotRad: ct1.rotRad,
2335
- size: newsize
2336
- };
2337
- }
2338
- function isParallelLines(line1, line2) {
2339
- var isParallel = false;
2340
- if (Math.abs(line1[0].y - line1[1].y) <= _constants.EPSILON && Math.abs(line2[0].y - line2[1].y) <= _constants.EPSILON) isParallel = true;
2341
- if (Math.abs(line1[0].x - line1[1].x) <= _constants.EPSILON && Math.abs(line2[0].x - line2[1].x) <= _constants.EPSILON) isParallel = true;
2342
- if (Math.abs((line1[0].x - line1[1].x) / (line1[0].y - line1[1].y) - (line2[0].x - line2[1].x) / (line2[0].y - line2[1].y)) <= _constants.EPSILON) isParallel = true;
2343
- if (isParallel) {
2344
- return true;
2345
- }
2346
- return false;
2347
- }
2348
- function tryAdjacentMD(md1, md2, molding) {
2349
- log('----tryAdjacent', md1.id, md2.id);
2350
- if (Math.abs(md1.pos.z - md2.pos.z) > _constants.EPSILON) return false;
2351
- var id1 = md1.items[0].doorStyle.hasOwnProperty('id') ? md1.items[0].doorStyle.id : md1.items[0].doorStyle.toJS().id,
2352
- id2 = md2.items[0].doorStyle.hasOwnProperty('id') ? md2.items[0].doorStyle.id : md2.items[0].doorStyle.toJS().id;
2353
- if (id1 !== id2) return false;
2354
- var newLines = md1.lines.concat(md2.lines);
2355
- var isMerge = false;
2356
- md1.lines.forEach(function (line1) {
2357
- md2.lines.map(function (line2) {
2358
- // filter removed lines
2359
- if (newLines.findIndex(function (a) {
2360
- return a[2] === line1[2];
2361
- }) === -1 || newLines.findIndex(function (a) {
2362
- return a[2] === line2[2];
2363
- }) === -1) return false;
2364
- // is parallel two lines
2365
- if (isParallelLines(line1, line2)) {
2366
- var disLine1 = _export.GeometryUtils.verticesDistance(line1[0], line1[1]);
2367
- var disLine2 = _export.GeometryUtils.verticesDistance(line2[0], line2[1]);
2368
- if (_export.GeometryUtils.sameMDistances(_export.GeometryUtils.verticesDistance(line2[0], line1[0]) + _export.GeometryUtils.verticesDistance(line1[1], line2[1]), Math.abs(disLine2 - disLine1))) {
2369
- newLines = newLines.filter(function (a) {
2370
- return !(a[2] === line1[2] || a[2] === line2[2]);
2371
- });
2372
- if (!_export.GeometryUtils.sameMPoints(line1[0], line2[0])) newLines.push([line1[0], line2[0], _export.IDBroker.acquireID()]);
2373
- if (!_export.GeometryUtils.sameMPoints(line1[1], line2[1])) newLines.push([line1[1], line2[1], _export.IDBroker.acquireID()]);
2374
- isMerge = true;
2375
- return false;
2376
- }
2377
- if (_export.GeometryUtils.sameMDistances(_export.GeometryUtils.verticesDistance(line2[0], line1[1]) + _export.GeometryUtils.verticesDistance(line1[0], line2[1]), Math.abs(disLine2 - disLine1))) {
2378
- newLines = newLines.filter(function (a) {
2379
- return !(a[2] === line1[2] || a[2] === line2[2]);
2380
- });
2381
- if (!_export.GeometryUtils.sameMPoints(line1[1], line2[0])) newLines.push([line1[1], line2[0], _export.IDBroker.acquireID()]);
2382
- if (!_export.GeometryUtils.sameMPoints(line1[0], line2[1])) newLines.push([line1[0], line2[1], _export.IDBroker.acquireID()]);
2383
- isMerge = true;
2384
- return false;
2385
- }
2386
- var samePointNum = -1,
2387
- i = 0;
2388
- while (i < 4 && samePointNum === -1) {
2389
- if (_export.GeometryUtils.sameMPoints(line1[Math.floor(i / 2)], line2[i % 2]) && _export.GeometryUtils.sameMDistances(disLine1 + disLine2, _export.GeometryUtils.verticesDistance(line1[Math.floor((3 - i) / 2)], line2[(3 - i) % 2]))) {
2390
- samePointNum = 3 - i;
2391
- } else {
2392
- i++;
2393
- }
2394
- }
2395
- if (samePointNum > -1) {
2396
- newLines = newLines.filter(function (a) {
2397
- return !(a[2] === line1[2] || a[2] === line2[2]);
2398
- });
2399
- newLines.push([_objectSpread({}, line1[Math.floor(samePointNum / 2)]), _objectSpread({}, line2[samePointNum % 2]), _export.IDBroker.acquireID()]);
2400
- isMerge = true;
2401
- return false;
2402
- }
2403
- var pointNum = -1,
2404
- k = 0;
2405
- while (k < 4 && pointNum === -1) {
2406
- if (_export.GeometryUtils.sameMDistances(_export.GeometryUtils.verticesDistance(line1[Math.floor(k / 2)], line2[k % 2]) + _export.GeometryUtils.verticesDistance(line1[1 - Math.floor(k / 2)], line2[k % 2]), disLine1) && _export.GeometryUtils.sameMDistances(_export.GeometryUtils.verticesDistance(line1[1 - Math.floor(k / 2)], line2[k % 2]) + _export.GeometryUtils.verticesDistance(line1[1 - Math.floor(k / 2)], line2[1 - k % 2]), disLine2)) {
2407
- pointNum = k;
2408
- } else {
2409
- k++;
2410
- }
2411
- }
2412
- }
2413
- return false;
2414
- });
2415
- });
2416
- if (!newLines.length) return _objectSpread({}, md2);
2417
- if (!isMerge) return false;
2418
- return {
2419
- id: _export.IDBroker.acquireID(),
2420
- items: [].concat(_toConsumableArray(md2.items.filter(function (item) {
2421
- return md1.items.findIndex(function (it) {
2422
- return it.id === item.id;
2423
- }) === -1;
2424
- })), _toConsumableArray(md1.items)),
2425
- meshes: [],
2426
- pos: md1.pos,
2427
- size: md1.size,
2428
- lines: newLines,
2429
- molding: molding
2430
- };
2431
- }
2432
- function showItemCT(item, CT, visible, planData, layer) {
2433
- var item3D = planData.sceneGraph.layers[layer.id].items[item.id];
2434
- if (item3D === undefined) return undefined;
2435
- item3D.traverse(function (child) {
2436
- if (child.name.includes('countertop')) {
2437
- child.visible = visible;
2438
- if (child.material.map === null) {
2439
- var normalMap = item.counterTop.uri;
2440
- var interiortexture = (0, _itemLoader.loadTexture)(normalMap);
2441
- applyTexture(child.material, interiortexture, 100, 100);
2442
- child.material.color = new _three.Color(1, 1, 1);
2443
- return;
2444
- }
2445
- child.material.map.repeat.x = 1;
2446
- }
2447
- });
2448
- }
2449
- function getCountertopMesh(item, visible, planData, layer) {
2450
- if (item.type.includes('Dishwasher')) return undefined;
2451
- if (item.type.includes('BF')) return undefined;
2452
- var item3D = planData.sceneGraph.layers[layer.id].items[item.id];
2453
- var countertop = null;
2454
- if (item3D === undefined) return undefined;
2455
- item3D.traverse(function (child) {
2456
- if (child.name.includes('countertop')) {
2457
- countertop = child;
2458
- }
2459
- });
2460
- return countertop;
2461
- }
2462
- function getDoorStyleMaterial(items, planData, layer, name) {
2463
- var item3D = null;
2464
- // find Item with visible = true, in elevation mode
2465
- items.forEach(function (item) {
2466
- var tempItem = null;
2467
- tempItem = planData.sceneGraph.layers[layer.id].items[item.id];
2468
- if (tempItem && tempItem.visible) {
2469
- item3D = tempItem;
2470
- }
2471
- });
2472
- var door_mesh = null;
2473
- if (!item3D) return undefined;
2474
- item3D.traverse(function (child) {
2475
- if (!door_mesh && !child.name.includes('countertop') && !child.name.includes('_interior_') && !child.name.includes('handle') && child.type === _constants.OBJTYPE_MESH) {
2476
- door_mesh = child;
2477
- }
2478
- });
2479
- return door_mesh && door_mesh.material;
2480
- }
2481
- function addCTMesh(countertop, planData, layer) {
2482
- if (countertop.items.length == 1) {
2483
- showItemCT(countertop.items[0], countertop, true, planData, layer);
2484
- } else {
2485
- var ctMesh = null;
2486
- countertop.items.some(function (item) {
2487
- ctMesh = getCountertopMesh(item, true, planData, layer);
2488
- return ctMesh != null;
2489
- });
2490
- if (!ctMesh) return;
2491
- if (0) {
2492
- var material = ctMesh.material;
2493
- var thickness = 3.81;
2494
- var geometry = new Three.BoxGeometry(countertop.size.width, thickness, countertop.size.depth);
2495
- var ct3d = new Three.Mesh(geometry, material);
2496
- countertop.ct3d = ct3d;
2497
- planData.plan.add(ct3d);
2498
- ct3d.position.x = countertop.pos.x;
2499
- ct3d.position.z = -countertop.pos.y;
2500
- ct3d.position.y = countertop.size.height + thickness / 2;
2501
- ct3d.quaternion.setFromAxisAngle(new Three.Vector3(0, 1, 0), countertop.rotRad);
2502
- ct3d.name = 'countertops';
2503
- } else {
2504
- var _ct3d = ctMesh.clone();
2505
- countertop.ct3d = _ct3d;
2506
- _ct3d.visible = true;
2507
- _ct3d.material = ctMesh.material.clone();
2508
- if (_ct3d.material.map !== null) {
2509
- _ct3d.material.map.copy(ctMesh.material.map);
2510
- _ct3d.material.map.repeat.x = countertop.items.length;
2511
- }
2512
- ctMesh.updateMatrix();
2513
- ctMesh.parent.updateMatrix();
2514
- ctMesh.parent.parent.updateMatrix();
2515
- var ctmeshMat = ctMesh.matrix;
2516
- var objMat = ctMesh.parent.matrix;
2517
- var pivotMat = ctMesh.parent.parent.matrix;
2518
- pivotMat.setPosition(new Three.Vector3(countertop.pos.x, 0, -countertop.pos.y));
2519
- var width = countertop.items.find(function (ct) {
2520
- return !ct.type.includes('Dishwasher') && !ct.type.includes('BF');
2521
- }).properties.get('width').get('_length');
2522
- var unit_width = countertop.items.find(function (ct) {
2523
- return !ct.type.includes('Dishwasher') && !ct.type.includes('BF');
2524
- }).properties.get('width').get('_unit') || 'cm';
2525
- width = (0, _convertUnits["default"])(width).from(unit_width).to('cm');
2526
- pivotMat.scale(new Three.Vector3(countertop.size.width / width, 1, 1));
2527
- var finalMat = objMat.premultiply(pivotMat);
2528
- _ct3d.applyMatrix4(finalMat);
2529
- planData.plan.add(_ct3d);
2530
- _ct3d.name = 'countertops';
2531
- }
2532
- }
2533
- }
2534
- function getArea(a, b, c) {
2535
- return a.x * (b.y - c.y) + b.x * (c.y - a.y) + c.x * (a.y - b.y);
2536
- }
2537
- function isSingleQuadrilateral(groupCount, pointGroup) {
2538
- return groupCount === 1 && pointGroup.length === 4;
2539
- }
2540
-
2541
- /**
2542
- * @param MDV - molding points
2543
- * @param width - cabinet width
2544
- * @param depth - cabinet depth ( z axis )
2545
- * @param model - molding info that appear in real 3D
2546
- */
2547
- function moldingVertices(mPointGroup, mdGeo, MDV, model, svg_width, svg_height, groupCount) {
2548
- var pointGroup = mPointGroup;
2549
- var length = pointGroup.length;
2550
- var isSnap = true;
2551
-
2552
- // Point O
2553
- var o = new Three.Vector2(0, 0);
2554
- if (_export.GeometryUtils.samePoints(pointGroup[0], pointGroup[length - 1])) {
2555
- pointGroup = pointGroup.slice(0, length - 1);
2556
- length--;
2557
- isSnap = false;
2558
- }
2559
- var verticesArray = [];
2560
- var t = [[-1, -1], [1, -1], [1, 1], [-1, 1]];
2561
- if (!isSnap && isSingleQuadrilateral(groupCount, pointGroup)) {
2562
- var tmp_pos = [];
2563
- t.forEach(function (tmp) {
2564
- pointGroup.forEach(function (point) {
2565
- if (point.x * tmp[0] > 0 && point.y * tmp[1] > 0) {
2566
- tmp_pos.push(point);
2567
- }
2568
- });
2569
- });
2570
- pointGroup = tmp_pos;
2571
- }
2572
- pointGroup.forEach(function (cur, i) {
2573
- var prev = isSnap && i === 0 ? cur : pointGroup[(i + length - 1) % length];
2574
- var next = isSnap && i === length - 1 ? cur : pointGroup[(i + 1) % length];
2575
- var vecPC = cur.clone().sub(prev); // vector from point `prev` to point `cur`
2576
- var vecNC = cur.clone().sub(next); // vector from point `next` to point `cur`
2577
-
2578
- // Calculate normal vector to `vecPC`
2579
- var vecNorm = new Three.Vector2(0, 1);
2580
- if (vecPC.x) {
2581
- if (vecPC.x > 0) {
2582
- vecNorm = new Three.Vector2(-vecPC.y / vecPC.x, 1);
2583
- } else {
2584
- vecNorm = new Three.Vector2(vecPC.y / vecPC.x, -1);
2585
- }
2586
- } else {
2587
- if (vecPC.y === 0) {
2588
- if (vecNC.x) {
2589
- if (vecNC.x > 0) {
2590
- vecNorm = new Three.Vector2(vecNC.y / vecNC.x, -1);
2591
- } else {
2592
- vecNorm = new Three.Vector2(-vecNC.y / vecNC.x, 1);
2593
- }
2594
- } else {
2595
- if (vecNC.y > 0) {
2596
- vecNorm = new Three.Vector2(1, 0);
2597
- } else {
2598
- vecNorm = new Three.Vector2(-1, 0);
2599
- }
2600
- }
2601
- } else {
2602
- if (vecPC.y > 0) {
2603
- vecNorm = new Three.Vector2(-1, 0);
2604
- } else {
2605
- vecNorm = new Three.Vector2(1, 0);
2606
- }
2607
- }
2608
- }
2609
- var p1 = cur.clone().add(vecNorm); // the point that's away from `cur` by `vecNorm`
2610
- if (getArea(prev, p1, cur) > 0) {
2611
- vecNorm.multiplyScalar(-1);
2612
- }
2613
- var area = 0.5 * getArea(prev, cur, next);
2614
- var lenPN = next.clone().sub(prev).length();
2615
- var lenNC = vecNC.length();
2616
- var lenPC = vecPC.length();
2617
- var alpha = Math.acos((lenNC * lenNC + lenPC * lenPC - lenPN * lenPN) / (2 * lenNC * lenPC));
2618
- if (area < 0) alpha = 2 * Math.PI - alpha; // Exterior Angle
2619
- alpha /= 2;
2620
- if (isNaN(alpha)) {
2621
- alpha = Math.PI / 2;
2622
- }
2623
- vecNorm.rotateAround(o, Math.PI / 2 - alpha);
2624
- vecNorm.normalize();
2625
- vecNorm.multiplyScalar(1 / Math.sin(alpha));
2626
-
2627
- // Make 3D Points
2628
- MDV.forEach(function (p) {
2629
- var x = cur.x - vecNorm.x * ((p.x / svg_width - 0.5) * model.length);
2630
- var y = (0.5 - p.y / svg_height) * model.width;
2631
- var z = -cur.y + vecNorm.y * ((p.x / svg_width - 0.5) * model.length);
2632
- if (mdGeo.attributes.hasOwnProperty('position')) verticesArray = mdGeo.attributes.position.array;
2633
- verticesArray.push(x, y, z);
2634
- });
2635
- });
2636
- var mdGeo1 = mdGeo.setAttribute('position', new Three.BufferAttribute(new Float32Array(verticesArray), 3));
2637
- mdGeo1.needsUpdate = true;
2638
- return mdGeo1;
2639
- }
2640
- var dcmFace = function dcmFace(a, leng, MDV) {
2641
- for (var i = a; i < a + 2; i++) {
2642
- var f_a1 = i;
2643
- var f_b1 = i + leng;
2644
- var f_c1 = i + leng + 1;
2645
- var f_a2 = i;
2646
- var f_b2 = i + 1;
2647
- var f_c2 = f_c1;
2648
- var _indices = Array.from(MDV.index.array);
2649
- _indices.push(f_a1, f_b1, f_c1, f_c2, f_b2, f_a2);
2650
- MDV.setIndex(_indices);
2651
- }
2652
- var indices = Array.from(MDV.index.array);
2653
- indices.push(a + 2, a + leng + 2, a + leng + 4, a + leng + 4, a + 4, a + 2);
2654
- MDV.setIndex(indices);
2655
- for (var _i = a + 4; _i < a + 74; _i++) {
2656
- var _f_a = _i;
2657
- var _f_b = _i + leng;
2658
- var _f_c = _i + leng + 1;
2659
- var _f_a2 = _i;
2660
- var _f_b2 = _i + 1;
2661
- var _f_c2 = _f_c;
2662
- var _indices2 = Array.from(MDV.index.array);
2663
- _indices2.push(_f_a, _f_b, _f_c, _f_c2, _f_b2, _f_a2);
2664
- MDV.setIndex(_indices2);
2665
- }
2666
- var faces = Array.from(MDV.index.array);
2667
- faces.push(a + 50, a + 3, a + 103, a + 103, a + 150, a + 50);
2668
- MDV.setIndex(faces);
2669
- };
2670
- var fbmFace = function fbmFace(a, leng, MDV) {
2671
- var total_leng = leng * 4;
2672
- for (var i = a; i < a + leng - 1; i++) {
2673
- var f_a1 = i;
2674
- var f_b1 = (i + leng) % total_leng;
2675
- var f_c1 = (i + leng + 1) % total_leng;
2676
- var f_a2 = i;
2677
- var f_b2 = i + 1;
2678
- var f_c2 = f_c1;
2679
- var indices = [];
2680
- if (MDV.index !== null) {
2681
- indices = Array.from(MDV.index.array);
2682
- }
2683
- indices.push(f_a1, f_b1, f_c1, f_c2, f_b2, f_a2);
2684
- MDV.setIndex(indices);
2685
- }
2686
- };
2687
- var assignUVs = function assignUVs(geometry) {
2688
- geometry.computeBoundingBox();
2689
- var h = 400;
2690
- var _geometry$boundingBox = geometry.boundingBox,
2691
- min = _geometry$boundingBox.min,
2692
- max = _geometry$boundingBox.max;
2693
- var offset = new Three.Vector2(0 - min.x, 0 - min.z);
2694
- var range = new Three.Vector2(max.x - min.x, max.z - min.z);
2695
- geometry.faceVertexUvs[0] = geometry.faces.map(function (face) {
2696
- var v1 = geometry.vertices[face.a];
2697
- var v2 = geometry.vertices[face.b];
2698
- var v3 = geometry.vertices[face.c];
2699
- return [new Three.Vector2((v1.x + offset.x) / range.x, (v1.z + offset.y) / (range.y + h)), new Three.Vector2((v2.x + offset.x) / range.x, (v2.z + offset.y) / (range.y + h)), new Three.Vector2((v3.x + offset.x) / range.x, (v3.z + offset.y) / (range.y + h))];
2700
- });
2701
- geometry.uvsNeedUpdate = true;
2702
- };
2703
- var assignUVsA = function assignUVsA(geometry) {
2704
- geometry.computeBoundingBox();
2705
- var h = 200;
2706
- var _geometry$boundingBox2 = geometry.boundingBox,
2707
- min = _geometry$boundingBox2.min,
2708
- max = _geometry$boundingBox2.max;
2709
- var offset = new Three.Vector2(0 - min.x, 0 - min.y);
2710
- var range = new Three.Vector2(max.x - min.x, max.y - min.y);
2711
- geometry.faceVertexUvs[0] = geometry.faces.map(function (face) {
2712
- var v1 = geometry.vertices[face.a];
2713
- var v2 = geometry.vertices[face.b];
2714
- var v3 = geometry.vertices[face.c];
2715
- return [new Three.Vector2((v1.x + offset.x) / (range.x + h), (v1.y + offset.y) / (range.y + h)), new Three.Vector2((v2.x + offset.x) / (range.x + h), (v2.y + offset.y) / (range.y + h)), new Three.Vector2((v3.x + offset.x) / (range.x + h), (v3.y + offset.y) / (range.y + h))];
2716
- });
2717
- geometry.uvsNeedUpdate = true;
2718
- };
2719
-
2720
- /*
2721
- Remove specified type of 3d object easily
2722
- */
2723
- function deleteSpecifiedMeshObjects(type) {
2724
- var childLen = planData.plan.children.length;
2725
- var children = [];
2726
- for (var i = 0; i < childLen; i++) {
2727
- if (planData.plan.children[i].name != type) children.push(planData.plan.children[i]);
2728
- }
2729
- planData.plan.children = children;
2730
- }
2731
- function getMeshesFromScene() {
2732
- var childLen = planData.plan.children.length;
2733
- var children = [];
2734
- for (var i = 0; i < childLen; i++) {
2735
- if (planData.plan.children[i].type == _constants.OBJTYPE_MESH) children.push(planData.plan.children[i]);
2736
- }
2737
- return children;
2738
- }
2739
- function threedfabs(a) {
2740
- return a > 0 ? a : -a;
2741
- }
2742
- function getDistanceBetweenLineSegment(pos1, pos2, pos3, pos4) {
2743
- if (pos1.x == pos2.x && pos3.x == pos4.x) return pos3.x - pos1.x;else if (pos1.y == pos2.y && pos3.y == pos4.y) return pos3.y - pos1.y;else return -1;
2744
- }
2745
-
2746
- /**
2747
- * check to see if an item is suitable for the given doorStyle.
2748
- * @param _item
2749
- * @returns true if it's not suitable.
2750
- */
2751
- function showYelloBox(_item) {
2752
- var _doorStyle;
2753
- var doorStyle = _item === null || _item === void 0 ? void 0 : _item.doorStyle;
2754
-
2755
- // If doorStyle is an Immutable Map, convert to plain JS
2756
- if (doorStyle && typeof doorStyle.toJS === 'function') {
2757
- doorStyle = doorStyle.toJS();
2758
- }
2759
- var isItemCabinet = (_item === null || _item === void 0 ? void 0 : _item.category) === 'cabinet';
2760
- var cds = (_doorStyle = doorStyle) === null || _doorStyle === void 0 || (_doorStyle = _doorStyle.doorStyles) === null || _doorStyle === void 0 ? void 0 : _doorStyle.cds;
2761
-
2762
- // hasItemCDS: item is suitable if its itemID exists in cds
2763
- var hasItemCDS = isItemCabinet && Array.isArray(cds) ? cds.some(function (element) {
2764
- return element.itemID === _item.itemID;
2765
- }) : false;
2766
-
2767
- // return true if it's a cabinet but not suitable for the current doorStyle
2768
- return isItemCabinet && !hasItemCDS;
2769
- }
2770
- function isSimilar(a, b) {
2771
- if (threedfabs(a - b) <= 0.01) return 1;
2772
- return 0;
2773
- }
2774
- function sameSign(pos1, pos2, pos3) {
2775
- var ch1 = 0.0;
2776
- var ch2 = 1.0;
2777
- if (isSimilar(pos1.x, pos2.x) && isSimilar(pos1.x, pos3.x)) {
2778
- ch1 = (pos2.y - pos1.y) * (pos3.y - pos1.y);
2779
- } else if (isSimilar(pos1.y, pos2.y) && isSimilar(pos1.y, pos3.y)) {
2780
- ch1 = (pos2.x - pos1.x) * (pos3.x - pos1.x);
2781
- } else {
2782
- ch1 = (pos2.y - pos1.y) * 1.0 / (pos2.x - pos1.x);
2783
- ch2 = (pos3.y - pos1.y) * 1.0 / (pos3.x - pos1.x);
2784
- }
2785
- if (ch1 * ch2 >= 0) return 1;
2786
- return 0;
2787
- }
2788
- function getTotalDistance(pos, rect) {
2789
- var sum = 0;
2790
- for (var i = 0; i < rect.length; i++) {
2791
- sum += (0, _geometry2.verticesDistance)(pos, rect[i]);
2792
- }
2793
- return sum;
2794
- }
2795
- var applyTexture = function applyTexture(material, texture, length, height) {
2796
- if (texture) {
2797
- material.map = texture;
2798
- material.needsUpdate = true;
2799
- material.map.wrapS = Three.RepeatWrapping;
2800
- material.map.wrapT = Three.RepeatWrapping;
2801
- material.map.repeat.set(length * 0.01, height * 0.01);
2802
- if (texture.normal) {
2803
- material.normalMap = (0, _itemLoader.loadTexture)(texture.normal.uri);
2804
- material.normalScale = new Vector2(texture.normal.normalScaleX, texture.normal.normalScaleY);
2805
- material.normalMap.wrapS = Three.RepeatWrapping;
2806
- material.normalMap.wrapT = Three.RepeatWrapping;
2807
- material.normalMap.repeat.set(length * texture.normal.lengthRepeatScale, height * texture.normal.heightRepeatScale);
2808
- }
2809
- }
2810
- };
2811
-
2812
- /**
2813
- *
2814
- * @param {{is_corner:number,itemInfo:Item,layoutpos:string,pos:{x:number,y:number},rect:[{x:number,y:number}],
2815
- * rotRad:number,size:{depth:number,width:number,height:number}}} item
2816
- * @param {Layer} layer
2817
- * @param {{boundingBox:Box3,catalog:Catalog,grid: Object3D,plan: Object3D,sceneData: Scene,sceneGraph}} planData
2818
- * @param {Scene} scene
2819
- */
2820
- function createBacksplash(item, layer, planData, scene) {
2821
- var sceneGraph = planData.sceneGraph;
2822
- var selectedLayer = planData.sceneData.selectedLayer;
2823
- /**
2824
- * @type {[{backsplash,info:{rotY:number,posX:number,posY:number,posZ:number,splashWidth:number,splashHeight:number,splashDepth:number,id:string}}]}
2825
- */
2826
- var backsplashes = sceneGraph.layers[selectedLayer].backsplashes;
2827
- var backsplashApplied = layer.get('backsplashApplied');
2828
- var name = 'backsplash' + item.itemInfo.id;
2829
- var index = backsplashes.findIndex(function (item) {
2830
- return item.backsplash.name === name;
2831
- });
2832
- var itemToSave = {
2833
- backsplash: null,
2834
- info: {}
2835
- };
2836
- if (!item.itemInfo.backsplashVisible) {
2837
- // If backsplash is not visible
2838
- if (index >= 0) {
2839
- backsplashes.splice(index, 1); // Remove from backsplashes array
2840
- }
2841
- return;
2842
- }
2843
-
2844
- // Get wall items
2845
-
2846
- var i,
2847
- wallItems = [];
2848
- var allWallItems = _export.GeometryUtils.getAllItemSpecified(scene, planData.catalog, _constants.WALL_CABINET_LAYOUTPOS);
2849
- for (i = 0; i < allWallItems.others.length; i++) wallItems.push(allWallItems.others[i]);
2850
- if (allWallItems.cur) wallItems.push(allWallItems.cur);
2851
-
2852
- // Get information of item itself
2853
-
2854
- var altitude = item.itemInfo.properties.get('altitude').get('_length');
2855
- var altitudeUnit = item.itemInfo.properties.get('altitude').get('_unit') || 'cm';
2856
- altitude = (0, _convertUnits["default"])(altitude).from(altitudeUnit).to('cm');
2857
- var thickness = 1,
2858
- /** Height --- altitude */depth;
2859
-
2860
- // Calc wall & hole items info
2861
-
2862
- /**
2863
- * Wall & Hole items info
2864
- * @type {[{x:number,width:number,altitude:number}]}
2865
- */
2866
- var altItems = [],
2867
- flag = false;
2868
- wallItems.map(function (wallItem) {
2869
- var altitude = wallItem.itemInfo.properties.get('altitude').get('_length');
2870
- var altitudeUnit = wallItem.itemInfo.properties.get('altitude').get('_unit') || 'cm';
2871
- altitude = (0, _convertUnits["default"])(altitude).from(altitudeUnit).to('cm');
2872
- altItems.push({
2873
- x: wallItem.pos.x,
2874
- width: wallItem.size.width,
2875
- altitude: altitude
2876
- });
2877
- });
2878
- layer.holes.map(function (hole) {
2879
- var width = hole.properties.getIn(['width', 'length']);
2880
- var altitude = hole.properties.getIn(['altitude', 'length']);
2881
- altItems.push({
2882
- x: hole.x,
2883
- width: width,
2884
- altitude: altitude
2885
- });
2886
- });
2887
- if (altItems.length > 0) {
2888
- depth = altItems[0].altitude;
2889
- altItems.map(function (altItem) {
2890
- if (item.pos.x + item.size.width / 2 >= altItem.x - altItem.width / 2 && item.pos.x - item.size.width / 2 <= altItem.x + altItem.width / 2) {
2891
- if (depth >= altItem.altitude) {
2892
- depth = altItem.altitude;
2893
- flag = true;
2894
- }
2895
- }
2896
- });
2897
- }
2898
- if (!flag) depth = 52 * 2.54;
2899
-
2900
- // Get backsplash info
2901
-
2902
- var posX = item.pos.x - Math.sin(item.rotRad) * (item.size.depth / 2 - thickness);
2903
- var posY = altitude + depth / 2;
2904
- var posZ = -item.pos.y - Math.cos(item.rotRad) * (item.size.depth / 2 - thickness);
2905
- // TODO If you want apply backsplash to walls that's not vertical or horizontal ( slope )
2906
- // You must update this calcuating rotY
2907
- var rotY = item.rotRad;
2908
- var posX1 = item.pos.x + Math.cos(item.rotRad) * (item.size.width / 2 - thickness);
2909
- var posY1 = altitude + depth / 2;
2910
- var posZ1 = -item.pos.y - Math.sin(item.rotRad) * (item.size.width / 2 - thickness);
2911
- // TODO If you want apply backsplash to walls that's not vertical or horizontal ( slope )
2912
- // You must update this calcuating rotY
2913
- var rotY1 = item.rotRad + Math.PI / 2;
2914
- var splashWidth = item.size.width;
2915
- var splashHeight = depth;
2916
- var splashDepth = thickness;
2917
-
2918
- // Find mergeable other backsplashes
2919
-
2920
- var info, wholeWidth, /** Width factor */factor, distance, halfWidth, /** To get new center */centerFactor;
2921
- var _iterator = _createForOfIteratorHelper(backsplashes),
2922
- _step;
2923
- try {
2924
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
2925
- var back = _step.value;
2926
- info = back.info;
2927
- if (info.height === splashHeight && info.rotY === rotY) {
2928
- factor = Math.cos(rotY) || 1;
2929
- distance = Math.hypot(posX - info.posX, posZ - info.posZ) / factor;
2930
- halfWidth = (info.width + splashWidth) / 2;
2931
- if (Math.abs(distance - halfWidth) < 1e-2) {
2932
- // dispose `back`
2933
- if (info.id) {
2934
- deleteSpecifiedMeshObjects('backsplash' + info.id);
2935
- }
2936
-
2937
- // Get center position
2938
- wholeWidth = info.width + splashWidth;
2939
- centerFactor = info.width / wholeWidth;
2940
- posX = posX + centerFactor * (info.posX - posX);
2941
- posZ = posZ + centerFactor * (info.posZ - posZ);
2942
- splashWidth = wholeWidth;
2943
- }
2944
- }
2945
- }
2946
- } catch (err) {
2947
- _iterator.e(err);
2948
- } finally {
2949
- _iterator.f();
2950
- }
2951
- itemToSave.info.posX = posX;
2952
- itemToSave.info.posY = posY;
2953
- itemToSave.info.posZ = posZ;
2954
- itemToSave.info.rotY = rotY;
2955
- itemToSave.info.width = splashWidth;
2956
- itemToSave.info.height = splashHeight;
2957
- itemToSave.info.depth = splashDepth;
2958
-
2959
- // Make material
2960
-
2961
- var texture = layer.get('backsplash');
2962
- var areaMaterial = new Three.MeshStandardMaterial({
2963
- side: Three.DoubleSide,
2964
- metalness: texture.metalness,
2965
- roughness: texture.roughness
2966
- });
2967
- var interiortexture = (0, _itemLoader.loadTexture)(texture.uri);
2968
- applyTexture(areaMaterial, interiortexture, splashWidth * 1.5, splashHeight * 1.5);
2969
-
2970
- // Make geometry
2971
- var geometry = new Three.BoxGeometry(splashWidth, splashHeight, splashDepth);
2972
-
2973
- // Make backsplash mesh
2974
-
2975
- var backsplash = itemToSave.backsplash = new Three.Mesh(geometry, areaMaterial);
2976
- backsplash.position.x = itemToSave.info.posX;
2977
- backsplash.position.y = itemToSave.info.posY;
2978
- backsplash.position.z = itemToSave.info.posZ;
2979
- backsplash.rotation.y = itemToSave.info.rotY;
2980
- var allLines = _export.GeometryUtils.getAllLines(layer);
2981
- var allLineRects = _export.GeometryUtils.buildRectFromLines(layer, allLines);
2982
- if (item.is_corner && _export.GeometryUtils.isSnappedSideLine(item, allLineRects)) {
2983
- // corner cabinet item.itemInfo.getIn(["cabinet_category"]) === "Corner Base Cabinets"
2984
- var geometry1 = new Three.BoxGeometry(splashWidth, splashHeight, splashDepth);
2985
- // Make backsplash mesh
2986
- //console.log(sceneGraph.layers["layer-1"].lines);
2987
- var backsplash1 = itemToSave.backsplash = new Three.Mesh(geometry1, areaMaterial);
2988
- backsplash1.position.x = posX1;
2989
- backsplash1.position.y = posY1;
2990
- backsplash1.position.z = posZ1;
2991
- backsplash1.rotation.y = rotY1;
2992
- var newBacksplash = new _three.Group();
2993
- newBacksplash.add(backsplash);
2994
- newBacksplash.add(backsplash1);
2995
- backsplash = newBacksplash;
2996
- }
2997
- itemToSave.info.id = item.itemInfo.id;
2998
- deleteSpecifiedMeshObjects('backsplash' + item.itemInfo.id);
2999
- if (item.rotRad % (Math.PI / 2) === 0) planData.plan.add(backsplash);
3000
- backsplash.name = name;
3001
- backsplash.visible = item.itemInfo.get('backsplashVisible') && backsplashApplied && item.rotRad % (Math.PI / 2) === 0;
3002
-
3003
- // Save to scene graph
3004
-
3005
- if (index < 0) {
3006
- backsplashes.push(itemToSave);
3007
- } else {
3008
- (0, _threeMemoryCleaner.disposeObject)(backsplashes[index].backsplash);
3009
- backsplashes.splice(index, 1, itemToSave);
3010
- }
3011
- }
3012
-
3013
- /**
3014
- * @param {Map} item - Selected Item
3015
- */
3016
- function addMGMesh(molding, planData, layer) {
3017
- var _molding$molding;
3018
- var flag = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
3019
- var point = [];
3020
- var data = molding === null || molding === void 0 || (_molding$molding = molding.molding) === null || _molding$molding === void 0 ? void 0 : _molding$molding.data;
3021
- if ((0, _helper.isEmpty)(data)) return;
3022
- var paths = data.paths,
3023
- svg_width = data.svg_width,
3024
- svg_height = data.svg_height;
3025
- for (var i = 0; i < paths.length; i++) {
3026
- var path = paths[i];
3027
- for (var j = 0, jl = path.subPaths.length; j < jl; j++) {
3028
- var subPath = new Three.Path();
3029
- if (path.subPaths[j].hasOwnProperty('metadata')) {
3030
- subPath.fromJSON(path.subPaths[j]);
3031
- } else {
3032
- subPath = path.subPaths[j];
3033
- }
3034
- point = subPath.getPoints();
3035
- }
3036
- }
3037
- _addMGMesh(molding, planData, layer, point, svg_width, svg_height, flag);
3038
- }
3039
- var isBaseCabinet = function isBaseCabinet(item) {
3040
- return item.layoutpos === _constants.BASE_CABINET_LAYOUTPOS;
3041
- };
3042
-
3043
- /**
3044
- * @param data - Molding SVG Points
3045
- */
3046
-
3047
- // function assignUVs
3048
- function _addMGMesh(molding, planData, layer, data, svg_width, svg_height, flag) {
3049
- var child = molding.molding;
3050
- var material = getDoorStyleMaterial(molding.items, planData, layer, child.name);
3051
- if (!material) return;
3052
- material = new Three.MeshStandardMaterial(material);
3053
- // let texture = loadTexture(material.map.image.src);
3054
- // var material1 = new Three.MeshLambertMaterial( { map:texture } );
3055
- material.side = parseInt(Three.DoubleSide);
3056
- // let layoutType = molding.items[0].layoutpos;
3057
- // let visible = molding.items[0];
3058
- molding.pointGroups.forEach(function (pointGroup) {
3059
- var geometry = new Three.BufferGeometry();
3060
- var length = data.length; //point array
3061
- var temp_unit = child.height_unit;
3062
- if (temp_unit === 'inch') {
3063
- child.height = (0, _convertUnits["default"])(child.height).from('in').to('cm');
3064
- child.height_unit = 'cm';
3065
- }
3066
- temp_unit = child.width_unit;
3067
- if (temp_unit === 'inch') {
3068
- child.width = (0, _convertUnits["default"])(child.width).from('in').to('cm');
3069
- child.width_unit = 'cm';
3070
- }
3071
- temp_unit = child.length_unit;
3072
- if (temp_unit === 'inch') {
3073
- child.length = (0, _convertUnits["default"])(child.length).from('in').to('cm');
3074
- child.length_unit = 'cm';
3075
- }
3076
- geometry.needsUpdate = true;
3077
- geometry = moldingVertices(pointGroup, geometry, data, child, svg_width, svg_height, molding.pointGroups.length);
3078
- var total = geometry.attributes.position.count;
3079
- var len = geometry.attributes.position.count / length;
3080
- if (!_export.GeometryUtils.samePoints(pointGroup[0], pointGroup[pointGroup.length - 1])) {
3081
- len--;
3082
- }
3083
- for (var i = 0; i < len; i++) {
3084
- for (var j = i * length; j < (i + 1) * length - 1; j++) {
3085
- var f_a1 = j;
3086
- var f_b1 = (j + length) % total;
3087
- var f_c1 = (j + length + 1) % total;
3088
- var f_a2 = j;
3089
- var f_b2 = j + 1;
3090
- var f_c2 = f_c1;
3091
- var indices = [];
3092
- if (geometry.index !== null) {
3093
- indices = Array.from(geometry.index.array);
3094
- }
3095
- indices.push(f_a1, f_b1, f_c1, f_c2, f_b2, f_a2);
3096
- geometry.setIndex(indices);
3097
- }
3098
- }
3099
-
3100
- // handle molding texture
3101
- // (0, e[i]) ------------- (1, e[i])
3102
- // ----------- --- -----------
3103
- // ----------- --- -----------
3104
- // ----------- --- -----------
3105
- // ----------- --- -----------
3106
- // (0, e[i+1]) ------------- (1, e[i+1])
3107
- geometry = geometry.toNonIndexed();
3108
- var sumDistance = 0;
3109
- var sumDistanceArray = [0];
3110
- var finalDistance = 0;
3111
- var uvs_element_array = [];
3112
- for (var _i2 = 0; _i2 < data.length - 1; _i2++) {
3113
- var v1 = {
3114
- x: data[_i2].x,
3115
- y: data[_i2].y
3116
- };
3117
- var v2 = {
3118
- x: data[_i2 + 1].x,
3119
- y: data[_i2 + 1].y
3120
- };
3121
- var posDistance = (0, _geometry2.verticesDistance)(v1, v2);
3122
- sumDistance += posDistance;
3123
- if (_i2 === data.length - 2) finalDistance = sumDistance;
3124
- sumDistanceArray.push(sumDistance);
3125
- }
3126
- for (var _i3 = 0; _i3 < sumDistanceArray.length; _i3++) {
3127
- uvs_element_array.push(sumDistanceArray[_i3] / finalDistance);
3128
- }
3129
- var uvs = [];
3130
- var uvs_item = [];
3131
- for (var _i4 = 0; _i4 < uvs_element_array.length - 1; _i4++) {
3132
- uvs_item = [0, uvs_element_array[_i4], 1, uvs_element_array[_i4], 1, uvs_element_array[_i4 + 1], 1, uvs_element_array[_i4 + 1], 0, uvs_element_array[_i4 + 1], 0, uvs_element_array[_i4]];
3133
- uvs.push.apply(uvs, _toConsumableArray(uvs_item));
3134
- }
3135
- var all_uvs = [];
3136
- for (var _i5 = 0; _i5 < pointGroup.length; _i5++) {
3137
- all_uvs.push.apply(all_uvs, uvs);
3138
- }
3139
- geometry.setAttribute('uv', new Three.BufferAttribute(new Float32Array(all_uvs), 2));
3140
- geometry.computeVertexNormals();
3141
- var fbm3d = new Three.Mesh(geometry, material);
3142
- fbm3d.position.x = molding.pos.x;
3143
- fbm3d.position.z = -molding.pos.y;
3144
- fbm3d.position.y = molding.pos.z;
3145
- planData.plan.add(fbm3d);
3146
- fbm3d.name = child.name + molding.id + 'molding';
3147
- molding.meshes.push(fbm3d);
3148
- fbm3d.visible = true;
3149
- fbm3d.castShadow = true;
3150
- });
3151
- }
3152
- function deleteCTMesh(countertop, planData, layer) {
3153
- log('--deleteCTMesh', countertop);
3154
- if (countertop.items.length == 1) {
3155
- showItemCT(countertop.items[0], countertop, false, planData, layer);
3156
- } else {
3157
- var ct3d = countertop.ct3d;
3158
- if (ct3d) {
3159
- planData.plan.remove(ct3d);
3160
- (0, _threeMemoryCleaner.disposeObject)(ct3d);
3161
- }
3162
- }
3163
- }
3164
- function deleteMGMesh(molding, planData) {
3165
- var mode = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
3166
- // mode is 3D or elevation
3167
- molding.meshes.forEach(function (mesh) {
3168
- if ((0, _helper.isElevationView)(mode)) {
3169
- var _planData$plan$childr;
3170
- // when elevation mode, remove obj same as selected global molding_name in platnData.plan
3171
- (_planData$plan$childr = planData.plan.children) === null || _planData$plan$childr === void 0 || _planData$plan$childr.forEach(function (obj) {
3172
- var parent = obj.parent;
3173
- if (obj.name.match(mesh.name)) parent.remove(obj);
3174
- });
3175
- } else {
3176
- // when 3D mode
3177
- planData.plan.remove(mesh);
3178
- (0, _threeMemoryCleaner.disposeObject)(mesh);
3179
- }
3180
- });
3181
- molding.meshes = [];
3182
- }
3183
- function log() {
3184
- // console.log(...arguments);
3185
- }
3186
- function addCountertop(CTArray, addItem, planData, layer) {
3187
- log('addCountertop', _toConsumableArray(CTArray), addItem.id);
3188
- var tmp = planData;
3189
- tmp = tmp && tmp.catalog.getElement(addItem.type);
3190
- if (!tmp) tmp = planData.catalog.getElement((0, _utils.returnReplaceableDeepSearchType)(addItem.type));
3191
- var long_name = tmp && tmp.long_name;
3192
- if (long_name.includes('Sink ')) return;
3193
- var newCT = createCTFromItem(addItem, planData.sceneGraph.unit, planData.catalog);
3194
- var oldCT = null;
3195
- var extCT = false;
3196
- var extCTIndex = -1;
3197
- var tryMergeCT = function tryMergeCT() {
3198
- extCTIndex = CTArray.findIndex(function (el) {
3199
- extCT = tryAdjacent(newCT, el);
3200
- return extCT != false;
3201
- });
3202
- return extCTIndex >= 0;
3203
- };
3204
- while (tryMergeCT()) {
3205
- oldCT = CTArray.splice(extCTIndex, 1)[0];
3206
- deleteCTMesh(newCT, planData, layer);
3207
- deleteCTMesh(oldCT, planData, layer);
3208
- newCT = extCT;
3209
- }
3210
- addCTMesh(newCT, planData, layer);
3211
- CTArray.push(newCT);
3212
- }
3213
- function deleteCountertop(CTArray, delItem, planData, layer) {
3214
- if (delItem == undefined) {
3215
- return;
3216
- }
3217
- log('deleteCountertop', _toConsumableArray(CTArray), delItem.id);
3218
- var delCT = null;
3219
- var delItemIndex = -1;
3220
- var delCTIndex = CTArray.findIndex(function (el) {
3221
- delItemIndex = el.items.findIndex(function (el) {
3222
- return el.id == delItem.id;
3223
- });
3224
- return delItemIndex >= 0;
3225
- });
3226
- if (delCTIndex < 0) return;
3227
- delCT = CTArray.splice(delCTIndex, 1)[0];
3228
- if (delCT.items.length > 1) {
3229
- deleteCTMesh(delCT, planData, layer);
3230
- var ct1 = delCT.items.slice(0, delItemIndex);
3231
- var ct2 = delCT.items.slice(delItemIndex + 1);
3232
- [ct1, ct2].forEach(function (cts) {
3233
- if (cts.length == 0) return;
3234
- var newCT = createCTFromItems(cts, planData.sceneGraph.unit, planData.catalog);
3235
- CTArray.push(newCT);
3236
- addCTMesh(newCT, planData, layer);
3237
- });
3238
- }
3239
- }
3240
- function deleteAllMolding(MGArray, delItem, planData, oldSceneLayer, newSceneLayer) {
3241
- var tempMGArray = _toConsumableArray(MGArray);
3242
- if ((0, _helper.isEmpty)(delItem)) {
3243
- return tempMGArray;
3244
- }
3245
-
3246
- // remove the MGs which includes delItem
3247
- tempMGArray = tempMGArray.filter(function (mg) {
3248
- if (mg.items.some(function (it) {
3249
- return it.id === delItem.id;
3250
- })) {
3251
- deleteMGMesh(mg, planData, null);
3252
- return false;
3253
- } else return true;
3254
- });
3255
- if (newSceneLayer !== null) {
3256
- // find the snapped items with delItem
3257
- var snappedItems = [];
3258
- oldSceneLayer.items.toArray().forEach(function (oItem) {
3259
- if (oItem.category === 'cabinet' && oItem.id !== delItem.id && _export.MoldingUtils.isItemSnappedItem(delItem, oItem)) {
3260
- snappedItems.push(oItem);
3261
- }
3262
- });
3263
-
3264
- // update molding group array with snapped items in the new scene layer
3265
- for (var i = 0; i < snappedItems.length; i++) {
3266
- tempMGArray = updateMoldingGroupArray(tempMGArray, snappedItems[i], planData, newSceneLayer, null, null, 0);
3267
- }
3268
- }
3269
- return tempMGArray;
3270
- }
3271
- function addMolding(MGArray, addItem, planData, layer, itemActions, mode) {
3272
- if (addItem.selected && [_constants.MODE_DRAGGING_ITEM_3D, _constants.MODE_ROTATING_ITEM_3D].includes(mode)) return false;
3273
-
3274
- // If the item is not available for current doorStyle
3275
- if (showYelloBox(addItem))
3276
- // Do not add molding to that item
3277
- return MGArray;
3278
-
3279
- // if (
3280
- // !(
3281
- // (addItem.layoutpos === BASE_CABINET_LAYOUTPOS &&
3282
- // !GeometryUtils.isSnappedLine(
3283
- // MoldingUtils.getItemRect(addItem),
3284
- // GeometryUtils.buildRectFromLines(
3285
- // layer,
3286
- // GeometryUtils.getAllLines(layer)
3287
- // )
3288
- // )) ||
3289
- // ((addItem.layoutpos === WALL_CABINET_LAYOUTPOS ||
3290
- // addItem.layoutpos === TALL_CABINET_LAYOUTPOS) &&
3291
- // GeometryUtils.isSnappedLine(
3292
- // MoldingUtils.getItemRect(addItem),
3293
- // GeometryUtils.buildRectFromLines(
3294
- // layer,
3295
- // GeometryUtils.getAllLines(layer)
3296
- // )
3297
- // ))
3298
- // )
3299
- // )
3300
- // return false;
3301
-
3302
- // update the molding group array.
3303
- var temp_MGArray = updateMoldingGroupArray(MGArray, addItem, planData, layer, itemActions, mode, 0);
3304
- temp_MGArray.forEach(function (mg) {
3305
- var moldingMesh = mg.meshes[0];
3306
- if ((0, _helper.isElevationView)(mode)) {
3307
- if (!(0, _helper.isEmpty)(moldingMesh)) {
3308
- (0, _helper.replaceMeshesWithLineSegments)(moldingMesh);
3309
- }
3310
- }
3311
- });
3312
- return temp_MGArray;
3313
- }
3314
- function updateMoldingGroupArray(MGArray, selItem, planData, layer) {
3315
- var itemActions = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : null;
3316
- var mode = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : null;
3317
- var cnt = arguments.length > 6 ? arguments[6] : undefined;
3318
- try {
3319
- cnt++;
3320
- if (cnt > 100) return MGArray;
3321
- var temp_MGArray = _toConsumableArray(MGArray);
3322
- if ((0, _helper.isEmpty)(selItem)) return temp_MGArray;
3323
- var isEnableMolding = _export.MoldingUtils.isEnableItemForMolding(layer, selItem);
3324
- // Make a items group with selItem to create the new MG(molding group) array of selItem
3325
- var itemsForGroup = [selItem];
3326
- var i = 0;
3327
- while (i < itemsForGroup.length) {
3328
- layer.items.toArray().forEach(function (curItem) {
3329
- if (!itemsForGroup.some(function (it) {
3330
- return it.id === curItem.id;
3331
- }) && curItem.category === 'cabinet' && _export.MoldingUtils.isSameMoldingLayoutpos(curItem, itemsForGroup[i]) && _export.MoldingUtils.isItemSnappedItem(itemsForGroup[i], curItem)) {
3332
- itemsForGroup.push(curItem);
3333
- }
3334
- });
3335
- i++;
3336
- }
3337
-
3338
- // Create the new MG(molding group) array of selItem
3339
- var new_MGArray = _export.MoldingUtils.getAllMoldingGroups(layer, itemsForGroup);
3340
-
3341
- // get molding settings of update molding from adjoined item's molding
3342
- var changeMoldings = [];
3343
- new_MGArray.forEach(function (mg) {
3344
- if (mg.items.some(function (it) {
3345
- return it.id === selItem.id;
3346
- }) && mg.items.length > 1) {
3347
- var destItem = mg.items.find(function (it) {
3348
- return it.id !== selItem.id;
3349
- });
3350
- var destMolding = destItem.molding.find(function (md) {
3351
- return md.location_type === mg.location_type;
3352
- });
3353
-
3354
- // if current item has not destination molding then set it to the current molding
3355
- if (!(0, _helper.isEmpty)(destMolding) && !selItem.molding.some(function (md) {
3356
- return md.location_type === destMolding.location_type;
3357
- })) {
3358
- // only update with the same height cabinet or update the bottom molding setting
3359
- // itemActions.setMolding(destMoldings[i], false);
3360
- changeMoldings.push(destMolding);
3361
- } else if ((0, _helper.isEmpty)(destMolding) && selItem.molding.some(function (md) {
3362
- return md.location_type === mg.location_type;
3363
- })) {
3364
- // if current item has more molding than adjoined then remove theses moldings
3365
- // itemActions.setMolding(selItem.molding[i], false);
3366
- changeMoldings.push(selItem.molding.find(function (md) {
3367
- return md.location_type === mg.location_type;
3368
- }));
3369
- }
3370
- }
3371
- });
3372
- var regenMGItemList = [];
3373
- // An old MG and a new MG include a same item && The location_type of Two MGs are same
3374
- // Then replace the old MG with the new MG
3375
- temp_MGArray = temp_MGArray.filter(function (oldMG) {
3376
- var filteredNewMGList = new_MGArray.filter(function (mg) {
3377
- return mg.location_type === oldMG.location_type;
3378
- });
3379
- if ((0, _helper.isEmpty)(filteredNewMGList)) {
3380
- return true;
3381
- }
3382
- var _loop3 = function _loop3() {
3383
- var newMG = filteredNewMGList[k];
3384
- if (oldMG.items.some(function (it) {
3385
- return it.id === selItem.id;
3386
- })) {
3387
- // if current action is a seprating item from group, then have to regenerate the MGs of old snapped items
3388
- if (oldMG.items.filter(function (oIt) {
3389
- return !newMG.items.some(function (nIt) {
3390
- return nIt.id === oIt.id;
3391
- });
3392
- }).length > 0) {
3393
- oldMG.items.forEach(function (oIt) {
3394
- if (oIt.id !== selItem.id && !regenMGItemList.some(function (rIt) {
3395
- return rIt.id === oIt.id;
3396
- })) regenMGItemList.push(oIt);
3397
- });
3398
- }
3399
- }
3400
- // remove the old MG meshes
3401
- for (var _i6 = 0; _i6 < oldMG.items.length; _i6++) {
3402
- var oItem = oldMG.items[_i6];
3403
- for (var j = 0; j < newMG.items.length; j++) {
3404
- var nItem = newMG.items[j];
3405
- if (oItem.id === nItem.id) {
3406
- deleteMGMesh(oldMG, planData, mode);
3407
- // if (oldMG.items.length > 1) {
3408
- // // separating item from group
3409
- // oldMG.items.splice(i, 1);
3410
- // // update the old molding group info
3411
- // const mIdx = oldMG.items[0].molding.findIndex(
3412
- // m => m.location_type == oldMG.location_type
3413
- // );
3414
- // if (mIdx >= 0) {
3415
- // let molding = oldMG.items[0].molding[mIdx];
3416
- // oldMG = MoldingUtils.createMonldingGroup(
3417
- // oldMG,
3418
- // layer,
3419
- // molding,
3420
- // planData.catalog
3421
- // );
3422
- // addMGMesh(oldMG, planData, layer);
3423
- // }
3424
- // return true;
3425
- // }
3426
- return {
3427
- v: false
3428
- };
3429
- }
3430
- }
3431
- }
3432
- },
3433
- _ret;
3434
- for (var k = 0; k < filteredNewMGList.length; k++) {
3435
- _ret = _loop3();
3436
- if (_ret) return _ret.v;
3437
- }
3438
- return true;
3439
- });
3440
- if (changeMoldings.length === 0 && isEnableMolding) {
3441
- // refresh mesh of the updating molding groups
3442
- new_MGArray.forEach(function (mg, index) {
3443
- if (mg.items[0].molding.some(function (mol) {
3444
- return mol.location_type === mg.location_type;
3445
- })) {
3446
- var molding = mg.items[0].molding.filter(function (mol) {
3447
- return mol.location_type === mg.location_type;
3448
- })[0];
3449
- if (mg.molding === null || mg.molding.itemID !== mol.itemID || mg.lines === null || mg.points === null) {
3450
- if (mg.molding !== null && mg.molding.itemID !== molding.itemID) {
3451
- deleteMGMesh(mg, planData, mode);
3452
- }
3453
- mg = _export.MoldingUtils.createMonldingGroup(mg, layer, molding, planData.catalog);
3454
- }
3455
- if (!mg.meshes.length) {
3456
- addMGMesh(mg, planData, layer);
3457
- }
3458
- } else {
3459
- deleteMGMesh(mg, planData, mode);
3460
- }
3461
- });
3462
- }
3463
- new_MGArray.forEach(function (mg) {
3464
- return temp_MGArray.push(mg);
3465
- });
3466
- regenMGItemList.forEach(function (it) {
3467
- temp_MGArray = updateMoldingGroupArray(temp_MGArray, it, planData, layer, itemActions, mode, cnt);
3468
- });
3469
- if (changeMoldings.length > 0 && itemActions !== null) {
3470
- setTimeout(function () {
3471
- changeMoldings.forEach(function (chMolding) {
3472
- itemActions.setMolding(chMolding, false);
3473
- });
3474
- }, 200);
3475
- }
3476
- return temp_MGArray;
3477
- } catch (e) {
3478
- console.log('update molding catched :', e);
3479
- return MGArray;
3480
- }
3481
- }
3482
- function removeSelItemMesh(MGArray, selItem, planData, mode) {
3483
- if (selItem) {
3484
- if (!selItem.selected) {
3485
- return;
3486
- }
3487
- MGArray.forEach(function (mg) {
3488
- if (mg.items.some(function (it) {
3489
- return it.id === selItem.id;
3490
- })) deleteMGMesh(mg, planData, mode);
3491
- });
3492
- }
3493
- }
3494
-
3495
- /**
3496
- * Flip door handle
3497
- * @param item Scene state item ( redux )
3498
- * @param item3D Mesh
3499
- * @param {Boolean} flip Determines handle position.
3500
- * @note When `flip` is set
3501
- *
3502
- * `true`
3503
- * * Left side door - use left handle (LL)
3504
- * * Right side door - use right handle (RR)
3505
- *
3506
- * `false`
3507
- * * Left side door - use right handle (LR)
3508
- * * Right side door - use left handle (RL)
3509
- *
3510
- * And one-door-cabinet is the same case with the left door of two-door-cabinet
3511
- */
3512
- function updateDoorHandleMesh(_, item3D, flip) {
3513
- if (!item3D) {
3514
- console.error('Item mesh is undefined.');
3515
- return;
3516
- }
3517
-
3518
- /**
3519
- * Mesh whose name pass this regexp is a place holder for a door
3520
- * which is the parent or grand parent of a door mesh and its handles
3521
- */
3522
- var doorReg = /ph_.*[^(drawer)]_door(?:_(L|R))?(?:_[1-9])?$/;
3523
- var doorHandleReg = /ph_.*_door_.*_handle_(L|R)?(_[1-9])?/;
3524
- item3D.traverse(function (child) {
3525
- /**
3526
- * Hold the name of the place holder for door and its position
3527
- * @type {[string,"L"|"R"|undefined]}
3528
- */
3529
- var doorRegResult = doorReg.exec(child.name);
3530
- if (doorRegResult) {
3531
- // `child` is place holder for door mesh, and also grand parent of on[0]e
3532
- var phDoor = child.children[0];
3533
- if (!phDoor) {
3534
- return console.error('Group is no valid.');
3535
- }
3536
- var doorHandle = null;
3537
- var phRight = null;
3538
- var phLeft = null;
3539
-
3540
- // Find door_handle, ph_left, ph_right 3D item
3541
- phDoor.traverse(function (childOfDoor) {
3542
- /**
3543
- * @type {[string, "L"|"R"]}
3544
- */
3545
- var result = doorHandleReg.exec(childOfDoor.name);
3546
- if (result !== null) {
3547
- // `childOfDoor` is place holder for door handle
3548
-
3549
- switch (result[1]) {
3550
- case 'L':
3551
- phLeft = childOfDoor;
3552
- break;
3553
- case 'R':
3554
- phRight = childOfDoor;
3555
- break;
3556
- default:
3557
- console.error('Place holder type should be L or R.');
3558
- return;
3559
- }
3560
- if (childOfDoor.children.length !== 0) {
3561
- // It has a door handle
3562
- doorHandle = childOfDoor.children[0];
3563
- }
3564
- }
3565
- });
3566
-
3567
- // Change door handle position
3568
- if (doorHandle && phLeft && phRight) {
3569
- // Remove handles for re-addition
3570
- if (phLeft.children.length) {
3571
- phLeft.remove(doorHandle);
3572
- }
3573
- if (phRight.children.length) {
3574
- phRight.remove(doorHandle);
3575
- }
3576
- switch (doorRegResult[1]) {
3577
- case undefined: // Single door cabinet
3578
- case 'R':
3579
- // Right side door
3580
- (flip ? phRight : phLeft).add(doorHandle);
3581
- break;
3582
- case 'L':
3583
- // Left side door
3584
- (flip ? phLeft : phRight).add(doorHandle);
3585
- break;
3586
- }
3587
- } else {
3588
- console.error('door_handle or ph_left or ph_right is null.');
3589
- }
3590
- }
3591
- });
3592
- }
3593
- function addWarningBox(itemId, altitude, planData) {
3594
- deleteSpecifiedMeshObjects('WarningBox' + itemId);
3595
- var item3D = planData.sceneGraph.layers[planData.sceneData.selectedLayer].items[itemId];
3596
- if (item3D == undefined) return;
3597
- var altitudeLength = (0, _convertUnits["default"])(altitude).from('in').to('cm');
3598
- var sBounding = item3D.children[0].userData;
3599
- var width = sBounding.max.x - sBounding.min.x;
3600
- var height = sBounding.max.y - sBounding.min.y;
3601
- var depth = sBounding.max.z - sBounding.min.z;
3602
- var warnBoxGeom = new Three.BoxGeometry(width, height, depth);
3603
- var warnBoxObj = new Three.Mesh(warnBoxGeom, new Three.MeshBasicMaterial({
3604
- color: 0xff2200,
3605
- opacity: 0.8,
3606
- transparent: true,
3607
- blending: Three.MultiplyBlending
3608
- }));
3609
- var box = new Three.BoxHelper(warnBoxObj, 0x000000);
3610
- box.material.linewidth = 2;
3611
- box.material.depthTest = false;
3612
- box.renderOrder = 200;
3613
- warnBoxObj.add(box);
3614
- warnBoxObj.position.set(item3D.position.x, altitudeLength + item3D.position.y + height / 2, item3D.position.z);
3615
- warnBoxObj.rotation.set(item3D.rotation.x, item3D.rotation.y, item3D.rotation.z);
3616
- warnBoxObj.name = 'WarningBox' + itemId;
3617
- // planData.plan.add(warnBoxObj);
3618
- }
3619
- function checkCabinetOverlap(itemPos, itemRect, holeItems, planData) {
3620
- if (holeItems.length) {
3621
- var depth = itemRect.size.depth;
3622
- var i;
3623
- for (i = 0; i < holeItems.length; i++) {
3624
- var hole = holeItems[i];
3625
- var holeAlti = hole.altitude;
3626
- if (holeAlti >= depth) continue;
3627
- if (Math.abs(Math.sin(itemRect.rotRad)) === 1) {
3628
- if (itemPos.y + itemRect.size.width / 2 >= hole.y - hole.width / 2 && itemPos.y - itemRect.size.width / 2 <= hole.y + hole.width / 2 && (itemRect.rotRad == 0 || itemRect.rotRad == -Math.PI / 2 ? itemPos.x <= hole.x && itemPos.x + itemRect.size.height >= hole.x : itemPos.x >= hole.x && itemPos.x - itemRect.size.height <= hole.x)) break;
3629
- } else {
3630
- if (itemPos.x + itemRect.size.width / 2 >= hole.x - hole.width / 2 && itemPos.x - itemRect.size.width / 2 <= hole.x + hole.width / 2 && (itemRect.rotRad == 0 || itemRect.rotRad == -Math.PI / 2 ? itemPos.y <= hole.y && itemPos.y + itemRect.size.height >= hole.y : itemPos.y >= hole.y && itemPos.y - itemRect.size.height <= hole.y)) break;
3631
- }
3632
- }
3633
- if (i != holeItems.length) {
3634
- var altitude = itemRect.itemInfo.properties.get('altitude').get('_length');
3635
- var altitudeUnit = itemRect.itemInfo.properties.get('altitude').get('_unit') || 'cm';
3636
- altitude = (0, _convertUnits["default"])(altitude).from(altitudeUnit).to('cm');
3637
- addWarningBox(itemRect.itemInfo.id, altitude, planData);
3638
- }
3639
- }
3640
- }
3641
- //# sourceMappingURL=scene-creator.js.map