kitchen-simulator 11.0.0-react.18 → 11.0.0

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 (707) hide show
  1. package/es/AppContext.js +1 -4
  2. package/es/LiteKitchenConfigurator.js +67 -23
  3. package/es/LiteRenderer.js +15 -64
  4. package/es/actions/export.js +25 -12
  5. package/es/actions/items-actions.js +18 -2
  6. package/es/analytics/ga4.js +188 -0
  7. package/es/analytics/posthog.js +60 -0
  8. package/es/assets/Window.hdr +2100 -0
  9. package/es/assets/img/default/maple.jpg +0 -0
  10. package/es/assets/img/default/steel.jpg +0 -0
  11. package/es/assets/img/loading/loading.gif +0 -0
  12. package/es/catalog/cabinet/cabinet-assembly-order.js +36 -0
  13. package/es/catalog/catalog.js +0 -2
  14. package/es/catalog/factories/area-factory-3d.js +1 -5
  15. package/es/catalog/factories/wall-factory.js +1 -1
  16. package/es/catalog/holes/door-double/door_double.png +0 -0
  17. package/es/catalog/holes/door-panic/panicDoor.png +0 -0
  18. package/es/catalog/holes/door-panic-double/panicDoorDouble.png +0 -0
  19. package/es/catalog/holes/gate/gate.jpg +0 -0
  20. package/es/catalog/holes/window-clear/texture.png +0 -0
  21. package/es/catalog/holes/window-cross/texture.png +0 -0
  22. package/es/catalog/holes/window-double-hung/texture.png +0 -0
  23. package/es/catalog/holes/window-vertical/texture.png +0 -0
  24. package/es/catalog/utils/exporter.js +4 -0
  25. package/es/catalog/utils/item-loader.js +12 -25
  26. package/es/class/area.js +0 -1
  27. package/es/class/export.js +1 -3
  28. package/es/class/item.js +207 -89
  29. package/es/class/line.js +1 -3
  30. package/es/class/project.js +15 -19
  31. package/es/components/content.js +20 -6
  32. package/es/components/export.js +3 -5
  33. package/es/components/style/export.js +2 -28
  34. package/es/components/style/form-number-input.js +34 -43
  35. package/es/components/viewer2d/group.js +12 -7
  36. package/es/components/viewer2d/item.js +159 -168
  37. package/es/components/viewer2d/line.js +18 -51
  38. package/es/components/viewer2d/rulerX.js +3 -0
  39. package/es/components/viewer2d/rulerY.js +3 -0
  40. package/es/components/viewer2d/scene.js +67 -47
  41. package/es/components/viewer2d/state.js +1 -1
  42. package/es/components/viewer2d/utils.js +0 -6
  43. package/es/components/viewer2d/viewer2d.js +566 -508
  44. package/es/components/viewer3d/front3D.js +1 -2
  45. package/es/components/viewer3d/pointer-lock-navigation.js +0 -90
  46. package/es/components/viewer3d/ruler-utils/layer3D.js +2 -2
  47. package/es/components/viewer3d/scene-creator.js +113 -120
  48. package/es/components/viewer3d/three-memory-cleaner.js +0 -14
  49. package/es/components/viewer3d/viewer3d-first-person.js +132 -134
  50. package/es/components/viewer3d/viewer3d.js +40 -28
  51. package/es/constants/catalog/skinPanel.js +9 -0
  52. package/es/constants.js +19 -8
  53. package/es/{WorkSpaceOriginal.js → devLiteRenderer.js} +241 -173
  54. package/es/events/external/handleExternalEvent.js +141 -0
  55. package/es/events/external/handleExternalEvent.util.js +1099 -0
  56. package/es/events/external/handlers.addItem.js +47 -0
  57. package/es/events/external/handlers.changeDoorStyle.js +140 -0
  58. package/es/events/external/handlers.elementOps.js +8 -0
  59. package/es/events/external/handlers.finishing.js +26 -0
  60. package/es/events/external/handlers.hole.js +4 -0
  61. package/es/events/external/handlers.loadProject.js +128 -0
  62. package/es/events/external/handlers.molding.js +24 -0
  63. package/es/events/external/handlers.projectLifecycle.js +11 -0
  64. package/es/events/external/handlers.projectSettings.js +32 -0
  65. package/es/events/external/handlers.replaceCabinet.js +41 -0
  66. package/es/events/external/handlers.roomShape.js +8 -0
  67. package/es/events/external/handlers.syncScene.js +21 -0
  68. package/es/events/external/handlers.updateSelectedElements.js +11 -0
  69. package/es/events/external/handlers.viewMode.js +11 -0
  70. package/es/events/external/handlers.viewerNavigation.js +108 -0
  71. package/es/events/external/handlers.wall.js +7 -0
  72. package/es/index.js +36 -76
  73. package/es/mappings/external-events/mapExternalEventPayload.js +28 -0
  74. package/es/mappings/external-events/mappers/addItemMapper.js +97 -0
  75. package/es/mappings/external-events/mappers/ccdfMapper.js +100 -0
  76. package/es/mappings/external-events/mappers/ccdfToCDSMapper.js +49 -0
  77. package/es/mappings/external-events/mappers/changeDoorStyleMapper.js +37 -0
  78. package/es/mappings/external-events/mappers/loadProjectMapper.js +62 -0
  79. package/es/mappings/holesToCatalog.js +139 -0
  80. package/es/models.js +16 -1
  81. package/es/plugins/keyboard.js +1 -1
  82. package/es/reducers/export.js +2 -4
  83. package/es/reducers/items-reducer.js +4 -2
  84. package/es/reducers/project-reducer.js +1 -1
  85. package/es/reducers/reducer.js +2 -3
  86. package/es/reducers/viewer2d-reducer.js +0 -2
  87. package/es/shared/domain/cabinet-warning.js +15 -0
  88. package/es/shared/objects/immutable.js +3 -0
  89. package/es/utils/geometry.js +418 -95
  90. package/es/utils/helper.js +41 -35
  91. package/es/utils/history.js +2 -2
  92. package/es/utils/molding.js +12 -241
  93. package/es/utils/name-generator.js +0 -3
  94. package/es/utils/skinPanelEngine.js +522 -0
  95. package/lib/@history.js +11 -0
  96. package/lib/AppContext.js +11 -0
  97. package/lib/LiteKitchenConfigurator.js +527 -0
  98. package/lib/LiteRenderer.js +323 -0
  99. package/lib/actions/area-actions.js +21 -0
  100. package/lib/actions/export.js +36 -0
  101. package/lib/actions/groups-actions.js +107 -0
  102. package/lib/actions/holes-actions.js +140 -0
  103. package/lib/actions/items-actions.js +383 -0
  104. package/lib/actions/lines-actions.js +98 -0
  105. package/lib/actions/project-actions.js +351 -0
  106. package/lib/actions/scene-actions.js +43 -0
  107. package/lib/actions/vertices-actions.js +35 -0
  108. package/lib/actions/viewer2d-actions.js +73 -0
  109. package/lib/actions/viewer3d-actions.js +32 -0
  110. package/lib/analytics/ga4.js +194 -0
  111. package/lib/analytics/posthog.js +68 -0
  112. package/lib/assets/Window.hdr +2100 -0
  113. package/lib/assets/brown_photostudio_02_1k.hdr +0 -0
  114. package/lib/assets/fonts/Rene Bieder Milliard Black Italic.woff +0 -0
  115. package/lib/assets/fonts/Rene Bieder Milliard Black.woff +0 -0
  116. package/lib/assets/fonts/Rene Bieder Milliard Bold Italic.woff +0 -0
  117. package/lib/assets/fonts/Rene Bieder Milliard Bold.woff +0 -0
  118. package/lib/assets/fonts/Rene Bieder Milliard Book Italic.woff +0 -0
  119. package/lib/assets/fonts/Rene Bieder Milliard Book.woff +0 -0
  120. package/lib/assets/fonts/Rene Bieder Milliard ExtraBold Italic.woff +0 -0
  121. package/lib/assets/fonts/Rene Bieder Milliard ExtraBold.woff +0 -0
  122. package/lib/assets/fonts/Rene Bieder Milliard ExtraLight Italic.woff +0 -0
  123. package/lib/assets/fonts/Rene Bieder Milliard ExtraLight.woff +0 -0
  124. package/lib/assets/fonts/Rene Bieder Milliard Hairline Italic.woff +0 -0
  125. package/lib/assets/fonts/Rene Bieder Milliard Hairline.woff +0 -0
  126. package/lib/assets/fonts/Rene Bieder Milliard Heavy Italic.woff +0 -0
  127. package/lib/assets/fonts/Rene Bieder Milliard Heavy.woff +0 -0
  128. package/lib/assets/fonts/Rene Bieder Milliard Light Italic.woff +0 -0
  129. package/lib/assets/fonts/Rene Bieder Milliard Light.woff +0 -0
  130. package/lib/assets/fonts/Rene Bieder Milliard Medium Italic.woff +0 -0
  131. package/lib/assets/fonts/Rene Bieder Milliard Medium.woff +0 -0
  132. package/lib/assets/fonts/Rene Bieder Milliard SemiBold Italic.woff +0 -0
  133. package/lib/assets/fonts/Rene Bieder Milliard SemiBold.woff +0 -0
  134. package/lib/assets/fonts/Rene Bieder Milliard Thin Italic.woff +0 -0
  135. package/lib/assets/fonts/Rene Bieder Milliard Thin.woff +0 -0
  136. package/lib/assets/fonts/style.css +177 -0
  137. package/lib/assets/gltf/door_closet.gltf +1 -0
  138. package/lib/assets/gltf/door_exterior.gltf +1 -0
  139. package/lib/assets/gltf/door_interior.gltf +1 -0
  140. package/lib/assets/gltf/door_sliding.gltf +1 -0
  141. package/lib/assets/gltf/doorway_framed.bin +0 -0
  142. package/lib/assets/gltf/doorway_framed.fbx +0 -0
  143. package/lib/assets/gltf/doorway_framed.gltf +1 -0
  144. package/lib/assets/gltf/window_clear.bin +0 -0
  145. package/lib/assets/gltf/window_clear.fbx +0 -0
  146. package/lib/assets/gltf/window_clear.gltf +1 -0
  147. package/lib/assets/gltf/window_cross.bin +0 -0
  148. package/lib/assets/gltf/window_cross.fbx +0 -0
  149. package/lib/assets/gltf/window_cross.gltf +1 -0
  150. package/lib/assets/gltf/window_double_hung.bin +0 -0
  151. package/lib/assets/gltf/window_double_hung.fbx +0 -0
  152. package/lib/assets/gltf/window_double_hung.gltf +1 -0
  153. package/lib/assets/gltf/window_vertical.bin +0 -0
  154. package/lib/assets/gltf/window_vertical.fbx +0 -0
  155. package/lib/assets/gltf/window_vertical.gltf +1 -0
  156. package/lib/assets/img/TKC_thumbnail.png +0 -0
  157. package/lib/assets/img/Toggle.png +0 -0
  158. package/lib/assets/img/default/maple.jpg +0 -0
  159. package/lib/assets/img/default/steel.jpg +0 -0
  160. package/lib/assets/img/loading/loading.gif +0 -0
  161. package/lib/assets/img/loading/loading_1.svg +11 -0
  162. package/lib/assets/img/loading_large.gif +0 -0
  163. package/lib/assets/img/png/door/closet.png +0 -0
  164. package/lib/assets/img/png/door/doorwaysframed.png +0 -0
  165. package/lib/assets/img/png/door/doorwaysframeles.png +0 -0
  166. package/lib/assets/img/png/door/doorwaysframeless.png +0 -0
  167. package/lib/assets/img/png/door/exterior.png +0 -0
  168. package/lib/assets/img/png/door/interior.png +0 -0
  169. package/lib/assets/img/png/door/sliding.png +0 -0
  170. package/lib/assets/img/png/helper/outcome.png +0 -0
  171. package/lib/assets/img/project_img.png +0 -0
  172. package/lib/assets/img/rta/rta_logo_box_blue.jpg +0 -0
  173. package/lib/assets/img/rta/rta_logo_box_blue_ico.jpg +0 -0
  174. package/lib/assets/img/rta/rta_logo_box_blue_ico.svg +55 -0
  175. package/lib/assets/img/rta/rta_logo_box_darkGray.jpg +0 -0
  176. package/lib/assets/img/rta/rta_logo_box_lightblue.png +0 -0
  177. package/lib/assets/img/rta/rta_logo_box_lightmaroon.png +0 -0
  178. package/lib/assets/img/rta/rta_logo_box_maroon.png +0 -0
  179. package/lib/assets/img/rta/rta_logo_box_white.png +0 -0
  180. package/lib/assets/img/rta_menu.png +0 -0
  181. package/lib/assets/img/step2.jpg +0 -0
  182. package/lib/assets/img/step3.jpg +0 -0
  183. package/lib/assets/img/step4.jpg +0 -0
  184. package/lib/assets/img/step5.jpg +0 -0
  185. package/lib/assets/img/step6.jpg +0 -0
  186. package/lib/assets/img/step7.jpg +0 -0
  187. package/lib/assets/img/step8.jpg +0 -0
  188. package/lib/assets/img/svg/2d_delete_object.svg +33 -0
  189. package/lib/assets/img/svg/2d_delete_object1.svg +33 -0
  190. package/lib/assets/img/svg/2d_lock_object.svg +33 -0
  191. package/lib/assets/img/svg/3d_item_move.svg +106 -0
  192. package/lib/assets/img/svg/3d_item_rotation.svg +76 -0
  193. package/lib/assets/img/svg/3d_item_warning_edit.svg +77 -0
  194. package/lib/assets/img/svg/3d_item_warning_info.svg +81 -0
  195. package/lib/assets/img/svg/accessories.svg +4 -0
  196. package/lib/assets/img/svg/angle_icon.svg +39 -0
  197. package/lib/assets/img/svg/blank_div.svg +14 -0
  198. package/lib/assets/img/svg/bottombar/2d3d_button.svg +3 -0
  199. package/lib/assets/img/svg/bottombar/2d3d_button_active.svg +3 -0
  200. package/lib/assets/img/svg/bottombar/2d3d_toggle.svg +4 -0
  201. package/lib/assets/img/svg/bottombar/2d3d_toggle_active.svg +4 -0
  202. package/lib/assets/img/svg/bottombar/arrow-down.svg +3 -0
  203. package/lib/assets/img/svg/bottombar/arrow-left.svg +3 -0
  204. package/lib/assets/img/svg/bottombar/arrow-minus.svg +3 -0
  205. package/lib/assets/img/svg/bottombar/arrow-plus.svg +11 -0
  206. package/lib/assets/img/svg/bottombar/arrow-right.svg +3 -0
  207. package/lib/assets/img/svg/bottombar/arrow-up.svg +3 -0
  208. package/lib/assets/img/svg/bottombar/collapse.svg +3 -0
  209. package/lib/assets/img/svg/bottombar/elevation-back.svg +6 -0
  210. package/lib/assets/img/svg/bottombar/elevation-front.svg +6 -0
  211. package/lib/assets/img/svg/bottombar/elevation-left.svg +6 -0
  212. package/lib/assets/img/svg/bottombar/elevation-right.svg +7 -0
  213. package/lib/assets/img/svg/bottombar/elevation.svg +13 -0
  214. package/lib/assets/img/svg/bottombar/expand.svg +3 -0
  215. package/lib/assets/img/svg/bottombar/help.svg +72 -0
  216. package/lib/assets/img/svg/bottombar/incm_toggle.svg +39 -0
  217. package/lib/assets/img/svg/bottombar/pan_1.svg +57 -0
  218. package/lib/assets/img/svg/bottombar/pan_2.svg +27 -0
  219. package/lib/assets/img/svg/bottombar/pan_3.svg +27 -0
  220. package/lib/assets/img/svg/bottombar/pan_4.svg +27 -0
  221. package/lib/assets/img/svg/bottombar/pan_5.svg +27 -0
  222. package/lib/assets/img/svg/bottombar/settings.svg +23 -0
  223. package/lib/assets/img/svg/bottombar/spin-down.svg +76 -0
  224. package/lib/assets/img/svg/bottombar/spin-left.svg +75 -0
  225. package/lib/assets/img/svg/bottombar/spin-right.svg +75 -0
  226. package/lib/assets/img/svg/bottombar/spin-up.svg +76 -0
  227. package/lib/assets/img/svg/bottombar/spin_1.svg +48 -0
  228. package/lib/assets/img/svg/bottombar/spin_2.svg +31 -0
  229. package/lib/assets/img/svg/bottombar/spin_3.svg +31 -0
  230. package/lib/assets/img/svg/bottombar/spin_4.svg +31 -0
  231. package/lib/assets/img/svg/bottombar/spin_5.svg +31 -0
  232. package/lib/assets/img/svg/bottombar/zoomin.svg +29 -0
  233. package/lib/assets/img/svg/bottombar/zoomout.svg +26 -0
  234. package/lib/assets/img/svg/check.svg +10 -0
  235. package/lib/assets/img/svg/close.svg +11 -0
  236. package/lib/assets/img/svg/color/Black.svg +3 -0
  237. package/lib/assets/img/svg/color/Blue.svg +3 -0
  238. package/lib/assets/img/svg/color/Cream.svg +3 -0
  239. package/lib/assets/img/svg/color/Gray.svg +3 -0
  240. package/lib/assets/img/svg/color/Green.svg +3 -0
  241. package/lib/assets/img/svg/color/White.svg +3 -0
  242. package/lib/assets/img/svg/color/White.svg.bak +3 -0
  243. package/lib/assets/img/svg/color/stone2.jpg +0 -0
  244. package/lib/assets/img/svg/color/wood2.jpg +0 -0
  245. package/lib/assets/img/svg/copy.svg +11 -0
  246. package/lib/assets/img/svg/delete.svg +3 -0
  247. package/lib/assets/img/svg/detail.svg +77 -0
  248. package/lib/assets/img/svg/disclaimer/background.svg +758 -0
  249. package/lib/assets/img/svg/disclaimer/logo-dots.svg +11 -0
  250. package/lib/assets/img/svg/door/Closet.svg +11 -0
  251. package/lib/assets/img/svg/door/Exterior.svg +5 -0
  252. package/lib/assets/img/svg/door/Framed_dorway.svg +5 -0
  253. package/lib/assets/img/svg/door/Frameless_dorway.svg +5 -0
  254. package/lib/assets/img/svg/door/Interior.svg +7 -0
  255. package/lib/assets/img/svg/door/Sliding.svg +5 -0
  256. package/lib/assets/img/svg/doors_closet.svg +47 -0
  257. package/lib/assets/img/svg/doors_exterior.svg +25 -0
  258. package/lib/assets/img/svg/doors_interior.svg +29 -0
  259. package/lib/assets/img/svg/doors_patio.svg +26 -0
  260. package/lib/assets/img/svg/duplicate.svg +11 -0
  261. package/lib/assets/img/svg/duplicate_object_left.svg +32 -0
  262. package/lib/assets/img/svg/duplicate_object_right.svg +32 -0
  263. package/lib/assets/img/svg/filtersActive.svg +19 -0
  264. package/lib/assets/img/svg/firstsetting/L.svg +3 -0
  265. package/lib/assets/img/svg/firstsetting/L2.svg +3 -0
  266. package/lib/assets/img/svg/firstsetting/Open.svg +3 -0
  267. package/lib/assets/img/svg/firstsetting/Square.svg +3 -0
  268. package/lib/assets/img/svg/firstsetting/bar-active.svg +9 -0
  269. package/lib/assets/img/svg/firstsetting/bar-normal.svg +3 -0
  270. package/lib/assets/img/svg/firstsetting/bullet-current.svg +3 -0
  271. package/lib/assets/img/svg/firstsetting/bullet-done.svg +3 -0
  272. package/lib/assets/img/svg/firstsetting/bullet-not-done.svg +3 -0
  273. package/lib/assets/img/svg/firstsetting/check-active.svg +3 -0
  274. package/lib/assets/img/svg/firstsetting/check-normal.svg +3 -0
  275. package/lib/assets/img/svg/firstsetting/pencil.svg +11 -0
  276. package/lib/assets/img/svg/green_checkmark.svg +27 -0
  277. package/lib/assets/img/svg/headerbar/assist.svg +3 -0
  278. package/lib/assets/img/svg/headerbar/cart.svg +3 -0
  279. package/lib/assets/img/svg/headerbar/check.svg +10 -0
  280. package/lib/assets/img/svg/headerbar/consult_designer.svg +45 -0
  281. package/lib/assets/img/svg/headerbar/edit_name.svg +26 -0
  282. package/lib/assets/img/svg/headerbar/file-dollar.svg +13 -0
  283. package/lib/assets/img/svg/headerbar/hamburger_menu.svg +32 -0
  284. package/lib/assets/img/svg/headerbar/plus.svg +11 -0
  285. package/lib/assets/img/svg/headerbar/review_quote.svg +44 -0
  286. package/lib/assets/img/svg/headerbar/ruler-measure.svg +11 -0
  287. package/lib/assets/img/svg/headerbar/save.svg +3 -0
  288. package/lib/assets/img/svg/headerbar/setting.svg +75 -0
  289. package/lib/assets/img/svg/help/check.svg +10 -0
  290. package/lib/assets/img/svg/help/search.svg +76 -0
  291. package/lib/assets/img/svg/intro/1-start-with-floorplan-whole.svg +27 -0
  292. package/lib/assets/img/svg/intro/1-start-with-floorplan.svg +26 -0
  293. package/lib/assets/img/svg/intro/2-start-from-scratch-whole.svg +28 -0
  294. package/lib/assets/img/svg/intro/2-start-from-scratch.svg +27 -0
  295. package/lib/assets/img/svg/intro/3-retrieve-project-whole.svg +19 -0
  296. package/lib/assets/img/svg/intro/3-retrieve-project.svg +18 -0
  297. package/lib/assets/img/svg/invert.svg +127 -0
  298. package/lib/assets/img/svg/lefttoolbar/appliance-active.svg +13 -0
  299. package/lib/assets/img/svg/lefttoolbar/appliance.svg +13 -0
  300. package/lib/assets/img/svg/lefttoolbar/cabinet-active.svg +10 -0
  301. package/lib/assets/img/svg/lefttoolbar/cabinet-category.svg +3 -0
  302. package/lib/assets/img/svg/lefttoolbar/cabinet-one.svg +3 -0
  303. package/lib/assets/img/svg/lefttoolbar/cabinet.svg +10 -0
  304. package/lib/assets/img/svg/lefttoolbar/disigner_assistance.svg +89 -0
  305. package/lib/assets/img/svg/lefttoolbar/door-style-active.svg +20 -0
  306. package/lib/assets/img/svg/lefttoolbar/door-style.svg +20 -0
  307. package/lib/assets/img/svg/lefttoolbar/door.svg +12 -0
  308. package/lib/assets/img/svg/lefttoolbar/error_icon.svg +81 -0
  309. package/lib/assets/img/svg/lefttoolbar/finishing-active.svg +13 -0
  310. package/lib/assets/img/svg/lefttoolbar/finishing.svg +13 -0
  311. package/lib/assets/img/svg/lefttoolbar/reviewforquote-active.svg +86 -0
  312. package/lib/assets/img/svg/lefttoolbar/reviewforquote.svg +12 -0
  313. package/lib/assets/img/svg/lefttoolbar/room-shape-L.svg +3 -0
  314. package/lib/assets/img/svg/lefttoolbar/room-shape-active.svg +18 -0
  315. package/lib/assets/img/svg/lefttoolbar/room-shape-custom.svg +12 -0
  316. package/lib/assets/img/svg/lefttoolbar/room-shape-irregular.svg +3 -0
  317. package/lib/assets/img/svg/lefttoolbar/room-shape-open.svg +3 -0
  318. package/lib/assets/img/svg/lefttoolbar/room-shape-square.svg +3 -0
  319. package/lib/assets/img/svg/lefttoolbar/room-shape.svg +18 -0
  320. package/lib/assets/img/svg/lefttoolbar/search.svg +76 -0
  321. package/lib/assets/img/svg/lefttoolbar/view_more.svg +86 -0
  322. package/lib/assets/img/svg/lefttoolbar/warning_icon.svg +81 -0
  323. package/lib/assets/img/svg/lefttoolbar/window.svg +12 -0
  324. package/lib/assets/img/svg/logo.svg +11 -0
  325. package/lib/assets/img/svg/logo_with_text.svg +25 -0
  326. package/lib/assets/img/svg/menubar/login.svg +84 -0
  327. package/lib/assets/img/svg/menubar/my_projects.svg +85 -0
  328. package/lib/assets/img/svg/menubar/new_project.svg +110 -0
  329. package/lib/assets/img/svg/menubar/save_project.svg +84 -0
  330. package/lib/assets/img/svg/options.svg +3 -0
  331. package/lib/assets/img/svg/positioning.svg +3 -0
  332. package/lib/assets/img/svg/rotate.png +0 -0
  333. package/lib/assets/img/svg/rotate.svg +17 -0
  334. package/lib/assets/img/svg/rotate_object_clockwise.svg +26 -0
  335. package/lib/assets/img/svg/rotate_object_counterclockwise.svg +26 -0
  336. package/lib/assets/img/svg/toggleFilters.svg +19 -0
  337. package/lib/assets/img/svg/toolbar/add_appliances_active.svg +64 -0
  338. package/lib/assets/img/svg/toolbar/add_appliances_inactive.svg +52 -0
  339. package/lib/assets/img/svg/toolbar/add_button.svg +36 -0
  340. package/lib/assets/img/svg/toolbar/add_cabinets_active.svg +59 -0
  341. package/lib/assets/img/svg/toolbar/add_cabinets_inactive.svg +49 -0
  342. package/lib/assets/img/svg/toolbar/add_items_doors.svg +25 -0
  343. package/lib/assets/img/svg/toolbar/add_items_doorways.svg +24 -0
  344. package/lib/assets/img/svg/toolbar/add_items_refrigerator.svg +32 -0
  345. package/lib/assets/img/svg/toolbar/add_items_windows.svg +28 -0
  346. package/lib/assets/img/svg/toolbar/apply_button.svg +38 -0
  347. package/lib/assets/img/svg/toolbar/arrow-plus.svg +11 -0
  348. package/lib/assets/img/svg/toolbar/backsplash.svg +8 -0
  349. package/lib/assets/img/svg/toolbar/cancel_button.svg +37 -0
  350. package/lib/assets/img/svg/toolbar/consult_a_designer_button.svg +47 -0
  351. package/lib/assets/img/svg/toolbar/countertop.svg +7 -0
  352. package/lib/assets/img/svg/toolbar/dcm.png +0 -0
  353. package/lib/assets/img/svg/toolbar/dcm_off.svg +12 -0
  354. package/lib/assets/img/svg/toolbar/dcm_on.svg +474 -0
  355. package/lib/assets/img/svg/toolbar/delete_button.svg +37 -0
  356. package/lib/assets/img/svg/toolbar/download.svg +77 -0
  357. package/lib/assets/img/svg/toolbar/draw_custom_floor.svg +31 -0
  358. package/lib/assets/img/svg/toolbar/edit_button.svg +75 -0
  359. package/lib/assets/img/svg/toolbar/email_quote_button.svg +44 -0
  360. package/lib/assets/img/svg/toolbar/fbm.png +0 -0
  361. package/lib/assets/img/svg/toolbar/finishing_touches_active.svg +54 -0
  362. package/lib/assets/img/svg/toolbar/finishing_touches_inactive.svg +42 -0
  363. package/lib/assets/img/svg/toolbar/floorstyle.svg +9 -0
  364. package/lib/assets/img/svg/toolbar/fmb.png +0 -0
  365. package/lib/assets/img/svg/toolbar/fmb_off.svg +12 -0
  366. package/lib/assets/img/svg/toolbar/fmb_on.svg +489 -0
  367. package/lib/assets/img/svg/toolbar/furnishings_icon.svg +6 -0
  368. package/lib/assets/img/svg/toolbar/get_started_button.svg +41 -0
  369. package/lib/assets/img/svg/toolbar/handles.svg +5 -0
  370. package/lib/assets/img/svg/toolbar/lighting.svg +7 -0
  371. package/lib/assets/img/svg/toolbar/lrm.png +0 -0
  372. package/lib/assets/img/svg/toolbar/lrm_off.svg +12 -0
  373. package/lib/assets/img/svg/toolbar/lrm_on.svg +470 -0
  374. package/lib/assets/img/svg/toolbar/make_floorplan_active.svg +66 -0
  375. package/lib/assets/img/svg/toolbar/make_floorplan_inactive.svg +52 -0
  376. package/lib/assets/img/svg/toolbar/predefined_room_l_shaped.svg +20 -0
  377. package/lib/assets/img/svg/toolbar/predefined_room_layout.svg +20 -0
  378. package/lib/assets/img/svg/toolbar/predefined_room_long_narrow.svg +20 -0
  379. package/lib/assets/img/svg/toolbar/predefined_room_open_l_shape.svg +20 -0
  380. package/lib/assets/img/svg/toolbar/predefined_room_open_pentagon.svg +20 -0
  381. package/lib/assets/img/svg/toolbar/predefined_room_open_rectangle.svg +20 -0
  382. package/lib/assets/img/svg/toolbar/predefined_room_open_rectangle_2.svg +20 -0
  383. package/lib/assets/img/svg/toolbar/predefined_room_pentagon.svg +20 -0
  384. package/lib/assets/img/svg/toolbar/predefined_room_rectangle.svg +20 -0
  385. package/lib/assets/img/svg/toolbar/predefined_room_rectangle_with_alcove.svg +20 -0
  386. package/lib/assets/img/svg/toolbar/redo_button.svg +75 -0
  387. package/lib/assets/img/svg/toolbar/redo_button1.svg +75 -0
  388. package/lib/assets/img/svg/toolbar/review_quote_active.svg +14 -0
  389. package/lib/assets/img/svg/toolbar/review_quote_inactive.svg +44 -0
  390. package/lib/assets/img/svg/toolbar/save_project_button.svg +44 -0
  391. package/lib/assets/img/svg/toolbar/select_doorstyle_active.svg +67 -0
  392. package/lib/assets/img/svg/toolbar/select_doorstyle_inactive.svg +57 -0
  393. package/lib/assets/img/svg/toolbar/shopping-cart.svg +13 -0
  394. package/lib/assets/img/svg/toolbar/style_change_button.svg +47 -0
  395. package/lib/assets/img/svg/toolbar/take_picture.svg +75 -0
  396. package/lib/assets/img/svg/toolbar/undo_button.svg +76 -0
  397. package/lib/assets/img/svg/toolbar/undo_button1.svg +76 -0
  398. package/lib/assets/img/svg/toolbar/use_button.svg +37 -0
  399. package/lib/assets/img/svg/toolbar/wall_color_icon.svg +6 -0
  400. package/lib/assets/img/svg/topbar/edit_active.svg +10 -0
  401. package/lib/assets/img/svg/topbar/edit_inactive.svg +10 -0
  402. package/lib/assets/img/svg/topbar/redo_active.svg +42 -0
  403. package/lib/assets/img/svg/topbar/redo_inactive.svg +23 -0
  404. package/lib/assets/img/svg/topbar/select_all_active.svg +50 -0
  405. package/lib/assets/img/svg/topbar/select_all_inactive.svg +32 -0
  406. package/lib/assets/img/svg/topbar/take_picture_active.svg +51 -0
  407. package/lib/assets/img/svg/topbar/take_picture_inactive.svg +26 -0
  408. package/lib/assets/img/svg/topbar/undo_active.svg +42 -0
  409. package/lib/assets/img/svg/topbar/undo_inactive.svg +23 -0
  410. package/lib/assets/img/svg/warning_info_2d.svg +81 -0
  411. package/lib/assets/img/svg/window/Clear.svg +3 -0
  412. package/lib/assets/img/svg/window/Cross.svg +5 -0
  413. package/lib/assets/img/svg/window/Double_hung.svg +4 -0
  414. package/lib/assets/img/svg/window/Vertical.svg +4 -0
  415. package/lib/assets/img/svg/windows_clear.svg +23 -0
  416. package/lib/assets/img/svg/windows_cross.svg +28 -0
  417. package/lib/assets/img/svg/windows_double_hung.svg +24 -0
  418. package/lib/assets/img/svg/windows_vertical.svg +24 -0
  419. package/lib/assets/img/svg/wizardstep/Custom.svg +3 -0
  420. package/lib/assets/img/svg/wizardstep/Dashed_line.svg +3 -0
  421. package/lib/assets/img/svg/wizardstep/L.svg +3 -0
  422. package/lib/assets/img/svg/wizardstep/L2.svg +3 -0
  423. package/lib/assets/img/svg/wizardstep/Open.svg +3 -0
  424. package/lib/assets/img/svg/wizardstep/Square.svg +3 -0
  425. package/lib/assets/img/svg/wizardstep/bar-active.svg +9 -0
  426. package/lib/assets/img/svg/wizardstep/bar-normal.svg +3 -0
  427. package/lib/assets/img/svg/wizardstep/bullet-current.svg +3 -0
  428. package/lib/assets/img/svg/wizardstep/bullet-done.svg +3 -0
  429. package/lib/assets/img/svg/wizardstep/bullet-not-done.svg +3 -0
  430. package/lib/assets/img/svg/wizardstep/check-active.svg +3 -0
  431. package/lib/assets/img/svg/wizardstep/check-normal.svg +3 -0
  432. package/lib/assets/img/svg/wizardstep/detail_view.svg +87 -0
  433. package/lib/assets/img/svg/wizardstep/pencil.svg +11 -0
  434. package/lib/assets/img/svg/wizardstep/tile_view.svg +95 -0
  435. package/lib/assets/img/texture/glass.jpg +0 -0
  436. package/lib/assets/img/texture/steel.jpg +0 -0
  437. package/lib/assets/img/texture/white1px.jpg +0 -0
  438. package/lib/assets/img/texture/wood.jpg +0 -0
  439. package/lib/assets/model/DCM.bin +0 -0
  440. package/lib/assets/model/DCM.fbx +0 -0
  441. package/lib/assets/model/DCM.gltf +1 -0
  442. package/lib/assets/model/FBM.bin +0 -0
  443. package/lib/assets/model/FBM.fbx +0 -0
  444. package/lib/assets/model/FBM.gltf +1 -0
  445. package/lib/assets/model/LRM.bin +0 -0
  446. package/lib/assets/model/LRM.fbx +0 -0
  447. package/lib/assets/model/LRM.gltf +1 -0
  448. package/lib/assets/rtastore_logo.png +0 -0
  449. package/lib/catalog/areas/area/planner-element.js +53 -0
  450. package/lib/catalog/areas/area/textures/ceramic-tile.jpg +0 -0
  451. package/lib/catalog/areas/area/textures/grass.jpg +0 -0
  452. package/lib/catalog/areas/area/textures/parquet.jpg +0 -0
  453. package/lib/catalog/areas/area/textures/strand-porcelain.jpg +0 -0
  454. package/lib/catalog/areas/area/textures/tile1.jpg +0 -0
  455. package/lib/catalog/back.png +0 -0
  456. package/lib/catalog/cabinet/cabinet-assembly-order.js +42 -0
  457. package/lib/catalog/catalog.js +270 -0
  458. package/lib/catalog/doors.png +0 -0
  459. package/lib/catalog/doorways.png +0 -0
  460. package/lib/catalog/envMap/nx.hdr +0 -0
  461. package/lib/catalog/envMap/ny.hdr +0 -0
  462. package/lib/catalog/envMap/nz.hdr +0 -0
  463. package/lib/catalog/envMap/px.hdr +0 -0
  464. package/lib/catalog/envMap/py.hdr +0 -0
  465. package/lib/catalog/envMap/pz.hdr +0 -0
  466. package/lib/catalog/export.js +1 -0
  467. package/lib/catalog/factories/area-factory-3d.js +187 -0
  468. package/lib/catalog/factories/area-factory.js +88 -0
  469. package/lib/catalog/factories/export.js +25 -0
  470. package/lib/catalog/factories/wall-factory-3d.js +212 -0
  471. package/lib/catalog/factories/wall-factory.js +279 -0
  472. package/lib/catalog/holes/door-closet/planner-element.js +232 -0
  473. package/lib/catalog/holes/door-double/door_double.png +0 -0
  474. package/lib/catalog/holes/door-double/planner-element.js +325 -0
  475. package/lib/catalog/holes/door-exterior/planner-element.js +225 -0
  476. package/lib/catalog/holes/door-interior/planner-element.js +237 -0
  477. package/lib/catalog/holes/door-panic/panicDoor.png +0 -0
  478. package/lib/catalog/holes/door-panic/planner-element.js +513 -0
  479. package/lib/catalog/holes/door-panic-double/panicDoorDouble.png +0 -0
  480. package/lib/catalog/holes/door-panic-double/planner-element.js +473 -0
  481. package/lib/catalog/holes/door-sliding/planner-element.js +235 -0
  482. package/lib/catalog/holes/doorway-framed/planner-element.js +155 -0
  483. package/lib/catalog/holes/doorway-frameless/planner-element.js +114 -0
  484. package/lib/catalog/holes/export.js +97 -0
  485. package/lib/catalog/holes/gate/gate.jpg +0 -0
  486. package/lib/catalog/holes/window-clear/planner-element.js +176 -0
  487. package/lib/catalog/holes/window-clear/texture.png +0 -0
  488. package/lib/catalog/holes/window-cross/planner-element.js +175 -0
  489. package/lib/catalog/holes/window-cross/texture.png +0 -0
  490. package/lib/catalog/holes/window-double-hung/planner-element.js +313 -0
  491. package/lib/catalog/holes/window-double-hung/texture.png +0 -0
  492. package/lib/catalog/holes/window-vertical/planner-element.js +286 -0
  493. package/lib/catalog/holes/window-vertical/texture.png +0 -0
  494. package/lib/catalog/lines/wall/planner-element.js +87 -0
  495. package/lib/catalog/lines/wall/textures/bricks-normal.jpg +0 -0
  496. package/lib/catalog/lines/wall/textures/bricks.jpg +0 -0
  497. package/lib/catalog/lines/wall/textures/bricks2.jpg +0 -0
  498. package/lib/catalog/lines/wall/textures/morden-normal.jpg +0 -0
  499. package/lib/catalog/lines/wall/textures/morden.jpg +0 -0
  500. package/lib/catalog/lines/wall/textures/painted.jpg +0 -0
  501. package/lib/catalog/lines/wall/textures/plaster-normal.jpg +0 -0
  502. package/lib/catalog/lines/wall/textures/plaster.jpg +0 -0
  503. package/lib/catalog/lines/wall/wall.png +0 -0
  504. package/lib/catalog/molding/molding-dcm/planner-element.js +33 -0
  505. package/lib/catalog/molding/molding-dcm/texture.png +0 -0
  506. package/lib/catalog/molding/molding-fbm/planner-element.js +33 -0
  507. package/lib/catalog/molding/molding-fbm/texture.png +0 -0
  508. package/lib/catalog/molding/molding-lrm/planner-element.js +33 -0
  509. package/lib/catalog/molding/molding-lrm/texture.png +0 -0
  510. package/lib/catalog/utils/exporter.js +173 -0
  511. package/lib/catalog/utils/geom-utils.js +205 -0
  512. package/lib/catalog/utils/item-loader.js +1603 -0
  513. package/lib/catalog/utils/load-obj.js +99 -0
  514. package/lib/catalog/utils/mtl-loader.js +366 -0
  515. package/lib/catalog/utils/obj-loader.js +486 -0
  516. package/lib/catalog/windows.png +0 -0
  517. package/lib/class/area.js +147 -0
  518. package/lib/class/export.js +88 -0
  519. package/lib/class/group.js +438 -0
  520. package/lib/class/guide.js +64 -0
  521. package/lib/class/hole.js +930 -0
  522. package/lib/class/item.js +2009 -0
  523. package/lib/class/layer.js +670 -0
  524. package/lib/class/line.js +1236 -0
  525. package/lib/class/project.js +949 -0
  526. package/lib/class/vertex.js +205 -0
  527. package/lib/components/content.js +160 -0
  528. package/lib/components/export.js +7 -0
  529. package/lib/components/style/export.js +17 -0
  530. package/lib/components/style/form-number-input.js +192 -0
  531. package/lib/components/style/form-submit-button.js +35 -0
  532. package/lib/components/viewer2d/area.js +89 -0
  533. package/lib/components/viewer2d/export.js +121 -0
  534. package/lib/components/viewer2d/grids/grid-horizontal-streak.js +44 -0
  535. package/lib/components/viewer2d/grids/grid-streak.js +44 -0
  536. package/lib/components/viewer2d/grids/grid-vertical-streak.js +44 -0
  537. package/lib/components/viewer2d/grids/grids.js +40 -0
  538. package/lib/components/viewer2d/group.js +63 -0
  539. package/lib/components/viewer2d/item.js +244 -0
  540. package/lib/components/viewer2d/layer.js +172 -0
  541. package/lib/components/viewer2d/line.js +975 -0
  542. package/lib/components/viewer2d/ruler.js +92 -0
  543. package/lib/components/viewer2d/rulerDist.js +110 -0
  544. package/lib/components/viewer2d/rulerX.js +154 -0
  545. package/lib/components/viewer2d/rulerY.js +156 -0
  546. package/lib/components/viewer2d/scene.js +137 -0
  547. package/lib/components/viewer2d/snap.js +84 -0
  548. package/lib/components/viewer2d/state.js +83 -0
  549. package/lib/components/viewer2d/utils.js +200 -0
  550. package/lib/components/viewer2d/vertex.js +76 -0
  551. package/lib/components/viewer2d/viewer2d.js +1472 -0
  552. package/lib/components/viewer3d/camera-controls-module/camera-controls.module.js +2591 -0
  553. package/lib/components/viewer3d/dcm.js +408 -0
  554. package/lib/components/viewer3d/fbm.js +421 -0
  555. package/lib/components/viewer3d/front3D.js +71 -0
  556. package/lib/components/viewer3d/grid-creator.js +35 -0
  557. package/lib/components/viewer3d/grids/grid-horizontal-streak.js +45 -0
  558. package/lib/components/viewer3d/grids/grid-streak.js +36 -0
  559. package/lib/components/viewer3d/grids/grid-vertical-streak.js +45 -0
  560. package/lib/components/viewer3d/libs/first-person-controls.js +74 -0
  561. package/lib/components/viewer3d/libs/helvetiker_regular.typeface.js +1287 -0
  562. package/lib/components/viewer3d/libs/mtl-loader.js +366 -0
  563. package/lib/components/viewer3d/libs/obj-loader.js +471 -0
  564. package/lib/components/viewer3d/libs/orbit-controls.js +706 -0
  565. package/lib/components/viewer3d/libs/pointer-lock-controls.js +53 -0
  566. package/lib/components/viewer3d/lrm.js +312 -0
  567. package/lib/components/viewer3d/model.js +714 -0
  568. package/lib/components/viewer3d/pointer-lock-navigation.js +32 -0
  569. package/lib/components/viewer3d/ruler-utils/itemRect.js +69 -0
  570. package/lib/components/viewer3d/ruler-utils/layer3D.js +503 -0
  571. package/lib/components/viewer3d/ruler-utils/ruler3D.js +232 -0
  572. package/lib/components/viewer3d/ruler-utils/scene3D.js +67 -0
  573. package/lib/components/viewer3d/ruler-utils/state3D.js +26 -0
  574. package/lib/components/viewer3d/scene-creator.js +3850 -0
  575. package/lib/components/viewer3d/three-memory-cleaner.js +46 -0
  576. package/lib/components/viewer3d/viewer3d-first-person.js +316 -0
  577. package/lib/components/viewer3d/viewer3d.js +2673 -0
  578. package/lib/constants/catalog/skinPanel.js +15 -0
  579. package/lib/constants.js +791 -0
  580. package/lib/devLiteRenderer.js +917 -0
  581. package/lib/events/external/handleExternalEvent.js +148 -0
  582. package/lib/events/external/handleExternalEvent.util.js +1110 -0
  583. package/lib/events/external/handlers.addItem.js +54 -0
  584. package/lib/events/external/handlers.changeDoorStyle.js +147 -0
  585. package/lib/events/external/handlers.elementOps.js +15 -0
  586. package/lib/events/external/handlers.finishing.js +32 -0
  587. package/lib/events/external/handlers.hole.js +10 -0
  588. package/lib/events/external/handlers.loadProject.js +135 -0
  589. package/lib/events/external/handlers.molding.js +31 -0
  590. package/lib/events/external/handlers.projectLifecycle.js +19 -0
  591. package/lib/events/external/handlers.projectSettings.js +38 -0
  592. package/lib/events/external/handlers.replaceCabinet.js +48 -0
  593. package/lib/events/external/handlers.roomShape.js +14 -0
  594. package/lib/events/external/handlers.syncScene.js +27 -0
  595. package/lib/events/external/handlers.updateSelectedElements.js +17 -0
  596. package/lib/events/external/handlers.viewMode.js +19 -0
  597. package/lib/events/external/handlers.viewerNavigation.js +117 -0
  598. package/lib/events/external/handlers.wall.js +13 -0
  599. package/lib/index.js +637 -0
  600. package/lib/mappings/external-events/mapExternalEventPayload.js +33 -0
  601. package/lib/mappings/external-events/mappers/addItemMapper.js +103 -0
  602. package/lib/mappings/external-events/mappers/ccdfMapper.js +107 -0
  603. package/lib/mappings/external-events/mappers/ccdfToCDSMapper.js +55 -0
  604. package/lib/mappings/external-events/mappers/changeDoorStyleMapper.js +44 -0
  605. package/lib/mappings/external-events/mappers/loadProjectMapper.js +70 -0
  606. package/lib/mappings/holesToCatalog.js +148 -0
  607. package/lib/models.js +534 -0
  608. package/lib/plugins/SVGLoader.js +1419 -0
  609. package/lib/plugins/console-debugger.js +42 -0
  610. package/lib/plugins/export.js +25 -0
  611. package/lib/plugins/keyboard.js +117 -0
  612. package/lib/reducers/areas-reducer.js +19 -0
  613. package/lib/reducers/export.js +89 -0
  614. package/lib/reducers/groups-reducer.js +45 -0
  615. package/lib/reducers/holes-reducer.js +69 -0
  616. package/lib/reducers/items-reducer.js +152 -0
  617. package/lib/reducers/lines-reducer.js +52 -0
  618. package/lib/reducers/project-reducer.js +143 -0
  619. package/lib/reducers/reducer.js +25 -0
  620. package/lib/reducers/scene-reducer.js +35 -0
  621. package/lib/reducers/vertices-reducer.js +26 -0
  622. package/lib/reducers/viewer2d-reducer.js +84 -0
  623. package/lib/reducers/viewer3d-reducer.js +65 -0
  624. package/lib/shared/domain/cabinet-warning.js +20 -0
  625. package/lib/shared/objects/immutable.js +9 -0
  626. package/lib/shared-style.js +72 -0
  627. package/lib/translator/en.js +111 -0
  628. package/lib/translator/it.js +86 -0
  629. package/lib/translator/ru.js +86 -0
  630. package/lib/translator/translator.js +87 -0
  631. package/lib/utils/browser.js +40 -0
  632. package/lib/utils/convert-units-lite.js +44 -0
  633. package/lib/utils/email-validator.js +10 -0
  634. package/lib/utils/export.js +56 -0
  635. package/lib/utils/geometry.js +3230 -0
  636. package/lib/utils/get-edges-of-subgraphs.js +33 -0
  637. package/lib/utils/graph-cycles.js +239 -0
  638. package/lib/utils/graph-inner-cycles.js +54 -0
  639. package/lib/utils/graph.js +153 -0
  640. package/lib/utils/helper.js +480 -0
  641. package/lib/utils/history.js +48 -0
  642. package/lib/utils/id-broker.js +22 -0
  643. package/lib/utils/logger.js +14 -0
  644. package/lib/utils/math.js +57 -0
  645. package/lib/utils/molding.js +1146 -0
  646. package/lib/utils/name-generator.js +21 -0
  647. package/lib/utils/objects-utils.js +62 -0
  648. package/lib/utils/phone-validator.js +10 -0
  649. package/lib/utils/process-black-list.js +22 -0
  650. package/lib/utils/react-if.js +25 -0
  651. package/lib/utils/ruler.js +63 -0
  652. package/lib/utils/skinPanelEngine.js +530 -0
  653. package/lib/utils/snap-scene.js +101 -0
  654. package/lib/utils/snap.js +245 -0
  655. package/lib/utils/summarizeCart.js +30 -0
  656. package/lib/utils/threeCSG.es6.js +504 -0
  657. package/lib/version.js +7 -0
  658. package/package.json +29 -24
  659. package/es/WorkSpace.js +0 -30
  660. package/es/WorkSpaceHostMimic.js +0 -132
  661. package/es/assets/gltf/door_closet.bin +0 -0
  662. package/es/assets/gltf/door_closet.fbx +0 -0
  663. package/es/assets/gltf/door_exterior.bin +0 -0
  664. package/es/assets/gltf/door_exterior.fbx +0 -0
  665. package/es/assets/gltf/door_interior.bin +0 -0
  666. package/es/assets/gltf/door_interior.fbx +0 -0
  667. package/es/assets/gltf/door_sliding.bin +0 -0
  668. package/es/assets/gltf/door_sliding.fbx +0 -0
  669. package/es/assets/img/png/helper/video_preview_3d.png +0 -0
  670. package/es/assets/img/png/helper/video_preview_start.png +0 -0
  671. package/es/assets/img/svg/color/Brown.svg +0 -9
  672. package/es/assets/img/svg/color/Dark.svg +0 -9
  673. package/es/assets/img/svg/color/Light.svg +0 -9
  674. package/es/assets/img/svg/color/Medium.svg +0 -9
  675. package/es/assets/img/svg/color/Unfinished.svg +0 -9
  676. package/es/catalog/lines/wall/textures/bricks3.jpg +0 -0
  677. package/es/catalog/properties/export.js +0 -21
  678. package/es/catalog/properties/property-checkbox.js +0 -68
  679. package/es/catalog/properties/property-color.js +0 -39
  680. package/es/catalog/properties/property-enum.js +0 -50
  681. package/es/catalog/properties/property-hidden.js +0 -19
  682. package/es/catalog/properties/property-lenght-measure.js +0 -96
  683. package/es/catalog/properties/property-length-measure.js +0 -80
  684. package/es/catalog/properties/property-length-measure_hole.js +0 -96
  685. package/es/catalog/properties/property-number.js +0 -48
  686. package/es/catalog/properties/property-read-only.js +0 -26
  687. package/es/catalog/properties/property-string.js +0 -48
  688. package/es/catalog/properties/property-toggle.js +0 -39
  689. package/es/catalog/properties/shared-property-style.js +0 -14
  690. package/es/catalog/utils/FuseUtils.js +0 -79
  691. package/es/class/FuseUtils.js +0 -79
  692. package/es/components/style/button.js +0 -106
  693. package/es/components/style/cancel-button.js +0 -21
  694. package/es/components/style/content-container.js +0 -30
  695. package/es/components/style/content-title.js +0 -25
  696. package/es/components/style/delete-button.js +0 -24
  697. package/es/components/style/form-block.js +0 -20
  698. package/es/components/style/form-color-input.js +0 -26
  699. package/es/components/style/form-label.js +0 -22
  700. package/es/components/style/form-number-input_2.js +0 -238
  701. package/es/components/style/form-select.js +0 -19
  702. package/es/components/style/form-slider.js +0 -60
  703. package/es/components/style/form-text-input.js +0 -69
  704. package/es/index.html.ejs +0 -264
  705. package/es/reducers/user-reducer.js +0 -41
  706. package/es/utils/isolate-event-handler.js +0 -1622
  707. /package/{es/catalog/lines/wall/textures/bricks-normal2.jpg → lib/catalog/lines/wall/textures/painted-normal.jpg} +0 -0
@@ -0,0 +1,1146 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ var _typeof = require("@babel/runtime/helpers/typeof");
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.createMonldingGroup = createMonldingGroup;
9
+ exports.getAllMoldingGroups = getAllMoldingGroups;
10
+ exports.getItemGroupFromMolding = getItemGroupFromMolding;
11
+ exports.getItemRect = getItemRect;
12
+ exports.getLinesFromItems = getLinesFromItems;
13
+ exports.getLinesFromItems2 = getLinesFromItems2;
14
+ exports.getLinesOfItem = getLinesOfItem;
15
+ exports.getLinesOfItem2 = getLinesOfItem2;
16
+ exports.getMoldingDataOfScene2 = getMoldingDataOfScene2;
17
+ exports.hasMoldingLayout = hasMoldingLayout;
18
+ exports.isAttachedWall = isAttachedWall;
19
+ exports.isEnableItemForMolding = isEnableItemForMolding;
20
+ exports.isItemSameItemByLocation = isItemSameItemByLocation;
21
+ exports.isItemSnappedGroup = isItemSnappedGroup;
22
+ exports.isItemSnappedItem = isItemSnappedItem;
23
+ exports.isLinesOverlapped = isLinesOverlapped;
24
+ exports.isSameMoldingLayoutpos = isSameMoldingLayoutpos;
25
+ exports.mergeOverlappedLines = mergeOverlappedLines;
26
+ exports.sortItemsByDistance = sortItemsByDistance;
27
+ exports.tryMergeMDItem = tryMergeMDItem;
28
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
29
+ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
30
+ var _immutable = require("immutable");
31
+ var _constants = require("../constants");
32
+ var Three = _interopRequireWildcard(require("three"));
33
+ var _convertUnitsLite = require("./convert-units-lite");
34
+ var _idBroker = _interopRequireDefault(require("./id-broker"));
35
+ var _utils = require("../components/viewer2d/utils");
36
+ var _export = require("./export");
37
+ var _helper = require("./helper");
38
+ 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); }
39
+ 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; }
40
+ 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) { (0, _defineProperty2["default"])(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; }
41
+ 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; } } }; }
42
+ 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; } }
43
+ 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; }
44
+ function getItemRect(item) {
45
+ var x = item.x;
46
+ var y = item.y;
47
+ var rotRad = item.rotation / 180 * Math.PI;
48
+ var itemWidth = item.properties.get('width').get('_length');
49
+ var itemWidthUnit = item.properties.get('width').get('_unit') || 'cm';
50
+ itemWidth = (0, _convertUnitsLite.convert)(itemWidth / 2).from(itemWidthUnit).to('cm');
51
+ var itemDepth = item.properties.get('depth').get('_length');
52
+ var itemDepthUnit = item.properties.get('depth').get('_unit') || 'cm';
53
+ itemDepth = (0, _convertUnitsLite.convert)(itemDepth / 2).from(itemDepthUnit).to('cm');
54
+ var mx = x - itemWidth * Math.cos(rotRad);
55
+ var my = y - itemWidth * Math.sin(rotRad);
56
+ var x0 = mx + itemDepth * Math.sin(rotRad);
57
+ var y0 = my - itemDepth * Math.cos(rotRad);
58
+ var x3 = mx * 2 - x0;
59
+ var y3 = my * 2 - y0;
60
+ var x1 = x * 2 - x3;
61
+ var y1 = y * 2 - y3;
62
+ var x2 = x * 2 - x0;
63
+ var y2 = y * 2 - y0;
64
+ return {
65
+ rect: [{
66
+ x: x0,
67
+ y: y0
68
+ }, {
69
+ x: x1,
70
+ y: y1
71
+ }, {
72
+ x: x2,
73
+ y: y2
74
+ }, {
75
+ x: x3,
76
+ y: y3
77
+ }]
78
+ };
79
+ }
80
+ function hasMoldingLayout(molding, layoutpos) {
81
+ var types = molding === null || molding === void 0 ? void 0 : molding.molding_type;
82
+ return (Array.isArray(types) || typeof types === 'string') && types.includes(layoutpos);
83
+ }
84
+ function isEnableItemForMolding(layer, selItem) {
85
+ var molding = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
86
+ var allLineRects = _export.GeometryUtils.buildRectFromLines(layer, _export.GeometryUtils.getAllLines(layer));
87
+ var result = !(0, _helper.isEmpty)(selItem) && selItem.category === 'cabinet' && (selItem.layoutpos === _constants.BASE_CABINET_LAYOUTPOS && !_export.GeometryUtils.isSnappedLine(getItemRect(selItem), allLineRects) || (selItem.layoutpos === _constants.WALL_CABINET_LAYOUTPOS || selItem.layoutpos === _constants.TALL_CABINET_LAYOUTPOS) && _export.GeometryUtils.isSnappedLine(getItemRect(selItem), allLineRects));
88
+
89
+ // check this item is enable for any molding
90
+ if ((0, _helper.isEmpty)(molding)) return result;
91
+ // check this item is enable for specified molding
92
+ else return result && hasMoldingLayout(molding, selItem.layoutpos);
93
+ }
94
+ function isAttachedWall(layer, selItem) {
95
+ var allLineRects = _export.GeometryUtils.buildRectFromLines(layer, _export.GeometryUtils.getAllLines(layer));
96
+ return _export.GeometryUtils.isSnappedLine(getItemRect(selItem), allLineRects);
97
+ }
98
+
99
+ /**
100
+ * Check two line segments are overlap. The direction of the two line segments must be opposite.
101
+ * s1 c2 s2 c1
102
+ * |--------|------|-----------|
103
+ * Decision Formular: L(s1,c1) + L(s2, c2) = L(s1, s2) + L(c1, c2)
104
+ * @param {*} selRectPos1
105
+ * @param {*} selRectPos2
106
+ * @param {*} curRectPos1
107
+ * @param {*} curRectPos2
108
+ * @returns L(s1,c1) + L(s2, c2) - L(s1, s2) - L(c1, c2)
109
+ */
110
+ function getDelta(selRectPos1, selRectPos2, curRectPos1, curRectPos2) {
111
+ return (
112
+ // GeometryUtils.verticesDistance(curRectPos1, selRectPos2) +
113
+ // GeometryUtils.verticesDistance(selRectPos1, curRectPos2) -
114
+ // Math.abs(
115
+ // GeometryUtils.verticesDistance(curRectPos2, curRectPos1) -
116
+ // GeometryUtils.verticesDistance(selRectPos1, selRectPos2)
117
+ // )
118
+ Math.abs(_export.GeometryUtils.verticesDistance(curRectPos1, selRectPos1) + _export.GeometryUtils.verticesDistance(selRectPos2, curRectPos2) - _export.GeometryUtils.verticesDistance(curRectPos2, curRectPos1) - _export.GeometryUtils.verticesDistance(selRectPos1, selRectPos2))
119
+ );
120
+ }
121
+ function isItemSnappedItem(selItem, curItem) {
122
+ var selRect = getItemRect(selItem).rect;
123
+ var curRect = getItemRect(curItem).rect;
124
+ var flag30 = getDelta(selRect[3], selRect[0], curRect[1], curRect[2]) < _constants.EPSILON;
125
+ var flag21 = getDelta(selRect[2], selRect[1], curRect[0], curRect[3]) < _constants.EPSILON;
126
+ var flag23 = getDelta(selRect[2], selRect[3], curRect[2], curRect[3]) < _constants.EPSILON;
127
+ var flag01 = getDelta(selRect[1], selRect[0], curRect[0], curRect[3]) < _constants.EPSILON;
128
+ var flag03 = getDelta(selRect[0], selRect[3], curRect[1], curRect[0]) < _constants.EPSILON;
129
+ return flag30 || flag21 || flag23 || flag01 || flag03;
130
+ }
131
+ function isItemSnappedGroup(selItem, itemGroup) {
132
+ return itemGroup.some(function (curItem) {
133
+ return isItemSnappedItem(selItem, curItem);
134
+ });
135
+ }
136
+ function sortItemsByDistance(items, selItem) {
137
+ items.sort(function (a, b) {
138
+ return _export.GeometryUtils.pointsDistance(a.x, a.y, selItem.x, selItem.y) - _export.GeometryUtils.pointsDistance(b.x, b.y, selItem.x, selItem.y);
139
+ });
140
+ return items;
141
+ }
142
+ function isSameMoldingLayoutpos(curItem, item) {
143
+ return curItem.layoutpos === _constants.BASE_CABINET_LAYOUTPOS && curItem.layoutpos === item.layoutpos || [_constants.WALL_CABINET_LAYOUTPOS, _constants.TALL_CABINET_LAYOUTPOS].includes(curItem.layoutpos) && [_constants.WALL_CABINET_LAYOUTPOS, _constants.TALL_CABINET_LAYOUTPOS].includes(item.layoutpos);
144
+ }
145
+ function isItemSameItemByLocation(item1, item2, location) {
146
+ var item1Altitude = item1.properties.get('altitude').get('_length');
147
+ var item1AltitudeUnit = item1.properties.get('altitude').get('_unit');
148
+ item1Altitude = (0, _convertUnitsLite.convert)(item1Altitude).from(item1AltitudeUnit).to('cm');
149
+ var item1Height = item1.properties.get('height').get('_length');
150
+ var item1HeightUnit = item1.properties.get('height').get('_unit');
151
+ item1Height = (0, _convertUnitsLite.convert)(item1Height).from(item1HeightUnit).to('cm');
152
+ var item2Altitude = item2.properties.get('altitude').get('_length');
153
+ var item2AltitudeUnit = item2.properties.get('altitude').get('_unit');
154
+ item2Altitude = (0, _convertUnitsLite.convert)(item2Altitude).from(item2AltitudeUnit).to('cm');
155
+ var item2Height = item2.properties.get('height').get('_length');
156
+ var item2HeightUnit = item2.properties.get('height').get('_unit');
157
+ item2Height = (0, _convertUnitsLite.convert)(item2Height).from(item2HeightUnit).to('cm');
158
+ var flag = false;
159
+ switch (location) {
160
+ case _constants.TOP_MOLDING_LOCATION:
161
+ if (_export.GeometryUtils.sameDistances(item1Altitude + item1Height, item2Altitude + item2Height)) flag = true;
162
+ break;
163
+ case _constants.MIDDLE_MOLDING_LOCATION:
164
+ if (_export.GeometryUtils.sameDistances(item1Altitude + item1Height / 2, item2Altitude + item2Height / 2)) flag = true;
165
+ break;
166
+ case _constants.BOTTOM_MOLDING_LOCATION:
167
+ if (_export.GeometryUtils.sameDistances(item1Altitude, item2Altitude)) flag = true;
168
+ break;
169
+ }
170
+ return flag;
171
+ }
172
+ function tryMergeMDItem(layer, selItem, curItem, itemGroup, molding) {
173
+ return isSameMoldingLayoutpos(selItem, curItem) && isEnableItemForMolding(layer, curItem, molding) && isItemSnappedGroup(curItem, itemGroup) && !itemGroup.some(function (item) {
174
+ return item.id === curItem.id;
175
+ }) && isItemSameItemByLocation(selItem, curItem, molding.location_type);
176
+ }
177
+ function getItemGroupFromMolding(layer, curItem, molding) {
178
+ var selectedItem = layer.getIn(['items', layer.selected.toJS().items[0]]);
179
+ var itemGroup = [curItem];
180
+ var temp_layer_items = layer.items.toArray().filter(function (item) {
181
+ return item.category === 'cabinet' && item.id !== curItem.id && item.id !== (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.id);
182
+ });
183
+ temp_layer_items = sortItemsByDistance(temp_layer_items, curItem);
184
+ for (var idx = 0; idx < temp_layer_items.length; idx++) {
185
+ if (tryMergeMDItem(layer, curItem, temp_layer_items[idx], itemGroup, molding)) {
186
+ itemGroup.push(temp_layer_items[idx]);
187
+ idx = -1;
188
+ }
189
+ }
190
+ return itemGroup;
191
+ }
192
+ function tryMergeItemWithLocation(curItem, itemGroup, location) {
193
+ return itemGroup.some(function (item) {
194
+ return isItemSnappedItem(curItem, item) && isItemSameItemByLocation(curItem, item, location);
195
+ });
196
+ }
197
+
198
+ /**
199
+ * Make the molding group array with [items].
200
+ * @param {*} layer
201
+ * @param {*} items - Mergable snapped item group, if [items] is null then get all MG array of layer
202
+ * @returns MG array
203
+ */
204
+ function getAllMoldingGroups(layer) {
205
+ var items = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
206
+ if (items === null) items = layer.items.toArray();
207
+ var MGArray = [];
208
+ items.forEach(function (curItem) {
209
+ // let allLineRects = GeometryUtils.buildRectFromLines(
210
+ // layer,
211
+ // GeometryUtils.getAllLines(layer)
212
+ // );
213
+ // if (
214
+ // (curItem.category === 'cabinet' &&
215
+ // curItem.layoutpos === BASE_CABINET_LAYOUTPOS &&
216
+ // !GeometryUtils.isSnappedLine(getItemRect(curItem), allLineRects)) ||
217
+ // ((curItem.layoutpos === WALL_CABINET_LAYOUTPOS ||
218
+ // curItem.layoutpos === TALL_CABINET_LAYOUTPOS) &&
219
+ // GeometryUtils.isSnappedLine(getItemRect(curItem), allLineRects))
220
+ // ) {
221
+ if (curItem.category === 'cabinet') {
222
+ var temp_items = items.filter(function (it) {
223
+ return it.category === 'cabinet' && isSameMoldingLayoutpos(curItem, it) && it.id !== curItem.id;
224
+ });
225
+ temp_items = sortItemsByDistance(temp_items, curItem);
226
+ _constants.MOLDING_LOCATIONS.forEach(function (location) {
227
+ if (!MGArray.some(function (mg) {
228
+ return mg.items.some(function (it) {
229
+ return it.id === curItem.id;
230
+ }) && mg.location_type === location;
231
+ })) {
232
+ var itemGroup = [curItem];
233
+ var isChangedItemGroup = false;
234
+ do {
235
+ isChangedItemGroup = false;
236
+ var _loop = function _loop(idx) {
237
+ if (!itemGroup.some(function (it) {
238
+ return it.id === temp_items[idx].id;
239
+ }) && tryMergeItemWithLocation(temp_items[idx], itemGroup, location)) {
240
+ itemGroup.push(temp_items[idx]);
241
+ isChangedItemGroup = true;
242
+ }
243
+ };
244
+ for (var idx = 0; idx < temp_items.length; idx++) {
245
+ _loop(idx);
246
+ }
247
+ } while (isChangedItemGroup);
248
+ MGArray.push({
249
+ id: _idBroker["default"].acquireID(),
250
+ items: itemGroup,
251
+ location_type: location,
252
+ molding: null,
253
+ lines: null,
254
+ pointGroups: null,
255
+ meshes: [],
256
+ rot: 0,
257
+ pos: 0
258
+ });
259
+ }
260
+ });
261
+ }
262
+ // }
263
+ });
264
+ return MGArray;
265
+ }
266
+ function getLinesOfItem(item, allLineRects, catalog) {
267
+ var lines = [];
268
+ var outline = null;
269
+ var element = catalog.elements[item.get('type')];
270
+ if (!element) element = catalog.elements[(0, _utils.returnReplaceableDeepSearchType)(item.get('type'))];
271
+ // get edge lines
272
+ var newWidth = item.properties.get('width').get('_length');
273
+ var wUnit = item.properties.get('width').get('_unit') || 'cm';
274
+ newWidth = (0, _convertUnitsLite.convert)(newWidth).from(wUnit).to('cm');
275
+ var newDepth = item.properties.get('depth').get('_length');
276
+ var hUnit = item.properties.get('depth').get('_unit') || 'cm';
277
+ newDepth = (0, _convertUnitsLite.convert)(newDepth).from(hUnit).to('cm');
278
+ if (item) {
279
+ var _element;
280
+ // Get Outline Data of Selected Item
281
+ outline = (_element = element) === null || _element === void 0 || (_element = _element.info) === null || _element === void 0 ? void 0 : _element.outline;
282
+ if (outline) {
283
+ // Extract Points from `outline`
284
+ var outlinePaths = outline.paths;
285
+ var outlineWidth = outline.svgWidth;
286
+ var outlineHeight = outline.svgHeight;
287
+ var outlinePoints = []; // Hold Points Of SVG
288
+ var _iterator = _createForOfIteratorHelper(outlinePaths),
289
+ _step;
290
+ try {
291
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
292
+ var path = _step.value;
293
+ var _iterator2 = _createForOfIteratorHelper(path.subPaths),
294
+ _step2;
295
+ try {
296
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
297
+ var subPath = _step2.value;
298
+ outlinePoints = outlinePoints.concat(subPath.getPoints());
299
+ }
300
+ } catch (err) {
301
+ _iterator2.e(err);
302
+ } finally {
303
+ _iterator2.f();
304
+ }
305
+ }
306
+ } catch (err) {
307
+ _iterator.e(err);
308
+ } finally {
309
+ _iterator.f();
310
+ }
311
+ outline.reverse && outlinePoints.reverse();
312
+ for (var i = 0; i < outlinePoints.length - 1; i++) {
313
+ lines.push([_export.GeometryUtils.rotatePointAroundPoint((outlinePoints[i].x / outlineWidth - 0.5) * newWidth + item.x, (outlinePoints[i].y / outlineHeight - 0.5) * newDepth + item.y, item.x, item.y, item.rotation + 90), _export.GeometryUtils.rotatePointAroundPoint((outlinePoints[i + 1].x / outlineWidth - 0.5) * newWidth + item.x, (outlinePoints[i + 1].y / outlineHeight - 0.5) * newDepth + item.y, item.x, item.y, item.rotation + 90), _idBroker["default"].acquireID()]);
314
+ }
315
+ } else {
316
+ var pos = [[-1, -1], [1, -1], [1, 1], [-1, 1]];
317
+ for (var _i = 0; _i < 4; _i++) {
318
+ lines.push([_export.GeometryUtils.rotatePointAroundPoint(pos[_i][0] * newWidth / 2 + item.x, pos[_i][1] * newDepth / 2 + item.y, item.x, item.y, item.rotation), _export.GeometryUtils.rotatePointAroundPoint(pos[(_i + 1) % 4][0] * newWidth / 2 + item.x, pos[(_i + 1) % 4][1] * newDepth / 2 + item.y, item.x, item.y, item.rotation), _idBroker["default"].acquireID()]);
319
+ }
320
+ }
321
+ }
322
+ if (item.layoutpos !== _constants.BASE_CABINET_LAYOUTPOS) {
323
+ lines = lines.filter(function (line) {
324
+ return !_export.GeometryUtils.isSnappedLine({
325
+ rect: [{
326
+ x: 0,
327
+ y: 0
328
+ }, {
329
+ x: 0,
330
+ y: 0
331
+ }, line[0], line[1]]
332
+ }, allLineRects);
333
+ });
334
+ }
335
+ return lines;
336
+ }
337
+ function getLinesOfItem2(item, allLineRects, catalog) {
338
+ var _lines;
339
+ var lines = [];
340
+ var outline = null;
341
+ var element = catalog.elements[item.get('type')];
342
+ if (!element) element = catalog.elements[(0, _utils.returnReplaceableDeepSearchType)(item.get('type'))];
343
+ // get edge lines
344
+ var newWidth = item.properties.get('width').get('_length');
345
+ var wUnit = item.properties.get('width').get('_unit') || 'cm';
346
+ newWidth = (0, _convertUnitsLite.convert)(newWidth).from(wUnit).to('cm');
347
+ var newDepth = item.properties.get('depth').get('_length');
348
+ var hUnit = item.properties.get('depth').get('_unit') || 'cm';
349
+ newDepth = (0, _convertUnitsLite.convert)(newDepth).from(hUnit).to('cm');
350
+ if (item) {
351
+ var _element2;
352
+ // Get Outline Data of Selected Item
353
+ outline = (_element2 = element) === null || _element2 === void 0 ? void 0 : _element2.info.outline;
354
+ if (outline) {
355
+ // Extract Points from `outline`
356
+ var outlinePaths = outline.paths;
357
+ var outlineWidth = outline.svgWidth;
358
+ var outlineHeight = outline.svgHeight;
359
+ var outlinePoints = []; // Hold Points Of SVG
360
+ var _iterator3 = _createForOfIteratorHelper(outlinePaths),
361
+ _step3;
362
+ try {
363
+ for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
364
+ var path = _step3.value;
365
+ var _iterator4 = _createForOfIteratorHelper(path.subPaths),
366
+ _step4;
367
+ try {
368
+ for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
369
+ var subPath = _step4.value;
370
+ outlinePoints = outlinePoints.concat(subPath.getPoints());
371
+ }
372
+ } catch (err) {
373
+ _iterator4.e(err);
374
+ } finally {
375
+ _iterator4.f();
376
+ }
377
+ }
378
+ } catch (err) {
379
+ _iterator3.e(err);
380
+ } finally {
381
+ _iterator3.f();
382
+ }
383
+ outline.reverse && outlinePoints.reverse();
384
+ for (var i = 0; i < outlinePoints.length - 1; i++) {
385
+ lines.push([_export.GeometryUtils.rotatePointAroundPoint((outlinePoints[i].x / outlineWidth - 0.5) * newWidth + item.x, (outlinePoints[i].y / outlineHeight - 0.5) * newDepth + item.y, item.x, item.y, item.rotation + 90), _export.GeometryUtils.rotatePointAroundPoint((outlinePoints[i + 1].x / outlineWidth - 0.5) * newWidth + item.x, (outlinePoints[i + 1].y / outlineHeight - 0.5) * newDepth + item.y, item.x, item.y, item.rotation + 90), _idBroker["default"].acquireID()]);
386
+ }
387
+ } else {
388
+ var pos = [[-1, -1], [1, -1], [1, 1], [-1, 1]];
389
+ for (var _i2 = 0; _i2 < 4; _i2++) {
390
+ lines.push([_export.GeometryUtils.rotatePointAroundPoint(pos[_i2][0] * newWidth / 2 + item.x, pos[_i2][1] * newDepth / 2 + item.y, item.x, item.y, item.rotation), _export.GeometryUtils.rotatePointAroundPoint(pos[(_i2 + 1) % 4][0] * newWidth / 2 + item.x, pos[(_i2 + 1) % 4][1] * newDepth / 2 + item.y, item.x, item.y, item.rotation), _idBroker["default"].acquireID()]);
391
+ }
392
+ }
393
+ }
394
+ lines = (_lines = lines) === null || _lines === void 0 ? void 0 : _lines.filter(function (line) {
395
+ return !_export.GeometryUtils.isSnappedLine({
396
+ rect: [{
397
+ x: 0,
398
+ y: 0
399
+ }, {
400
+ x: 0,
401
+ y: 0
402
+ }, line[0], line[1]]
403
+ }, allLineRects);
404
+ });
405
+ return lines;
406
+ }
407
+ function isParallelLines(line1, line2) {
408
+ var isParallel = false;
409
+ if (Math.abs(line1[0].y - line1[1].y) <= _constants.EPSILON && Math.abs(line2[0].y - line2[1].y) <= _constants.EPSILON) isParallel = true;
410
+ if (Math.abs(line1[0].x - line1[1].x) <= _constants.EPSILON && Math.abs(line2[0].x - line2[1].x) <= _constants.EPSILON) isParallel = true;
411
+ 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;
412
+ if (isParallel) {
413
+ return true;
414
+ }
415
+ return false;
416
+ }
417
+ function isLinesOverlapped(line1, line2) {
418
+ return isParallelLines(line1, line2) && line1.some(function (l1) {
419
+ return line2.some(function (l2) {
420
+ return _export.GeometryUtils.samePoints(l1, l2);
421
+ });
422
+ });
423
+ }
424
+ function mergeOverlappedLines(line1, line2) {
425
+ var line1_idx = 0,
426
+ line2_idx = 0;
427
+ line1.forEach(function (l1, idx1) {
428
+ if (idx1 !== line1.length - 1) {
429
+ line2.forEach(function (l2, idx2) {
430
+ if (idx2 !== line2.length - 1) {
431
+ if (_export.GeometryUtils.samePoints(l1, l2)) {
432
+ line1_idx = idx1;
433
+ line2_idx = idx2;
434
+ }
435
+ }
436
+ });
437
+ }
438
+ });
439
+ //If line1 's end point and line2 's start point is same, two lines merge into a line with
440
+ //the line1's start point as the start point and line2's end point as the end point.
441
+ if (line1_idx === 1) {
442
+ return [line1[1 - line1_idx], line2[1 - line2_idx], _idBroker["default"].acquireID()];
443
+ } else {
444
+ return [line2[1 - line2_idx], line1[1 - line1_idx], _idBroker["default"].acquireID()];
445
+ }
446
+ }
447
+
448
+ /**
449
+ * Get the contour line array of moldingGroup items
450
+ * @param {*} moldingGroup
451
+ * @param {*} layer
452
+ * @param {*} catalog
453
+ * @returns contour line array of moldingGroup items
454
+ */
455
+ function getLinesFromItems2(moldingGroup, layer, catalog) {
456
+ // wall lines
457
+ var allLineRects = _export.GeometryUtils.buildRectFromLines(layer, _export.GeometryUtils.getAllLines(layer));
458
+ var MGlines = [];
459
+ var MGlinesOtherSnapped = [];
460
+ var items = (0, _toConsumableArray2["default"])(moldingGroup.items);
461
+ items = sortItemsByDistance(items, items[0]);
462
+ // The other item's lines (these items are snapped to the moldingGroup items)
463
+ var itemsOtherSnapped = layer.items.toArray().filter(function (item) {
464
+ if (items.some(function (it) {
465
+ return item.id === it.id;
466
+ })) return false;
467
+ if (isItemSnappedGroup(item, items)) {
468
+ var itemLines = getLinesOfItem(item, allLineRects, catalog);
469
+ var itemAltitude = item.properties.get('altitude').get('_length');
470
+ var itemAltitudeUnit = item.properties.get('altitude').get('_unit');
471
+ itemAltitude = (0, _convertUnitsLite.convert)(itemAltitude).from(itemAltitudeUnit).to('cm');
472
+ var itemHeight = item.properties.get('height').get('_length');
473
+ var itemHeightUnit = item.properties.get('height').get('_unit');
474
+ itemHeight = (0, _convertUnitsLite.convert)(itemHeight).from(itemHeightUnit).to('cm');
475
+ itemLines.forEach(function (line) {
476
+ line.push({
477
+ altitude: itemAltitude,
478
+ height: itemHeight
479
+ });
480
+ });
481
+ MGlinesOtherSnapped = [].concat((0, _toConsumableArray2["default"])(MGlinesOtherSnapped), (0, _toConsumableArray2["default"])(itemLines));
482
+ return true;
483
+ } else return false;
484
+ });
485
+
486
+ // get all lines of moldingGroup items
487
+ items.forEach(function (item) {
488
+ var itemAltitude = item.properties.get('altitude').get('_length');
489
+ var itemAltitudeUnit = item.properties.get('altitude').get('_unit');
490
+ itemAltitude = (0, _convertUnitsLite.convert)(itemAltitude).from(itemAltitudeUnit).to('cm');
491
+ var itemHeight = item.properties.get('height').get('_length');
492
+ var itemHeightUnit = item.properties.get('height').get('_unit');
493
+ itemHeight = (0, _convertUnitsLite.convert)(itemHeight).from(itemHeightUnit).to('cm');
494
+ var itemLines = getLinesOfItem(item, allLineRects, catalog);
495
+
496
+ // remove the edge that overlapped with other snapped items
497
+ itemLines = itemLines.filter(function (itLine) {
498
+ var ret = true;
499
+ var srcLine = {
500
+ x1: itLine[0].x,
501
+ y1: itLine[0].y,
502
+ x2: itLine[1].x,
503
+ y2: itLine[1].y
504
+ };
505
+ for (var j = 0; j < MGlinesOtherSnapped.length; j++) {
506
+ var bCheck = false;
507
+ switch (moldingGroup.location_type) {
508
+ case _constants.TOP_MOLDING_LOCATION:
509
+ bCheck = MGlinesOtherSnapped[j][3].altitude + MGlinesOtherSnapped[j][3].height > itemAltitude + itemHeight;
510
+ break;
511
+ case _constants.MIDDLE_MOLDING_LOCATION:
512
+ bCheck = true;
513
+ break;
514
+ case _constants.BOTTOM_MOLDING_LOCATION:
515
+ bCheck = MGlinesOtherSnapped[j][3].altitude < itemAltitude;
516
+ break;
517
+ }
518
+ if (item.category !== 'cabinet' || ![_constants.BASE_CABINET_LAYOUTPOS, _constants.WALL_CABINET_LAYOUTPOS, _constants.TALL_CABINET_LAYOUTPOS].includes(item.layoutpos)) bCheck = true;
519
+ if (bCheck) {
520
+ var destLine = {
521
+ x1: MGlinesOtherSnapped[j][0].x,
522
+ y1: MGlinesOtherSnapped[j][0].y,
523
+ x2: MGlinesOtherSnapped[j][1].x,
524
+ y2: MGlinesOtherSnapped[j][1].y
525
+ };
526
+ var rst = _export.GeometryUtils.relationshipOfTwoOverlappedLines(srcLine, destLine);
527
+ if (rst.result === _constants.OVERLAP_SAME || rst.result === _constants.OVERLAP_INCLUDED) {
528
+ ret = false;
529
+ break;
530
+ }
531
+ }
532
+ }
533
+ return ret;
534
+ });
535
+ MGlines = [].concat((0, _toConsumableArray2["default"])(MGlines), (0, _toConsumableArray2["default"])(itemLines));
536
+ });
537
+
538
+ // Filtering overlapped edges and get contour edges
539
+ var removeLineIds = []; // remove the edge that fully overlapped to other edge
540
+ var newLines = []; // new countour edge segment that except the overlapped part
541
+ var _loop2 = function _loop2(i) {
542
+ var srcLine = {
543
+ x1: MGlines[i][0].x,
544
+ y1: MGlines[i][0].y,
545
+ x2: MGlines[i][1].x,
546
+ y2: MGlines[i][1].y
547
+ };
548
+ var _loop4 = function _loop4(j) {
549
+ if (i === j) return 0; // continue
550
+ var destLine = {
551
+ x1: MGlines[j][0].x,
552
+ y1: MGlines[j][0].y,
553
+ x2: MGlines[j][1].x,
554
+ y2: MGlines[j][1].y
555
+ };
556
+ var rst = _export.GeometryUtils.relationshipOfTwoOverlappedLines(srcLine, destLine);
557
+ if (rst.result === _constants.OVERLAP_SAME || rst.result === _constants.OVERLAP_INCLUDED) {
558
+ removeLineIds.push(i);
559
+ return 1; // break
560
+ } else if (rst.result === _constants.OVERLAP_SOME) {
561
+ removeLineIds.push(i);
562
+ var lineSegs = getTrimmedContourLineSegs(rst.trimmedSegs, MGlines.filter(function (v, idx) {
563
+ return idx !== i && idx !== j;
564
+ }), 0);
565
+ if (lineSegs.length > 0) newLines = [].concat((0, _toConsumableArray2["default"])(newLines), (0, _toConsumableArray2["default"])(lineSegs));
566
+ return 1; // break
567
+ }
568
+ },
569
+ _ret2;
570
+ for (var j = 0; j < MGlines.length; j++) {
571
+ _ret2 = _loop4(j);
572
+ if (_ret2 === 0) continue;
573
+ if (_ret2 === 1) break;
574
+ }
575
+ };
576
+ for (var i = 0; i < MGlines.length; i++) {
577
+ _loop2(i);
578
+ }
579
+ MGlines = MGlines.filter(function (line, idx) {
580
+ return !removeLineIds.some(function (id) {
581
+ return idx === id;
582
+ });
583
+ });
584
+ if (newLines.length > 0) MGlines = [].concat((0, _toConsumableArray2["default"])(MGlines), (0, _toConsumableArray2["default"])(newLines));
585
+
586
+ // merge the collinear linked lines to one line
587
+ var newMGlines = [];
588
+ var filteredMGlines = MGlines;
589
+ var _loop3 = function _loop3(_i3) {
590
+ if (filteredMGlines.length < 1) return 0; // break
591
+ if (!filteredMGlines.some(function (v) {
592
+ return v[2] === MGlines[_i3][2];
593
+ })) return 1; // continue
594
+ var mergedResult = getMergedLine(MGlines[_i3], filteredMGlines, 0);
595
+ if (mergedResult) {
596
+ newMGlines.push(mergedResult.mergedLine);
597
+ filteredMGlines = mergedResult.filteredMGlines;
598
+ }
599
+ },
600
+ _ret;
601
+ for (var _i3 = 0; _i3 < MGlines.length; _i3++) {
602
+ _ret = _loop3(_i3);
603
+ if (_ret === 0) break;
604
+ if (_ret === 1) continue;
605
+ }
606
+ return newMGlines;
607
+ }
608
+
609
+ /**
610
+ * Get the line that colinear linked with [line], and merge them to a new line
611
+ * @param {*} line
612
+ * @param {*} MGlines
613
+ * @returns
614
+ * - returns merged new line
615
+ * - returns filtered new line group (remove linked line from [MGlines])
616
+ */
617
+ function getMergedLine(line, MGlines, cnt) {
618
+ try {
619
+ cnt++;
620
+ if (cnt > 5000) {
621
+ console.log('getMergedLine has limited!');
622
+ return null;
623
+ }
624
+ var newMGlines = MGlines.filter(function (v) {
625
+ return line[2] !== v[2];
626
+ });
627
+ var mergeResult = {
628
+ mergedLine: line,
629
+ filteredMGlines: newMGlines
630
+ };
631
+ var srcLine = {
632
+ x1: line[0].x,
633
+ y1: line[0].y,
634
+ x2: line[1].x,
635
+ y2: line[1].y
636
+ };
637
+ var _loop5 = function _loop5(i) {
638
+ var destLine = {
639
+ x1: newMGlines[i][0].x,
640
+ y1: newMGlines[i][0].y,
641
+ x2: newMGlines[i][1].x,
642
+ y2: newMGlines[i][1].y
643
+ };
644
+ var rst = _export.GeometryUtils.relationshipOfTwoOverlappedLines(srcLine, destLine);
645
+ if (rst.result === _constants.OVERLAP_LINK) {
646
+ var mergedLine = [{
647
+ x: rst.linkedLine.x1,
648
+ y: rst.linkedLine.y1
649
+ }, {
650
+ x: rst.linkedLine.x2,
651
+ y: rst.linkedLine.y2
652
+ }, _idBroker["default"].acquireID()];
653
+ mergeResult = getMergedLine(mergedLine, newMGlines.filter(function (v, idx) {
654
+ return idx !== i;
655
+ }), cnt);
656
+ }
657
+ };
658
+ for (var i = 0; i < newMGlines.length; i++) {
659
+ _loop5(i);
660
+ }
661
+ return mergeResult;
662
+ } catch (e) {
663
+ console.log('getMergedLine catched :', e);
664
+ return null;
665
+ }
666
+ }
667
+
668
+ /**
669
+ * Get the contour line segments from [lineSegs]
670
+ * @param {*} lineSegs
671
+ * @param {*} otherLines
672
+ * @returns
673
+ */
674
+ function getTrimmedContourLineSegs(lineSegs, otherLines, cnt) {
675
+ try {
676
+ cnt++;
677
+ if (cnt > 5000) {
678
+ console.log('getTrimmedContourLineSegs has limited!');
679
+ return [];
680
+ }
681
+ var returnSegs = [];
682
+ for (var i = 0; i < lineSegs.length; i++) {
683
+ var srcLine = {
684
+ x1: lineSegs[i].x1,
685
+ y1: lineSegs[i].y1,
686
+ x2: lineSegs[i].x2,
687
+ y2: lineSegs[i].y2
688
+ };
689
+ var bContourSeg = true;
690
+ var _loop6 = function _loop6(j) {
691
+ var _otherLines$j$0$x, _otherLines$j$, _otherLines$j$line$, _otherLines$j$0$y, _otherLines$j$2, _otherLines$j$line$2, _otherLines$j$1$x, _otherLines$j$3, _otherLines$j$line$3, _otherLines$j$1$y, _otherLines$j$4, _otherLines$j$line$4;
692
+ var destLine = {
693
+ x1: (_otherLines$j$0$x = (_otherLines$j$ = otherLines[j][0]) === null || _otherLines$j$ === void 0 ? void 0 : _otherLines$j$.x) !== null && _otherLines$j$0$x !== void 0 ? _otherLines$j$0$x : (_otherLines$j$line$ = otherLines[j].line[0]) === null || _otherLines$j$line$ === void 0 ? void 0 : _otherLines$j$line$.x,
694
+ y1: (_otherLines$j$0$y = (_otherLines$j$2 = otherLines[j][0]) === null || _otherLines$j$2 === void 0 ? void 0 : _otherLines$j$2.y) !== null && _otherLines$j$0$y !== void 0 ? _otherLines$j$0$y : (_otherLines$j$line$2 = otherLines[j].line[0]) === null || _otherLines$j$line$2 === void 0 ? void 0 : _otherLines$j$line$2.y,
695
+ x2: (_otherLines$j$1$x = (_otherLines$j$3 = otherLines[j][1]) === null || _otherLines$j$3 === void 0 ? void 0 : _otherLines$j$3.x) !== null && _otherLines$j$1$x !== void 0 ? _otherLines$j$1$x : (_otherLines$j$line$3 = otherLines[j].line[1]) === null || _otherLines$j$line$3 === void 0 ? void 0 : _otherLines$j$line$3.x,
696
+ y2: (_otherLines$j$1$y = (_otherLines$j$4 = otherLines[j][1]) === null || _otherLines$j$4 === void 0 ? void 0 : _otherLines$j$4.y) !== null && _otherLines$j$1$y !== void 0 ? _otherLines$j$1$y : (_otherLines$j$line$4 = otherLines[j].line[1]) === null || _otherLines$j$line$4 === void 0 ? void 0 : _otherLines$j$line$4.y
697
+ };
698
+ var rst = _export.GeometryUtils.relationshipOfTwoOverlappedLines(srcLine, destLine);
699
+ if (rst.result == _constants.OVERLAP_SAME || rst.result == _constants.OVERLAP_INCLUDED) {
700
+ bContourSeg = false;
701
+ return 0; // break
702
+ } else if (rst.result == _constants.OVERLAP_SOME) {
703
+ var tLineSegs = getTrimmedContourLineSegs(rst.trimmedSegs, otherLines.filter(function (v, idx) {
704
+ return idx !== j;
705
+ }), cnt);
706
+ if (tLineSegs.length > 0) returnSegs = [].concat((0, _toConsumableArray2["default"])(returnSegs), (0, _toConsumableArray2["default"])(tLineSegs));
707
+ bContourSeg = false;
708
+ return 0; // break
709
+ }
710
+ },
711
+ _ret3;
712
+ for (var j = 0; j < otherLines.length; j++) {
713
+ _ret3 = _loop6(j);
714
+ if (_ret3 === 0) break;
715
+ }
716
+ if (bContourSeg) returnSegs.push([{
717
+ x: lineSegs[i].x1,
718
+ y: lineSegs[i].y1
719
+ }, {
720
+ x: lineSegs[i].x2,
721
+ y: lineSegs[i].y2
722
+ }, _idBroker["default"].acquireID()]);
723
+ }
724
+ return returnSegs;
725
+ } catch (e) {
726
+ console.log('getTrimmedContourLineSegs catched :', e);
727
+ return [];
728
+ }
729
+ }
730
+ function getLinesFromItems(moldingGroup, layer, catalog) {
731
+ var allLineRects = _export.GeometryUtils.buildRectFromLines(layer, _export.GeometryUtils.getAllLines(layer));
732
+ var items = (0, _toConsumableArray2["default"])(moldingGroup.items);
733
+ var MGlines = getLinesOfItem(items[0], allLineRects, catalog);
734
+ items = sortItemsByDistance(items, items[0]);
735
+ var _loop7 = function _loop7() {
736
+ var itemLines = getLinesOfItem(items[i], allLineRects, catalog);
737
+ var temp_MGLines = [];
738
+ MGlines.forEach(function (line) {
739
+ var idx = itemLines.findIndex(function (itemLine) {
740
+ return isLinesOverlapped(line, itemLine);
741
+ });
742
+ var curItemLine = itemLines[idx];
743
+ if (idx > -1) {
744
+ if (!(_export.GeometryUtils.samePoints(line[0], curItemLine[0]) && _export.GeometryUtils.samePoints(line[1], curItemLine[1]) || _export.GeometryUtils.samePoints(line[0], curItemLine[1]) && _export.GeometryUtils.samePoints(line[1], curItemLine[0]))) {
745
+ var MGLine = mergeOverlappedLines(line, curItemLine);
746
+ temp_MGLines.push(MGLine);
747
+ }
748
+ itemLines.splice(idx, 1);
749
+ } else {
750
+ temp_MGLines.push(line);
751
+ }
752
+ });
753
+ itemLines.forEach(function (itemLine) {
754
+ return temp_MGLines.push(itemLine);
755
+ });
756
+ MGlines = [].concat(temp_MGLines);
757
+ };
758
+ for (var i = 1; i < items.length; i++) {
759
+ _loop7();
760
+ }
761
+ // return MGlines;
762
+ var snapped_other_items = layer.items.toArray().filter(function (item) {
763
+ if (items.some(function (it) {
764
+ return item.id === it.id;
765
+ })) return false;
766
+ return isItemSnappedGroup(item, items);
767
+ });
768
+ snapped_other_items.forEach(function (item) {
769
+ var itemAltitude = item.properties.get('altitude').get('_length');
770
+ var itemAltitudeUnit = item.properties.get('altitude').get('_unit');
771
+ itemAltitude = (0, _convertUnitsLite.convert)(itemAltitude).from(itemAltitudeUnit).to('cm');
772
+ var itemHeight = item.properties.get('height').get('_length');
773
+ var itemHeightUnit = item.properties.get('height').get('_unit');
774
+ itemHeight = (0, _convertUnitsLite.convert)(itemHeight).from(itemHeightUnit).to('cm');
775
+ var mgroupAltitude = items[0].properties.get('altitude').get('_length');
776
+ var mgroupAltitudeUnit = items[0].properties.get('altitude').get('_unit');
777
+ mgroupAltitude = (0, _convertUnitsLite.convert)(mgroupAltitude).from(mgroupAltitudeUnit).to('cm');
778
+ var mgroupHeight = items[0].properties.get('height').get('_length');
779
+ var mgroupHeightUnit = items[0].properties.get('height').get('_unit');
780
+ mgroupHeight = (0, _convertUnitsLite.convert)(mgroupHeight).from(mgroupHeightUnit).to('cm');
781
+ var flag = false;
782
+ switch (moldingGroup.location_type) {
783
+ case _constants.TOP_MOLDING_LOCATION:
784
+ flag = itemAltitude + itemHeight > mgroupAltitude + mgroupHeight;
785
+ break;
786
+ case _constants.MIDDLE_MOLDING_LOCATION:
787
+ flag = true;
788
+ break;
789
+ case _constants.BOTTOM_MOLDING_LOCATION:
790
+ flag = itemAltitude < mgroupAltitude;
791
+ break;
792
+ }
793
+ if (item.category !== 'cabinet' || ![_constants.BASE_CABINET_LAYOUTPOS, _constants.WALL_CABINET_LAYOUTPOS, _constants.TALL_CABINET_LAYOUTPOS].includes(item.layoutpos)) flag = true;
794
+ if (flag) {
795
+ var itemLines = getLinesOfItem(item, allLineRects, catalog);
796
+ var temp_MGLines = [];
797
+ MGlines.forEach(function (mgl) {
798
+ var idx = itemLines.findIndex(function (itl) {
799
+ return isLinesOverlapped(mgl, itl);
800
+ });
801
+ var curITL = itemLines[idx];
802
+ if (idx > -1) {
803
+ if (getDelta(mgl[0], mgl[1], curITL[1], curITL[0]) < _constants.EPSILON || getDelta(mgl[0], mgl[1], curITL[0], curITL[1]) < _constants.EPSILON) {
804
+ if (_export.GeometryUtils.verticesDistance(mgl[0], mgl[1]) > _export.GeometryUtils.verticesDistance(curITL[0], curITL[1])) {
805
+ var MGLine = mergeOverlappedLines(mgl, curITL);
806
+ temp_MGLines.push(MGLine);
807
+ }
808
+ itemLines.splice(idx, 1);
809
+ } else {
810
+ temp_MGLines.push(mgl);
811
+ }
812
+ } else {
813
+ temp_MGLines.push(mgl);
814
+ }
815
+ });
816
+ MGlines = [].concat(temp_MGLines);
817
+ }
818
+ });
819
+ return MGlines;
820
+ }
821
+ function getMDPoints(newMD) {
822
+ if (newMD.lines.length < 1) return _objectSpread(_objectSpread({}, newMD), {}, {
823
+ pointGroups: []
824
+ });
825
+ // let maxX = newMD.lines[0][0].x,
826
+ var maxX = newMD.lines[0][0].x,
827
+ minX = newMD.lines[0][0].x;
828
+ var maxY = newMD.lines[0][0].y,
829
+ minY = newMD.lines[0][0].y;
830
+ newMD.lines.forEach(function (line) {
831
+ if (line[0].x > maxX) {
832
+ maxX = line[0].x;
833
+ }
834
+ if (line[0].x < minX) {
835
+ minX = line[0].x;
836
+ }
837
+ if (line[1].x > maxX) {
838
+ maxX = line[1].x;
839
+ }
840
+ if (line[1].x < minX) {
841
+ minX = line[1].x;
842
+ }
843
+ if (line[0].y > maxY) {
844
+ maxY = line[0].y;
845
+ }
846
+ if (line[0].y < minY) {
847
+ minY = line[0].y;
848
+ }
849
+ if (line[1].y > maxY) {
850
+ maxY = line[1].y;
851
+ }
852
+ if (line[1].y < minY) {
853
+ minY = line[1].y;
854
+ }
855
+ });
856
+ var cPos = {
857
+ x: (maxX + minX) / 2,
858
+ y: (maxY + minY) / 2
859
+ };
860
+ var newSize = _objectSpread(_objectSpread({}, newMD.size), {}, {
861
+ width: maxX - minX,
862
+ depth: maxY - minY
863
+ });
864
+
865
+ // get vertex points
866
+ var MDlines = (0, _toConsumableArray2["default"])(newMD.lines);
867
+ var pointGroups = [[]];
868
+ var flag = 1;
869
+ var i = 0;
870
+ var _loop8 = function _loop8() {
871
+ if (pointGroups[i].length === 0) {
872
+ pointGroups[i].push(new Three.Vector2(MDlines[0][0].x - cPos.x, MDlines[0][0].y - cPos.y), new Three.Vector2(MDlines[0][1].x - cPos.x, MDlines[0][1].y - cPos.y));
873
+ MDlines.splice(0, 1);
874
+ } else {
875
+ if (flag) {
876
+ var lastPoint = pointGroups[i][pointGroups[i].length - 1];
877
+ var res = MDlines.findIndex(function (a) {
878
+ return _export.GeometryUtils.samePoints({
879
+ x: a[0].x - cPos.x,
880
+ y: a[0].y - cPos.y
881
+ }, lastPoint) || _export.GeometryUtils.samePoints({
882
+ x: a[1].x - cPos.x,
883
+ y: a[1].y - cPos.y
884
+ }, lastPoint);
885
+ });
886
+ if (res > -1) {
887
+ var newPos = {
888
+ x: MDlines[res][0].x - cPos.x,
889
+ y: MDlines[res][0].y - cPos.y
890
+ };
891
+ if (_export.GeometryUtils.samePoints(newPos, lastPoint)) {
892
+ newPos = {
893
+ x: MDlines[res][1].x - cPos.x,
894
+ y: MDlines[res][1].y - cPos.y
895
+ };
896
+ }
897
+ pointGroups[i].push(new Three.Vector2(newPos.x, newPos.y));
898
+ MDlines.splice(res, 1);
899
+ } else {
900
+ flag = 0;
901
+ }
902
+ } else {
903
+ var firstPoint = pointGroups[i][0];
904
+ var _res = MDlines.findIndex(function (a) {
905
+ return _export.GeometryUtils.samePoints({
906
+ x: a[0].x - cPos.x,
907
+ y: a[0].y - cPos.y
908
+ }, firstPoint) || _export.GeometryUtils.samePoints({
909
+ x: a[1].x - cPos.x,
910
+ y: a[1].y - cPos.y
911
+ }, firstPoint);
912
+ });
913
+ if (_res > -1) {
914
+ var _newPos = {
915
+ x: MDlines[_res][0].x - cPos.x,
916
+ y: MDlines[_res][0].y - cPos.y
917
+ };
918
+ if (_export.GeometryUtils.samePoints(_newPos, firstPoint)) {
919
+ _newPos = {
920
+ x: MDlines[_res][1].x - cPos.x,
921
+ y: MDlines[_res][1].y - cPos.y
922
+ };
923
+ }
924
+ pointGroups[i] = [new Three.Vector2(_newPos.x, _newPos.y)].concat((0, _toConsumableArray2["default"])(pointGroups[i]));
925
+ MDlines.splice(_res, 1);
926
+ } else {
927
+ flag = 1;
928
+ i++;
929
+ if (MDlines.length !== 0) pointGroups.push([]);
930
+ }
931
+ }
932
+ }
933
+ };
934
+ while (MDlines.length !== 0) {
935
+ _loop8();
936
+ }
937
+ var z = newMD.items[0].properties.get('altitude').get('_length');
938
+ var zUnit = newMD.items[0].properties.get('altitude').get('_unit') || 'cm';
939
+ z = (0, _convertUnitsLite.convert)(z).from(zUnit).to('cm');
940
+ var height = newMD.items[0].properties.get('height').get('_length');
941
+ var heightUnit = newMD.items[0].properties.get('height').get('_unit') || 'cm';
942
+ height = (0, _convertUnitsLite.convert)(height).from(heightUnit).to('cm');
943
+ switch (newMD.location_type) {
944
+ case _constants.TOP_MOLDING_LOCATION:
945
+ z += height;
946
+ break;
947
+ case _constants.MIDDLE_MOLDING_LOCATION:
948
+ z += height / 2;
949
+ break;
950
+ case _constants.BOTTOM_MOLDING_LOCATION:
951
+ z += 0;
952
+ break;
953
+ default:
954
+ break;
955
+ }
956
+ return _objectSpread(_objectSpread({}, newMD), {}, {
957
+ pointGroups: pointGroups,
958
+ pos: _objectSpread(_objectSpread({}, cPos), {}, {
959
+ z: z
960
+ }),
961
+ size: newSize
962
+ });
963
+ }
964
+ function createMonldingGroup(oldMG, layer, molding, catalog) {
965
+ var newMG = _objectSpread({}, oldMG);
966
+ newMG.molding = molding;
967
+ newMG.lines = getLinesFromItems2(oldMG, layer, catalog);
968
+ newMG.lines.reverse();
969
+ newMG = getMDPoints(newMG);
970
+ return newMG;
971
+ }
972
+ function getMoldingDataOfScene2(layer, catalog, doorStyle, moldingPieceLength) {
973
+ var _layer$items;
974
+ var moldingData = [];
975
+ var items = layer === null || layer === void 0 || (_layer$items = layer.items) === null || _layer$items === void 0 ? void 0 : _layer$items.toArray();
976
+ var allLineRects = _export.GeometryUtils.buildRectFromLines(layer, _export.GeometryUtils.getAllLines(layer));
977
+
978
+ // get all molding line segments
979
+ var moldingLines = [];
980
+ items === null || items === void 0 || items.forEach(function (item) {
981
+ if (item.category === _constants.ITEM_TYPE.CABINET) {
982
+ var _item$properties$get$, _item$properties$get$2, _item$properties$get$3, _item$molding;
983
+ var MGlines = getLinesOfItem2(item, allLineRects, catalog); // exclude overlayed to wall
984
+ // id & width
985
+ var parentId = item.id;
986
+ var inchWidth = (0, _convertUnitsLite.convert)(item.properties.get('width').get('_length')).from((_item$properties$get$ = item.properties.get('width').get('_unit')) !== null && _item$properties$get$ !== void 0 ? _item$properties$get$ : 'in').to('in');
987
+ // z position of molding line
988
+ var z = item.properties.get('altitude').get('_length');
989
+ var zUnit = (_item$properties$get$2 = item.properties.get('altitude').get('_unit')) !== null && _item$properties$get$2 !== void 0 ? _item$properties$get$2 : 'in';
990
+ z = (0, _convertUnitsLite.convert)(z).from(zUnit).to('cm');
991
+ var h = item.properties.get('height').get('_length');
992
+ var hUnit = (_item$properties$get$3 = item.properties.get('height').get('_unit')) !== null && _item$properties$get$3 !== void 0 ? _item$properties$get$3 : 'in';
993
+ h = (0, _convertUnitsLite.convert)(h).from(hUnit).to('cm');
994
+ if (!(0, _helper.isEmpty)(item.molding) && isEnableItemForMolding(layer, item)) {
995
+ // calc normal molding line
996
+ item === null || item === void 0 || item.molding.forEach(function (molding) {
997
+ var lineZ = z;
998
+ switch (molding.location_type) {
999
+ case _constants.TOP_MOLDING_LOCATION:
1000
+ lineZ = z + h;
1001
+ break;
1002
+ case _constants.MIDDLE_MOLDING_LOCATION:
1003
+ lineZ = z + h / 2;
1004
+ break;
1005
+ }
1006
+ MGlines === null || MGlines === void 0 || MGlines.forEach(function (line) {
1007
+ return moldingLines.push({
1008
+ molding: _objectSpread({}, molding),
1009
+ doorStyle: !(0, _helper.isEmpty)(item.doorStyle) && _immutable.Map.isMap(item.doorStyle) ? item.doorStyle.toJS() : item.doorStyle,
1010
+ line: line,
1011
+ z: lineZ,
1012
+ parentId: parentId,
1013
+ inchWidth: inchWidth
1014
+ });
1015
+ });
1016
+ });
1017
+ } else if (
1018
+ // calc toe kick molding line
1019
+ item.layoutpos === _constants.BASE_CABINET_LAYOUTPOS && ((0, _helper.isEmpty)(item.molding) || ((_item$molding = item.molding) === null || _item$molding === void 0 ? void 0 : _item$molding.length) < 1 || !isEnableItemForMolding(layer, item))) {
1020
+ var skuName = (0, _utils.getToeKickSKU)(item.doorStyle, catalog);
1021
+ var thumbnail = skuName ? skuName : '';
1022
+ MGlines === null || MGlines === void 0 || MGlines.forEach(function (line) {
1023
+ return moldingLines.push({
1024
+ molding: {
1025
+ name: _constants.TOE_KICK_MOLDING,
1026
+ sku: (0, _utils.getToeKickSKU)(item.doorStyle, catalog),
1027
+ thumbnail: thumbnail,
1028
+ category: 'molding',
1029
+ type: 'cabinet'
1030
+ },
1031
+ doorStyle: !(0, _helper.isEmpty)(item.doorStyle) && _immutable.Map.isMap(item.doorStyle) ? item.doorStyle.toJS() : item.doorStyle,
1032
+ line: line,
1033
+ z: z,
1034
+ parentId: parentId,
1035
+ inchWidth: inchWidth
1036
+ });
1037
+ });
1038
+ }
1039
+ }
1040
+ });
1041
+
1042
+ // filter the real molding line segments
1043
+ var removeLineIds = []; // remove the line that fully overlapped to other line
1044
+ var newLines = []; // new countour line segment that except the overlapped part
1045
+ var _loop9 = function _loop9(i) {
1046
+ var srcLine = {
1047
+ x1: moldingLines[i].line[0].x,
1048
+ y1: moldingLines[i].line[0].y,
1049
+ x2: moldingLines[i].line[1].x,
1050
+ y2: moldingLines[i].line[1].y
1051
+ };
1052
+ var _loop1 = function _loop1(_j) {
1053
+ if (i === _j) return 0; // continue
1054
+ if (Math.abs(moldingLines[i].z - moldingLines[_j].z) > _constants.EPSILON) return 0; // continue
1055
+ var destLine = {
1056
+ x1: moldingLines[_j].line[0].x,
1057
+ y1: moldingLines[_j].line[0].y,
1058
+ x2: moldingLines[_j].line[1].x,
1059
+ y2: moldingLines[_j].line[1].y
1060
+ };
1061
+ var rst = _export.GeometryUtils.relationshipOfTwoOverlappedLines(srcLine, destLine);
1062
+ if (rst.result === _constants.OVERLAP_SAME || rst.result === _constants.OVERLAP_INCLUDED) {
1063
+ removeLineIds.push(i);
1064
+ return 1; // break
1065
+ } else if (rst.result === _constants.OVERLAP_SOME) {
1066
+ removeLineIds.push(i);
1067
+ var lineSegs = getTrimmedContourLineSegs(rst.trimmedSegs, moldingLines.filter(function (v, idx) {
1068
+ return idx !== i && idx !== _j && Math.abs(v.z - moldingLines[i].z) < _constants.EPSILON;
1069
+ }), 0);
1070
+ if (lineSegs.length > 0) {
1071
+ lineSegs.forEach(function (ls) {
1072
+ return newLines.push({
1073
+ molding: _objectSpread({}, moldingLines[i].molding),
1074
+ doorStyle: moldingLines[i].doorStyle,
1075
+ line: (0, _toConsumableArray2["default"])(ls),
1076
+ z: moldingLines[i].z,
1077
+ parentId: moldingLines[i].parentId,
1078
+ inchWidth: moldingLines[i].inchWidth
1079
+ });
1080
+ });
1081
+ }
1082
+ return 1; // break
1083
+ }
1084
+ },
1085
+ _ret4;
1086
+ for (var _j = 0; _j < moldingLines.length; _j++) {
1087
+ _ret4 = _loop1(_j);
1088
+ if (_ret4 === 0) continue;
1089
+ if (_ret4 === 1) break;
1090
+ }
1091
+ };
1092
+ for (var i = 0; i < moldingLines.length; i++) {
1093
+ _loop9(i);
1094
+ }
1095
+ moldingLines = moldingLines.filter(function (line, idx) {
1096
+ return !removeLineIds.some(function (id) {
1097
+ return idx === id;
1098
+ });
1099
+ });
1100
+ if (newLines.length > 0) moldingLines = [].concat((0, _toConsumableArray2["default"])(moldingLines), newLines);
1101
+
1102
+ // filter again for toe kick molding lines
1103
+ // only remain one line per toe kick molding item
1104
+ var duplicatedLineIdxs = [];
1105
+ for (var _i4 = 0; _i4 < moldingLines.length; _i4++) {
1106
+ var _iml$molding;
1107
+ if (duplicatedLineIdxs.includes(_i4)) continue;
1108
+ var iml = moldingLines[_i4];
1109
+ if (((_iml$molding = iml.molding) === null || _iml$molding === void 0 ? void 0 : _iml$molding.name) !== _constants.TOE_KICK_MOLDING) continue;
1110
+ for (var j = 0; j < moldingLines.length; j++) {
1111
+ if (_i4 === j) continue;
1112
+ var jml = moldingLines[j];
1113
+ if (jml.parentId === iml.parentId) duplicatedLineIdxs.push(j);
1114
+ }
1115
+ }
1116
+ moldingLines = moldingLines.filter(function (line, idx) {
1117
+ return !duplicatedLineIdxs.some(function (id) {
1118
+ return idx === id;
1119
+ });
1120
+ });
1121
+ // console.log('moldingLines: ', moldingLines);
1122
+
1123
+ // make molding data with grouping molding & doorStyle
1124
+ var _loop0 = function _loop0() {
1125
+ var ml = moldingLines[k];
1126
+ var mlLength = ml.molding.name === _constants.TOE_KICK_MOLDING ? ml.inchWidth : (0, _convertUnitsLite.convert)(_export.GeometryUtils.verticesDistance(ml.line[0], ml.line[1])).from('cm').to('in');
1127
+ var idx = moldingData.findIndex(function (v) {
1128
+ var _ml$molding, _v$doorStyle, _ml$doorStyle;
1129
+ return (v === null || v === void 0 ? void 0 : v.name) === ((_ml$molding = ml.molding) === null || _ml$molding === void 0 ? void 0 : _ml$molding.name) && ((_v$doorStyle = v.doorStyle) === null || _v$doorStyle === void 0 ? void 0 : _v$doorStyle.id) === ((_ml$doorStyle = ml.doorStyle) === null || _ml$doorStyle === void 0 ? void 0 : _ml$doorStyle.id);
1130
+ });
1131
+ if (idx < 0) moldingData.push(_objectSpread(_objectSpread({}, ml.molding), {}, {
1132
+ doorStyle: ml.doorStyle,
1133
+ totalLength: mlLength,
1134
+ count: Math.ceil(mlLength * 1.1 / moldingPieceLength)
1135
+ }));else {
1136
+ moldingData[idx].totalLength += mlLength;
1137
+ moldingData[idx].count = Math.ceil(moldingData[idx].totalLength * 1.1 / moldingPieceLength);
1138
+ }
1139
+ };
1140
+ for (var k = 0; k < moldingLines.length; k++) {
1141
+ _loop0();
1142
+ }
1143
+ // console.log('moldingData: ', moldingData);
1144
+
1145
+ return moldingData;
1146
+ }