kitchen-simulator 5.0.0-test.3 → 5.0.0-test.5
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.
- package/es/KitchenConfigurator.js +1 -1
- package/es/KitchenConfigurator.js.map +1 -1
- package/package.json +8 -13
- package/lib/@history.js +0 -11
- package/lib/@history.js.map +0 -1
- package/lib/AppContext.js +0 -11
- package/lib/AppContext.js.map +0 -1
- package/lib/KitchenConfigurator.js +0 -1353
- package/lib/KitchenConfigurator.js.map +0 -1
- package/lib/KitchenConfiguratorApp.js +0 -539
- package/lib/KitchenConfiguratorApp.js.map +0 -1
- package/lib/actions/area-actions.js +0 -22
- package/lib/actions/area-actions.js.map +0 -1
- package/lib/actions/export.js +0 -44
- package/lib/actions/export.js.map +0 -1
- package/lib/actions/groups-actions.js +0 -108
- package/lib/actions/groups-actions.js.map +0 -1
- package/lib/actions/holes-actions.js +0 -141
- package/lib/actions/holes-actions.js.map +0 -1
- package/lib/actions/items-actions.js +0 -365
- package/lib/actions/items-actions.js.map +0 -1
- package/lib/actions/lines-actions.js +0 -98
- package/lib/actions/lines-actions.js.map +0 -1
- package/lib/actions/project-actions.js +0 -333
- package/lib/actions/project-actions.js.map +0 -1
- package/lib/actions/scene-actions.js +0 -44
- package/lib/actions/scene-actions.js.map +0 -1
- package/lib/actions/user-actions.js +0 -69
- package/lib/actions/user-actions.js.map +0 -1
- package/lib/actions/vertices-actions.js +0 -36
- package/lib/actions/vertices-actions.js.map +0 -1
- package/lib/actions/viewer2d-actions.js +0 -74
- package/lib/actions/viewer2d-actions.js.map +0 -1
- package/lib/actions/viewer3d-actions.js +0 -33
- package/lib/actions/viewer3d-actions.js.map +0 -1
- package/lib/catalog/areas/area/planner-element.js +0 -47
- package/lib/catalog/areas/area/planner-element.js.map +0 -1
- package/lib/catalog/catalog.js +0 -283
- package/lib/catalog/catalog.js.map +0 -1
- package/lib/catalog/factories/area-factory-3d.js +0 -192
- package/lib/catalog/factories/area-factory-3d.js.map +0 -1
- package/lib/catalog/factories/area-factory.js +0 -90
- package/lib/catalog/factories/area-factory.js.map +0 -1
- package/lib/catalog/factories/export.js +0 -26
- package/lib/catalog/factories/export.js.map +0 -1
- package/lib/catalog/factories/wall-factory-3d.js +0 -213
- package/lib/catalog/factories/wall-factory-3d.js.map +0 -1
- package/lib/catalog/factories/wall-factory.js +0 -279
- package/lib/catalog/factories/wall-factory.js.map +0 -1
- package/lib/catalog/holes/door-closet/planner-element.js +0 -232
- package/lib/catalog/holes/door-closet/planner-element.js.map +0 -1
- package/lib/catalog/holes/door-double/planner-element.js +0 -325
- package/lib/catalog/holes/door-double/planner-element.js.map +0 -1
- package/lib/catalog/holes/door-exterior/planner-element.js +0 -225
- package/lib/catalog/holes/door-exterior/planner-element.js.map +0 -1
- package/lib/catalog/holes/door-interior/planner-element.js +0 -237
- package/lib/catalog/holes/door-interior/planner-element.js.map +0 -1
- package/lib/catalog/holes/door-panic/planner-element.js +0 -513
- package/lib/catalog/holes/door-panic/planner-element.js.map +0 -1
- package/lib/catalog/holes/door-panic-double/planner-element.js +0 -473
- package/lib/catalog/holes/door-panic-double/planner-element.js.map +0 -1
- package/lib/catalog/holes/door-sliding/planner-element.js +0 -235
- package/lib/catalog/holes/door-sliding/planner-element.js.map +0 -1
- package/lib/catalog/holes/doorway-framed/planner-element.js +0 -155
- package/lib/catalog/holes/doorway-framed/planner-element.js.map +0 -1
- package/lib/catalog/holes/doorway-frameless/planner-element.js +0 -114
- package/lib/catalog/holes/doorway-frameless/planner-element.js.map +0 -1
- package/lib/catalog/holes/window-clear/planner-element.js +0 -176
- package/lib/catalog/holes/window-clear/planner-element.js.map +0 -1
- package/lib/catalog/holes/window-cross/planner-element.js +0 -175
- package/lib/catalog/holes/window-cross/planner-element.js.map +0 -1
- package/lib/catalog/holes/window-double-hung/planner-element.js +0 -313
- package/lib/catalog/holes/window-double-hung/planner-element.js.map +0 -1
- package/lib/catalog/holes/window-vertical/planner-element.js +0 -286
- package/lib/catalog/holes/window-vertical/planner-element.js.map +0 -1
- package/lib/catalog/lines/wall/planner-element.js +0 -77
- package/lib/catalog/lines/wall/planner-element.js.map +0 -1
- package/lib/catalog/molding/molding-dcm/planner-element.js +0 -39
- package/lib/catalog/molding/molding-dcm/planner-element.js.map +0 -1
- package/lib/catalog/molding/molding-fbm/planner-element.js +0 -39
- package/lib/catalog/molding/molding-fbm/planner-element.js.map +0 -1
- package/lib/catalog/molding/molding-lrm/planner-element.js +0 -39
- package/lib/catalog/molding/molding-lrm/planner-element.js.map +0 -1
- package/lib/catalog/properties/export.js +0 -82
- package/lib/catalog/properties/export.js.map +0 -1
- package/lib/catalog/properties/property-checkbox.js +0 -79
- package/lib/catalog/properties/property-checkbox.js.map +0 -1
- package/lib/catalog/properties/property-color.js +0 -47
- package/lib/catalog/properties/property-color.js.map +0 -1
- package/lib/catalog/properties/property-enum.js +0 -63
- package/lib/catalog/properties/property-enum.js.map +0 -1
- package/lib/catalog/properties/property-hidden.js +0 -27
- package/lib/catalog/properties/property-hidden.js.map +0 -1
- package/lib/catalog/properties/property-lenght-measure.js +0 -109
- package/lib/catalog/properties/property-lenght-measure.js.map +0 -1
- package/lib/catalog/properties/property-length-measure.js +0 -93
- package/lib/catalog/properties/property-length-measure.js.map +0 -1
- package/lib/catalog/properties/property-length-measure_hole.js +0 -109
- package/lib/catalog/properties/property-length-measure_hole.js.map +0 -1
- package/lib/catalog/properties/property-number.js +0 -56
- package/lib/catalog/properties/property-number.js.map +0 -1
- package/lib/catalog/properties/property-read-only.js +0 -34
- package/lib/catalog/properties/property-read-only.js.map +0 -1
- package/lib/catalog/properties/property-string.js +0 -56
- package/lib/catalog/properties/property-string.js.map +0 -1
- package/lib/catalog/properties/property-toggle.js +0 -47
- package/lib/catalog/properties/property-toggle.js.map +0 -1
- package/lib/catalog/properties/shared-property-style.js +0 -21
- package/lib/catalog/properties/shared-property-style.js.map +0 -1
- package/lib/catalog/utils/FuseUtils.js +0 -89
- package/lib/catalog/utils/FuseUtils.js.map +0 -1
- package/lib/catalog/utils/exporter.js +0 -156
- package/lib/catalog/utils/exporter.js.map +0 -1
- package/lib/catalog/utils/geom-utils.js +0 -206
- package/lib/catalog/utils/geom-utils.js.map +0 -1
- package/lib/catalog/utils/item-loader.js +0 -1534
- package/lib/catalog/utils/item-loader.js.map +0 -1
- package/lib/catalog/utils/load-obj.js +0 -100
- package/lib/catalog/utils/load-obj.js.map +0 -1
- package/lib/catalog/utils/mtl-loader.js +0 -360
- package/lib/catalog/utils/mtl-loader.js.map +0 -1
- package/lib/catalog/utils/obj-loader.js +0 -479
- package/lib/catalog/utils/obj-loader.js.map +0 -1
- package/lib/class/FuseUtils.js +0 -89
- package/lib/class/FuseUtils.js.map +0 -1
- package/lib/class/area.js +0 -151
- package/lib/class/area.js.map +0 -1
- package/lib/class/export.js +0 -97
- package/lib/class/export.js.map +0 -1
- package/lib/class/group.js +0 -446
- package/lib/class/group.js.map +0 -1
- package/lib/class/guide.js +0 -68
- package/lib/class/guide.js.map +0 -1
- package/lib/class/hole.js +0 -935
- package/lib/class/hole.js.map +0 -1
- package/lib/class/item.js +0 -1894
- package/lib/class/item.js.map +0 -1
- package/lib/class/layer.js +0 -673
- package/lib/class/layer.js.map +0 -1
- package/lib/class/line.js +0 -1296
- package/lib/class/line.js.map +0 -1
- package/lib/class/project.js +0 -829
- package/lib/class/project.js.map +0 -1
- package/lib/class/vertex.js +0 -272
- package/lib/class/vertex.js.map +0 -1
- package/lib/components/atoms/Snackbar/index.js +0 -57
- package/lib/components/atoms/Snackbar/index.js.map +0 -1
- package/lib/components/atoms/radio-button/index.js +0 -33
- package/lib/components/atoms/radio-button/index.js.map +0 -1
- package/lib/components/atoms/radio-button/styles.js +0 -12
- package/lib/components/atoms/radio-button/styles.js.map +0 -1
- package/lib/components/button/MainButton.js +0 -98
- package/lib/components/button/MainButton.js.map +0 -1
- package/lib/components/button/ToggleMeasureButton.js +0 -63
- package/lib/components/button/ToggleMeasureButton.js.map +0 -1
- package/lib/components/catalog-view/catalog-breadcrumb.js +0 -61
- package/lib/components/catalog-view/catalog-breadcrumb.js.map +0 -1
- package/lib/components/catalog-view/catalog-item.js +0 -233
- package/lib/components/catalog-view/catalog-item.js.map +0 -1
- package/lib/components/catalog-view/catalog-list.js +0 -189
- package/lib/components/catalog-view/catalog-list.js.map +0 -1
- package/lib/components/catalog-view/catalog-page-item.js +0 -137
- package/lib/components/catalog-view/catalog-page-item.js.map +0 -1
- package/lib/components/catalog-view/catalog-turn-back-page-item.js +0 -113
- package/lib/components/catalog-view/catalog-turn-back-page-item.js.map +0 -1
- package/lib/components/configurator/custom-configurator.js +0 -101
- package/lib/components/configurator/custom-configurator.js.map +0 -1
- package/lib/components/configurator/project-configurator.js +0 -138
- package/lib/components/configurator/project-configurator.js.map +0 -1
- package/lib/components/content.js +0 -132
- package/lib/components/content.js.map +0 -1
- package/lib/components/export.js +0 -90
- package/lib/components/export.js.map +0 -1
- package/lib/components/firstsetting/button/styles.js +0 -34
- package/lib/components/firstsetting/button/styles.js.map +0 -1
- package/lib/components/firstsetting/export.js +0 -16
- package/lib/components/firstsetting/export.js.map +0 -1
- package/lib/components/firstsetting/firstsetting-content-button.js +0 -224
- package/lib/components/firstsetting/firstsetting-content-button.js.map +0 -1
- package/lib/components/firstsetting/firstsetting-toggle-button.js +0 -133
- package/lib/components/firstsetting/firstsetting-toggle-button.js.map +0 -1
- package/lib/components/firstsetting/firstsetting.js +0 -633
- package/lib/components/firstsetting/firstsetting.js.map +0 -1
- package/lib/components/footerbar/button/ControlButton.js +0 -79
- package/lib/components/footerbar/button/ControlButton.js.map +0 -1
- package/lib/components/footerbar/button/DirectionButton.js +0 -76
- package/lib/components/footerbar/button/DirectionButton.js.map +0 -1
- package/lib/components/footerbar/button/DirectionPanSpinButton.js +0 -57
- package/lib/components/footerbar/button/DirectionPanSpinButton.js.map +0 -1
- package/lib/components/footerbar/button/ToggleButton.js +0 -83
- package/lib/components/footerbar/button/ToggleButton.js.map +0 -1
- package/lib/components/footerbar/button/ToggleConvertButton.js +0 -80
- package/lib/components/footerbar/button/ToggleConvertButton.js.map +0 -1
- package/lib/components/footerbar/button/ToggleMeasureButton.js +0 -59
- package/lib/components/footerbar/button/ToggleMeasureButton.js.map +0 -1
- package/lib/components/footerbar/button/styles.js +0 -29
- package/lib/components/footerbar/button/styles.js.map +0 -1
- package/lib/components/footerbar/export.js +0 -16
- package/lib/components/footerbar/export.js.map +0 -1
- package/lib/components/footerbar/footer-content-button.js +0 -224
- package/lib/components/footerbar/footer-content-button.js.map +0 -1
- package/lib/components/footerbar/footer-toggle-button.js +0 -133
- package/lib/components/footerbar/footer-toggle-button.js.map +0 -1
- package/lib/components/footerbar/footerbar.js +0 -808
- package/lib/components/footerbar/footerbar.js.map +0 -1
- package/lib/components/footerbar/styles.js +0 -41
- package/lib/components/footerbar/styles.js.map +0 -1
- package/lib/components/header/button/MenuButton.js +0 -77
- package/lib/components/header/button/MenuButton.js.map +0 -1
- package/lib/components/header/button/SaveButton.js +0 -57
- package/lib/components/header/button/SaveButton.js.map +0 -1
- package/lib/components/header/button/styles.js +0 -68
- package/lib/components/header/button/styles.js.map +0 -1
- package/lib/components/header/export.js +0 -12
- package/lib/components/header/export.js.map +0 -1
- package/lib/components/header/header.js +0 -556
- package/lib/components/header/header.js.map +0 -1
- package/lib/components/header/styles.js +0 -47
- package/lib/components/header/styles.js.map +0 -1
- package/lib/components/login/Login.js +0 -94
- package/lib/components/login/Login.js.map +0 -1
- package/lib/components/login/LoginForm/index.js +0 -140
- package/lib/components/login/LoginForm/index.js.map +0 -1
- package/lib/components/login/Register.js +0 -104
- package/lib/components/login/Register.js.map +0 -1
- package/lib/components/login/RegisterForm/index.js +0 -237
- package/lib/components/login/RegisterForm/index.js.map +0 -1
- package/lib/components/login/jwtService.js +0 -239
- package/lib/components/login/jwtService.js.map +0 -1
- package/lib/components/molecules/slider/index.js +0 -22
- package/lib/components/molecules/slider/index.js.map +0 -1
- package/lib/components/molecules/slider/styles.js +0 -2
- package/lib/components/molecules/slider/styles.js.map +0 -1
- package/lib/components/myprojects/export.js +0 -12
- package/lib/components/myprojects/export.js.map +0 -1
- package/lib/components/myprojects/index.js +0 -453
- package/lib/components/myprojects/index.js.map +0 -1
- package/lib/components/myprojects/styles.js +0 -31
- package/lib/components/myprojects/styles.js.map +0 -1
- package/lib/components/sidebar/custom-accordion.js +0 -45
- package/lib/components/sidebar/custom-accordion.js.map +0 -1
- package/lib/components/sidebar/export.js +0 -50
- package/lib/components/sidebar/export.js.map +0 -1
- package/lib/components/sidebar/panel-element-editor/attributes-editor/attributes-editor.js +0 -74
- package/lib/components/sidebar/panel-element-editor/attributes-editor/attributes-editor.js.map +0 -1
- package/lib/components/sidebar/panel-element-editor/attributes-editor/confirm-popup.js +0 -124
- package/lib/components/sidebar/panel-element-editor/attributes-editor/confirm-popup.js.map +0 -1
- package/lib/components/sidebar/panel-element-editor/attributes-editor/hole-attributes-editor.js +0 -135
- package/lib/components/sidebar/panel-element-editor/attributes-editor/hole-attributes-editor.js.map +0 -1
- package/lib/components/sidebar/panel-element-editor/attributes-editor/item-attributes-editor.js +0 -260
- package/lib/components/sidebar/panel-element-editor/attributes-editor/item-attributes-editor.js.map +0 -1
- package/lib/components/sidebar/panel-element-editor/attributes-editor/line-attributes-editor.js +0 -84
- package/lib/components/sidebar/panel-element-editor/attributes-editor/line-attributes-editor.js.map +0 -1
- package/lib/components/sidebar/panel-element-editor/element-editor.js +0 -884
- package/lib/components/sidebar/panel-element-editor/element-editor.js.map +0 -1
- package/lib/components/sidebar/panel-element-editor/multi-elements-editor.js +0 -2
- package/lib/components/sidebar/panel-element-editor/multi-elements-editor.js.map +0 -1
- package/lib/components/sidebar/panel-element-editor/panel-element-editor.js +0 -56
- package/lib/components/sidebar/panel-element-editor/panel-element-editor.js.map +0 -1
- package/lib/components/sidebar/panel-element-editor/panel-multi-elements-editor.js +0 -125
- package/lib/components/sidebar/panel-element-editor/panel-multi-elements-editor.js.map +0 -1
- package/lib/components/sidebar/panel-group-editor.js +0 -218
- package/lib/components/sidebar/panel-group-editor.js.map +0 -1
- package/lib/components/sidebar/panel-groups.js +0 -274
- package/lib/components/sidebar/panel-groups.js.map +0 -1
- package/lib/components/sidebar/panel-guides.js +0 -192
- package/lib/components/sidebar/panel-guides.js.map +0 -1
- package/lib/components/sidebar/panel-layer-elements.js +0 -258
- package/lib/components/sidebar/panel-layer-elements.js.map +0 -1
- package/lib/components/sidebar/panel-layers.js +0 -347
- package/lib/components/sidebar/panel-layers.js.map +0 -1
- package/lib/components/sidebar/panel.js +0 -110
- package/lib/components/sidebar/panel.js.map +0 -1
- package/lib/components/sidebar/sidebar.js +0 -117
- package/lib/components/sidebar/sidebar.js.map +0 -1
- package/lib/components/sidebar/toolbar-panel.js +0 -171
- package/lib/components/sidebar/toolbar-panel.js.map +0 -1
- package/lib/components/sign/export.js +0 -18
- package/lib/components/sign/export.js.map +0 -1
- package/lib/components/sign/main/index.js +0 -567
- package/lib/components/sign/main/index.js.map +0 -1
- package/lib/components/sign/main/styles.js +0 -27
- package/lib/components/sign/main/styles.js.map +0 -1
- package/lib/components/style/button.js +0 -121
- package/lib/components/style/button.js.map +0 -1
- package/lib/components/style/cancel-button.js +0 -30
- package/lib/components/style/cancel-button.js.map +0 -1
- package/lib/components/style/content-container.js +0 -41
- package/lib/components/style/content-container.js.map +0 -1
- package/lib/components/style/content-title.js +0 -38
- package/lib/components/style/content-title.js.map +0 -1
- package/lib/components/style/delete-button.js +0 -35
- package/lib/components/style/delete-button.js.map +0 -1
- package/lib/components/style/export.js +0 -122
- package/lib/components/style/export.js.map +0 -1
- package/lib/components/style/form-block.js +0 -32
- package/lib/components/style/form-block.js.map +0 -1
- package/lib/components/style/form-color-input.js +0 -35
- package/lib/components/style/form-color-input.js.map +0 -1
- package/lib/components/style/form-label.js +0 -34
- package/lib/components/style/form-label.js.map +0 -1
- package/lib/components/style/form-number-input.js +0 -197
- package/lib/components/style/form-number-input.js.map +0 -1
- package/lib/components/style/form-number-input_2.js +0 -214
- package/lib/components/style/form-number-input_2.js.map +0 -1
- package/lib/components/style/form-select.js +0 -30
- package/lib/components/style/form-select.js.map +0 -1
- package/lib/components/style/form-slider.js +0 -53
- package/lib/components/style/form-slider.js.map +0 -1
- package/lib/components/style/form-submit-button.js +0 -36
- package/lib/components/style/form-submit-button.js.map +0 -1
- package/lib/components/style/form-text-input.js +0 -84
- package/lib/components/style/form-text-input.js.map +0 -1
- package/lib/components/toolbar/button/ControlButton.js +0 -76
- package/lib/components/toolbar/button/ControlButton.js.map +0 -1
- package/lib/components/toolbar/button/DirectionButton.js +0 -57
- package/lib/components/toolbar/button/DirectionButton.js.map +0 -1
- package/lib/components/toolbar/button/RightButton.js +0 -140
- package/lib/components/toolbar/button/RightButton.js.map +0 -1
- package/lib/components/toolbar/button/ToggleButton.js +0 -66
- package/lib/components/toolbar/button/ToggleButton.js.map +0 -1
- package/lib/components/toolbar/button/index.js +0 -94
- package/lib/components/toolbar/button/index.js.map +0 -1
- package/lib/components/toolbar/button/styles.js +0 -21
- package/lib/components/toolbar/button/styles.js.map +0 -1
- package/lib/components/toolbar/components/DoorStyleMenu.js +0 -112
- package/lib/components/toolbar/components/DoorStyleMenu.js.map +0 -1
- package/lib/components/toolbar/components/Pricing.js +0 -110
- package/lib/components/toolbar/components/Pricing.js.map +0 -1
- package/lib/components/toolbar/components/ReviewForQuote.js +0 -485
- package/lib/components/toolbar/components/ReviewForQuote.js.map +0 -1
- package/lib/components/toolbar/export.js +0 -50
- package/lib/components/toolbar/export.js.map +0 -1
- package/lib/components/toolbar/main/Alert.js +0 -132
- package/lib/components/toolbar/main/Alert.js.map +0 -1
- package/lib/components/toolbar/main/TakePictureModal.js +0 -109
- package/lib/components/toolbar/main/TakePictureModal.js.map +0 -1
- package/lib/components/toolbar/main/confirm-popup.js +0 -95
- package/lib/components/toolbar/main/confirm-popup.js.map +0 -1
- package/lib/components/toolbar/main/index.js +0 -4619
- package/lib/components/toolbar/main/index.js.map +0 -1
- package/lib/components/toolbar/main/myComponents.js +0 -125
- package/lib/components/toolbar/main/myComponents.js.map +0 -1
- package/lib/components/toolbar/main/styles.js +0 -73
- package/lib/components/toolbar/main/styles.js.map +0 -1
- package/lib/components/toolbar/plugin-item.js +0 -156
- package/lib/components/toolbar/plugin-item.js.map +0 -1
- package/lib/components/toolbar/popup/appliance/appliance-category/index.js +0 -86
- package/lib/components/toolbar/popup/appliance/appliance-category/index.js.map +0 -1
- package/lib/components/toolbar/popup/appliance/choose-appliance/index.js +0 -85
- package/lib/components/toolbar/popup/appliance/choose-appliance/index.js.map +0 -1
- package/lib/components/toolbar/popup/appliance/index.js +0 -89
- package/lib/components/toolbar/popup/appliance/index.js.map +0 -1
- package/lib/components/toolbar/popup/autosaveprompt/index.js +0 -99
- package/lib/components/toolbar/popup/autosaveprompt/index.js.map +0 -1
- package/lib/components/toolbar/popup/autosaveprompt/styles.js +0 -16
- package/lib/components/toolbar/popup/autosaveprompt/styles.js.map +0 -1
- package/lib/components/toolbar/popup/cabinet/cabinet-category/index.js +0 -86
- package/lib/components/toolbar/popup/cabinet/cabinet-category/index.js.map +0 -1
- package/lib/components/toolbar/popup/cabinet/choose-product/index.js +0 -107
- package/lib/components/toolbar/popup/cabinet/choose-product/index.js.map +0 -1
- package/lib/components/toolbar/popup/cabinet/index.js +0 -91
- package/lib/components/toolbar/popup/cabinet/index.js.map +0 -1
- package/lib/components/toolbar/popup/doorStyle/choose-style/index.js +0 -59
- package/lib/components/toolbar/popup/doorStyle/choose-style/index.js.map +0 -1
- package/lib/components/toolbar/popup/doorStyle/index.js +0 -68
- package/lib/components/toolbar/popup/doorStyle/index.js.map +0 -1
- package/lib/components/toolbar/popup/doorStyle/style-category/index.js +0 -152
- package/lib/components/toolbar/popup/doorStyle/style-category/index.js.map +0 -1
- package/lib/components/toolbar/popup/downloadsummary/downloadSummaryContext.js +0 -9
- package/lib/components/toolbar/popup/downloadsummary/downloadSummaryContext.js.map +0 -1
- package/lib/components/toolbar/popup/downloadsummary/downloadSummaryTemp.js +0 -128
- package/lib/components/toolbar/popup/downloadsummary/downloadSummaryTemp.js.map +0 -1
- package/lib/components/toolbar/popup/downloadsummary/index.js +0 -572
- package/lib/components/toolbar/popup/downloadsummary/index.js.map +0 -1
- package/lib/components/toolbar/popup/downloadsummary/show2D/show2DView.js +0 -60
- package/lib/components/toolbar/popup/downloadsummary/show2D/show2DView.js.map +0 -1
- package/lib/components/toolbar/popup/downloadsummary/show2D/viewer2DDownLoad.js +0 -200
- package/lib/components/toolbar/popup/downloadsummary/show2D/viewer2DDownLoad.js.map +0 -1
- package/lib/components/toolbar/popup/downloadsummary/show3D/show3DView.js +0 -254
- package/lib/components/toolbar/popup/downloadsummary/show3D/show3DView.js.map +0 -1
- package/lib/components/toolbar/popup/downloadsummary/show3D/viewer3DDownLoad.js +0 -1762
- package/lib/components/toolbar/popup/downloadsummary/show3D/viewer3DDownLoad.js.map +0 -1
- package/lib/components/toolbar/popup/downloadsummary/showCabinetInfo.js +0 -96
- package/lib/components/toolbar/popup/downloadsummary/showCabinetInfo.js.map +0 -1
- package/lib/components/toolbar/popup/downloadsummary/showElevation/showElevationView.js +0 -125
- package/lib/components/toolbar/popup/downloadsummary/showElevation/showElevationView.js.map +0 -1
- package/lib/components/toolbar/popup/downloadsummary/showElevation/viewer3DElevationDownload.js +0 -1713
- package/lib/components/toolbar/popup/downloadsummary/showElevation/viewer3DElevationDownload.js.map +0 -1
- package/lib/components/toolbar/popup/downloadsummary/showElevation/viewerElevationDownload.js +0 -184
- package/lib/components/toolbar/popup/downloadsummary/showElevation/viewerElevationDownload.js.map +0 -1
- package/lib/components/toolbar/popup/downloadsummary/showWarranty.js +0 -115
- package/lib/components/toolbar/popup/downloadsummary/showWarranty.js.map +0 -1
- package/lib/components/toolbar/popup/downloadsummary/styles.js +0 -47
- package/lib/components/toolbar/popup/downloadsummary/styles.js.map +0 -1
- package/lib/components/toolbar/popup/finishingtouch/category/index.js +0 -44
- package/lib/components/toolbar/popup/finishingtouch/category/index.js.map +0 -1
- package/lib/components/toolbar/popup/finishingtouch/index.js +0 -54
- package/lib/components/toolbar/popup/finishingtouch/index.js.map +0 -1
- package/lib/components/toolbar/popup/finishingtouch/material-edit.js +0 -163
- package/lib/components/toolbar/popup/finishingtouch/material-edit.js.map +0 -1
- package/lib/components/toolbar/popup/finishingtouch/product/index.js +0 -65
- package/lib/components/toolbar/popup/finishingtouch/product/index.js.map +0 -1
- package/lib/components/toolbar/popup/floorplan/choose-floor/confirm-popup.js +0 -124
- package/lib/components/toolbar/popup/floorplan/choose-floor/confirm-popup.js.map +0 -1
- package/lib/components/toolbar/popup/floorplan/choose-floor/index.js +0 -255
- package/lib/components/toolbar/popup/floorplan/choose-floor/index.js.map +0 -1
- package/lib/components/toolbar/popup/floorplan/choose-floor/styles.js +0 -20
- package/lib/components/toolbar/popup/floorplan/choose-floor/styles.js.map +0 -1
- package/lib/components/toolbar/popup/floorplan/floor-category/index.js +0 -99
- package/lib/components/toolbar/popup/floorplan/floor-category/index.js.map +0 -1
- package/lib/components/toolbar/popup/floorplan/index.js +0 -56
- package/lib/components/toolbar/popup/floorplan/index.js.map +0 -1
- package/lib/components/toolbar/popup/index.js +0 -195
- package/lib/components/toolbar/popup/index.js.map +0 -1
- package/lib/components/toolbar/popup/newproject/index.js +0 -75
- package/lib/components/toolbar/popup/newproject/index.js.map +0 -1
- package/lib/components/toolbar/popup/newproject/styles.js +0 -16
- package/lib/components/toolbar/popup/newproject/styles.js.map +0 -1
- package/lib/components/toolbar/popup/product/appliance.js +0 -73
- package/lib/components/toolbar/popup/product/appliance.js.map +0 -1
- package/lib/components/toolbar/popup/product/cabinetproduct.js +0 -33
- package/lib/components/toolbar/popup/product/cabinetproduct.js.map +0 -1
- package/lib/components/toolbar/popup/product/doorstyle.js +0 -59
- package/lib/components/toolbar/popup/product/doorstyle.js.map +0 -1
- package/lib/components/toolbar/popup/product/doorstyleproduct.js +0 -59
- package/lib/components/toolbar/popup/product/doorstyleproduct.js.map +0 -1
- package/lib/components/toolbar/popup/product/floor.js +0 -59
- package/lib/components/toolbar/popup/product/floor.js.map +0 -1
- package/lib/components/toolbar/popup/product/floorproduct.js +0 -68
- package/lib/components/toolbar/popup/product/floorproduct.js.map +0 -1
- package/lib/components/toolbar/popup/product/index.js +0 -59
- package/lib/components/toolbar/popup/product/index.js.map +0 -1
- package/lib/components/toolbar/popup/product/primary.js +0 -71
- package/lib/components/toolbar/popup/product/primary.js.map +0 -1
- package/lib/components/toolbar/popup/product/productline.js +0 -128
- package/lib/components/toolbar/popup/product/productline.js.map +0 -1
- package/lib/components/toolbar/popup/product/reviewItem.js +0 -346
- package/lib/components/toolbar/popup/product/reviewItem.js.map +0 -1
- package/lib/components/toolbar/popup/product/reviewMolding.js +0 -291
- package/lib/components/toolbar/popup/product/reviewMolding.js.map +0 -1
- package/lib/components/toolbar/popup/product/styles.js +0 -79
- package/lib/components/toolbar/popup/product/styles.js.map +0 -1
- package/lib/components/toolbar/popup/savedesign/FullPictureForm.js +0 -169
- package/lib/components/toolbar/popup/savedesign/FullPictureForm.js.map +0 -1
- package/lib/components/toolbar/popup/savedesign/index.js +0 -516
- package/lib/components/toolbar/popup/savedesign/index.js.map +0 -1
- package/lib/components/toolbar/popup/savedesign/styles.js +0 -26
- package/lib/components/toolbar/popup/savedesign/styles.js.map +0 -1
- package/lib/components/toolbar/popup/setDoorStyleOption/index.js +0 -64
- package/lib/components/toolbar/popup/setDoorStyleOption/index.js.map +0 -1
- package/lib/components/toolbar/popup/styles.js +0 -104
- package/lib/components/toolbar/popup/styles.js.map +0 -1
- package/lib/components/toolbar/popup/submitforquote/AddToCartOptions.js +0 -166
- package/lib/components/toolbar/popup/submitforquote/AddToCartOptions.js.map +0 -1
- package/lib/components/toolbar/popup/submitforquote/CustomerRequestsForm.js +0 -93
- package/lib/components/toolbar/popup/submitforquote/CustomerRequestsForm.js.map +0 -1
- package/lib/components/toolbar/popup/submitforquote/SkipDesignerReview.js +0 -45
- package/lib/components/toolbar/popup/submitforquote/SkipDesignerReview.js.map +0 -1
- package/lib/components/toolbar/popup/submitforquote/StepDots.js +0 -40
- package/lib/components/toolbar/popup/submitforquote/StepDots.js.map +0 -1
- package/lib/components/toolbar/popup/submitforquote/cart-choice.js +0 -141
- package/lib/components/toolbar/popup/submitforquote/cart-choice.js.map +0 -1
- package/lib/components/toolbar/popup/submitforquote/doorstyle-menus.js +0 -50
- package/lib/components/toolbar/popup/submitforquote/doorstyle-menus.js.map +0 -1
- package/lib/components/toolbar/popup/submitforquote/index.js +0 -698
- package/lib/components/toolbar/popup/submitforquote/index.js.map +0 -1
- package/lib/components/toolbar/popup/submitforquote/styles.js +0 -38
- package/lib/components/toolbar/popup/submitforquote/styles.js.map +0 -1
- package/lib/components/toolbar/popup/submitprompt/index.js +0 -79
- package/lib/components/toolbar/popup/submitprompt/index.js.map +0 -1
- package/lib/components/toolbar/popup/submitprompt/styles.js +0 -16
- package/lib/components/toolbar/popup/submitprompt/styles.js.map +0 -1
- package/lib/components/toolbar/toolbar-button.js +0 -111
- package/lib/components/toolbar/toolbar-button.js.map +0 -1
- package/lib/components/toolbar/toolbar-load-button.js +0 -36
- package/lib/components/toolbar/toolbar-load-button.js.map +0 -1
- package/lib/components/toolbar/toolbar-save-button.js +0 -34
- package/lib/components/toolbar/toolbar-save-button.js.map +0 -1
- package/lib/components/tutorial-view/Modal.js +0 -503
- package/lib/components/tutorial-view/Modal.js.map +0 -1
- package/lib/components/tutorial-view/styles.js +0 -13
- package/lib/components/tutorial-view/styles.js.map +0 -1
- package/lib/components/viewer2d/area.js +0 -90
- package/lib/components/viewer2d/area.js.map +0 -1
- package/lib/components/viewer2d/export.js +0 -122
- package/lib/components/viewer2d/export.js.map +0 -1
- package/lib/components/viewer2d/grids/grid-horizontal-streak.js +0 -45
- package/lib/components/viewer2d/grids/grid-horizontal-streak.js.map +0 -1
- package/lib/components/viewer2d/grids/grid-streak.js +0 -45
- package/lib/components/viewer2d/grids/grid-streak.js.map +0 -1
- package/lib/components/viewer2d/grids/grid-vertical-streak.js +0 -45
- package/lib/components/viewer2d/grids/grid-vertical-streak.js.map +0 -1
- package/lib/components/viewer2d/grids/grids.js +0 -45
- package/lib/components/viewer2d/grids/grids.js.map +0 -1
- package/lib/components/viewer2d/group.js +0 -63
- package/lib/components/viewer2d/group.js.map +0 -1
- package/lib/components/viewer2d/item.js +0 -522
- package/lib/components/viewer2d/item.js.map +0 -1
- package/lib/components/viewer2d/layer.js +0 -172
- package/lib/components/viewer2d/layer.js.map +0 -1
- package/lib/components/viewer2d/line.js +0 -899
- package/lib/components/viewer2d/line.js.map +0 -1
- package/lib/components/viewer2d/ruler.js +0 -108
- package/lib/components/viewer2d/ruler.js.map +0 -1
- package/lib/components/viewer2d/rulerDist.js +0 -154
- package/lib/components/viewer2d/rulerDist.js.map +0 -1
- package/lib/components/viewer2d/rulerX.js +0 -159
- package/lib/components/viewer2d/rulerX.js.map +0 -1
- package/lib/components/viewer2d/rulerY.js +0 -161
- package/lib/components/viewer2d/rulerY.js.map +0 -1
- package/lib/components/viewer2d/scene.js +0 -148
- package/lib/components/viewer2d/scene.js.map +0 -1
- package/lib/components/viewer2d/snap.js +0 -84
- package/lib/components/viewer2d/snap.js.map +0 -1
- package/lib/components/viewer2d/state.js +0 -88
- package/lib/components/viewer2d/state.js.map +0 -1
- package/lib/components/viewer2d/utils.js +0 -174
- package/lib/components/viewer2d/utils.js.map +0 -1
- package/lib/components/viewer2d/vertex.js +0 -76
- package/lib/components/viewer2d/vertex.js.map +0 -1
- package/lib/components/viewer2d/viewer2d.js +0 -1409
- package/lib/components/viewer2d/viewer2d.js.map +0 -1
- package/lib/components/viewer3d/camera-controls-module/camera-controls.module.js +0 -2598
- package/lib/components/viewer3d/camera-controls-module/camera-controls.module.js.map +0 -1
- package/lib/components/viewer3d/dcm.js +0 -408
- package/lib/components/viewer3d/dcm.js.map +0 -1
- package/lib/components/viewer3d/fbm.js +0 -421
- package/lib/components/viewer3d/fbm.js.map +0 -1
- package/lib/components/viewer3d/front3D.js +0 -76
- package/lib/components/viewer3d/front3D.js.map +0 -1
- package/lib/components/viewer3d/grid-creator.js +0 -35
- package/lib/components/viewer3d/grid-creator.js.map +0 -1
- package/lib/components/viewer3d/grids/grid-horizontal-streak.js +0 -45
- package/lib/components/viewer3d/grids/grid-horizontal-streak.js.map +0 -1
- package/lib/components/viewer3d/grids/grid-streak.js +0 -36
- package/lib/components/viewer3d/grids/grid-streak.js.map +0 -1
- package/lib/components/viewer3d/grids/grid-vertical-streak.js +0 -45
- package/lib/components/viewer3d/grids/grid-vertical-streak.js.map +0 -1
- package/lib/components/viewer3d/libs/first-person-controls.js +0 -75
- package/lib/components/viewer3d/libs/first-person-controls.js.map +0 -1
- package/lib/components/viewer3d/libs/helvetiker_regular.typeface.js +0 -1288
- package/lib/components/viewer3d/libs/helvetiker_regular.typeface.js.map +0 -1
- package/lib/components/viewer3d/libs/mtl-loader.js +0 -360
- package/lib/components/viewer3d/libs/mtl-loader.js.map +0 -1
- package/lib/components/viewer3d/libs/obj-loader.js +0 -465
- package/lib/components/viewer3d/libs/obj-loader.js.map +0 -1
- package/lib/components/viewer3d/libs/orbit-controls.js +0 -701
- package/lib/components/viewer3d/libs/orbit-controls.js.map +0 -1
- package/lib/components/viewer3d/libs/pointer-lock-controls.js +0 -48
- package/lib/components/viewer3d/libs/pointer-lock-controls.js.map +0 -1
- package/lib/components/viewer3d/lrm.js +0 -312
- package/lib/components/viewer3d/lrm.js.map +0 -1
- package/lib/components/viewer3d/model.js +0 -715
- package/lib/components/viewer3d/model.js.map +0 -1
- package/lib/components/viewer3d/pointer-lock-navigation.js +0 -123
- package/lib/components/viewer3d/pointer-lock-navigation.js.map +0 -1
- package/lib/components/viewer3d/ruler-utils/itemRect.js +0 -69
- package/lib/components/viewer3d/ruler-utils/itemRect.js.map +0 -1
- package/lib/components/viewer3d/ruler-utils/layer3D.js +0 -503
- package/lib/components/viewer3d/ruler-utils/layer3D.js.map +0 -1
- package/lib/components/viewer3d/ruler-utils/ruler3D.js +0 -235
- package/lib/components/viewer3d/ruler-utils/ruler3D.js.map +0 -1
- package/lib/components/viewer3d/ruler-utils/scene3D.js +0 -70
- package/lib/components/viewer3d/ruler-utils/scene3D.js.map +0 -1
- package/lib/components/viewer3d/ruler-utils/state3D.js +0 -26
- package/lib/components/viewer3d/ruler-utils/state3D.js.map +0 -1
- package/lib/components/viewer3d/scene-creator.js +0 -3641
- package/lib/components/viewer3d/scene-creator.js.map +0 -1
- package/lib/components/viewer3d/three-memory-cleaner.js +0 -61
- package/lib/components/viewer3d/three-memory-cleaner.js.map +0 -1
- package/lib/components/viewer3d/viewer3d-first-person.js +0 -321
- package/lib/components/viewer3d/viewer3d-first-person.js.map +0 -1
- package/lib/components/viewer3d/viewer3d.js +0 -2508
- package/lib/components/viewer3d/viewer3d.js.map +0 -1
- package/lib/components/wizardstep/button/styles.js +0 -67
- package/lib/components/wizardstep/button/styles.js.map +0 -1
- package/lib/components/wizardstep/export.js +0 -12
- package/lib/components/wizardstep/export.js.map +0 -1
- package/lib/components/wizardstep/index.js +0 -978
- package/lib/components/wizardstep/index.js.map +0 -1
- package/lib/components/wizardstep/styles.js +0 -68
- package/lib/components/wizardstep/styles.js.map +0 -1
- package/lib/components/wizardstep/wizardstep-content-button.js +0 -224
- package/lib/components/wizardstep/wizardstep-content-button.js.map +0 -1
- package/lib/components/wizardstep/wizardstep-toggle-button.js +0 -133
- package/lib/components/wizardstep/wizardstep-toggle-button.js.map +0 -1
- package/lib/constants.js +0 -646
- package/lib/constants.js.map +0 -1
- package/lib/hooks/useCheckCart.js +0 -60
- package/lib/hooks/useCheckCart.js.map +0 -1
- package/lib/hooks/useGetPricesBySku.js +0 -81
- package/lib/hooks/useGetPricesBySku.js.map +0 -1
- package/lib/hooks/useValidateToken.js +0 -207
- package/lib/hooks/useValidateToken.js.map +0 -1
- package/lib/index.js +0 -102
- package/lib/index.js.map +0 -1
- package/lib/models.js +0 -518
- package/lib/models.js.map +0 -1
- package/lib/plugins/SVGLoader.js +0 -1418
- package/lib/plugins/SVGLoader.js.map +0 -1
- package/lib/plugins/autosave.js +0 -40
- package/lib/plugins/autosave.js.map +0 -1
- package/lib/plugins/console-debugger.js +0 -45
- package/lib/plugins/console-debugger.js.map +0 -1
- package/lib/plugins/export.js +0 -34
- package/lib/plugins/export.js.map +0 -1
- package/lib/plugins/keyboard.js +0 -108
- package/lib/plugins/keyboard.js.map +0 -1
- package/lib/reducers/areas-reducer.js +0 -19
- package/lib/reducers/areas-reducer.js.map +0 -1
- package/lib/reducers/export.js +0 -98
- package/lib/reducers/export.js.map +0 -1
- package/lib/reducers/groups-reducer.js +0 -45
- package/lib/reducers/groups-reducer.js.map +0 -1
- package/lib/reducers/holes-reducer.js +0 -69
- package/lib/reducers/holes-reducer.js.map +0 -1
- package/lib/reducers/items-reducer.js +0 -147
- package/lib/reducers/items-reducer.js.map +0 -1
- package/lib/reducers/lines-reducer.js +0 -52
- package/lib/reducers/lines-reducer.js.map +0 -1
- package/lib/reducers/project-reducer.js +0 -136
- package/lib/reducers/project-reducer.js.map +0 -1
- package/lib/reducers/reducer.js +0 -27
- package/lib/reducers/reducer.js.map +0 -1
- package/lib/reducers/scene-reducer.js +0 -35
- package/lib/reducers/scene-reducer.js.map +0 -1
- package/lib/reducers/user-reducer.js +0 -48
- package/lib/reducers/user-reducer.js.map +0 -1
- package/lib/reducers/vertices-reducer.js +0 -26
- package/lib/reducers/vertices-reducer.js.map +0 -1
- package/lib/reducers/viewer2d-reducer.js +0 -83
- package/lib/reducers/viewer2d-reducer.js.map +0 -1
- package/lib/reducers/viewer3d-reducer.js +0 -64
- package/lib/reducers/viewer3d-reducer.js.map +0 -1
- package/lib/shared-style.js +0 -73
- package/lib/shared-style.js.map +0 -1
- package/lib/styles/export.js +0 -14
- package/lib/styles/export.js.map +0 -1
- package/lib/translator/en.js +0 -111
- package/lib/translator/en.js.map +0 -1
- package/lib/translator/it.js +0 -86
- package/lib/translator/it.js.map +0 -1
- package/lib/translator/ru.js +0 -86
- package/lib/translator/ru.js.map +0 -1
- package/lib/translator/translator.js +0 -91
- package/lib/translator/translator.js.map +0 -1
- package/lib/utils/browser.js +0 -41
- package/lib/utils/browser.js.map +0 -1
- package/lib/utils/email-validator.js +0 -11
- package/lib/utils/email-validator.js.map +0 -1
- package/lib/utils/export.js +0 -57
- package/lib/utils/export.js.map +0 -1
- package/lib/utils/geometry.js +0 -2329
- package/lib/utils/geometry.js.map +0 -1
- package/lib/utils/get-edges-of-subgraphs.js +0 -29
- package/lib/utils/get-edges-of-subgraphs.js.map +0 -1
- package/lib/utils/graph-cycles.js +0 -241
- package/lib/utils/graph-cycles.js.map +0 -1
- package/lib/utils/graph-inner-cycles.js +0 -55
- package/lib/utils/graph-inner-cycles.js.map +0 -1
- package/lib/utils/graph.js +0 -152
- package/lib/utils/graph.js.map +0 -1
- package/lib/utils/helper.js +0 -360
- package/lib/utils/helper.js.map +0 -1
- package/lib/utils/history.js +0 -37
- package/lib/utils/history.js.map +0 -1
- package/lib/utils/id-broker.js +0 -26
- package/lib/utils/id-broker.js.map +0 -1
- package/lib/utils/logger.js +0 -15
- package/lib/utils/logger.js.map +0 -1
- package/lib/utils/math.js +0 -58
- package/lib/utils/math.js.map +0 -1
- package/lib/utils/molding.js +0 -864
- package/lib/utils/molding.js.map +0 -1
- package/lib/utils/name-generator.js +0 -24
- package/lib/utils/name-generator.js.map +0 -1
- package/lib/utils/objects-utils.js +0 -61
- package/lib/utils/objects-utils.js.map +0 -1
- package/lib/utils/phone-validator.js +0 -11
- package/lib/utils/phone-validator.js.map +0 -1
- package/lib/utils/process-black-list.js +0 -25
- package/lib/utils/process-black-list.js.map +0 -1
- package/lib/utils/react-if.js +0 -25
- package/lib/utils/react-if.js.map +0 -1
- package/lib/utils/snap-scene.js +0 -106
- package/lib/utils/snap-scene.js.map +0 -1
- package/lib/utils/snap.js +0 -250
- package/lib/utils/snap.js.map +0 -1
- package/lib/utils/threeCSG.es6.js +0 -504
- package/lib/utils/threeCSG.es6.js.map +0 -1
- package/lib/version.js +0 -8
- package/lib/version.js.map +0 -1
- package/src/@history.js +0 -3
- package/src/AppContext.js +0 -5
- package/src/KitchenConfigurator.jsx +0 -1517
- package/src/KitchenConfiguratorApp.jsx +0 -443
- package/src/actions/area-actions.js +0 -15
- package/src/actions/export.js +0 -38
- package/src/actions/groups-actions.js +0 -102
- package/src/actions/holes-actions.js +0 -152
- package/src/actions/items-actions.js +0 -393
- package/src/actions/lines-actions.js +0 -103
- package/src/actions/project-actions.js +0 -391
- package/src/actions/scene-actions.js +0 -44
- package/src/actions/user-actions.js +0 -75
- package/src/actions/vertices-actions.js +0 -34
- package/src/actions/viewer2d-actions.js +0 -79
- package/src/actions/viewer3d-actions.js +0 -32
- package/src/catalog/areas/area/planner-element.jsx +0 -43
- package/src/catalog/areas/area/textures/ceramic-tile.jpg +0 -0
- package/src/catalog/areas/area/textures/grass.jpg +0 -0
- package/src/catalog/areas/area/textures/parquet.jpg +0 -0
- package/src/catalog/areas/area/textures/strand-porcelain.jpg +0 -0
- package/src/catalog/areas/area/textures/tile1.jpg +0 -0
- package/src/catalog/back.png +0 -0
- package/src/catalog/catalog.js +0 -258
- package/src/catalog/doors.png +0 -0
- package/src/catalog/doorways.png +0 -0
- package/src/catalog/envMap/nx.hdr +0 -0
- package/src/catalog/envMap/ny.hdr +0 -0
- package/src/catalog/envMap/nz.hdr +0 -0
- package/src/catalog/envMap/px.hdr +0 -0
- package/src/catalog/envMap/py.hdr +0 -0
- package/src/catalog/envMap/pz.hdr +0 -0
- package/src/catalog/factories/area-factory-3d.js +0 -252
- package/src/catalog/factories/area-factory.jsx +0 -102
- package/src/catalog/factories/export.js +0 -9
- package/src/catalog/factories/wall-factory-3d.js +0 -296
- package/src/catalog/factories/wall-factory.jsx +0 -321
- package/src/catalog/holes/door-closet/planner-element.jsx +0 -251
- package/src/catalog/holes/door-double/door_double.png +0 -0
- package/src/catalog/holes/door-double/planner-element.jsx +0 -391
- package/src/catalog/holes/door-exterior/planner-element.jsx +0 -245
- package/src/catalog/holes/door-interior/planner-element.jsx +0 -256
- package/src/catalog/holes/door-panic/panicDoor.png +0 -0
- package/src/catalog/holes/door-panic/planner-element.jsx +0 -594
- package/src/catalog/holes/door-panic-double/panicDoorDouble.png +0 -0
- package/src/catalog/holes/door-panic-double/planner-element.jsx +0 -574
- package/src/catalog/holes/door-sliding/planner-element.jsx +0 -256
- package/src/catalog/holes/doorway-framed/planner-element.jsx +0 -169
- package/src/catalog/holes/doorway-frameless/planner-element.jsx +0 -116
- package/src/catalog/holes/gate/gate.jpg +0 -0
- package/src/catalog/holes/window-clear/planner-element.jsx +0 -181
- package/src/catalog/holes/window-clear/texture.png +0 -0
- package/src/catalog/holes/window-cross/planner-element.jsx +0 -180
- package/src/catalog/holes/window-cross/texture.png +0 -0
- package/src/catalog/holes/window-double-hung/planner-element.jsx +0 -366
- package/src/catalog/holes/window-double-hung/texture.png +0 -0
- package/src/catalog/holes/window-vertical/planner-element.jsx +0 -290
- package/src/catalog/holes/window-vertical/texture.png +0 -0
- package/src/catalog/lines/wall/planner-element.jsx +0 -73
- package/src/catalog/lines/wall/textures/bricks-normal.jpg +0 -0
- package/src/catalog/lines/wall/textures/bricks-normal2.jpg +0 -0
- package/src/catalog/lines/wall/textures/bricks.jpg +0 -0
- package/src/catalog/lines/wall/textures/bricks2.jpg +0 -0
- package/src/catalog/lines/wall/textures/bricks3.jpg +0 -0
- package/src/catalog/lines/wall/textures/morden-normal.jpg +0 -0
- package/src/catalog/lines/wall/textures/morden.jpg +0 -0
- package/src/catalog/lines/wall/textures/painted-normal.jpg +0 -0
- package/src/catalog/lines/wall/textures/painted.jpg +0 -0
- package/src/catalog/lines/wall/textures/plaster-normal.jpg +0 -0
- package/src/catalog/lines/wall/textures/plaster.jpg +0 -0
- package/src/catalog/lines/wall/wall.png +0 -0
- package/src/catalog/molding/molding-dcm/planner-element.jsx +0 -35
- package/src/catalog/molding/molding-dcm/texture.png +0 -0
- package/src/catalog/molding/molding-fbm/planner-element.jsx +0 -35
- package/src/catalog/molding/molding-fbm/texture.png +0 -0
- package/src/catalog/molding/molding-lrm/planner-element.jsx +0 -35
- package/src/catalog/molding/molding-lrm/texture.png +0 -0
- package/src/catalog/properties/export.js +0 -33
- package/src/catalog/properties/property-checkbox.jsx +0 -123
- package/src/catalog/properties/property-color.jsx +0 -52
- package/src/catalog/properties/property-enum.jsx +0 -87
- package/src/catalog/properties/property-hidden.jsx +0 -22
- package/src/catalog/properties/property-lenght-measure.jsx +0 -113
- package/src/catalog/properties/property-length-measure.jsx +0 -129
- package/src/catalog/properties/property-length-measure_hole.jsx +0 -110
- package/src/catalog/properties/property-number.jsx +0 -63
- package/src/catalog/properties/property-read-only.jsx +0 -37
- package/src/catalog/properties/property-string.jsx +0 -59
- package/src/catalog/properties/property-toggle.jsx +0 -51
- package/src/catalog/properties/shared-property-style.js +0 -13
- package/src/catalog/utils/FuseUtils.js +0 -61
- package/src/catalog/utils/exporter.js +0 -173
- package/src/catalog/utils/geom-utils.js +0 -301
- package/src/catalog/utils/item-loader.jsx +0 -2122
- package/src/catalog/utils/load-obj.js +0 -113
- package/src/catalog/utils/mtl-loader.js +0 -462
- package/src/catalog/utils/obj-loader.js +0 -544
- package/src/catalog/windows.png +0 -0
- package/src/class/FuseUtils.js +0 -61
- package/src/class/area.js +0 -159
- package/src/class/export.js +0 -37
- package/src/class/group.js +0 -565
- package/src/class/guide.js +0 -44
- package/src/class/hole.js +0 -1359
- package/src/class/item.js +0 -2050
- package/src/class/layer.js +0 -926
- package/src/class/line.js +0 -1780
- package/src/class/project.js +0 -875
- package/src/class/vertex.js +0 -409
- package/src/components/atoms/Snackbar/index.jsx +0 -43
- package/src/components/atoms/radio-button/index.jsx +0 -20
- package/src/components/atoms/radio-button/styles.js +0 -56
- package/src/components/button/MainButton.jsx +0 -157
- package/src/components/button/ToggleMeasureButton.jsx +0 -65
- package/src/components/catalog-view/catalog-breadcrumb.jsx +0 -53
- package/src/components/catalog-view/catalog-item.jsx +0 -229
- package/src/components/catalog-view/catalog-list.jsx +0 -173
- package/src/components/catalog-view/catalog-page-item.jsx +0 -110
- package/src/components/catalog-view/catalog-turn-back-page-item.jsx +0 -80
- package/src/components/configurator/custom-configurator.jsx +0 -77
- package/src/components/configurator/project-configurator.jsx +0 -120
- package/src/components/content.jsx +0 -136
- package/src/components/export.js +0 -36
- package/src/components/firstsetting/button/styles.js +0 -223
- package/src/components/firstsetting/export.js +0 -9
- package/src/components/firstsetting/firstsetting-content-button.jsx +0 -198
- package/src/components/firstsetting/firstsetting-toggle-button.jsx +0 -101
- package/src/components/firstsetting/firstsetting.jsx +0 -814
- package/src/components/footerbar/button/ControlButton.jsx +0 -43
- package/src/components/footerbar/button/DirectionButton.jsx +0 -54
- package/src/components/footerbar/button/DirectionPanSpinButton.jsx +0 -36
- package/src/components/footerbar/button/ToggleButton.jsx +0 -58
- package/src/components/footerbar/button/ToggleConvertButton.jsx +0 -48
- package/src/components/footerbar/button/ToggleMeasureButton.jsx +0 -33
- package/src/components/footerbar/button/styles.js +0 -217
- package/src/components/footerbar/export.js +0 -9
- package/src/components/footerbar/footer-content-button.jsx +0 -198
- package/src/components/footerbar/footer-toggle-button.jsx +0 -101
- package/src/components/footerbar/footerbar.jsx +0 -1103
- package/src/components/footerbar/styles.js +0 -263
- package/src/components/header/button/MenuButton.jsx +0 -46
- package/src/components/header/button/SaveButton.jsx +0 -54
- package/src/components/header/button/styles.js +0 -181
- package/src/components/header/export.js +0 -5
- package/src/components/header/header.jsx +0 -631
- package/src/components/header/header.style.css +0 -47
- package/src/components/header/styles.js +0 -320
- package/src/components/login/Login.js +0 -77
- package/src/components/login/LoginForm/index.js +0 -108
- package/src/components/login/Register.js +0 -83
- package/src/components/login/RegisterForm/index.js +0 -171
- package/src/components/login/jwtService.js +0 -201
- package/src/components/login/style.css +0 -158
- package/src/components/login/style.scss +0 -260
- package/src/components/molecules/slider/index.jsx +0 -15
- package/src/components/molecules/slider/styles.js +0 -0
- package/src/components/molecules/slider/styles.scss +0 -3
- package/src/components/myprojects/export.js +0 -5
- package/src/components/myprojects/index.jsx +0 -445
- package/src/components/myprojects/styles.js +0 -241
- package/src/components/sidebar/custom-accordion.jsx +0 -48
- package/src/components/sidebar/export.js +0 -15
- package/src/components/sidebar/panel-element-editor/attributes-editor/attributes-editor.jsx +0 -73
- package/src/components/sidebar/panel-element-editor/attributes-editor/confirm-popup.jsx +0 -101
- package/src/components/sidebar/panel-element-editor/attributes-editor/hole-attributes-editor.jsx +0 -149
- package/src/components/sidebar/panel-element-editor/attributes-editor/item-attributes-editor.jsx +0 -316
- package/src/components/sidebar/panel-element-editor/attributes-editor/line-attributes-editor.jsx +0 -108
- package/src/components/sidebar/panel-element-editor/element-editor.jsx +0 -1070
- package/src/components/sidebar/panel-element-editor/multi-elements-editor.jsx +0 -0
- package/src/components/sidebar/panel-element-editor/panel-element-editor.jsx +0 -104
- package/src/components/sidebar/panel-element-editor/panel-multi-elements-editor.jsx +0 -155
- package/src/components/sidebar/panel-group-editor.jsx +0 -272
- package/src/components/sidebar/panel-groups.jsx +0 -310
- package/src/components/sidebar/panel-guides.jsx +0 -192
- package/src/components/sidebar/panel-layer-elements.jsx +0 -298
- package/src/components/sidebar/panel-layers.jsx +0 -381
- package/src/components/sidebar/panel.jsx +0 -71
- package/src/components/sidebar/sidebar.jsx +0 -106
- package/src/components/sidebar/toolbar-panel.jsx +0 -139
- package/src/components/sign/export.js +0 -7
- package/src/components/sign/main/index.jsx +0 -523
- package/src/components/sign/main/styles.js +0 -163
- package/src/components/style/button.jsx +0 -95
- package/src/components/style/cancel-button.jsx +0 -20
- package/src/components/style/content-container.jsx +0 -29
- package/src/components/style/content-title.jsx +0 -20
- package/src/components/style/delete-button.jsx +0 -23
- package/src/components/style/export.jsx +0 -48
- package/src/components/style/form-block.jsx +0 -13
- package/src/components/style/form-color-input.jsx +0 -27
- package/src/components/style/form-label.jsx +0 -15
- package/src/components/style/form-number-input.jsx +0 -196
- package/src/components/style/form-number-input_2.jsx +0 -191
- package/src/components/style/form-select.jsx +0 -38
- package/src/components/style/form-slider.jsx +0 -36
- package/src/components/style/form-submit-button.jsx +0 -23
- package/src/components/style/form-text-input.jsx +0 -65
- package/src/components/toolbar/button/ControlButton.jsx +0 -41
- package/src/components/toolbar/button/DirectionButton.jsx +0 -34
- package/src/components/toolbar/button/RightButton.jsx +0 -103
- package/src/components/toolbar/button/ToggleButton.jsx +0 -41
- package/src/components/toolbar/button/index.jsx +0 -55
- package/src/components/toolbar/button/styles.js +0 -127
- package/src/components/toolbar/components/DoorStyleMenu.jsx +0 -103
- package/src/components/toolbar/components/Pricing.jsx +0 -126
- package/src/components/toolbar/components/ReviewForQuote.jsx +0 -635
- package/src/components/toolbar/export.js +0 -21
- package/src/components/toolbar/main/Alert.js +0 -122
- package/src/components/toolbar/main/TakePictureModal.jsx +0 -104
- package/src/components/toolbar/main/confirm-popup.jsx +0 -99
- package/src/components/toolbar/main/index.jsx +0 -5687
- package/src/components/toolbar/main/lShaped.json +0 -311
- package/src/components/toolbar/main/longNarrow.json +0 -238
- package/src/components/toolbar/main/myComponents.js +0 -123
- package/src/components/toolbar/main/oRectangle.json +0 -220
- package/src/components/toolbar/main/rectangle.json +0 -238
- package/src/components/toolbar/main/style.css +0 -107
- package/src/components/toolbar/main/styles.js +0 -696
- package/src/components/toolbar/plugin-item.jsx +0 -123
- package/src/components/toolbar/popup/appliance/appliance-category/index.jsx +0 -73
- package/src/components/toolbar/popup/appliance/choose-appliance/index.jsx +0 -102
- package/src/components/toolbar/popup/appliance/index.jsx +0 -83
- package/src/components/toolbar/popup/autosaveprompt/index.jsx +0 -150
- package/src/components/toolbar/popup/autosaveprompt/styles.css +0 -64
- package/src/components/toolbar/popup/autosaveprompt/styles.js +0 -40
- package/src/components/toolbar/popup/cabinet/cabinet-category/index.jsx +0 -73
- package/src/components/toolbar/popup/cabinet/choose-product/index.jsx +0 -119
- package/src/components/toolbar/popup/cabinet/index.jsx +0 -85
- package/src/components/toolbar/popup/doorStyle/choose-style/index.jsx +0 -63
- package/src/components/toolbar/popup/doorStyle/index.jsx +0 -71
- package/src/components/toolbar/popup/doorStyle/style-category/index.jsx +0 -139
- package/src/components/toolbar/popup/downloadsummary/downloadSummaryContext.js +0 -2
- package/src/components/toolbar/popup/downloadsummary/downloadSummaryTemp.jsx +0 -157
- package/src/components/toolbar/popup/downloadsummary/index.jsx +0 -643
- package/src/components/toolbar/popup/downloadsummary/show2D/show2DView.jsx +0 -51
- package/src/components/toolbar/popup/downloadsummary/show2D/viewer2DDownLoad.jsx +0 -175
- package/src/components/toolbar/popup/downloadsummary/show3D/show3DView.jsx +0 -283
- package/src/components/toolbar/popup/downloadsummary/show3D/viewer3DDownLoad.jsx +0 -2257
- package/src/components/toolbar/popup/downloadsummary/showCabinetInfo.js +0 -93
- package/src/components/toolbar/popup/downloadsummary/showElevation/showElevationView.jsx +0 -132
- package/src/components/toolbar/popup/downloadsummary/showElevation/viewer3DElevationDownload.jsx +0 -2198
- package/src/components/toolbar/popup/downloadsummary/showElevation/viewerElevationDownload.jsx +0 -152
- package/src/components/toolbar/popup/downloadsummary/showWarranty.jsx +0 -149
- package/src/components/toolbar/popup/downloadsummary/styles.css +0 -177
- package/src/components/toolbar/popup/downloadsummary/styles.js +0 -453
- package/src/components/toolbar/popup/finishingtouch/category/index.jsx +0 -34
- package/src/components/toolbar/popup/finishingtouch/index.jsx +0 -58
- package/src/components/toolbar/popup/finishingtouch/material-edit.jsx +0 -112
- package/src/components/toolbar/popup/finishingtouch/product/index.jsx +0 -116
- package/src/components/toolbar/popup/floorplan/choose-floor/confirm-popup.jsx +0 -101
- package/src/components/toolbar/popup/floorplan/choose-floor/index.jsx +0 -254
- package/src/components/toolbar/popup/floorplan/choose-floor/lShaped.json +0 -311
- package/src/components/toolbar/popup/floorplan/choose-floor/longNarrow.json +0 -238
- package/src/components/toolbar/popup/floorplan/choose-floor/oRectangle.json +0 -220
- package/src/components/toolbar/popup/floorplan/choose-floor/rectangle.json +0 -238
- package/src/components/toolbar/popup/floorplan/choose-floor/styles.js +0 -86
- package/src/components/toolbar/popup/floorplan/floor-category/index.jsx +0 -109
- package/src/components/toolbar/popup/floorplan/index.jsx +0 -60
- package/src/components/toolbar/popup/index.jsx +0 -241
- package/src/components/toolbar/popup/newproject/index.jsx +0 -59
- package/src/components/toolbar/popup/newproject/styles.css +0 -64
- package/src/components/toolbar/popup/newproject/styles.js +0 -41
- package/src/components/toolbar/popup/product/appliance.jsx +0 -54
- package/src/components/toolbar/popup/product/cabinetproduct.jsx +0 -15
- package/src/components/toolbar/popup/product/doorstyle.jsx +0 -58
- package/src/components/toolbar/popup/product/doorstyleproduct.jsx +0 -47
- package/src/components/toolbar/popup/product/floor.jsx +0 -36
- package/src/components/toolbar/popup/product/floorproduct.jsx +0 -42
- package/src/components/toolbar/popup/product/index.jsx +0 -36
- package/src/components/toolbar/popup/product/primary.jsx +0 -77
- package/src/components/toolbar/popup/product/productline.jsx +0 -93
- package/src/components/toolbar/popup/product/reviewItem.jsx +0 -427
- package/src/components/toolbar/popup/product/reviewMolding.jsx +0 -310
- package/src/components/toolbar/popup/product/style.css +0 -54
- package/src/components/toolbar/popup/product/styles.js +0 -260
- package/src/components/toolbar/popup/savedesign/FullPictureForm.jsx +0 -146
- package/src/components/toolbar/popup/savedesign/index.jsx +0 -495
- package/src/components/toolbar/popup/savedesign/savedesign.style.css +0 -16
- package/src/components/toolbar/popup/savedesign/styles.js +0 -151
- package/src/components/toolbar/popup/setDoorStyleOption/index.jsx +0 -87
- package/src/components/toolbar/popup/styles.js +0 -909
- package/src/components/toolbar/popup/submitforquote/AddToCartOptions.jsx +0 -192
- package/src/components/toolbar/popup/submitforquote/CustomerRequestsForm.jsx +0 -96
- package/src/components/toolbar/popup/submitforquote/SkipDesignerReview.jsx +0 -54
- package/src/components/toolbar/popup/submitforquote/StepDots.jsx +0 -25
- package/src/components/toolbar/popup/submitforquote/cart-choice.jsx +0 -116
- package/src/components/toolbar/popup/submitforquote/doorstyle-menus.js +0 -38
- package/src/components/toolbar/popup/submitforquote/index.jsx +0 -698
- package/src/components/toolbar/popup/submitforquote/styles.css +0 -105
- package/src/components/toolbar/popup/submitforquote/styles.js +0 -294
- package/src/components/toolbar/popup/submitprompt/index.jsx +0 -89
- package/src/components/toolbar/popup/submitprompt/styles.css +0 -64
- package/src/components/toolbar/popup/submitprompt/styles.js +0 -42
- package/src/components/toolbar/toolbar-button.jsx +0 -90
- package/src/components/toolbar/toolbar-load-button.jsx +0 -36
- package/src/components/toolbar/toolbar-save-button.jsx +0 -32
- package/src/components/tutorial-view/Modal.jsx +0 -584
- package/src/components/tutorial-view/style.css +0 -111
- package/src/components/tutorial-view/styles.js +0 -65
- package/src/components/viewer2d/area.jsx +0 -98
- package/src/components/viewer2d/export.js +0 -48
- package/src/components/viewer2d/grids/grid-horizontal-streak.jsx +0 -40
- package/src/components/viewer2d/grids/grid-streak.jsx +0 -32
- package/src/components/viewer2d/grids/grid-vertical-streak.jsx +0 -41
- package/src/components/viewer2d/grids/grids.jsx +0 -30
- package/src/components/viewer2d/group.jsx +0 -57
- package/src/components/viewer2d/item.jsx +0 -618
- package/src/components/viewer2d/layer.jsx +0 -214
- package/src/components/viewer2d/line.jsx +0 -1358
- package/src/components/viewer2d/ruler.jsx +0 -136
- package/src/components/viewer2d/rulerDist.jsx +0 -192
- package/src/components/viewer2d/rulerX.jsx +0 -141
- package/src/components/viewer2d/rulerY.jsx +0 -138
- package/src/components/viewer2d/scene.jsx +0 -94
- package/src/components/viewer2d/snap.jsx +0 -118
- package/src/components/viewer2d/state.jsx +0 -77
- package/src/components/viewer2d/utils.js +0 -195
- package/src/components/viewer2d/vertex.jsx +0 -76
- package/src/components/viewer2d/viewer2d.jsx +0 -1830
- package/src/components/viewer3d/camera-controls-module/camera-controls.module.js +0 -3078
- package/src/components/viewer3d/dcm.js +0 -226
- package/src/components/viewer3d/fbm.js +0 -383
- package/src/components/viewer3d/front3D.jsx +0 -63
- package/src/components/viewer3d/grid-creator.js +0 -25
- package/src/components/viewer3d/grids/grid-horizontal-streak.js +0 -41
- package/src/components/viewer3d/grids/grid-streak.js +0 -34
- package/src/components/viewer3d/grids/grid-vertical-streak.js +0 -42
- package/src/components/viewer3d/libs/first-person-controls.js +0 -70
- package/src/components/viewer3d/libs/helvetiker_regular.typeface.js +0 -1265
- package/src/components/viewer3d/libs/mtl-loader.js +0 -462
- package/src/components/viewer3d/libs/obj-loader.js +0 -653
- package/src/components/viewer3d/libs/orbit-controls.js +0 -945
- package/src/components/viewer3d/libs/pointer-lock-controls.js +0 -67
- package/src/components/viewer3d/lrm.js +0 -358
- package/src/components/viewer3d/model.js +0 -830
- package/src/components/viewer3d/pointer-lock-navigation.js +0 -140
- package/src/components/viewer3d/ruler-utils/itemRect.jsx +0 -91
- package/src/components/viewer3d/ruler-utils/layer3D.jsx +0 -528
- package/src/components/viewer3d/ruler-utils/ruler3D.jsx +0 -218
- package/src/components/viewer3d/ruler-utils/scene3D.jsx +0 -87
- package/src/components/viewer3d/ruler-utils/state3D.jsx +0 -25
- package/src/components/viewer3d/scene-creator.js +0 -5172
- package/src/components/viewer3d/three-memory-cleaner.js +0 -65
- package/src/components/viewer3d/viewer3d-first-person.js +0 -395
- package/src/components/viewer3d/viewer3d.js +0 -3376
- package/src/components/wizardstep/button/styles.js +0 -677
- package/src/components/wizardstep/export.js +0 -5
- package/src/components/wizardstep/index.jsx +0 -1372
- package/src/components/wizardstep/styles.js +0 -688
- package/src/components/wizardstep/wizardstep-content-button.jsx +0 -198
- package/src/components/wizardstep/wizardstep-toggle-button.jsx +0 -101
- package/src/constants.js +0 -731
- package/src/hooks/useCheckCart.js +0 -38
- package/src/hooks/useGetPricesBySku.js +0 -59
- package/src/hooks/useValidateToken.js +0 -181
- package/src/index.js +0 -32
- package/src/models.js +0 -541
- package/src/plugins/SVGLoader.js +0 -1991
- package/src/plugins/autosave.js +0 -39
- package/src/plugins/console-debugger.js +0 -36
- package/src/plugins/export.js +0 -11
- package/src/plugins/keyboard.js +0 -194
- package/src/reducers/areas-reducer.js +0 -13
- package/src/reducers/export.js +0 -39
- package/src/reducers/groups-reducer.js +0 -73
- package/src/reducers/holes-reducer.js +0 -125
- package/src/reducers/items-reducer.js +0 -286
- package/src/reducers/lines-reducer.js +0 -96
- package/src/reducers/project-reducer.js +0 -239
- package/src/reducers/reducer.js +0 -59
- package/src/reducers/scene-reducer.js +0 -41
- package/src/reducers/user-reducer.js +0 -30
- package/src/reducers/vertices-reducer.js +0 -34
- package/src/reducers/viewer2d-reducer.js +0 -81
- package/src/reducers/viewer3d-reducer.js +0 -65
- package/src/shared-style.js +0 -72
- package/src/styles/export.js +0 -7
- package/src/styles/tabs.css +0 -40
- package/src/translator/en.js +0 -106
- package/src/translator/it.js +0 -80
- package/src/translator/ru.js +0 -80
- package/src/translator/translator.js +0 -81
- package/src/utils/browser.js +0 -36
- package/src/utils/email-validator.js +0 -5
- package/src/utils/export.js +0 -39
- package/src/utils/geometry.js +0 -2572
- package/src/utils/get-edges-of-subgraphs.js +0 -29
- package/src/utils/graph-cycles.js +0 -259
- package/src/utils/graph-inner-cycles.js +0 -49
- package/src/utils/graph.js +0 -147
- package/src/utils/helper.js +0 -431
- package/src/utils/history.js +0 -37
- package/src/utils/id-broker.js +0 -9
- package/src/utils/logger.js +0 -8
- package/src/utils/math.js +0 -51
- package/src/utils/molding.js +0 -973
- package/src/utils/name-generator.js +0 -5
- package/src/utils/objects-utils.js +0 -56
- package/src/utils/phone-validator.js +0 -4
- package/src/utils/process-black-list.js +0 -10
- package/src/utils/react-if.jsx +0 -20
- package/src/utils/snap-scene.js +0 -102
- package/src/utils/snap.js +0 -184
- package/src/utils/threeCSG.es6.js +0 -578
- package/src/version.js +0 -1
package/lib/utils/geometry.js
DELETED
|
@@ -1,2329 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.ContainsPoint = ContainsPoint;
|
|
8
|
-
exports.absAngleBetweenTwoPoints = absAngleBetweenTwoPoints;
|
|
9
|
-
exports.almostEqual = void 0;
|
|
10
|
-
exports.angleBetweenTwoLines = angleBetweenTwoLines;
|
|
11
|
-
exports.angleBetweenTwoPoints = angleBetweenTwoPoints;
|
|
12
|
-
exports.angleBetweenTwoPointsAndOrigin = angleBetweenTwoPointsAndOrigin;
|
|
13
|
-
exports.buildRectFromLines = buildRectFromLines;
|
|
14
|
-
exports.calcCreateSnap = calcCreateSnap;
|
|
15
|
-
exports.calcSnap = calcSnap;
|
|
16
|
-
exports.calcSnap1 = calcSnap1;
|
|
17
|
-
exports.calcSnap2 = calcSnap2;
|
|
18
|
-
exports.calcSnap3 = calcSnap3;
|
|
19
|
-
exports.clone_point = clone_point;
|
|
20
|
-
exports.closestPointFromLine = closestPointFromLine;
|
|
21
|
-
exports.closestPointFromLineSegment = closestPointFromLineSegment;
|
|
22
|
-
exports.compareVertices = compareVertices;
|
|
23
|
-
exports.containLine = containLine;
|
|
24
|
-
exports.containPointInRect = containPointInRect;
|
|
25
|
-
exports.cosWithThreshold = cosWithThreshold;
|
|
26
|
-
exports.crossprod = crossprod;
|
|
27
|
-
exports.diff = diff;
|
|
28
|
-
exports.distancePointFromLine = distancePointFromLine;
|
|
29
|
-
exports.distancePointFromLineSegment = distancePointFromLineSegment;
|
|
30
|
-
exports.dotprod = dotprod;
|
|
31
|
-
exports.downcrossLine = downcrossLine;
|
|
32
|
-
exports.extendLine = extendLine;
|
|
33
|
-
exports.findCatalogElement = findCatalogElement;
|
|
34
|
-
exports.getAllArea = getAllArea;
|
|
35
|
-
exports.getAllAreaLines = getAllAreaLines;
|
|
36
|
-
exports.getAllCurSnap = getAllCurSnap;
|
|
37
|
-
exports.getAllHoleRect = getAllHoleRect;
|
|
38
|
-
exports.getAllItemSnap = getAllItemSnap;
|
|
39
|
-
exports.getAllItemSpecified = getAllItemSpecified;
|
|
40
|
-
exports.getAllItems = getAllItems;
|
|
41
|
-
exports.getAllLineSnap = getAllLineSnap;
|
|
42
|
-
exports.getAllLines = getAllLines;
|
|
43
|
-
exports.getCalcRectFromItem = getCalcRectFromItem;
|
|
44
|
-
exports.getCalcRectFromItem3D = getCalcRectFromItem3D;
|
|
45
|
-
exports.getCalcRectFromLine = getCalcRectFromLine;
|
|
46
|
-
exports.getHoleItems = getHoleItems;
|
|
47
|
-
exports.getInterSect = getInterSect;
|
|
48
|
-
exports.getLineInterSect = getLineInterSect;
|
|
49
|
-
exports.getNormaline = getNormaline;
|
|
50
|
-
exports.getRelatedLines = void 0;
|
|
51
|
-
exports.getRelatedVertices = getRelatedVertices;
|
|
52
|
-
exports.horizontalLine = horizontalLine;
|
|
53
|
-
exports.intersectRect = intersectRect;
|
|
54
|
-
exports.isBackWall = isBackWall;
|
|
55
|
-
exports.isFrontWall = isFrontWall;
|
|
56
|
-
exports.isLeftWall = isLeftWall;
|
|
57
|
-
exports.isPointInArea = isPointInArea;
|
|
58
|
-
exports.isPointInRect = isPointInRect;
|
|
59
|
-
exports.isPointOnLineSegment = isPointOnLineSegment;
|
|
60
|
-
exports.isRightWall = isRightWall;
|
|
61
|
-
exports.isSnappedLine = isSnappedLine;
|
|
62
|
-
exports.isSnappedSideLine = isSnappedSideLine;
|
|
63
|
-
exports.itemInfo = itemInfo;
|
|
64
|
-
exports.linePassingThroughTwoPoints = linePassingThroughTwoPoints;
|
|
65
|
-
exports.mapRange = mapRange;
|
|
66
|
-
exports.maxVertex = maxVertex;
|
|
67
|
-
exports.midPoint = midPoint;
|
|
68
|
-
exports.minVertex = minVertex;
|
|
69
|
-
exports.needSnap = needSnap;
|
|
70
|
-
exports.orderVertices = orderVertices;
|
|
71
|
-
exports.pointPositionOnLineSegment = pointPositionOnLineSegment;
|
|
72
|
-
exports.pointsDistance = pointsDistance;
|
|
73
|
-
exports.relationshipOfTwoOverlappedLines = relationshipOfTwoOverlappedLines;
|
|
74
|
-
exports.rotatePointAroundPoint = rotatePointAroundPoint;
|
|
75
|
-
exports.roundVertex = roundVertex;
|
|
76
|
-
exports.sameDistances = sameDistances;
|
|
77
|
-
exports.sameMDistances = sameMDistances;
|
|
78
|
-
exports.sameMPoints = sameMPoints;
|
|
79
|
-
exports.samePoints = samePoints;
|
|
80
|
-
exports.shrinkRect = shrinkRect;
|
|
81
|
-
exports.sinWithThreshold = sinWithThreshold;
|
|
82
|
-
exports.snapAngleByUnit = snapAngleByUnit;
|
|
83
|
-
exports.twoLineSegmentsIntersection = twoLineSegmentsIntersection;
|
|
84
|
-
exports.twoLinesIntersection = twoLinesIntersection;
|
|
85
|
-
exports.upcrossLine = upcrossLine;
|
|
86
|
-
exports.validInterSect = validInterSect;
|
|
87
|
-
exports.validSnap = validSnap;
|
|
88
|
-
exports.validateLineSnaps = validateLineSnaps;
|
|
89
|
-
exports.validateSnaps = validateSnaps;
|
|
90
|
-
exports.verticalLine = verticalLine;
|
|
91
|
-
exports.verticesDistance = verticesDistance;
|
|
92
|
-
exports.verticesMidPoint = verticesMidPoint;
|
|
93
|
-
var _math = require("./math.js");
|
|
94
|
-
var _constants = require("../constants");
|
|
95
|
-
var _convertUnits = _interopRequireDefault(require("convert-units"));
|
|
96
|
-
var Three = _interopRequireWildcard(require("three"));
|
|
97
|
-
var _utils = require("../components/viewer2d/utils.js");
|
|
98
|
-
var _helper = require("./helper.js");
|
|
99
|
-
var _export = require("./export.js");
|
|
100
|
-
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); }
|
|
101
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
102
|
-
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
103
|
-
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
104
|
-
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
105
|
-
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
106
|
-
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; }
|
|
107
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
108
|
-
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
109
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
110
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
111
|
-
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; } } }; }
|
|
112
|
-
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
113
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
114
|
-
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; } }
|
|
115
|
-
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; }
|
|
116
|
-
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
117
|
-
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; } /** @description Determines the distance between two points
|
|
118
|
-
* @param {number} x0 Vertex 0 x
|
|
119
|
-
* @param {number} y0 Vertex 0 y
|
|
120
|
-
* @param {number} x1 Vertex 1 x
|
|
121
|
-
* @param {number} y1 Vertex 1 y
|
|
122
|
-
* @return {number}
|
|
123
|
-
*/
|
|
124
|
-
function compareVertices(v0, v1) {
|
|
125
|
-
return v0.x === v1.x ? v0.y - v1.y : v0.x - v1.x;
|
|
126
|
-
}
|
|
127
|
-
function minVertex(v0, v1) {
|
|
128
|
-
return compareVertices(v0, v1) > 0 ? v1 : v0;
|
|
129
|
-
}
|
|
130
|
-
function maxVertex(v0, v1) {
|
|
131
|
-
return compareVertices(v0, v1) > 0 ? v0 : v1;
|
|
132
|
-
}
|
|
133
|
-
function orderVertices(vertices) {
|
|
134
|
-
return vertices.sort(compareVertices);
|
|
135
|
-
}
|
|
136
|
-
function pointsDistance(x0, y0, x1, y1) {
|
|
137
|
-
var diff_x = x0 - x1;
|
|
138
|
-
var diff_y = y0 - y1;
|
|
139
|
-
return Math.sqrt(diff_x * diff_x + diff_y * diff_y);
|
|
140
|
-
}
|
|
141
|
-
function verticesDistance(v1, v2) {
|
|
142
|
-
var x0 = v1.x,
|
|
143
|
-
y0 = v1.y;
|
|
144
|
-
var x1 = v2.x,
|
|
145
|
-
y1 = v2.y;
|
|
146
|
-
return pointsDistance(x0, y0, x1, y1);
|
|
147
|
-
}
|
|
148
|
-
function horizontalLine(y) {
|
|
149
|
-
return {
|
|
150
|
-
a: 0,
|
|
151
|
-
b: 1,
|
|
152
|
-
c: -y
|
|
153
|
-
};
|
|
154
|
-
}
|
|
155
|
-
var almostEqual = exports.almostEqual = function almostEqual(x, y) {
|
|
156
|
-
return Math.abs(x - y) < _constants.EPSILON;
|
|
157
|
-
};
|
|
158
|
-
function verticalLine(x) {
|
|
159
|
-
return {
|
|
160
|
-
a: 1,
|
|
161
|
-
b: 0,
|
|
162
|
-
c: -x
|
|
163
|
-
};
|
|
164
|
-
}
|
|
165
|
-
function upcrossLine(x, y) {
|
|
166
|
-
return {
|
|
167
|
-
a: 1,
|
|
168
|
-
b: 1,
|
|
169
|
-
c: -x - y
|
|
170
|
-
};
|
|
171
|
-
}
|
|
172
|
-
function downcrossLine(x, y) {
|
|
173
|
-
return {
|
|
174
|
-
a: 1,
|
|
175
|
-
b: -1,
|
|
176
|
-
c: -x + y
|
|
177
|
-
};
|
|
178
|
-
}
|
|
179
|
-
function linePassingThroughTwoPoints(x1, y1, x2, y2) {
|
|
180
|
-
if (x1 === x2 && y1 == y2) throw new Error('Geometry error');
|
|
181
|
-
//if (x1 === x2) return verticalLine(x1);
|
|
182
|
-
//if (y1 === y2) return horizontalLine(y1);
|
|
183
|
-
|
|
184
|
-
return {
|
|
185
|
-
a: y1 - y2,
|
|
186
|
-
b: x2 - x1,
|
|
187
|
-
c: y2 * x1 - x2 * y1
|
|
188
|
-
};
|
|
189
|
-
}
|
|
190
|
-
function getNormaline(x1, y1, x2, y2) {
|
|
191
|
-
var lineFunction = linePassingThroughTwoPoints(x1, y1, x2, y2);
|
|
192
|
-
return {
|
|
193
|
-
x: lineFunction.a / Math.sqrt(lineFunction.a * lineFunction.a + lineFunction.b * lineFunction.b),
|
|
194
|
-
y: lineFunction.b / Math.sqrt(lineFunction.a * lineFunction.a + lineFunction.b * lineFunction.b)
|
|
195
|
-
};
|
|
196
|
-
}
|
|
197
|
-
function distancePointFromLine(a, b, c, x, y) {
|
|
198
|
-
//https://en.wikipedia.org/wiki/Distance_from_a_point_to_a_line
|
|
199
|
-
return (0, _math.fAbs)(a * x + b * y + c) / Math.sqrt(a * a + b * b);
|
|
200
|
-
}
|
|
201
|
-
function closestPointFromLine(a, b, c, x, y) {
|
|
202
|
-
//https://en.wikipedia.org/wiki/Distance_from_a_point_to_a_line
|
|
203
|
-
var denom = a * a + b * b;
|
|
204
|
-
return {
|
|
205
|
-
x: (b * (b * x - a * y) - a * c) / denom,
|
|
206
|
-
y: (a * -b * x + a * y - b * c) / denom
|
|
207
|
-
};
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
/** @description Get point of intersection between two lines using ax+by+c line's equation
|
|
211
|
-
* @param {number} a x coefficent of first line
|
|
212
|
-
* @param {number} b y coefficent of first line
|
|
213
|
-
* @param {number} c costant of first line
|
|
214
|
-
* @param {number} j x coefficent of second line
|
|
215
|
-
* @param {number} k y coefficent of second line
|
|
216
|
-
* @param {number} l costant of second line
|
|
217
|
-
* @return {object} {x,y} point's coordinates
|
|
218
|
-
*/
|
|
219
|
-
function twoLinesIntersection(a, b, c, j, k, l) {
|
|
220
|
-
var angularCoefficientsDiff = b * j - a * k;
|
|
221
|
-
if (angularCoefficientsDiff === 0) return undefined; //no intersection
|
|
222
|
-
|
|
223
|
-
var y = (a * l - c * j) / angularCoefficientsDiff;
|
|
224
|
-
var x = (c * k - b * l) / angularCoefficientsDiff;
|
|
225
|
-
return {
|
|
226
|
-
x: x,
|
|
227
|
-
y: y
|
|
228
|
-
};
|
|
229
|
-
}
|
|
230
|
-
function twoLineSegmentsIntersection(p1, p2, p3, p4) {
|
|
231
|
-
//https://github.com/psalaets/line-intersect/blob/master/lib/check-intersection.js
|
|
232
|
-
|
|
233
|
-
var x1 = p1.x,
|
|
234
|
-
y1 = p1.y;
|
|
235
|
-
var x2 = p2.x,
|
|
236
|
-
y2 = p2.y;
|
|
237
|
-
var x3 = p3.x,
|
|
238
|
-
y3 = p3.y;
|
|
239
|
-
var x4 = p4.x,
|
|
240
|
-
y4 = p4.y;
|
|
241
|
-
var denom = (y4 - y3) * (x2 - x1) - (x4 - x3) * (y2 - y1);
|
|
242
|
-
var numA = (x4 - x3) * (y1 - y3) - (y4 - y3) * (x1 - x3);
|
|
243
|
-
var numB = (x2 - x1) * (y1 - y3) - (y2 - y1) * (x1 - x3);
|
|
244
|
-
if ((0, _math.fAbs)(denom) <= _constants.EPSILON) {
|
|
245
|
-
if ((0, _math.fAbs)(numA) <= _constants.EPSILON && (0, _math.fAbs)(numB) <= _constants.EPSILON) {
|
|
246
|
-
var comparator = function comparator(pa, pb) {
|
|
247
|
-
return pa.x === pb.x ? pa.y - pb.y : pa.x - pb.x;
|
|
248
|
-
};
|
|
249
|
-
var line0 = [p1, p2].sort(comparator);
|
|
250
|
-
var line1 = [p3.toJS(), p4.toJS()].sort(comparator);
|
|
251
|
-
var _sort = [line0, line1].sort(function (lineA, lineB) {
|
|
252
|
-
return comparator(lineA[0], lineB[0]);
|
|
253
|
-
}),
|
|
254
|
-
_sort2 = _slicedToArray(_sort, 2),
|
|
255
|
-
lineSX = _sort2[0],
|
|
256
|
-
lineDX = _sort2[1];
|
|
257
|
-
if (lineSX[1].x === lineDX[0].x) {
|
|
258
|
-
return {
|
|
259
|
-
type: lineDX[0].y <= lineSX[1].y ? 'colinear' : 'none'
|
|
260
|
-
};
|
|
261
|
-
} else {
|
|
262
|
-
return {
|
|
263
|
-
type: lineDX[0].x <= lineSX[1].x ? 'colinear' : 'none'
|
|
264
|
-
};
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
return {
|
|
268
|
-
type: 'parallel'
|
|
269
|
-
};
|
|
270
|
-
}
|
|
271
|
-
var uA = numA / denom;
|
|
272
|
-
var uB = numB / denom;
|
|
273
|
-
if (uA >= 0 - _constants.EPSILON && uA <= 1 + _constants.EPSILON && uB >= 0 - _constants.EPSILON && uB <= 1 + _constants.EPSILON) {
|
|
274
|
-
var _point = {
|
|
275
|
-
x: x1 + uA * (x2 - x1),
|
|
276
|
-
y: y1 + uA * (y2 - y1)
|
|
277
|
-
};
|
|
278
|
-
return {
|
|
279
|
-
type: 'intersecting',
|
|
280
|
-
point: _point
|
|
281
|
-
};
|
|
282
|
-
}
|
|
283
|
-
return {
|
|
284
|
-
type: 'none'
|
|
285
|
-
};
|
|
286
|
-
}
|
|
287
|
-
function distancePointFromLineSegment(v1, v2, xp, yp) {
|
|
288
|
-
//http://stackoverflow.com/a/6853926/1398836
|
|
289
|
-
var x1 = v1.x,
|
|
290
|
-
y1 = v1.y;
|
|
291
|
-
var x2 = v2.x,
|
|
292
|
-
y2 = v2.y;
|
|
293
|
-
var A = xp - x1;
|
|
294
|
-
var B = yp - y1;
|
|
295
|
-
var C = x2 - x1;
|
|
296
|
-
var D = y2 - y1;
|
|
297
|
-
var dot = A * C + B * D;
|
|
298
|
-
var len_sq = C * C + D * D;
|
|
299
|
-
var param = -1;
|
|
300
|
-
if (len_sq != 0)
|
|
301
|
-
//in case of 0 length line
|
|
302
|
-
param = dot / len_sq;
|
|
303
|
-
var xx, yy;
|
|
304
|
-
if (param < 0) {
|
|
305
|
-
xx = x1;
|
|
306
|
-
yy = y1;
|
|
307
|
-
} else if (param > 1) {
|
|
308
|
-
xx = x2;
|
|
309
|
-
yy = y2;
|
|
310
|
-
} else {
|
|
311
|
-
xx = x1 + param * C;
|
|
312
|
-
yy = y1 + param * D;
|
|
313
|
-
}
|
|
314
|
-
var dx = xp - xx;
|
|
315
|
-
var dy = yp - yy;
|
|
316
|
-
return Math.sqrt(dx * dx + dy * dy);
|
|
317
|
-
}
|
|
318
|
-
|
|
319
|
-
/**
|
|
320
|
-
*
|
|
321
|
-
* @param x1 {number} x for first vertex of the segment
|
|
322
|
-
* @param y1 {number} y for first vertex of the segment
|
|
323
|
-
* @param x2 {number} x for second vertex of the segment
|
|
324
|
-
* @param y2 {number} y for second vertex of the segment
|
|
325
|
-
* @param xp {number} x for point we want to verify
|
|
326
|
-
* @param yp {number} y for point we want to verify
|
|
327
|
-
* @param maxDistance {number} the epsilon value used for comparisons
|
|
328
|
-
* @returns {boolean} true if the point lies on the line segment false otherwise
|
|
329
|
-
*/
|
|
330
|
-
function isPointOnLineSegment(x1, y1, x2, y2, xp, yp) {
|
|
331
|
-
var maxDistance = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : _constants.EPSILON;
|
|
332
|
-
return distancePointFromLineSegment({
|
|
333
|
-
x: x1,
|
|
334
|
-
y: y1
|
|
335
|
-
}, {
|
|
336
|
-
x: x2,
|
|
337
|
-
y: y2
|
|
338
|
-
}, xp, yp) <= maxDistance;
|
|
339
|
-
}
|
|
340
|
-
function closestPointFromLineSegment(x1, y1, x2, y2, xp, yp) {
|
|
341
|
-
if (x1 === x2) return {
|
|
342
|
-
x: x1,
|
|
343
|
-
y: yp
|
|
344
|
-
};
|
|
345
|
-
if (y1 === y2) return {
|
|
346
|
-
x: xp,
|
|
347
|
-
y: y1
|
|
348
|
-
};
|
|
349
|
-
var m = (y2 - y1) / (x2 - x1);
|
|
350
|
-
var q = y1 - m * x1;
|
|
351
|
-
var mi = -1 / m;
|
|
352
|
-
var qi = yp - mi * xp;
|
|
353
|
-
var x = (qi - q) / (m - mi);
|
|
354
|
-
var y = m * x + q;
|
|
355
|
-
return {
|
|
356
|
-
x: x,
|
|
357
|
-
y: y
|
|
358
|
-
};
|
|
359
|
-
}
|
|
360
|
-
function pointPositionOnLineSegment(x1, y1, x2, y2, xp, yp) {
|
|
361
|
-
var length = pointsDistance(x1, y1, x2, y2);
|
|
362
|
-
var distance = pointsDistance(x1, y1, xp, yp);
|
|
363
|
-
var offset = distance / length;
|
|
364
|
-
/*
|
|
365
|
-
if (x1 > x2) offset = 1 - offset;
|
|
366
|
-
if (y1 > y2) offset = 1 - offset;
|
|
367
|
-
*/
|
|
368
|
-
return offset;
|
|
369
|
-
}
|
|
370
|
-
function mapRange(value, low1, high1, low2, high2) {
|
|
371
|
-
return low2 + (high2 - low2) * (value - low1) / (high1 - low1);
|
|
372
|
-
}
|
|
373
|
-
function angleBetweenTwoPointsAndOrigin(x1, y1, x2, y2) {
|
|
374
|
-
return -Math.atan2(y1 - y2, x2 - x1) * 180 / Math.PI;
|
|
375
|
-
}
|
|
376
|
-
function angleBetweenTwoPoints(x1, y1, x2, y2) {
|
|
377
|
-
return Math.atan2(y2 - y1, x2 - x1);
|
|
378
|
-
}
|
|
379
|
-
function angleBetweenTwoLines(line, drawingLine, vertices) {
|
|
380
|
-
var points = [];
|
|
381
|
-
|
|
382
|
-
// safety guards
|
|
383
|
-
var lv = Array.isArray(line === null || line === void 0 ? void 0 : line.vertices) ? line.vertices : [];
|
|
384
|
-
var dv = Array.isArray(drawingLine === null || drawingLine === void 0 ? void 0 : drawingLine.vertices) ? drawingLine.vertices : [];
|
|
385
|
-
|
|
386
|
-
// 1) push common vertices (in order of line.vertices)
|
|
387
|
-
var _iterator = _createForOfIteratorHelper(lv),
|
|
388
|
-
_step;
|
|
389
|
-
try {
|
|
390
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
391
|
-
var vt = _step.value;
|
|
392
|
-
if (dv.includes(vt) && !points.includes(vt)) points.push(vt);
|
|
393
|
-
}
|
|
394
|
-
|
|
395
|
-
// 2) push remaining vertices from line.vertices
|
|
396
|
-
} catch (err) {
|
|
397
|
-
_iterator.e(err);
|
|
398
|
-
} finally {
|
|
399
|
-
_iterator.f();
|
|
400
|
-
}
|
|
401
|
-
var _iterator2 = _createForOfIteratorHelper(lv),
|
|
402
|
-
_step2;
|
|
403
|
-
try {
|
|
404
|
-
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
405
|
-
var _vt = _step2.value;
|
|
406
|
-
if (!points.includes(_vt)) points.push(_vt);
|
|
407
|
-
}
|
|
408
|
-
|
|
409
|
-
// 3) push remaining vertices from drawingLine.vertices
|
|
410
|
-
} catch (err) {
|
|
411
|
-
_iterator2.e(err);
|
|
412
|
-
} finally {
|
|
413
|
-
_iterator2.f();
|
|
414
|
-
}
|
|
415
|
-
var _iterator3 = _createForOfIteratorHelper(dv),
|
|
416
|
-
_step3;
|
|
417
|
-
try {
|
|
418
|
-
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
419
|
-
var _vt2 = _step3.value;
|
|
420
|
-
if (!points.includes(_vt2)) points.push(_vt2);
|
|
421
|
-
}
|
|
422
|
-
|
|
423
|
-
// If no points at all, nothing to compute — return 0 (safe fallback)
|
|
424
|
-
} catch (err) {
|
|
425
|
-
_iterator3.e(err);
|
|
426
|
-
} finally {
|
|
427
|
-
_iterator3.f();
|
|
428
|
-
}
|
|
429
|
-
if (points.length === 0) return 0;
|
|
430
|
-
|
|
431
|
-
// Ensure we have at least 3 entries (same behaviour as original)
|
|
432
|
-
while (points.length < 3) points.push(points[points.length - 1]);
|
|
433
|
-
var _points$slice$map = points.slice(0, 3).map(function (idx) {
|
|
434
|
-
var v = vertices === null || vertices === void 0 ? void 0 : vertices[idx];
|
|
435
|
-
return v ? new Three.Vector2(v.x, v.y) : new Three.Vector2(0, 0);
|
|
436
|
-
}),
|
|
437
|
-
_points$slice$map2 = _slicedToArray(_points$slice$map, 3),
|
|
438
|
-
c = _points$slice$map2[0],
|
|
439
|
-
p1 = _points$slice$map2[1],
|
|
440
|
-
p2 = _points$slice$map2[2];
|
|
441
|
-
var vec1 = p1.clone().sub(c).normalize();
|
|
442
|
-
var vec2 = p2.clone().sub(c).normalize();
|
|
443
|
-
return Math.floor(vec1.angle() * 180 / Math.PI - vec2.angle() * 180 / Math.PI + 0.5);
|
|
444
|
-
}
|
|
445
|
-
var getRelatedLines = exports.getRelatedLines = function getRelatedLines(tlines, drawingLine, vertices, lines) {
|
|
446
|
-
var exceptLineId = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : null;
|
|
447
|
-
if (!(drawingLine !== null && drawingLine !== void 0 && drawingLine.vertices) || !Array.isArray(drawingLine.vertices)) return;
|
|
448
|
-
var seen = new Set();
|
|
449
|
-
var _iterator4 = _createForOfIteratorHelper(drawingLine.vertices),
|
|
450
|
-
_step4;
|
|
451
|
-
try {
|
|
452
|
-
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
453
|
-
var vIdx = _step4.value;
|
|
454
|
-
var vertex = vertices === null || vertices === void 0 ? void 0 : vertices[vIdx];
|
|
455
|
-
if (!(vertex !== null && vertex !== void 0 && vertex.lines)) continue;
|
|
456
|
-
var _iterator5 = _createForOfIteratorHelper(vertex.lines),
|
|
457
|
-
_step5;
|
|
458
|
-
try {
|
|
459
|
-
for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
|
|
460
|
-
var lineId = _step5.value;
|
|
461
|
-
if (lineId !== drawingLine.id && lineId !== exceptLineId && !(0, _helper.isEmpty)(lines === null || lines === void 0 ? void 0 : lines[lineId]) && !seen.has(lineId)) {
|
|
462
|
-
seen.add(lineId);
|
|
463
|
-
tlines.push(lines[lineId]);
|
|
464
|
-
}
|
|
465
|
-
}
|
|
466
|
-
} catch (err) {
|
|
467
|
-
_iterator5.e(err);
|
|
468
|
-
} finally {
|
|
469
|
-
_iterator5.f();
|
|
470
|
-
}
|
|
471
|
-
}
|
|
472
|
-
} catch (err) {
|
|
473
|
-
_iterator4.e(err);
|
|
474
|
-
} finally {
|
|
475
|
-
_iterator4.f();
|
|
476
|
-
}
|
|
477
|
-
};
|
|
478
|
-
function snapAngleByUnit(lineAngle, vertices, drawingLine, x, y, dragVertexId) {
|
|
479
|
-
var tx, ty;
|
|
480
|
-
var absAngle = Math.abs(lineAngle);
|
|
481
|
-
// angle snapping as a value of UNIT_ANGLE
|
|
482
|
-
var rest = absAngle % _constants.UNIT_ANGLE;
|
|
483
|
-
var missAngle = _constants.UNIT_ANGLE - rest;
|
|
484
|
-
// the origin point of rotation(snapping)
|
|
485
|
-
var originVerId = drawingLine.vertices.findIndex(function (vertice) {
|
|
486
|
-
return vertice !== dragVertexId;
|
|
487
|
-
});
|
|
488
|
-
originVerId = originVerId < 0 ? drawingLine.vertices[0] : drawingLine.vertices[originVerId];
|
|
489
|
-
var ox = vertices[originVerId].x;
|
|
490
|
-
var oy = vertices[originVerId].y;
|
|
491
|
-
// check whether the line is snapped to before point.
|
|
492
|
-
if (rest <= _constants.UNIT_ANGLE / 2) {
|
|
493
|
-
// determine the direction of rotation.
|
|
494
|
-
rest = lineAngle > 0 ? rest : -rest;
|
|
495
|
-
// rotate the current point to last point around the first point of drawing line.
|
|
496
|
-
tx = rotatePointAroundPoint(x, y, ox, oy, rest).x;
|
|
497
|
-
ty = rotatePointAroundPoint(x, y, ox, oy, rest).y;
|
|
498
|
-
}
|
|
499
|
-
// check whether the line is snapped to next new point.
|
|
500
|
-
else if (rest > _constants.UNIT_ANGLE / 2) {
|
|
501
|
-
// determine the direction of rotation.
|
|
502
|
-
missAngle = lineAngle > 0 ? -missAngle : missAngle;
|
|
503
|
-
// rotate the current point to last point around the first point of drawing line.
|
|
504
|
-
tx = rotatePointAroundPoint(x, y, ox, oy, missAngle).x;
|
|
505
|
-
ty = rotatePointAroundPoint(x, y, ox, oy, missAngle).y;
|
|
506
|
-
}
|
|
507
|
-
var resPoint = {
|
|
508
|
-
x: tx,
|
|
509
|
-
y: ty
|
|
510
|
-
};
|
|
511
|
-
return resPoint;
|
|
512
|
-
}
|
|
513
|
-
function absAngleBetweenTwoPoints(x1, y1, x2, y2) {
|
|
514
|
-
return Math.atan2(y2 - y1, Math.abs(x2 - x1));
|
|
515
|
-
}
|
|
516
|
-
function samePoints(_ref, _ref2) {
|
|
517
|
-
var x1 = _ref.x,
|
|
518
|
-
y1 = _ref.y;
|
|
519
|
-
var x2 = _ref2.x,
|
|
520
|
-
y2 = _ref2.y;
|
|
521
|
-
return (0, _math.fAbs)(x1 - x2) <= _constants.EPSILON && (0, _math.fAbs)(y1 - y2) <= _constants.EPSILON;
|
|
522
|
-
}
|
|
523
|
-
function sameDistances(dis1, dis2) {
|
|
524
|
-
return (0, _math.fAbs)(dis1 - dis2) <= _constants.EPSILON;
|
|
525
|
-
}
|
|
526
|
-
function sameMPoints(_ref3, _ref4) {
|
|
527
|
-
var x1 = _ref3.x,
|
|
528
|
-
y1 = _ref3.y;
|
|
529
|
-
var x2 = _ref4.x,
|
|
530
|
-
y2 = _ref4.y;
|
|
531
|
-
return (0, _math.fAbs)(x1 - x2) <= _constants.MEPSILON && (0, _math.fAbs)(y1 - y2) <= _constants.MEPSILON;
|
|
532
|
-
}
|
|
533
|
-
function sameMDistances(dis1, dis2) {
|
|
534
|
-
return (0, _math.fAbs)(dis1 - dis2) <= _constants.MEPSILON;
|
|
535
|
-
}
|
|
536
|
-
function isPointInRect(rect, point) {
|
|
537
|
-
var result = true;
|
|
538
|
-
for (var i = 0; i < rect.length; i++) {
|
|
539
|
-
var pos1 = rect[i];
|
|
540
|
-
var pos2 = rect[(i + 1) % rect.length];
|
|
541
|
-
if (isPointOnLineSegment(pos1.x, pos1.y, pos2.x, pos2.y, point.x, point.y)) {
|
|
542
|
-
result = false;
|
|
543
|
-
}
|
|
544
|
-
}
|
|
545
|
-
return result;
|
|
546
|
-
}
|
|
547
|
-
|
|
548
|
-
/** @description Extend line based on coordinates and new line length
|
|
549
|
-
* @param {number} x1 Vertex 1 x
|
|
550
|
-
* @param {number} y1 Vertex 1 y
|
|
551
|
-
* @param {number} x2 Vertex 2 x
|
|
552
|
-
* @param {number} y2 Vertex 2 y
|
|
553
|
-
* @param {number} newDistance New line length
|
|
554
|
-
* @return {object}
|
|
555
|
-
*/
|
|
556
|
-
function extendLine(x1, y1, x2, y2, newDistance) {
|
|
557
|
-
var precision = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 6;
|
|
558
|
-
var rad = angleBetweenTwoPoints(x1, y1, x2, y2);
|
|
559
|
-
return {
|
|
560
|
-
x: (0, _math.toFixedFloat)(x1 + Math.cos(rad) * newDistance, precision),
|
|
561
|
-
y: (0, _math.toFixedFloat)(y1 + Math.sin(rad) * newDistance, precision)
|
|
562
|
-
};
|
|
563
|
-
}
|
|
564
|
-
function roundVertex(vertex) {
|
|
565
|
-
var precision = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 6;
|
|
566
|
-
vertex.set('x', (0, _math.toFixedFloat)(vertex.get('x'), precision));
|
|
567
|
-
vertex.set('y', (0, _math.toFixedFloat)(vertex.get('y'), precision));
|
|
568
|
-
return vertex;
|
|
569
|
-
}
|
|
570
|
-
|
|
571
|
-
//https://github.com/MartyWallace/PolyK
|
|
572
|
-
function ContainsPoint(polygon, pointX, pointY) {
|
|
573
|
-
var n = polygon.length >> 1;
|
|
574
|
-
var ax, lup;
|
|
575
|
-
var ay = polygon[2 * n - 3] - pointY;
|
|
576
|
-
var bx = polygon[2 * n - 2] - pointX;
|
|
577
|
-
var by = polygon[2 * n - 1] - pointY;
|
|
578
|
-
if (bx === 0 && by === 0) return false; // point on edge
|
|
579
|
-
|
|
580
|
-
// let lup = by > ay;
|
|
581
|
-
for (var ii = 0; ii < n; ii++) {
|
|
582
|
-
ax = bx;
|
|
583
|
-
ay = by;
|
|
584
|
-
bx = polygon[2 * ii] - pointX;
|
|
585
|
-
by = polygon[2 * ii + 1] - pointY;
|
|
586
|
-
if (bx === 0 && by === 0) return false; // point on edge
|
|
587
|
-
if (ay === by) continue;
|
|
588
|
-
lup = by > ay;
|
|
589
|
-
}
|
|
590
|
-
var depth = 0;
|
|
591
|
-
for (var i = 0; i < n; i++) {
|
|
592
|
-
ax = bx;
|
|
593
|
-
ay = by;
|
|
594
|
-
bx = polygon[2 * i] - pointX;
|
|
595
|
-
by = polygon[2 * i + 1] - pointY;
|
|
596
|
-
if (ay < 0 && by < 0) continue; // both 'up' or both 'down'
|
|
597
|
-
if (ay > 0 && by > 0) continue; // both 'up' or both 'down'
|
|
598
|
-
if (ax < 0 && bx < 0) continue; // both points on the left
|
|
599
|
-
|
|
600
|
-
if (ay === by && Math.min(ax, bx) < 0) return true;
|
|
601
|
-
if (ay === by) continue;
|
|
602
|
-
var lx = ax + (bx - ax) * -ay / (by - ay);
|
|
603
|
-
if (lx === 0) return false; // point on edge
|
|
604
|
-
if (lx > 0) depth++;
|
|
605
|
-
if (ay === 0 && lup && by > ay) depth--; // hit vertex, both up
|
|
606
|
-
if (ay === 0 && !lup && by < ay) depth--; // hit vertex, both down
|
|
607
|
-
lup = by > ay;
|
|
608
|
-
}
|
|
609
|
-
return (depth & 1) === 1;
|
|
610
|
-
}
|
|
611
|
-
function cosWithThreshold(alpha, threshold) {
|
|
612
|
-
var cos = Math.cos(alpha);
|
|
613
|
-
return cos < threshold ? 0 : cos;
|
|
614
|
-
}
|
|
615
|
-
function sinWithThreshold(alpha, threshold) {
|
|
616
|
-
var sin = Math.sin(alpha);
|
|
617
|
-
return sin < threshold ? 0 : sin;
|
|
618
|
-
}
|
|
619
|
-
function midPoint(x1, y1, x2, y2) {
|
|
620
|
-
return {
|
|
621
|
-
x: (x1 + x2) / 2,
|
|
622
|
-
y: (y1 + y2) / 2
|
|
623
|
-
};
|
|
624
|
-
}
|
|
625
|
-
function verticesMidPoint(verticesArray) {
|
|
626
|
-
var res = verticesArray.reduce(function (incr, vertex) {
|
|
627
|
-
return {
|
|
628
|
-
x: incr.x + vertex.x,
|
|
629
|
-
y: incr.y + vertex.y
|
|
630
|
-
};
|
|
631
|
-
}, {
|
|
632
|
-
x: 0,
|
|
633
|
-
y: 0
|
|
634
|
-
});
|
|
635
|
-
return {
|
|
636
|
-
x: res.x / verticesArray.length,
|
|
637
|
-
y: res.y / verticesArray.length
|
|
638
|
-
};
|
|
639
|
-
}
|
|
640
|
-
function rotatePointAroundPoint(px, py, ox, oy, theta) {
|
|
641
|
-
var thetaRad = theta * Math.PI / 180;
|
|
642
|
-
var cos = Math.cos(thetaRad);
|
|
643
|
-
var sin = Math.sin(thetaRad);
|
|
644
|
-
var deltaX = px - ox;
|
|
645
|
-
var deltaY = py - oy;
|
|
646
|
-
return {
|
|
647
|
-
x: cos * deltaX - sin * deltaY + ox,
|
|
648
|
-
y: sin * deltaX + cos * deltaY + oy
|
|
649
|
-
};
|
|
650
|
-
}
|
|
651
|
-
|
|
652
|
-
// point: x,y
|
|
653
|
-
// itemrectInfo: pos(x,y),rotRad,size,layoutpos,is_corner
|
|
654
|
-
// calcRect: rect(point[4]),pos(x,y),rotRad,size,layoutpos,is_corner
|
|
655
|
-
|
|
656
|
-
function point(x, y) {
|
|
657
|
-
return {
|
|
658
|
-
x: x,
|
|
659
|
-
y: y
|
|
660
|
-
};
|
|
661
|
-
}
|
|
662
|
-
function itemrectInfo(x, y, rotRad, size, layoutpos, is_corner) {
|
|
663
|
-
return {
|
|
664
|
-
pos: {
|
|
665
|
-
x: x,
|
|
666
|
-
y: y
|
|
667
|
-
},
|
|
668
|
-
rotRad: rotRad,
|
|
669
|
-
size: size,
|
|
670
|
-
layoutpos: layoutpos,
|
|
671
|
-
is_corner: is_corner
|
|
672
|
-
};
|
|
673
|
-
}
|
|
674
|
-
function getCalcRectFromItem(item) {
|
|
675
|
-
var itemInfo;
|
|
676
|
-
if (item === undefined) itemInfo = [];else itemInfo = item.item;
|
|
677
|
-
var x = item.pos.x;
|
|
678
|
-
var y = item.pos.y;
|
|
679
|
-
var rotRad = item.rotRad;
|
|
680
|
-
var w = item.size && item.size.width / 2;
|
|
681
|
-
var h = item.size && item.size.height / 2;
|
|
682
|
-
var mx = x - w * Math.cos(rotRad);
|
|
683
|
-
var my = y - w * Math.sin(rotRad);
|
|
684
|
-
var x0 = mx + h * Math.sin(rotRad);
|
|
685
|
-
var y0 = my - h * Math.cos(rotRad);
|
|
686
|
-
var x3 = mx * 2 - x0;
|
|
687
|
-
var y3 = my * 2 - y0;
|
|
688
|
-
var x1 = x * 2 - x3;
|
|
689
|
-
var y1 = y * 2 - y3;
|
|
690
|
-
var x2 = x * 2 - x0;
|
|
691
|
-
var y2 = y * 2 - y0;
|
|
692
|
-
return {
|
|
693
|
-
rect: [point(x0, y0), point(x1, y1), point(x2, y2), point(x3, y3)],
|
|
694
|
-
pos: point(x, y),
|
|
695
|
-
rotRad: rotRad,
|
|
696
|
-
size: item.size,
|
|
697
|
-
layoutpos: item.layoutpos,
|
|
698
|
-
is_corner: item.is_corner,
|
|
699
|
-
itemInfo: itemInfo
|
|
700
|
-
};
|
|
701
|
-
}
|
|
702
|
-
function getCalcRectFromItem3D(item) {
|
|
703
|
-
var itemInfo;
|
|
704
|
-
if (item === undefined) itemInfo = [];else itemInfo = item.item;
|
|
705
|
-
var x = item.pos.x;
|
|
706
|
-
var y = item.pos.y;
|
|
707
|
-
var rotRad = item.rotRad;
|
|
708
|
-
var w = item.size.width / 2;
|
|
709
|
-
var h = item.size.depth / 2;
|
|
710
|
-
var mx = x - w * Math.cos(rotRad);
|
|
711
|
-
var my = y - w * Math.sin(rotRad);
|
|
712
|
-
var x0 = mx + h * Math.sin(rotRad);
|
|
713
|
-
var y0 = my - h * Math.cos(rotRad);
|
|
714
|
-
var x3 = mx * 2 - x0;
|
|
715
|
-
var y3 = my * 2 - y0;
|
|
716
|
-
var x1 = x * 2 - x3;
|
|
717
|
-
var y1 = y * 2 - y3;
|
|
718
|
-
var x2 = x * 2 - x0;
|
|
719
|
-
var y2 = y * 2 - y0;
|
|
720
|
-
return {
|
|
721
|
-
rect: [point(x0, y0), point(x1, y1), point(x2, y2), point(x3, y3)],
|
|
722
|
-
pos: point(x, y),
|
|
723
|
-
rotRad: rotRad,
|
|
724
|
-
size: item.size,
|
|
725
|
-
layoutpos: item.layoutpos,
|
|
726
|
-
is_corner: item.is_corner,
|
|
727
|
-
itemInfo: itemInfo
|
|
728
|
-
};
|
|
729
|
-
}
|
|
730
|
-
function getAllItems(scene, catalog, allLineRects) {
|
|
731
|
-
var layerID = scene.selectedLayer;
|
|
732
|
-
var layer = scene.layers.get(layerID);
|
|
733
|
-
var curiteminfo;
|
|
734
|
-
var iteminfo = [];
|
|
735
|
-
var otherItems = [];
|
|
736
|
-
var selectedItem;
|
|
737
|
-
var currentItem;
|
|
738
|
-
if (layer.selected.items.size > 0) {
|
|
739
|
-
selectedItem = layer.getIn(['items', layer.selected.items.get(0)]);
|
|
740
|
-
var catid = selectedItem.type;
|
|
741
|
-
var cat = catalog.elements[catid];
|
|
742
|
-
if (!cat) cat = catalog.elements[(0, _utils.returnReplaceableDeepSearchType)(catid)];
|
|
743
|
-
currentItem = {
|
|
744
|
-
selectedItem: selectedItem,
|
|
745
|
-
cat: cat
|
|
746
|
-
};
|
|
747
|
-
}
|
|
748
|
-
layer.items.forEach(function (item) {
|
|
749
|
-
var val = {
|
|
750
|
-
pos: {
|
|
751
|
-
x: item.x,
|
|
752
|
-
y: item.y
|
|
753
|
-
},
|
|
754
|
-
rotRad: item.rotation / 180 * Math.PI
|
|
755
|
-
};
|
|
756
|
-
var catid = item.type;
|
|
757
|
-
var cat = catalog.elements[catid];
|
|
758
|
-
if (!cat) {
|
|
759
|
-
cat = catalog.elements[(0, _utils.returnReplaceableDeepSearchType)(catid)];
|
|
760
|
-
}
|
|
761
|
-
var sizeinfo = [];
|
|
762
|
-
var width, height, depth;
|
|
763
|
-
sizeinfo = {
|
|
764
|
-
width: item.properties.get('width').get('_length'),
|
|
765
|
-
height: item.properties.get('height').get('_length'),
|
|
766
|
-
depth: item.properties.get('depth').get('_length'),
|
|
767
|
-
widthUnit: item.properties.get('width').get('_unit'),
|
|
768
|
-
heightUnit: item.properties.get('height').get('_unit'),
|
|
769
|
-
depthUnit: item.properties.get('depth').get('_unit')
|
|
770
|
-
};
|
|
771
|
-
sizeinfo = _objectSpread(_objectSpread({}, sizeinfo), {}, {
|
|
772
|
-
layoutpos: cat && cat.info.layoutpos,
|
|
773
|
-
is_corner: cat && cat.info.is_corner
|
|
774
|
-
});
|
|
775
|
-
width = (0, _convertUnits["default"])(sizeinfo.width).from(sizeinfo.widthUnit).to(scene.unit);
|
|
776
|
-
height = (0, _convertUnits["default"])(sizeinfo.depth).from(sizeinfo.depthUnit).to(scene.unit);
|
|
777
|
-
depth = (0, _convertUnits["default"])(sizeinfo.height).from(sizeinfo.heightUnit).to(scene.unit);
|
|
778
|
-
val.size = {
|
|
779
|
-
width: width,
|
|
780
|
-
height: height,
|
|
781
|
-
depth: depth
|
|
782
|
-
};
|
|
783
|
-
val.layoutpos = sizeinfo.layoutpos;
|
|
784
|
-
val.is_corner = sizeinfo.is_corner;
|
|
785
|
-
val.doorStyle = item.doorStyle;
|
|
786
|
-
val.item = item;
|
|
787
|
-
var otherItem = {
|
|
788
|
-
item: item,
|
|
789
|
-
cat: cat
|
|
790
|
-
};
|
|
791
|
-
if (!needSnap(currentItem, otherItem)) {
|
|
792
|
-
return;
|
|
793
|
-
}
|
|
794
|
-
if (item.selected) {
|
|
795
|
-
curiteminfo = getCalcRectFromItem(val);
|
|
796
|
-
} else {
|
|
797
|
-
var calcrect = getCalcRectFromItem(val);
|
|
798
|
-
calcrect.isSnappedLine = isSnappedLine(calcrect, allLineRects);
|
|
799
|
-
iteminfo.push(calcrect);
|
|
800
|
-
otherItems.push(otherItem);
|
|
801
|
-
}
|
|
802
|
-
});
|
|
803
|
-
return {
|
|
804
|
-
cur: curiteminfo,
|
|
805
|
-
others: iteminfo,
|
|
806
|
-
currentItem: currentItem,
|
|
807
|
-
otherItems: otherItems
|
|
808
|
-
};
|
|
809
|
-
}
|
|
810
|
-
function getAllItemSpecified(scene, catalog, filter) {
|
|
811
|
-
var _scene$layers, _scene$layers$get;
|
|
812
|
-
var layerID = scene === null || scene === void 0 ? void 0 : scene.selectedLayer;
|
|
813
|
-
var layer = scene === null || scene === void 0 || (_scene$layers = scene.layers) === null || _scene$layers === void 0 || (_scene$layers$get = _scene$layers.get) === null || _scene$layers$get === void 0 ? void 0 : _scene$layers$get.call(_scene$layers, layerID);
|
|
814
|
-
if (!layer || !layer.items) return {
|
|
815
|
-
cur: null,
|
|
816
|
-
others: []
|
|
817
|
-
};
|
|
818
|
-
var curiteminfo;
|
|
819
|
-
var iteminfo = [];
|
|
820
|
-
layer.items.forEach(function (item) {
|
|
821
|
-
var _cat$obj;
|
|
822
|
-
if (!item) return;
|
|
823
|
-
var val = {
|
|
824
|
-
pos: {
|
|
825
|
-
x: item.x,
|
|
826
|
-
y: item.y
|
|
827
|
-
},
|
|
828
|
-
rotRad: item.rotation / 180 * Math.PI
|
|
829
|
-
};
|
|
830
|
-
var cat = item.type ? findCatalogElement(catalog, item.type) : null;
|
|
831
|
-
var info = cat === null || cat === void 0 ? void 0 : cat.info;
|
|
832
|
-
var props = item.properties;
|
|
833
|
-
var getSize = function getSize(key) {
|
|
834
|
-
var _props$getIn;
|
|
835
|
-
var length = props === null || props === void 0 || (_props$getIn = props.getIn) === null || _props$getIn === void 0 ? void 0 : _props$getIn.call(props, [key, '_length']);
|
|
836
|
-
return length != null ? (0, _convertUnits["default"])(length).from('in').to(scene.unit) : 0;
|
|
837
|
-
};
|
|
838
|
-
val.size = {
|
|
839
|
-
width: getSize('width'),
|
|
840
|
-
height: getSize('height'),
|
|
841
|
-
depth: getSize('depth')
|
|
842
|
-
};
|
|
843
|
-
val.item = item;
|
|
844
|
-
if (info) {
|
|
845
|
-
val.layoutpos = info.layoutpos;
|
|
846
|
-
val.is_corner = info.is_corner;
|
|
847
|
-
}
|
|
848
|
-
|
|
849
|
-
// Filter check
|
|
850
|
-
if (Array.isArray(filter)) {
|
|
851
|
-
if (info && !filter.includes(info.layoutpos)) return;
|
|
852
|
-
} else if (info && (info.layoutpos !== filter || (cat === null || cat === void 0 ? void 0 : cat.type) === 'appliance' && ['Cook Top', 'Microwave'].includes(cat === null || cat === void 0 || (_cat$obj = cat.obj) === null || _cat$obj === void 0 ? void 0 : _cat$obj.category))) {
|
|
853
|
-
return;
|
|
854
|
-
}
|
|
855
|
-
|
|
856
|
-
// Current vs others
|
|
857
|
-
var rect = getCalcRectFromItem3D(val);
|
|
858
|
-
if (item.selected) {
|
|
859
|
-
curiteminfo = rect;
|
|
860
|
-
} else {
|
|
861
|
-
iteminfo.push(rect);
|
|
862
|
-
}
|
|
863
|
-
});
|
|
864
|
-
return {
|
|
865
|
-
cur: curiteminfo,
|
|
866
|
-
others: iteminfo
|
|
867
|
-
};
|
|
868
|
-
}
|
|
869
|
-
function findCatalogElement(catalog, elementName) {
|
|
870
|
-
if (!elementName || !catalog) return null;
|
|
871
|
-
var variants = [elementName, elementName.toLowerCase()];
|
|
872
|
-
var deepVariants = variants.map(function (v) {
|
|
873
|
-
return (0, _utils.returnReplaceableDeepSearchType)(v);
|
|
874
|
-
}).filter(Boolean);
|
|
875
|
-
var allCandidates = [].concat(variants, _toConsumableArray(deepVariants));
|
|
876
|
-
var getElement = function getElement(catid) {
|
|
877
|
-
if (!catid) return null;
|
|
878
|
-
|
|
879
|
-
// Immutable.js Map
|
|
880
|
-
if (typeof catalog.getIn === 'function') {
|
|
881
|
-
return catalog.getIn(['elements', catid]);
|
|
882
|
-
}
|
|
883
|
-
|
|
884
|
-
// Plain JS object
|
|
885
|
-
if (catalog.elements && catalog.elements[catid]) {
|
|
886
|
-
return catalog.elements[catid];
|
|
887
|
-
}
|
|
888
|
-
return null;
|
|
889
|
-
};
|
|
890
|
-
var _iterator6 = _createForOfIteratorHelper(allCandidates),
|
|
891
|
-
_step6;
|
|
892
|
-
try {
|
|
893
|
-
for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
|
|
894
|
-
var name = _step6.value;
|
|
895
|
-
var cat = getElement(name);
|
|
896
|
-
if (cat) return cat;
|
|
897
|
-
}
|
|
898
|
-
} catch (err) {
|
|
899
|
-
_iterator6.e(err);
|
|
900
|
-
} finally {
|
|
901
|
-
_iterator6.f();
|
|
902
|
-
}
|
|
903
|
-
return null;
|
|
904
|
-
}
|
|
905
|
-
function isSnappedLine(calcrect, allLineRects) {
|
|
906
|
-
if (allLineRects === undefined) return false;
|
|
907
|
-
var r2 = calcrect.rect[2];
|
|
908
|
-
var r3 = calcrect.rect[3];
|
|
909
|
-
var result = allLineRects.some(function (linerect) {
|
|
910
|
-
var l2 = linerect.rect[2];
|
|
911
|
-
var l3 = linerect.rect[3];
|
|
912
|
-
var delta = verticesDistance(l2, r3) + verticesDistance(r3, r2) + verticesDistance(r2, l3) - verticesDistance(l3, l2);
|
|
913
|
-
if (delta < _constants.EPSILON) {
|
|
914
|
-
return true;
|
|
915
|
-
} else {
|
|
916
|
-
l2 = linerect.rect[3];
|
|
917
|
-
l3 = linerect.rect[2];
|
|
918
|
-
delta = verticesDistance(l2, r3) + verticesDistance(r3, r2) + verticesDistance(r2, l3) - verticesDistance(l3, l2);
|
|
919
|
-
return delta < _constants.EPSILON;
|
|
920
|
-
}
|
|
921
|
-
});
|
|
922
|
-
return result;
|
|
923
|
-
}
|
|
924
|
-
function isSnappedSideLine(calcrect, allLineRects) {
|
|
925
|
-
if (allLineRects === undefined) return 0;
|
|
926
|
-
var r2 = calcrect.rect[1];
|
|
927
|
-
var r3 = calcrect.rect[2];
|
|
928
|
-
var result = allLineRects.some(function (linerect) {
|
|
929
|
-
var l2 = linerect.rect[2];
|
|
930
|
-
var l3 = linerect.rect[3];
|
|
931
|
-
var delta = verticesDistance(l2, r3) + verticesDistance(r3, r2) + verticesDistance(r2, l3) - verticesDistance(l3, l2);
|
|
932
|
-
return delta < _constants.EPSILON;
|
|
933
|
-
});
|
|
934
|
-
return result;
|
|
935
|
-
}
|
|
936
|
-
|
|
937
|
-
/** Calculate candidate positions */
|
|
938
|
-
function getAllItemSnap(allItemRects) {
|
|
939
|
-
var allItemSnap = [];
|
|
940
|
-
var cur = allItemRects.cur;
|
|
941
|
-
|
|
942
|
-
// For development
|
|
943
|
-
var otherItems = allItemRects.otherItems,
|
|
944
|
-
currentItem = allItemRects.currentItem;
|
|
945
|
-
allItemRects.others.forEach(function (rect, index) {
|
|
946
|
-
var cw = cur && cur.size.width / 2;
|
|
947
|
-
var ch = cur && cur.size.height / 2;
|
|
948
|
-
var cos = Math.cos(rect.rotRad);
|
|
949
|
-
var sin = Math.sin(rect.rotRad);
|
|
950
|
-
var ox0 = cw * cos - ch * sin; // (cw, ch) rot
|
|
951
|
-
var oy0 = cw * sin + ch * cos;
|
|
952
|
-
var ox1 = -cw * cos - ch * sin; // (-cw, ch) rot
|
|
953
|
-
var oy1 = -cw * sin + ch * cos;
|
|
954
|
-
var ox2 = ch * sin - cw * cos;
|
|
955
|
-
var oy2 = -ch * cos - cw * sin;
|
|
956
|
-
var ox3 = ch * sin + cw * cos;
|
|
957
|
-
var oy3 = -ch * cos + cw * sin;
|
|
958
|
-
var nrot = rect.rotRad + Math.PI;
|
|
959
|
-
if (nrot >= Math.PI) nrot -= Math.PI * 2;
|
|
960
|
-
var snap1 = itemrectInfo(rect.rect[2].x + ox3, rect.rect[2].y + oy3, rect.rotRad, cur && cur.size, rect.layoutpos, rect.is_corner);
|
|
961
|
-
var snap2 = itemrectInfo(rect.rect[3].x + ox2, rect.rect[3].y + oy2, rect.rotRad, cur && cur.size, rect.layoutpos, rect.is_corner);
|
|
962
|
-
var snap3 = itemrectInfo(rect.rect[2].x + ox1, rect.rect[2].y + oy1, nrot, cur && cur.size, rect.layoutpos, rect.is_corner);
|
|
963
|
-
var snap4 = itemrectInfo(rect.rect[3].x + ox0, rect.rect[3].y + oy0, nrot, cur && cur.size, rect.layoutpos, rect.is_corner);
|
|
964
|
-
var sizeinfo = otherItems[index].cat && otherItems[index].cat.info.sizeinfo;
|
|
965
|
-
if (sizeinfo) {
|
|
966
|
-
var leftBlindLength = sizeinfo.leftBlindLength,
|
|
967
|
-
rightBlindLength = sizeinfo.rightBlindLength;
|
|
968
|
-
if (leftBlindLength > 0) {
|
|
969
|
-
var vx = leftBlindLength - ch;
|
|
970
|
-
var vy = cw;
|
|
971
|
-
var dx = vx * cos + vy * sin;
|
|
972
|
-
var dy = vx * sin - vy * cos;
|
|
973
|
-
var snap6 = itemrectInfo(rect.rect[0].x + dx, rect.rect[0].y + dy, rect.rotRad + Math.PI / 2, cur && cur.size, rect.layoutpos, rect.is_corner);
|
|
974
|
-
allItemSnap.push(snap6);
|
|
975
|
-
}
|
|
976
|
-
if (rightBlindLength > 0) {
|
|
977
|
-
var _vx = ch - rightBlindLength;
|
|
978
|
-
var _vy = cw;
|
|
979
|
-
var _dx = _vx * cos + _vy * sin;
|
|
980
|
-
var _dy = _vx * sin - _vy * cos;
|
|
981
|
-
var snap7 = itemrectInfo(rect.rect[1].x + _dx, rect.rect[1].y + _dy, rect.rotRad - Math.PI / 2, cur && cur.size, rect.layoutpos, rect.is_corner);
|
|
982
|
-
allItemSnap.push(snap7);
|
|
983
|
-
}
|
|
984
|
-
}
|
|
985
|
-
if (rect.isSnappedLine) {
|
|
986
|
-
snap1.isSnappedLine = true;
|
|
987
|
-
snap2.isSnappedLine = true;
|
|
988
|
-
}
|
|
989
|
-
if (rect.is_corner) {
|
|
990
|
-
var _nrot = rect.rotRad + Math.PI * 3 / 2;
|
|
991
|
-
if (_nrot >= Math.PI) _nrot -= Math.PI * 2;
|
|
992
|
-
var snap5 = itemrectInfo(rect.rect[1].x - oy1, rect.rect[1].y + ox1, _nrot, cur && cur.size, rect.layoutpos, rect.is_corner);
|
|
993
|
-
allItemSnap.push(snap2);
|
|
994
|
-
allItemSnap.push(snap5);
|
|
995
|
-
} else {
|
|
996
|
-
allItemSnap.push(snap1);
|
|
997
|
-
allItemSnap.push(snap2);
|
|
998
|
-
allItemSnap.push(snap3);
|
|
999
|
-
allItemSnap.push(snap4);
|
|
1000
|
-
}
|
|
1001
|
-
});
|
|
1002
|
-
return allItemSnap;
|
|
1003
|
-
}
|
|
1004
|
-
function getAllArea(layer) {
|
|
1005
|
-
var allAreaLines = [];
|
|
1006
|
-
var allLines = [];
|
|
1007
|
-
var verticesArray = [];
|
|
1008
|
-
var vertexID_to_verticesArrayIndex = {};
|
|
1009
|
-
layer.vertices.forEach(function (vertex) {
|
|
1010
|
-
var verticesCount = verticesArray.push([vertex.x, vertex.y]);
|
|
1011
|
-
var latestVertexIndex = verticesCount - 1;
|
|
1012
|
-
vertexID_to_verticesArrayIndex[vertex.id] = latestVertexIndex;
|
|
1013
|
-
});
|
|
1014
|
-
layer.areas.forEach(function (area) {
|
|
1015
|
-
allAreaLines.push(area.vertices);
|
|
1016
|
-
});
|
|
1017
|
-
allAreaLines.forEach(function (area) {
|
|
1018
|
-
var pt = [];
|
|
1019
|
-
area.forEach(function (element) {
|
|
1020
|
-
pt.push({
|
|
1021
|
-
x: verticesArray[vertexID_to_verticesArrayIndex[element]][0],
|
|
1022
|
-
y: verticesArray[vertexID_to_verticesArrayIndex[element]][1]
|
|
1023
|
-
});
|
|
1024
|
-
});
|
|
1025
|
-
allLines.push(pt);
|
|
1026
|
-
});
|
|
1027
|
-
return allLines;
|
|
1028
|
-
}
|
|
1029
|
-
|
|
1030
|
-
/** Get all lines of the scene */
|
|
1031
|
-
function getAllLines(layer) {
|
|
1032
|
-
var allAreaLines = getAllAreaLines(layer);
|
|
1033
|
-
var allLines = [];
|
|
1034
|
-
//let allNonAreaLines = [];
|
|
1035
|
-
var thick = _constants.LINE_THICKNESS / 2;
|
|
1036
|
-
layer.lines.forEach(function (line) {
|
|
1037
|
-
var i = containLine(allAreaLines, line);
|
|
1038
|
-
// let thick = line.properties.getIn(['thickness', 'length']);
|
|
1039
|
-
if (i < 0) {
|
|
1040
|
-
var vertices = line.vertices.toJS();
|
|
1041
|
-
var tmp_vertices = {
|
|
1042
|
-
x1: layer.vertices.get(vertices[0]).x,
|
|
1043
|
-
y1: layer.vertices.get(vertices[0]).y,
|
|
1044
|
-
x2: layer.vertices.get(vertices[1]).x,
|
|
1045
|
-
y2: layer.vertices.get(vertices[1]).y
|
|
1046
|
-
};
|
|
1047
|
-
if (tmp_vertices.x1 == tmp_vertices.x2 && tmp_vertices.y1 == tmp_vertices.y2) return;
|
|
1048
|
-
var addIdx = allLines.length;
|
|
1049
|
-
var flag = 0;
|
|
1050
|
-
allLines.forEach(function (element, idx) {
|
|
1051
|
-
if (flag == 0) {
|
|
1052
|
-
var el = element[0];
|
|
1053
|
-
var tmp_el = {
|
|
1054
|
-
x1: layer.vertices.get(el[0]).x,
|
|
1055
|
-
y1: layer.vertices.get(el[0]).y,
|
|
1056
|
-
x2: layer.vertices.get(el[1]).x,
|
|
1057
|
-
y2: layer.vertices.get(el[1]).y
|
|
1058
|
-
};
|
|
1059
|
-
if (tmp_el.x1 == tmp_vertices.x1 && tmp_el.y1 == tmp_vertices.y1) {
|
|
1060
|
-
var tmp = vertices[0];
|
|
1061
|
-
vertices[0] = vertices[1];
|
|
1062
|
-
vertices[1] = tmp;
|
|
1063
|
-
addIdx = idx == 0 ? 0 : idx - 1;
|
|
1064
|
-
flag = 1;
|
|
1065
|
-
} else if (tmp_el.x2 == tmp_vertices.x1 && tmp_el.y2 == tmp_vertices.y1) {
|
|
1066
|
-
addIdx = idx;
|
|
1067
|
-
flag = 1;
|
|
1068
|
-
} else if (tmp_el.x1 == tmp_vertices.x2 && tmp_el.y1 == tmp_vertices.y2) {
|
|
1069
|
-
addIdx = idx == 0 ? 0 : idx - 1;
|
|
1070
|
-
flag = 1;
|
|
1071
|
-
} else if (tmp_el.x2 == tmp_vertices.x2 && tmp_el.y2 == tmp_vertices.y2) {
|
|
1072
|
-
var _tmp = vertices[0];
|
|
1073
|
-
vertices[0] = vertices[1];
|
|
1074
|
-
vertices[1] = _tmp;
|
|
1075
|
-
addIdx = idx;
|
|
1076
|
-
flag = 1;
|
|
1077
|
-
}
|
|
1078
|
-
}
|
|
1079
|
-
});
|
|
1080
|
-
allLines.splice(addIdx, 0, [vertices, thick]);
|
|
1081
|
-
} else {
|
|
1082
|
-
allLines.push([allAreaLines[i], thick]);
|
|
1083
|
-
}
|
|
1084
|
-
});
|
|
1085
|
-
return allLines;
|
|
1086
|
-
}
|
|
1087
|
-
|
|
1088
|
-
/** Get lines that wraps the area */
|
|
1089
|
-
function getAllAreaLines(layer) {
|
|
1090
|
-
var areainfo = [];
|
|
1091
|
-
layer.areas.forEach(function (area) {
|
|
1092
|
-
var sz = area.vertices.size;
|
|
1093
|
-
for (var i = 0; i < sz; i++) {
|
|
1094
|
-
areainfo.push([area.vertices.get(i), area.vertices.get((i + 1) % sz)]);
|
|
1095
|
-
}
|
|
1096
|
-
});
|
|
1097
|
-
return areainfo;
|
|
1098
|
-
}
|
|
1099
|
-
function containLine(lines, line) {
|
|
1100
|
-
// lines: [array]
|
|
1101
|
-
var sz = lines.length;
|
|
1102
|
-
for (var i = 0; i < sz; i++) {
|
|
1103
|
-
var l = lines[i];
|
|
1104
|
-
if (line.vertices.get(0) == l[0] && line.vertices.get(1) == l[1] || line.vertices.get(1) == l[0] && line.vertices.get(0) == l[1]) {
|
|
1105
|
-
return i;
|
|
1106
|
-
}
|
|
1107
|
-
}
|
|
1108
|
-
return -1;
|
|
1109
|
-
}
|
|
1110
|
-
function buildRectFromLines(layer, lines) {
|
|
1111
|
-
var rect = [];
|
|
1112
|
-
lines.forEach(function (line) {
|
|
1113
|
-
var vxys = []; // 0: x0, 1: y0, 2: x1, 3: y1
|
|
1114
|
-
line[0].forEach(function (vertex) {
|
|
1115
|
-
var vert = layer.vertices.get(vertex);
|
|
1116
|
-
vxys.push(vert.x);
|
|
1117
|
-
vxys.push(vert.y);
|
|
1118
|
-
});
|
|
1119
|
-
var thick = line[1];
|
|
1120
|
-
var x0 = vxys[0];
|
|
1121
|
-
var y0 = vxys[1];
|
|
1122
|
-
var x1 = vxys[2];
|
|
1123
|
-
var y1 = vxys[3];
|
|
1124
|
-
rect.push(getCalcRectFromLine(x0, y0, x1, y1, thick, layer));
|
|
1125
|
-
});
|
|
1126
|
-
return rect;
|
|
1127
|
-
}
|
|
1128
|
-
function getRelatedVertices(x0, y0, x1, y1, layer) {
|
|
1129
|
-
var verticesArray = [];
|
|
1130
|
-
var mapVertIDtoIndex = {};
|
|
1131
|
-
layer.vertices.forEach(function (vertex) {
|
|
1132
|
-
var verticesCount = verticesArray.push([vertex.x, vertex.y]);
|
|
1133
|
-
var latestVertexIndex = verticesCount - 1;
|
|
1134
|
-
mapVertIDtoIndex[vertex.id] = latestVertexIndex;
|
|
1135
|
-
});
|
|
1136
|
-
var relVerts = [];
|
|
1137
|
-
layer.lines.some(function (line) {
|
|
1138
|
-
var vertID0 = line.vertices.get(0);
|
|
1139
|
-
var vertID1 = line.vertices.get(1);
|
|
1140
|
-
var pt0 = {
|
|
1141
|
-
x: verticesArray[mapVertIDtoIndex[vertID0]][0],
|
|
1142
|
-
y: verticesArray[mapVertIDtoIndex[vertID0]][1]
|
|
1143
|
-
};
|
|
1144
|
-
var pt1 = {
|
|
1145
|
-
x: verticesArray[mapVertIDtoIndex[vertID1]][0],
|
|
1146
|
-
y: verticesArray[mapVertIDtoIndex[vertID1]][1]
|
|
1147
|
-
};
|
|
1148
|
-
if (Math.abs(pt0.x - x0) < _constants.EPSILON && Math.abs(pt0.y - y0) < _constants.EPSILON && Math.abs(pt1.x - x1) < _constants.EPSILON && Math.abs(pt1.y - y1) < _constants.EPSILON || Math.abs(pt0.x - x1) < _constants.EPSILON && Math.abs(pt0.y - y1) < _constants.EPSILON && Math.abs(pt1.x - x0) < _constants.EPSILON && Math.abs(pt1.y - y0) < _constants.EPSILON) {
|
|
1149
|
-
if (line.relatedVertices.size == 2) {
|
|
1150
|
-
var relPt0 = point(x0, y0);
|
|
1151
|
-
var relPt1 = point(x1, y1);
|
|
1152
|
-
line.relatedVertices.forEach(function (relatedVertice, index) {
|
|
1153
|
-
if (relatedVertice.index == undefined) relatedVertice = relatedVertice.toJSON();
|
|
1154
|
-
if (relatedVertice.index == 0) relPt0 = point(relatedVertice.point.x, relatedVertice.point.y);else relPt1 = point(relatedVertice.point.x, relatedVertice.point.y);
|
|
1155
|
-
});
|
|
1156
|
-
relVerts.push(relPt0);
|
|
1157
|
-
relVerts.push(relPt1);
|
|
1158
|
-
}
|
|
1159
|
-
return true;
|
|
1160
|
-
}
|
|
1161
|
-
});
|
|
1162
|
-
return relVerts;
|
|
1163
|
-
}
|
|
1164
|
-
function getCalcRectFromLine(x0, y0, x1, y1, thick, layer) {
|
|
1165
|
-
// get line from vertex coordinate
|
|
1166
|
-
var relVerts = getRelatedVertices(x0, y0, x1, y1, layer);
|
|
1167
|
-
var dx = x1 - x0;
|
|
1168
|
-
var dy = y1 - y0;
|
|
1169
|
-
var dl = Math.sqrt(dx * dx + dy * dy);
|
|
1170
|
-
var ox = -dy / dl * thick;
|
|
1171
|
-
var oy = dx / dl * thick;
|
|
1172
|
-
var rot = Math.atan2(dy, dx);
|
|
1173
|
-
if (relVerts.length == 2) {
|
|
1174
|
-
var vN = point(ox, oy);
|
|
1175
|
-
var vR = point(relVerts[0].x - x0, relVerts[0].y - y0);
|
|
1176
|
-
if (dotprod(vN, vR) < 0) {
|
|
1177
|
-
ox = -ox;
|
|
1178
|
-
oy = -oy;
|
|
1179
|
-
} else {
|
|
1180
|
-
rot += Math.PI;
|
|
1181
|
-
}
|
|
1182
|
-
} else {
|
|
1183
|
-
var pt0 = point(x0 + ox, y0 + oy);
|
|
1184
|
-
var pt1 = point(x1 + ox, y1 + oy);
|
|
1185
|
-
var ptC = point((pt0.x + pt1.x) / 2, (pt0.y + pt1.y) / 2);
|
|
1186
|
-
var allArea = getAllArea(layer);
|
|
1187
|
-
if (isPointInArea(allArea, ptC)) {
|
|
1188
|
-
// try make rect under line
|
|
1189
|
-
var _pt0 = point(x0 - ox, y0 - oy);
|
|
1190
|
-
var _pt1 = point(x1 - ox, y1 - oy);
|
|
1191
|
-
var _ptC = point((_pt0.x + _pt1.x) / 2, (_pt0.y + _pt1.y) / 2);
|
|
1192
|
-
if (!isPointInArea(allArea, _ptC)) {
|
|
1193
|
-
// only under rect is not included in area, make rect under line
|
|
1194
|
-
ox = -ox;
|
|
1195
|
-
oy = -oy;
|
|
1196
|
-
}
|
|
1197
|
-
}
|
|
1198
|
-
}
|
|
1199
|
-
return {
|
|
1200
|
-
rectEnd: [point(x0 + ox / 2, y0 + oy / 2), point(x1 + ox / 2, y1 + oy / 2)],
|
|
1201
|
-
rect: [point(x0 + ox, y0 + oy), point(x1 + ox, y1 + oy), point(x1, y1), point(x0, y0)],
|
|
1202
|
-
pos: point((x0 + x1 + ox) / 2, (y0 + y1 + ox) / 2),
|
|
1203
|
-
rotRad: rot,
|
|
1204
|
-
size: {
|
|
1205
|
-
width: dl,
|
|
1206
|
-
height: thick / 2
|
|
1207
|
-
}
|
|
1208
|
-
};
|
|
1209
|
-
}
|
|
1210
|
-
function getAllLineSnap(allLineRects, curItemRect) {
|
|
1211
|
-
var allLineSnap = [];
|
|
1212
|
-
var cur = curItemRect;
|
|
1213
|
-
if (cur === undefined || cur === null) return;else allLineRects.forEach(function (rect) {
|
|
1214
|
-
var cw = cur.size.width / 2;
|
|
1215
|
-
var ch = cur.size.height / 2;
|
|
1216
|
-
var cos = Math.cos(rect.rotRad);
|
|
1217
|
-
var sin = Math.sin(rect.rotRad);
|
|
1218
|
-
var ox0 = cw * cos - ch * sin; // (cw, ch) rot
|
|
1219
|
-
var oy0 = cw * sin + ch * cos;
|
|
1220
|
-
var ox1 = -cw * cos - ch * sin; // (-cw, ch) rot
|
|
1221
|
-
var oy1 = -cw * sin + ch * cos;
|
|
1222
|
-
var nrot = rect.rotRad + Math.PI;
|
|
1223
|
-
if (nrot >= Math.PI) nrot -= Math.PI * 2;
|
|
1224
|
-
var thick = rect.size.height;
|
|
1225
|
-
var snap3 = itemInfo(rect.rect[2].x + ox1, rect.rect[2].y + oy1, nrot, cur.size);
|
|
1226
|
-
var snap4 = itemInfo(rect.rect[3].x + ox0, rect.rect[3].y + oy0, nrot, cur.size);
|
|
1227
|
-
if (!cur.is_corner) {
|
|
1228
|
-
allLineSnap.push(snap3);
|
|
1229
|
-
}
|
|
1230
|
-
allLineSnap.push(snap4);
|
|
1231
|
-
});
|
|
1232
|
-
return allLineSnap;
|
|
1233
|
-
}
|
|
1234
|
-
function validateSnaps(allSnaps, allRects) {
|
|
1235
|
-
var validSnaps = [];
|
|
1236
|
-
if (allSnaps !== undefined && allSnaps !== null && allSnaps.length > 0) allSnaps.forEach(function (snap) {
|
|
1237
|
-
if (validSnap(snap, allRects)) {
|
|
1238
|
-
validSnaps.push(snap);
|
|
1239
|
-
}
|
|
1240
|
-
});
|
|
1241
|
-
return validSnaps;
|
|
1242
|
-
}
|
|
1243
|
-
function validateLineSnaps(allSnaps, allItemSnap, allLineSnap, allItemRects, allLineRects, allRects) {
|
|
1244
|
-
var validSnaps = [];
|
|
1245
|
-
allSnaps.forEach(function (snap) {
|
|
1246
|
-
if (validSnap(snap, allRects)) {
|
|
1247
|
-
validSnaps.push(snap);
|
|
1248
|
-
} else {
|
|
1249
|
-
allItemSnap.forEach(function (snap) {
|
|
1250
|
-
validSnaps.push(snap);
|
|
1251
|
-
});
|
|
1252
|
-
allLineSnap.forEach(function (snap) {
|
|
1253
|
-
validSnaps.push(snap);
|
|
1254
|
-
});
|
|
1255
|
-
}
|
|
1256
|
-
});
|
|
1257
|
-
return validSnaps;
|
|
1258
|
-
}
|
|
1259
|
-
function validSnap(snap, rects) {
|
|
1260
|
-
var snaprect = getCalcRectFromItem(snap);
|
|
1261
|
-
return rects.every(function (rect) {
|
|
1262
|
-
return !intersectRect(rect.rect, snaprect.rect);
|
|
1263
|
-
});
|
|
1264
|
-
}
|
|
1265
|
-
function itemInfo(x, y, rotRad, size) {
|
|
1266
|
-
return {
|
|
1267
|
-
pos: {
|
|
1268
|
-
x: x,
|
|
1269
|
-
y: y
|
|
1270
|
-
},
|
|
1271
|
-
rotRad: rotRad,
|
|
1272
|
-
size: size
|
|
1273
|
-
};
|
|
1274
|
-
}
|
|
1275
|
-
function intersectRect(rect1, rect2) {
|
|
1276
|
-
var ret = false;
|
|
1277
|
-
rect1 = shrinkRect(rect1);
|
|
1278
|
-
rect2 = shrinkRect(rect2);
|
|
1279
|
-
ret = ret || getInterSect(rect1, rect2);
|
|
1280
|
-
ret = ret || rect1.some(function (pt) {
|
|
1281
|
-
return containPointInRect(pt, rect2);
|
|
1282
|
-
});
|
|
1283
|
-
ret = ret || rect2.some(function (pt) {
|
|
1284
|
-
return containPointInRect(pt, rect1);
|
|
1285
|
-
});
|
|
1286
|
-
return ret;
|
|
1287
|
-
}
|
|
1288
|
-
function containPointInRect(point, rect) {
|
|
1289
|
-
// true: contain, false: not contain
|
|
1290
|
-
for (var i = 0; i < rect.length; i++) {
|
|
1291
|
-
var ni = (i + 1) % rect.length;
|
|
1292
|
-
if (crossprod(diff(point, rect[i]), diff(rect[i], rect[ni])) < 0) {
|
|
1293
|
-
return false;
|
|
1294
|
-
}
|
|
1295
|
-
}
|
|
1296
|
-
return true;
|
|
1297
|
-
}
|
|
1298
|
-
function diff(v0, v1) {
|
|
1299
|
-
return {
|
|
1300
|
-
x: v0.x - v1.x,
|
|
1301
|
-
y: v0.y - v1.y
|
|
1302
|
-
};
|
|
1303
|
-
}
|
|
1304
|
-
function crossprod(v0, v1) {
|
|
1305
|
-
return v0.x * v1.y - v0.y * v1.x;
|
|
1306
|
-
}
|
|
1307
|
-
function shrinkRect(rect) {
|
|
1308
|
-
var v02x = rect[2].x - rect[0].x;
|
|
1309
|
-
var v02y = rect[2].y - rect[0].y;
|
|
1310
|
-
var d02 = Math.sqrt(v02x * v02x + v02y * v02y);
|
|
1311
|
-
var o02x = v02x / d02 * 0.1;
|
|
1312
|
-
var o02y = v02y / d02 * 0.1;
|
|
1313
|
-
var v13x = rect[3].x - rect[1].x;
|
|
1314
|
-
var v13y = rect[3].y - rect[1].y;
|
|
1315
|
-
var d13 = Math.sqrt(v02x * v02x + v02y * v02y);
|
|
1316
|
-
var o13x = v13x / d13 * 0.1;
|
|
1317
|
-
var o13y = v13y / d13 * 0.1;
|
|
1318
|
-
return [point(rect[0].x + o02x, rect[0].y + o02y), point(rect[1].x + o13x, rect[1].y + o13y), point(rect[2].x - o02x, rect[2].y - o02y), point(rect[3].x - o13x, rect[3].y - o13y)];
|
|
1319
|
-
}
|
|
1320
|
-
function getInterSect(shape1, shape2) {
|
|
1321
|
-
// return result of intersect of two shape
|
|
1322
|
-
var count = 0;
|
|
1323
|
-
for (var i = 0; i < shape1.length; i++) {
|
|
1324
|
-
var sl1 = {
|
|
1325
|
-
x: shape1[i].x,
|
|
1326
|
-
y: shape1[i].y
|
|
1327
|
-
};
|
|
1328
|
-
var sl2 = {
|
|
1329
|
-
x: shape1[(i + 1) % shape1.length].x,
|
|
1330
|
-
y: shape1[(i + 1) % shape1.length].y
|
|
1331
|
-
};
|
|
1332
|
-
for (var j = 0; j < shape2.length; j++) {
|
|
1333
|
-
var el1 = {
|
|
1334
|
-
x: shape2[j].x,
|
|
1335
|
-
y: shape2[j].y
|
|
1336
|
-
};
|
|
1337
|
-
var el2 = {
|
|
1338
|
-
x: shape2[(j + 1) % shape2.length].x,
|
|
1339
|
-
y: shape2[(j + 1) % shape2.length].y
|
|
1340
|
-
};
|
|
1341
|
-
var flag = getLineInterSect(sl1.x, sl1.y, sl2.x, sl2.y, el1.x, el1.y, el2.x, el2.y);
|
|
1342
|
-
if (flag) {
|
|
1343
|
-
count++;
|
|
1344
|
-
if (count > 1) return true;
|
|
1345
|
-
}
|
|
1346
|
-
}
|
|
1347
|
-
}
|
|
1348
|
-
return false;
|
|
1349
|
-
}
|
|
1350
|
-
function getLineInterSect(s1x, s1y, e1x, e1y, s2x, s2y, e2x, e2y) {
|
|
1351
|
-
var ax = s1x;
|
|
1352
|
-
var ay = s1y;
|
|
1353
|
-
var bx = e1x - s1x;
|
|
1354
|
-
var by = e1y - s1y;
|
|
1355
|
-
var cx = s2x;
|
|
1356
|
-
var cy = s2y;
|
|
1357
|
-
var dx = e2x - s2x;
|
|
1358
|
-
var dy = e2y - s2y;
|
|
1359
|
-
if (Math.abs(bx * dy - by * dx) < 0.00000001) {
|
|
1360
|
-
if (Math.abs((cx - ax) * by - (cy - ay) * bx) < 0.00000001) {
|
|
1361
|
-
var maxX = ax;
|
|
1362
|
-
var minX = ax;
|
|
1363
|
-
var maxY = ay;
|
|
1364
|
-
var minY = ay;
|
|
1365
|
-
if (maxX < e1x) maxX = e1x;
|
|
1366
|
-
if (maxX < cx) maxX = cx;
|
|
1367
|
-
if (maxX < e2x) maxX = e2x;
|
|
1368
|
-
if (minX > e1x) minX = e1x;
|
|
1369
|
-
if (minX > cx) minX = cx;
|
|
1370
|
-
if (minX > e2x) minX = e2x;
|
|
1371
|
-
if (maxY < e1y) maxY = e1y;
|
|
1372
|
-
if (maxY < cy) maxY = cy;
|
|
1373
|
-
if (maxY < e2y) maxY = e2y;
|
|
1374
|
-
if (minY > e1y) minY = e1y;
|
|
1375
|
-
if (minY > cy) minY = cy;
|
|
1376
|
-
if (minY > e2y) minX = e2y;
|
|
1377
|
-
var len = Math.sqrt((maxX - minX) * (maxX - minX) + (maxY - minY) * (maxY - minY));
|
|
1378
|
-
var len1 = Math.sqrt(bx * bx + by * by);
|
|
1379
|
-
var len2 = Math.sqrt(dx * dx + dy * dy);
|
|
1380
|
-
if (len < len1 + len2) {
|
|
1381
|
-
return true;
|
|
1382
|
-
} else {
|
|
1383
|
-
return false;
|
|
1384
|
-
}
|
|
1385
|
-
} else {
|
|
1386
|
-
return false;
|
|
1387
|
-
}
|
|
1388
|
-
} else {
|
|
1389
|
-
var t = (dx * (ay - cy) + dy * (cx - ax)) / (bx * dy - by * dx);
|
|
1390
|
-
var u = (bx * (cy - ay) + by * (ax - cx)) / (dx * by - dy * bx);
|
|
1391
|
-
var ret = u < 1 && u > 0 && t > 0 && t < 1;
|
|
1392
|
-
return ret;
|
|
1393
|
-
}
|
|
1394
|
-
}
|
|
1395
|
-
function isPointInArea(allArea, pt) {
|
|
1396
|
-
var x = pt.x;
|
|
1397
|
-
var y = pt.y;
|
|
1398
|
-
var result = false;
|
|
1399
|
-
result = allArea.some(function (area) {
|
|
1400
|
-
var sum = 0,
|
|
1401
|
-
alpha = 0;
|
|
1402
|
-
for (var i = 0; i < area.length; i++) {
|
|
1403
|
-
var x0 = area[i].x;
|
|
1404
|
-
var y0 = area[i].y;
|
|
1405
|
-
var x1 = area[(i + 1) % area.length].x;
|
|
1406
|
-
var y1 = area[(i + 1) % area.length].y;
|
|
1407
|
-
var v0 = {
|
|
1408
|
-
x: x0 - x,
|
|
1409
|
-
y: y0 - y
|
|
1410
|
-
};
|
|
1411
|
-
var v1 = {
|
|
1412
|
-
x: x1 - x,
|
|
1413
|
-
y: y1 - y
|
|
1414
|
-
};
|
|
1415
|
-
if (Math.abs(v0.x) < _constants.EPSILON && Math.abs(v0.y) < _constants.EPSILON)
|
|
1416
|
-
// check if pt is area point
|
|
1417
|
-
return true;
|
|
1418
|
-
|
|
1419
|
-
// check if pt is in area line
|
|
1420
|
-
var lineLen = Math.sqrt((x1 - x0) * (x1 - x0) + (y1 - y0) * (y1 - y0));
|
|
1421
|
-
var v0Len = Math.sqrt(v0.x * v0.x + v0.y * v0.y);
|
|
1422
|
-
var vPt = {
|
|
1423
|
-
x: -v0.x / v0Len,
|
|
1424
|
-
y: -v0.y / v0Len
|
|
1425
|
-
};
|
|
1426
|
-
var xE = x0 + vPt.x * lineLen;
|
|
1427
|
-
var yE = y0 + vPt.y * lineLen;
|
|
1428
|
-
if (v0Len <= lineLen && Math.abs(xE - x1) < _constants.EPSILON && Math.abs(yE - y1) < _constants.EPSILON) return true;
|
|
1429
|
-
alpha = Math.atan2(v0.x * v1.y - v1.x * v0.y, v0.x * v1.x + v0.y * v1.y);
|
|
1430
|
-
sum += alpha;
|
|
1431
|
-
}
|
|
1432
|
-
if (Math.abs(Math.abs(sum) - Math.PI * 2) < _constants.EPSILON) return true;
|
|
1433
|
-
});
|
|
1434
|
-
return result;
|
|
1435
|
-
}
|
|
1436
|
-
function calcSnap(allItemRect, allItemSnap, allLineRects, allLineSnap, allRect, x, y, allAreaLines) {
|
|
1437
|
-
return calcSnap2(allItemRect, allItemSnap, allLineRects, allLineSnap, allRect, x, y, allAreaLines);
|
|
1438
|
-
}
|
|
1439
|
-
function calcCreateSnap(allItemRect, allItemSnap, allLineRects, allLineSnap, allRect, x, y, polygonPoint) {
|
|
1440
|
-
// Validate required input and guard against missing `.cur`
|
|
1441
|
-
if (!allItemRect || !allItemRect.cur) return;
|
|
1442
|
-
var cur = allItemRect.cur; // safe alias
|
|
1443
|
-
var cx = x;
|
|
1444
|
-
var cy = y;
|
|
1445
|
-
var ndist = 5000;
|
|
1446
|
-
var rotRad = cur.rotRad;
|
|
1447
|
-
|
|
1448
|
-
// Get candidate snaps and validate them as before
|
|
1449
|
-
var allCurSnap = getAllCurSnap(allLineRects, x, y, cur);
|
|
1450
|
-
allCurSnap = validateLineSnaps(allCurSnap, allItemSnap, allLineSnap, allItemRect, allLineRects, allRect);
|
|
1451
|
-
var getSnap = false;
|
|
1452
|
-
var snapdist = [];
|
|
1453
|
-
|
|
1454
|
-
// Build distances for snaps that lie inside polygonPoint (if any)
|
|
1455
|
-
if (Array.isArray(allCurSnap)) {
|
|
1456
|
-
allCurSnap.forEach(function (snap) {
|
|
1457
|
-
if (!snap || !snap.pos) return;
|
|
1458
|
-
var inside = ContainsPoint(polygonPoint, snap.pos.x, snap.pos.y);
|
|
1459
|
-
if (inside) {
|
|
1460
|
-
var dx = snap.pos.x - x;
|
|
1461
|
-
var dy = snap.pos.y - y;
|
|
1462
|
-
snapdist.push(dx * dx + dy * dy);
|
|
1463
|
-
}
|
|
1464
|
-
});
|
|
1465
|
-
}
|
|
1466
|
-
|
|
1467
|
-
// Find minimum distance (Infinity if none)
|
|
1468
|
-
var edist = snapdist.length ? Math.min.apply(Math, snapdist) : Infinity;
|
|
1469
|
-
|
|
1470
|
-
// Choose the snap with distance === edist
|
|
1471
|
-
if (Array.isArray(allCurSnap)) {
|
|
1472
|
-
allCurSnap.forEach(function (snap) {
|
|
1473
|
-
if (!snap || !snap.pos) return;
|
|
1474
|
-
var dx = snap.pos.x - x;
|
|
1475
|
-
var dy = snap.pos.y - y;
|
|
1476
|
-
var dist = dx * dx + dy * dy;
|
|
1477
|
-
if (dist === edist) {
|
|
1478
|
-
var _snap$rotRad;
|
|
1479
|
-
ndist = dist;
|
|
1480
|
-
cx = snap.pos.x;
|
|
1481
|
-
cy = snap.pos.y;
|
|
1482
|
-
rotRad = (_snap$rotRad = snap.rotRad) !== null && _snap$rotRad !== void 0 ? _snap$rotRad : rotRad; // nullish coalescing
|
|
1483
|
-
getSnap = true;
|
|
1484
|
-
}
|
|
1485
|
-
});
|
|
1486
|
-
}
|
|
1487
|
-
var crot = rotRad / Math.PI * 180;
|
|
1488
|
-
return {
|
|
1489
|
-
cx: cx,
|
|
1490
|
-
cy: cy,
|
|
1491
|
-
crot: crot,
|
|
1492
|
-
rotRad: rotRad
|
|
1493
|
-
};
|
|
1494
|
-
}
|
|
1495
|
-
|
|
1496
|
-
////////////
|
|
1497
|
-
function calcSnap1(allItemRect, allItemSnap, allLineRects, allLineSnap, allRect, x, y) {
|
|
1498
|
-
var cx = allItemRect.cur.pos.x;
|
|
1499
|
-
var cy = allItemRect.cur.pos.y;
|
|
1500
|
-
var nx = x;
|
|
1501
|
-
var ny = y;
|
|
1502
|
-
var cursize = allItemRect.cur.size;
|
|
1503
|
-
var ndist = cursize.width * cursize.width + cursize.height * cursize.height;
|
|
1504
|
-
ndist = ndist / 4;
|
|
1505
|
-
var rotRad = allItemRect.cur.rotRad;
|
|
1506
|
-
var allCurSnap = getAllCurSnap(allLineRects, x, y, allItemRect.cur);
|
|
1507
|
-
allCurSnap = validateSnaps(allCurSnap, allRect);
|
|
1508
|
-
var getSnap = false;
|
|
1509
|
-
allCurSnap.forEach(function (snap) {
|
|
1510
|
-
var dist = (snap.pos.x - x) * (snap.pos.x - x) + (snap.pos.y - y) * (snap.pos.y - y);
|
|
1511
|
-
if (dist < ndist) {
|
|
1512
|
-
ndist = dist;
|
|
1513
|
-
nx = snap.pos.x;
|
|
1514
|
-
ny = snap.pos.y;
|
|
1515
|
-
rotRad = snap.rotRad;
|
|
1516
|
-
getSnap = true;
|
|
1517
|
-
}
|
|
1518
|
-
});
|
|
1519
|
-
if (!getSnap) {
|
|
1520
|
-
allLineSnap.concat(allItemSnap).forEach(function (snap) {
|
|
1521
|
-
var dist = (snap.pos.x - x) * (snap.pos.x - x) + (snap.pos.y - y) * (snap.pos.y - y);
|
|
1522
|
-
if (dist < ndist) {
|
|
1523
|
-
ndist = dist;
|
|
1524
|
-
nx = snap.pos.x;
|
|
1525
|
-
ny = snap.pos.y;
|
|
1526
|
-
rotRad = snap.rotRad;
|
|
1527
|
-
}
|
|
1528
|
-
});
|
|
1529
|
-
}
|
|
1530
|
-
var rot = rotRad / Math.PI * 180;
|
|
1531
|
-
var ret = {
|
|
1532
|
-
nx: nx,
|
|
1533
|
-
ny: ny,
|
|
1534
|
-
rot: rot,
|
|
1535
|
-
rotRad: rotRad
|
|
1536
|
-
};
|
|
1537
|
-
return ret;
|
|
1538
|
-
}
|
|
1539
|
-
|
|
1540
|
-
////////////
|
|
1541
|
-
function calcSnap2(allItemRect, allItemSnap, allLineRects, allLineSnap, allRect, x, y, allArea) {
|
|
1542
|
-
var nx = x;
|
|
1543
|
-
var ny = y;
|
|
1544
|
-
var ndist = 20;
|
|
1545
|
-
var rotRad = allItemRect.cur && allItemRect.cur.rotRad;
|
|
1546
|
-
var val = {
|
|
1547
|
-
pos: {
|
|
1548
|
-
x: x,
|
|
1549
|
-
y: y
|
|
1550
|
-
},
|
|
1551
|
-
rotRad: rotRad
|
|
1552
|
-
};
|
|
1553
|
-
val.size = allItemRect.cur && allItemRect.cur.size;
|
|
1554
|
-
val.layoutpos = allItemRect.cur && allItemRect.cur.layoutpos;
|
|
1555
|
-
val.is_corner = allItemRect.cur && allItemRect.cur.is_corner;
|
|
1556
|
-
var curitem = getCalcRectFromItem(val);
|
|
1557
|
-
var allCurSnap = [];
|
|
1558
|
-
//if (!val.is_corner) {
|
|
1559
|
-
allCurSnap = getAllCurSnap(allLineRects, x, y, allItemRect.cur);
|
|
1560
|
-
allCurSnap = validateSnaps(allCurSnap, allRect);
|
|
1561
|
-
//}
|
|
1562
|
-
var getSnap = false;
|
|
1563
|
-
var snapdist = [];
|
|
1564
|
-
//console.log("allItemSnap", allItemSnap.filter(e => e.isSnappedLine))
|
|
1565
|
-
//console.log("~~~~start~~~~");
|
|
1566
|
-
allItemSnap.filter(function (e) {
|
|
1567
|
-
return e.isSnappedLine;
|
|
1568
|
-
}).forEach(function (snap) {
|
|
1569
|
-
var dist = (snap.pos.x - x) * (snap.pos.x - x) + (snap.pos.y - y) * (snap.pos.y - y);
|
|
1570
|
-
snapdist.push(dist);
|
|
1571
|
-
//console.log("dist", snap)
|
|
1572
|
-
if (isPointInArea(allArea, snap.pos) || !allArea.length) if (dist < 100) {
|
|
1573
|
-
ndist = dist;
|
|
1574
|
-
nx = snap.pos.x;
|
|
1575
|
-
ny = snap.pos.y;
|
|
1576
|
-
rotRad = snap.rotRad;
|
|
1577
|
-
getSnap = true;
|
|
1578
|
-
|
|
1579
|
-
//console.log("SUCCESS!!!!");
|
|
1580
|
-
}
|
|
1581
|
-
});
|
|
1582
|
-
//console.log("====end====");
|
|
1583
|
-
if (getSnap == false) {
|
|
1584
|
-
allCurSnap.forEach(function (snap) {
|
|
1585
|
-
var dist = (snap.pos.x - x) * (snap.pos.x - x) + (snap.pos.y - y) * (snap.pos.y - y);
|
|
1586
|
-
snapdist.push(dist);
|
|
1587
|
-
if (isPointInArea(allArea, snap.pos) || !allArea.length) if (dist < ndist) {
|
|
1588
|
-
ndist = dist;
|
|
1589
|
-
nx = snap.pos.x;
|
|
1590
|
-
ny = snap.pos.y;
|
|
1591
|
-
rotRad = snap.rotRad;
|
|
1592
|
-
getSnap = true;
|
|
1593
|
-
//console.log("SUCCE!!!!");
|
|
1594
|
-
}
|
|
1595
|
-
});
|
|
1596
|
-
if (!getSnap && allLineRects.some(function (others) {
|
|
1597
|
-
return intersectRect(others.rect, curitem.rect);
|
|
1598
|
-
})) {
|
|
1599
|
-
var edist = Math.min.apply(null, snapdist);
|
|
1600
|
-
allCurSnap.forEach(function (snap) {
|
|
1601
|
-
var dist = (snap.pos.x - x) * (snap.pos.x - x) + (snap.pos.y - y) * (snap.pos.y - y);
|
|
1602
|
-
if (isPointInArea(allArea, snap.pos) || !allArea.length) if (dist === edist) {
|
|
1603
|
-
ndist = dist;
|
|
1604
|
-
nx = snap.pos.x;
|
|
1605
|
-
ny = snap.pos.y;
|
|
1606
|
-
rotRad = snap.rotRad;
|
|
1607
|
-
getSnap = true;
|
|
1608
|
-
}
|
|
1609
|
-
});
|
|
1610
|
-
}
|
|
1611
|
-
if (getSnap === false) {
|
|
1612
|
-
var nearRect = null;
|
|
1613
|
-
var minDist = Infinity;
|
|
1614
|
-
allLineRects.forEach(function (rect) {
|
|
1615
|
-
var e = rect.rectEnd[0];
|
|
1616
|
-
e = clone_point(e);
|
|
1617
|
-
e.x -= curitem.pos.x;
|
|
1618
|
-
e.y -= curitem.pos.y;
|
|
1619
|
-
var nRot = rect.rotRad + Math.PI / 2;
|
|
1620
|
-
var dist = Math.abs(e.x * Math.cos(nRot) + e.y * Math.sin(nRot));
|
|
1621
|
-
if (minDist > dist) {
|
|
1622
|
-
minDist = dist;
|
|
1623
|
-
nearRect = rect;
|
|
1624
|
-
}
|
|
1625
|
-
});
|
|
1626
|
-
var containrect = nearRect && intersectRect(nearRect.rect, curitem.rect);
|
|
1627
|
-
if (containrect) {
|
|
1628
|
-
var filter_func = function filter_func(snap) {
|
|
1629
|
-
var diff = Math.abs(snap.rotRad - nearRect.rotRad - Math.PI);
|
|
1630
|
-
return diff == 0 || diff == 2 * Math.PI;
|
|
1631
|
-
};
|
|
1632
|
-
var tempSnap = allLineSnap.filter(filter_func);
|
|
1633
|
-
tempSnap = tempSnap.concat(allLineSnap.filter(function (snap) {
|
|
1634
|
-
return !filter_func(snap);
|
|
1635
|
-
}));
|
|
1636
|
-
tempSnap.some(function (snap) {
|
|
1637
|
-
var dist = (snap.pos.x - x) * (snap.pos.x - x) + (snap.pos.y - y) * (snap.pos.y - y);
|
|
1638
|
-
if (isPointInArea(allArea, snap.pos) || !allArea.length) if (dist < 5000) {
|
|
1639
|
-
nx = snap.pos.x;
|
|
1640
|
-
ny = snap.pos.y;
|
|
1641
|
-
rotRad = snap.rotRad;
|
|
1642
|
-
getSnap = true;
|
|
1643
|
-
return true;
|
|
1644
|
-
}
|
|
1645
|
-
return false;
|
|
1646
|
-
});
|
|
1647
|
-
}
|
|
1648
|
-
}
|
|
1649
|
-
if (allItemRect.others.some(function (others) {
|
|
1650
|
-
return intersectRect(others.rect, curitem.rect);
|
|
1651
|
-
})) {
|
|
1652
|
-
getSnap = false;
|
|
1653
|
-
}
|
|
1654
|
-
if (!getSnap) {
|
|
1655
|
-
var _snapdist = [];
|
|
1656
|
-
allItemSnap.forEach(function (snap) {
|
|
1657
|
-
var dist = (snap.pos.x - x) * (snap.pos.x - x) + (snap.pos.y - y) * (snap.pos.y - y);
|
|
1658
|
-
_snapdist.push(dist);
|
|
1659
|
-
if (isPointInArea(allArea, snap.pos) || !allArea.length) if (dist < ndist) {
|
|
1660
|
-
ndist = dist;
|
|
1661
|
-
nx = snap.pos.x;
|
|
1662
|
-
ny = snap.pos.y;
|
|
1663
|
-
rotRad = snap.rotRad;
|
|
1664
|
-
getSnap = true;
|
|
1665
|
-
}
|
|
1666
|
-
});
|
|
1667
|
-
if (!getSnap && allItemRect.others.some(function (others) {
|
|
1668
|
-
return intersectRect(others.rect, curitem.rect);
|
|
1669
|
-
})) {
|
|
1670
|
-
var _edist = Math.min.apply(null, _snapdist);
|
|
1671
|
-
allItemSnap.forEach(function (snap) {
|
|
1672
|
-
var dist = (snap.pos.x - x) * (snap.pos.x - x) + (snap.pos.y - y) * (snap.pos.y - y);
|
|
1673
|
-
if (isPointInArea(allArea, snap.pos) || !allArea.length) if (dist === _edist) {
|
|
1674
|
-
ndist = dist;
|
|
1675
|
-
nx = snap.pos.x;
|
|
1676
|
-
ny = snap.pos.y;
|
|
1677
|
-
rotRad = snap.rotRad;
|
|
1678
|
-
}
|
|
1679
|
-
});
|
|
1680
|
-
if (allItemRect.cur.itemInfo.name.includes('Cook Top')) {
|
|
1681
|
-
var intersects = allItemRect.others.filter(function (others) {
|
|
1682
|
-
return intersectRect(others.rect, curitem.rect);
|
|
1683
|
-
});
|
|
1684
|
-
intersects.forEach(function (rect) {
|
|
1685
|
-
if (isPointInArea(allArea, rect.itemInfo) || !allArea.length) if (rect.itemInfo.layoutpos.includes(_constants.BASE_CABINET_LAYOUTPOS)) {
|
|
1686
|
-
nx = rect.itemInfo.x;
|
|
1687
|
-
ny = rect.itemInfo.y;
|
|
1688
|
-
rotRad = rect.itemInfo.rotation * Math.PI / 180;
|
|
1689
|
-
}
|
|
1690
|
-
});
|
|
1691
|
-
}
|
|
1692
|
-
if (allItemRect.cur.itemInfo.name.includes('Hood') || allItemRect.cur.itemInfo.name.includes('Range') || allItemRect.cur.itemInfo.name.includes('Cook Top')) {
|
|
1693
|
-
var _intersects = allItemRect.others.filter(function (others) {
|
|
1694
|
-
return intersectRect(others.rect, curitem.rect);
|
|
1695
|
-
});
|
|
1696
|
-
_intersects.forEach(function (rect) {
|
|
1697
|
-
if (isPointInArea(allArea, rect.itemInfo) || !allArea.length) if (rect.itemInfo.name.includes('Hood') || rect.itemInfo.name.includes('Range') || rect.itemInfo.name.includes('Cook Top')) {
|
|
1698
|
-
nx = rect.itemInfo.x;
|
|
1699
|
-
ny = rect.itemInfo.y;
|
|
1700
|
-
rotRad = rect.itemInfo.rotation * Math.PI / 180;
|
|
1701
|
-
}
|
|
1702
|
-
});
|
|
1703
|
-
}
|
|
1704
|
-
}
|
|
1705
|
-
}
|
|
1706
|
-
}
|
|
1707
|
-
var rot = rotRad / Math.PI * 180;
|
|
1708
|
-
|
|
1709
|
-
//Check case.
|
|
1710
|
-
//If item is 'blind base cabinet', it must be pulled from other 3".
|
|
1711
|
-
if (allItemRect.cur && allItemRect.cur.itemInfo.sku_number.startsWith('BBC')) {
|
|
1712
|
-
var offset3inch = (0, _convertUnits["default"])(3).from('in').to('cm');
|
|
1713
|
-
var tx = nx,
|
|
1714
|
-
ty = ny;
|
|
1715
|
-
if (allItemRect.cur && allItemRect.cur.itemInfo.sku_number.endsWith('-L')) {
|
|
1716
|
-
if (rot == 0 || rot == -180) {
|
|
1717
|
-
tx -= offset3inch * Math.cos(rotRad);
|
|
1718
|
-
}
|
|
1719
|
-
if (rot == 90 || rot == -90) {
|
|
1720
|
-
ty -= offset3inch * Math.sin(rotRad);
|
|
1721
|
-
}
|
|
1722
|
-
}
|
|
1723
|
-
if (allItemRect.cur && allItemRect.cur.itemInfo.sku_number.endsWith('-R')) {
|
|
1724
|
-
if (rot == 0 || rot == -180) {
|
|
1725
|
-
tx += offset3inch * Math.cos(rotRad);
|
|
1726
|
-
}
|
|
1727
|
-
if (rot == 90 || rot == -90) {
|
|
1728
|
-
ty += offset3inch * Math.sin(rotRad);
|
|
1729
|
-
}
|
|
1730
|
-
}
|
|
1731
|
-
var t_val = {
|
|
1732
|
-
pos: {
|
|
1733
|
-
x: tx,
|
|
1734
|
-
y: ty
|
|
1735
|
-
},
|
|
1736
|
-
rotRad: rotRad,
|
|
1737
|
-
size: allItemRect.cur.size,
|
|
1738
|
-
layoutpos: allItemRect.cur.layoutpos,
|
|
1739
|
-
is_corner: allItemRect.cur.is_corner
|
|
1740
|
-
};
|
|
1741
|
-
var isItemRectSect = validInterSect(allItemRect.others, t_val);
|
|
1742
|
-
var isWallRectSect = validInterSect(allLineRects, t_val);
|
|
1743
|
-
if (isItemRectSect && isWallRectSect) {
|
|
1744
|
-
nx = tx;
|
|
1745
|
-
ny = ty;
|
|
1746
|
-
}
|
|
1747
|
-
}
|
|
1748
|
-
return {
|
|
1749
|
-
nx: nx,
|
|
1750
|
-
ny: ny,
|
|
1751
|
-
rot: rot,
|
|
1752
|
-
rotRad: rotRad
|
|
1753
|
-
};
|
|
1754
|
-
}
|
|
1755
|
-
|
|
1756
|
-
////////////
|
|
1757
|
-
function calcSnap3(allItemRect, allItemSnap, allLineRects, allLineSnap, allRect, x, y) {
|
|
1758
|
-
// let layer = scene.layers.get(layerID);
|
|
1759
|
-
// let cx = allItemRect.cur.pos.x;
|
|
1760
|
-
// let cy = allItemRect.cur.pos.y;
|
|
1761
|
-
var nx = x;
|
|
1762
|
-
var ny = y;
|
|
1763
|
-
var ndist = 20;
|
|
1764
|
-
var rotRad = allItemRect.cur.rotRad;
|
|
1765
|
-
var val = {
|
|
1766
|
-
pos: {
|
|
1767
|
-
x: x,
|
|
1768
|
-
y: y
|
|
1769
|
-
},
|
|
1770
|
-
rotRad: rotRad
|
|
1771
|
-
};
|
|
1772
|
-
val.size = allItemRect.cur.size;
|
|
1773
|
-
val.layoutpos = allItemRect.cur.layoutpos;
|
|
1774
|
-
val.is_corner = allItemRect.cur.is_corner;
|
|
1775
|
-
var curitem = getCalcRectFromItem3D(val);
|
|
1776
|
-
var allCurSnap = getAllCurSnap(allLineRects, x, y, allItemRect.cur);
|
|
1777
|
-
allCurSnap = validateSnaps(allCurSnap, allRect);
|
|
1778
|
-
var getSnap = false;
|
|
1779
|
-
var snapdist = [];
|
|
1780
|
-
allCurSnap.forEach(function (snap) {
|
|
1781
|
-
var dist = (snap.pos.x - x) * (snap.pos.x - x) + (snap.pos.y - y) * (snap.pos.y - y);
|
|
1782
|
-
snapdist.push(dist);
|
|
1783
|
-
if (dist < ndist) {
|
|
1784
|
-
ndist = dist;
|
|
1785
|
-
nx = snap.pos.x;
|
|
1786
|
-
ny = snap.pos.y;
|
|
1787
|
-
rotRad = snap.rotRad;
|
|
1788
|
-
getSnap = true;
|
|
1789
|
-
} else {
|
|
1790
|
-
var i = 0;
|
|
1791
|
-
allLineRects.forEach(function (others) {
|
|
1792
|
-
var containrect = intersectRect(others.rect, curitem.rect);
|
|
1793
|
-
if (containrect) {
|
|
1794
|
-
var edist = Math.min.apply(null, snapdist);
|
|
1795
|
-
allCurSnap.forEach(function (snap) {
|
|
1796
|
-
var dist = (snap.pos.x - x) * (snap.pos.x - x) + (snap.pos.y - y) * (snap.pos.y - y);
|
|
1797
|
-
if (dist === edist) {
|
|
1798
|
-
ndist = dist;
|
|
1799
|
-
nx = snap.pos.x;
|
|
1800
|
-
ny = snap.pos.y;
|
|
1801
|
-
rotRad = snap.rotRad;
|
|
1802
|
-
getSnap = true;
|
|
1803
|
-
}
|
|
1804
|
-
});
|
|
1805
|
-
}
|
|
1806
|
-
});
|
|
1807
|
-
}
|
|
1808
|
-
});
|
|
1809
|
-
if (getSnap === false) {
|
|
1810
|
-
allLineRects.forEach(function (others) {
|
|
1811
|
-
var containrect = intersectRect(others.rect, curitem.rect);
|
|
1812
|
-
if (containrect) {
|
|
1813
|
-
allLineSnap.forEach(function (snap) {
|
|
1814
|
-
var dist = (snap.pos.x - x) * (snap.pos.x - x) + (snap.pos.y - y) * (snap.pos.y - y);
|
|
1815
|
-
if (dist < 5000) {
|
|
1816
|
-
nx = snap.pos.x;
|
|
1817
|
-
ny = snap.pos.y;
|
|
1818
|
-
rotRad = snap.rotRad;
|
|
1819
|
-
getSnap = true;
|
|
1820
|
-
}
|
|
1821
|
-
});
|
|
1822
|
-
}
|
|
1823
|
-
});
|
|
1824
|
-
}
|
|
1825
|
-
allItemRect.others.forEach(function (others) {
|
|
1826
|
-
if (!(others.layoutpos === 'base' && allItemRect.cur.layoutpos === 'wall') || !(others.layoutpos === 'wall' && allItemRect.cur.layoutpos === 'base')) {
|
|
1827
|
-
var containrect = intersectRect(others.rect, curitem.rect);
|
|
1828
|
-
if (containrect) {
|
|
1829
|
-
getSnap = false;
|
|
1830
|
-
}
|
|
1831
|
-
}
|
|
1832
|
-
});
|
|
1833
|
-
if (!getSnap) {
|
|
1834
|
-
var _snapdist2 = [];
|
|
1835
|
-
allItemSnap.forEach(function (snap) {
|
|
1836
|
-
var dist = (snap.pos.x - x) * (snap.pos.x - x) + (snap.pos.y - y) * (snap.pos.y - y);
|
|
1837
|
-
_snapdist2.push(dist);
|
|
1838
|
-
if (dist < ndist) {
|
|
1839
|
-
ndist = dist;
|
|
1840
|
-
nx = snap.pos.x;
|
|
1841
|
-
ny = snap.pos.y;
|
|
1842
|
-
rotRad = snap.rotRad;
|
|
1843
|
-
} else {
|
|
1844
|
-
allItemRect.others.forEach(function (others) {
|
|
1845
|
-
if (!(others.layoutpos === 'base' && allItemRect.cur.layoutpos === 'wall') || !(others.layoutpos === 'wall' && allItemRect.cur.layoutpos === 'base')) {
|
|
1846
|
-
var containrect = intersectRect(others.rect, curitem.rect);
|
|
1847
|
-
if (containrect) {
|
|
1848
|
-
var edist = Math.min.apply(null, _snapdist2);
|
|
1849
|
-
allItemSnap.forEach(function (snap) {
|
|
1850
|
-
var dist = (snap.pos.x - x) * (snap.pos.x - x) + (snap.pos.y - y) * (snap.pos.y - y);
|
|
1851
|
-
if (dist === edist) {
|
|
1852
|
-
ndist = dist;
|
|
1853
|
-
nx = snap.pos.x;
|
|
1854
|
-
ny = snap.pos.y;
|
|
1855
|
-
rotRad = snap.rotRad;
|
|
1856
|
-
}
|
|
1857
|
-
});
|
|
1858
|
-
}
|
|
1859
|
-
}
|
|
1860
|
-
});
|
|
1861
|
-
}
|
|
1862
|
-
});
|
|
1863
|
-
}
|
|
1864
|
-
var rot = rotRad / Math.PI * 180;
|
|
1865
|
-
return {
|
|
1866
|
-
nx: nx,
|
|
1867
|
-
ny: ny,
|
|
1868
|
-
rot: rot,
|
|
1869
|
-
rotRad: rotRad
|
|
1870
|
-
};
|
|
1871
|
-
}
|
|
1872
|
-
function getAllCurSnap(allLineRects, x, y, curItemRect) {
|
|
1873
|
-
if (!curItemRect) return;
|
|
1874
|
-
var allCurSnap = [];
|
|
1875
|
-
var thick = _constants.LINE_THICKNESS / 2;
|
|
1876
|
-
allLineRects.forEach(function (linerect) {
|
|
1877
|
-
//allLineRects:left, right, top, bottom line
|
|
1878
|
-
var p0 = clone_point(linerect.rect[2]); //point 2(x, y) inside of line
|
|
1879
|
-
var p1 = clone_point(linerect.rect[3]); //point 3(x, y) inside of line
|
|
1880
|
-
var q = point(x, y); // point of item
|
|
1881
|
-
var cos = Math.cos(linerect.rotRad);
|
|
1882
|
-
var sin = Math.sin(linerect.rotRad);
|
|
1883
|
-
p0.x -= cos * curItemRect.size.width / 2;
|
|
1884
|
-
p0.y -= sin * curItemRect.size.width / 2;
|
|
1885
|
-
p1.x += cos * curItemRect.size.width / 2;
|
|
1886
|
-
p1.y += sin * curItemRect.size.width / 2;
|
|
1887
|
-
var n = point(-sin, cos);
|
|
1888
|
-
var v3to0 = {
|
|
1889
|
-
x: linerect.rect[0].x - p1.x,
|
|
1890
|
-
y: linerect.rect[0].y - p1.y
|
|
1891
|
-
};
|
|
1892
|
-
var fDot = dotprod(n, v3to0);
|
|
1893
|
-
if (fDot > 0) {
|
|
1894
|
-
// normal vector is crossing the wall
|
|
1895
|
-
n.x = -n.x;
|
|
1896
|
-
n.y = -n.y;
|
|
1897
|
-
}
|
|
1898
|
-
var dist = dotprod(diff(p1, q), n);
|
|
1899
|
-
var h = point(q.x + dist * n.x, q.y + dist * n.y);
|
|
1900
|
-
var nrot = linerect.rotRad + Math.PI;
|
|
1901
|
-
if (nrot >= Math.PI) nrot -= Math.PI * 2;
|
|
1902
|
-
var o = itemrectInfo(h.x + n.x * (curItemRect && curItemRect.size.height / 2), h.y + n.y * (curItemRect && curItemRect.size.height / 2), nrot, curItemRect && curItemRect.size, curItemRect && curItemRect.layoutpos, curItemRect && curItemRect.is_corner);
|
|
1903
|
-
allCurSnap.push(o);
|
|
1904
|
-
nrot = nrot + Math.PI;
|
|
1905
|
-
o = itemrectInfo(h.x - n.x * (curItemRect && curItemRect.size.height / 2 + thick), h.y - n.y * (curItemRect && curItemRect.size.height / 2 + thick), nrot, curItemRect && curItemRect.size, curItemRect && curItemRect.layoutpos, curItemRect && curItemRect.is_corner);
|
|
1906
|
-
allCurSnap.push(o);
|
|
1907
|
-
});
|
|
1908
|
-
return allCurSnap;
|
|
1909
|
-
}
|
|
1910
|
-
function clone_point(pt) {
|
|
1911
|
-
return point(pt.x, pt.y);
|
|
1912
|
-
}
|
|
1913
|
-
function dotprod(v0, v1) {
|
|
1914
|
-
return v0.x * v1.x + v0.y * v1.y;
|
|
1915
|
-
}
|
|
1916
|
-
|
|
1917
|
-
//////////
|
|
1918
|
-
function validInterSect(rect, val) {
|
|
1919
|
-
var curitem = getCalcRectFromItem(val);
|
|
1920
|
-
var datas = [];
|
|
1921
|
-
rect.forEach(function (line) {
|
|
1922
|
-
datas.push(line);
|
|
1923
|
-
});
|
|
1924
|
-
for (var i = 0; i < datas.length; i++) {
|
|
1925
|
-
var data = datas[i];
|
|
1926
|
-
var containrect = intersectRect(data.rect, curitem.rect);
|
|
1927
|
-
if (containrect) {
|
|
1928
|
-
return false;
|
|
1929
|
-
}
|
|
1930
|
-
}
|
|
1931
|
-
return true;
|
|
1932
|
-
}
|
|
1933
|
-
var lineRect = function lineRect(layer) {
|
|
1934
|
-
var areainfo = [];
|
|
1935
|
-
layer.areas.forEach(function (area) {
|
|
1936
|
-
var sz = area.vertices.size;
|
|
1937
|
-
for (var i = 0; i < sz; i++) {
|
|
1938
|
-
areainfo.push(area.vertices.get(i));
|
|
1939
|
-
}
|
|
1940
|
-
});
|
|
1941
|
-
var rect = [];
|
|
1942
|
-
areainfo.forEach(function (area) {
|
|
1943
|
-
var vert = layer.vertices.get(area);
|
|
1944
|
-
rect.push(vert.x, vert.y);
|
|
1945
|
-
});
|
|
1946
|
-
return rect;
|
|
1947
|
-
};
|
|
1948
|
-
function getAllHoleRect(scene, val) {
|
|
1949
|
-
var layerID = scene.selectedLayer;
|
|
1950
|
-
var layer = scene.layers.get(layerID);
|
|
1951
|
-
var selectedItem = layer.getIn(['items', layer.selected.items.get(0)]);
|
|
1952
|
-
if (selectedItem !== undefined) {
|
|
1953
|
-
if (selectedItem.category != 'cabinet') {
|
|
1954
|
-
// If selected Item type is not `cabinet` then do not snap at windows
|
|
1955
|
-
return {
|
|
1956
|
-
isSect: true,
|
|
1957
|
-
snap: null
|
|
1958
|
-
};
|
|
1959
|
-
}
|
|
1960
|
-
} else {
|
|
1961
|
-
return {
|
|
1962
|
-
isSect: false,
|
|
1963
|
-
snap: null
|
|
1964
|
-
};
|
|
1965
|
-
}
|
|
1966
|
-
var holes = [];
|
|
1967
|
-
var itemRect = getCalcRectFromItem(val);
|
|
1968
|
-
layer.lines.forEach(function (line) {
|
|
1969
|
-
line.holes.forEach(function (holeID) {
|
|
1970
|
-
var hole = layer.holes.get(holeID);
|
|
1971
|
-
holes.push(hole);
|
|
1972
|
-
});
|
|
1973
|
-
});
|
|
1974
|
-
var i = 0;
|
|
1975
|
-
for (; i < holes.length; i++) {
|
|
1976
|
-
var twidth = holes[i].properties.getIn(['width', 'length']);
|
|
1977
|
-
var theight = holes[i].properties.getIn(['thickness', 'length']) + 1;
|
|
1978
|
-
var tdepth = holes[i].properties.getIn(['altitude', 'length']);
|
|
1979
|
-
//let trot = holes[i].rotation;
|
|
1980
|
-
var verticeIDs = scene.getIn(['layers', layerID, 'lines', holes[i].line, 'vertices'])._tail.array;
|
|
1981
|
-
var vertice0 = scene.getIn(['layers', layerID, 'vertices', verticeIDs[0]]);
|
|
1982
|
-
var vertice1 = scene.getIn(['layers', layerID, 'vertices', verticeIDs[1]]);
|
|
1983
|
-
var point0 = {
|
|
1984
|
-
x: vertice0.x,
|
|
1985
|
-
y: vertice0.y
|
|
1986
|
-
};
|
|
1987
|
-
var point1 = {
|
|
1988
|
-
x: vertice1.x,
|
|
1989
|
-
y: vertice1.y
|
|
1990
|
-
};
|
|
1991
|
-
var rotation = Math.atan2(point1.y - point0.y, point1.x - point0.x);
|
|
1992
|
-
var rectInfo = getCalcRectFromLine(point0.x, point0.y, point1.x, point1.y, _constants.LINE_THICKNESS, layer);
|
|
1993
|
-
var vN = point(rectInfo.rect[0].x - rectInfo.rect[3].x, rectInfo.rect[0].y - rectInfo.rect[3].y);
|
|
1994
|
-
var lenN = Math.sqrt(vN.x * vN.x + vN.y * vN.y);
|
|
1995
|
-
vN.x /= lenN;
|
|
1996
|
-
vN.y /= lenN;
|
|
1997
|
-
var hx = holes[i].x;
|
|
1998
|
-
var hy = holes[i].y;
|
|
1999
|
-
hx += theight / 2 * vN.x;
|
|
2000
|
-
hy += theight / 2 * vN.y;
|
|
2001
|
-
var tval = {
|
|
2002
|
-
pos: {
|
|
2003
|
-
x: hx,
|
|
2004
|
-
y: hy
|
|
2005
|
-
},
|
|
2006
|
-
rotRad: rotation
|
|
2007
|
-
};
|
|
2008
|
-
tval.size = {
|
|
2009
|
-
width: twidth,
|
|
2010
|
-
height: theight
|
|
2011
|
-
};
|
|
2012
|
-
var hole_rect = getCalcRectFromItem(tval);
|
|
2013
|
-
if (intersectRect(itemRect.rect, hole_rect.rect)) {
|
|
2014
|
-
if (tdepth > itemRect.size.depth && itemRect.layoutpos !== _constants.WALL_CABINET_LAYOUTPOS) {
|
|
2015
|
-
var dist = itemRect.size.height / 2 + theight / 2;
|
|
2016
|
-
var snap = [];
|
|
2017
|
-
var p0 = {
|
|
2018
|
-
x: hx + dist * Math.cos(rotation + Math.PI / 2),
|
|
2019
|
-
y: hy + dist * Math.sin(rotation + Math.PI / 2)
|
|
2020
|
-
};
|
|
2021
|
-
var p1 = {
|
|
2022
|
-
x: hx - dist * Math.cos(rotation + Math.PI / 2),
|
|
2023
|
-
y: hy - dist * Math.sin(rotation + Math.PI / 2)
|
|
2024
|
-
};
|
|
2025
|
-
var allArea = getAllArea(layer);
|
|
2026
|
-
if (isPointInArea(allArea, p0)) {
|
|
2027
|
-
snap.push(p0);
|
|
2028
|
-
}
|
|
2029
|
-
if (isPointInArea(allArea, p1)) {
|
|
2030
|
-
snap.push(p1);
|
|
2031
|
-
}
|
|
2032
|
-
return {
|
|
2033
|
-
isSect: true,
|
|
2034
|
-
snap: snap
|
|
2035
|
-
};
|
|
2036
|
-
} else return {
|
|
2037
|
-
isSect: false,
|
|
2038
|
-
snap: null
|
|
2039
|
-
};
|
|
2040
|
-
}
|
|
2041
|
-
}
|
|
2042
|
-
return {
|
|
2043
|
-
isSect: true,
|
|
2044
|
-
snap: null
|
|
2045
|
-
};
|
|
2046
|
-
}
|
|
2047
|
-
function getHoleItems(layer) {
|
|
2048
|
-
var holeItems = [];
|
|
2049
|
-
layer.holes.map(function (hole) {
|
|
2050
|
-
var width = hole.properties.getIn(['width', 'length']);
|
|
2051
|
-
var altitude = hole.properties.getIn(['altitude', 'length']);
|
|
2052
|
-
holeItems.push({
|
|
2053
|
-
x: hole.x,
|
|
2054
|
-
y: hole.y,
|
|
2055
|
-
width: width,
|
|
2056
|
-
altitude: altitude
|
|
2057
|
-
});
|
|
2058
|
-
});
|
|
2059
|
-
return holeItems;
|
|
2060
|
-
}
|
|
2061
|
-
function needSnap(curItem, othItem) {
|
|
2062
|
-
var blSnap = false;
|
|
2063
|
-
if (curItem == undefined || curItem == null) return false;
|
|
2064
|
-
var altitude = curItem.selectedItem.properties.get('altitude');
|
|
2065
|
-
var heightFromFloor = (0, _convertUnits["default"])(altitude.get('_length')).from(altitude.get('_unit')).to('in');
|
|
2066
|
-
var height = curItem.cat.info.sizeinfo.height;
|
|
2067
|
-
var currentItem = {
|
|
2068
|
-
heightFromFloor: heightFromFloor,
|
|
2069
|
-
height: height
|
|
2070
|
-
};
|
|
2071
|
-
altitude = othItem.item.properties.get('altitude');
|
|
2072
|
-
heightFromFloor = (0, _convertUnits["default"])(altitude.get('_length')).from(altitude.get('_unit')).to('in');
|
|
2073
|
-
height = othItem.cat && othItem.cat.info.sizeinfo.height;
|
|
2074
|
-
var otherItem = {
|
|
2075
|
-
heightFromFloor: heightFromFloor,
|
|
2076
|
-
height: height
|
|
2077
|
-
};
|
|
2078
|
-
var curFloor = currentItem.heightFromFloor;
|
|
2079
|
-
var otherFloor = otherItem.heightFromFloor;
|
|
2080
|
-
var delta;
|
|
2081
|
-
curFloor > otherFloor ? delta = otherItem.height : delta = currentItem.height;
|
|
2082
|
-
if (Math.abs(curFloor - otherFloor) < delta) blSnap = true;
|
|
2083
|
-
if (curItem.cat.hasOwnProperty('long_name') || othItem.cat && othItem.cat.hasOwnProperty('long_name')) {
|
|
2084
|
-
if (curItem.cat.long_name.includes('Hood') || othItem.cat && othItem.cat.long_name.includes('Hood')) blSnap = true;
|
|
2085
|
-
if (curItem.cat.long_name.includes('Hood') && othItem.cat && othItem.cat.long_name.includes('Base Cabinet') || curItem.cat.long_name.includes('Base Cabinet') && othItem.cat && othItem.cat.long_name.includes('Hood')) blSnap = false;
|
|
2086
|
-
if (curItem.cat.long_name.includes('Cook Top') && othItem.cat && othItem.cat.long_name.includes('Cabinet') || curItem.cat.long_name.includes('Cabinet') && othItem.cat && othItem.cat.long_name.includes('Cook Top')) blSnap = true;
|
|
2087
|
-
}
|
|
2088
|
-
return blSnap;
|
|
2089
|
-
}
|
|
2090
|
-
function isFrontWall(v0, v1) {
|
|
2091
|
-
var x1 = v0.x,
|
|
2092
|
-
y1 = v0.y;
|
|
2093
|
-
var x2 = v1.x,
|
|
2094
|
-
y2 = v1.y;
|
|
2095
|
-
var alpha = angleBetweenTwoPoints(x1, y1, x2, y2);
|
|
2096
|
-
return almostEqual(y1, y2) && x1 < x2 || -Math.PI / 2 < alpha && alpha < Math.PI / 2;
|
|
2097
|
-
}
|
|
2098
|
-
function isBackWall(v0, v1) {
|
|
2099
|
-
var x1 = v0.x,
|
|
2100
|
-
y1 = v0.y;
|
|
2101
|
-
var x2 = v1.x,
|
|
2102
|
-
y2 = v1.y;
|
|
2103
|
-
var alpha = angleBetweenTwoPoints(x1, y1, x2, y2);
|
|
2104
|
-
return almostEqual(y1, y2) && x1 > x2 || -Math.PI / 2 > alpha || alpha > Math.PI / 2;
|
|
2105
|
-
}
|
|
2106
|
-
function isLeftWall(v0, v1) {
|
|
2107
|
-
var x1 = v0.x,
|
|
2108
|
-
y1 = v0.y;
|
|
2109
|
-
var x2 = v1.x,
|
|
2110
|
-
y2 = v1.y;
|
|
2111
|
-
var alpha = angleBetweenTwoPoints(x1, y1, x2, y2);
|
|
2112
|
-
return almostEqual(x1, x2) && y1 < y2 || Math.PI > alpha && alpha > 0;
|
|
2113
|
-
}
|
|
2114
|
-
function isRightWall(v0, v1) {
|
|
2115
|
-
var x1 = v0.x,
|
|
2116
|
-
y1 = v0.y;
|
|
2117
|
-
var x2 = v1.x,
|
|
2118
|
-
y2 = v1.y;
|
|
2119
|
-
var alpha = angleBetweenTwoPoints(x1, y1, x2, y2);
|
|
2120
|
-
return almostEqual(x1, x2) && y1 > y2 || -Math.PI < alpha && alpha < 0;
|
|
2121
|
-
}
|
|
2122
|
-
|
|
2123
|
-
/**
|
|
2124
|
-
* Calculate the overlapping relationship of two lines
|
|
2125
|
-
* @param {*} srcLine // source line
|
|
2126
|
-
* @param {*} destLine // destination line
|
|
2127
|
-
* @returns overlapping status (OVERLAP_NONE | OVERLAP_SAME | OVERLAP_LINK | OVERLAP_INCLUDED | OVERLAP_SOME) and line segments of srcLine which broken with destLine
|
|
2128
|
-
* OVERLAP_NONE: two lines are not overlapped
|
|
2129
|
-
* OVERLAP_SAME: the start point and endpoint of two lines are same
|
|
2130
|
-
* OVERLAP_LINK: two lines are linked at the common point, so they can be merged to one line
|
|
2131
|
-
* OVERLAP_INCLUDED: destLine includes srcLine
|
|
2132
|
-
* OVERLAP_SOME: two lines are overlapped with some common range, then returns the trimmed segments of srcLine
|
|
2133
|
-
*
|
|
2134
|
-
* //////// test - start /////////////
|
|
2135
|
-
const p1 = { x1: 1413.1313131313132, y1: 1044.949494949495 };
|
|
2136
|
-
const p2 = { x1: 1476.2626262626263, y1: 1108.0808080808079 };
|
|
2137
|
-
const p3 = { x1: 1596.969696969697, y1: 1228.7878787878785 };
|
|
2138
|
-
const p4 = { x1: 1664.1414141414139, y1: 1295.9595959595958 };
|
|
2139
|
-
const tempRet = GeometryUtils.relationshipOfTwoOverlappedLines(
|
|
2140
|
-
{ x1: p3.x1, y1: p3.y1, x2: p1.x1, y2: p1.y1 },
|
|
2141
|
-
{ x1: p1.x1, y1: p1.y1, x2: p3.x1, y2: p3.y1 }
|
|
2142
|
-
);
|
|
2143
|
-
console.log(tempRet);
|
|
2144
|
-
//////// test - end /////////////
|
|
2145
|
-
|
|
2146
|
-
*/
|
|
2147
|
-
function relationshipOfTwoOverlappedLines(srcLine, destLine) {
|
|
2148
|
-
var INFINITY = 1000000;
|
|
2149
|
-
// geometric equation of srcLine
|
|
2150
|
-
var dx1 = _export.MathUtils.toFixedFloat(srcLine.x2 - srcLine.x1, 2);
|
|
2151
|
-
var dy1 = _export.MathUtils.toFixedFloat(srcLine.y2 - srcLine.y1, 2);
|
|
2152
|
-
var a1 = dx1 === 0 ? INFINITY : _export.MathUtils.toFixedFloat(dy1 / dx1, 2);
|
|
2153
|
-
var b1 = a1 === INFINITY ? _export.MathUtils.toFixedFloat(srcLine.x1, 2) : _export.MathUtils.toFixedFloat(srcLine.y1 - a1 * srcLine.x1, 2);
|
|
2154
|
-
// geometric equation of destLine
|
|
2155
|
-
var dx2 = _export.MathUtils.toFixedFloat(destLine.x2 - destLine.x1, 2);
|
|
2156
|
-
var dy2 = _export.MathUtils.toFixedFloat(destLine.y2 - destLine.y1, 2);
|
|
2157
|
-
var a2 = dx2 === 0 ? INFINITY : _export.MathUtils.toFixedFloat(dy2 / dx2, 2);
|
|
2158
|
-
var b2 = a2 === INFINITY ? _export.MathUtils.toFixedFloat(destLine.x1, 2) : _export.MathUtils.toFixedFloat(destLine.y1 - a2 * destLine.x1, 2);
|
|
2159
|
-
if (_export.MathUtils.fAbs(a1) - _export.MathUtils.fAbs(a2) !== 0)
|
|
2160
|
-
// two lines are not parallel
|
|
2161
|
-
return {
|
|
2162
|
-
result: _constants.OVERLAP_NONE
|
|
2163
|
-
};
|
|
2164
|
-
if (b1 !== b2)
|
|
2165
|
-
// two lines are parallel but not overlap
|
|
2166
|
-
return {
|
|
2167
|
-
result: _constants.OVERLAP_NONE
|
|
2168
|
-
};
|
|
2169
|
-
|
|
2170
|
-
// parametric equation of destLine
|
|
2171
|
-
var sk1 = dx1 === 0 ? INFINITY : _export.MathUtils.toFixedFloat(_export.MathUtils.toFixedFloat(destLine.x1 - srcLine.x1, 2) / dx1, 2);
|
|
2172
|
-
var sk2 = dy1 === 0 ? INFINITY : _export.MathUtils.toFixedFloat(_export.MathUtils.toFixedFloat(destLine.y1 - srcLine.y1, 2) / dy1, 2);
|
|
2173
|
-
var ek1 = dx1 === 0 ? INFINITY : _export.MathUtils.toFixedFloat(_export.MathUtils.toFixedFloat(destLine.x2 - srcLine.x1, 2) / dx1, 2);
|
|
2174
|
-
var ek2 = dy1 === 0 ? INFINITY : _export.MathUtils.toFixedFloat(_export.MathUtils.toFixedFloat(destLine.y2 - srcLine.y1, 2) / dy1, 2);
|
|
2175
|
-
if (sk1 !== INFINITY && sk2 !== INFINITY && ek1 !== INFINITY && ek2 !== INFINITY && (sk1 !== sk2 || ek1 !== ek2))
|
|
2176
|
-
// destLine does not overlap with srcLine
|
|
2177
|
-
return {
|
|
2178
|
-
result: _constants.OVERLAP_NONE
|
|
2179
|
-
};
|
|
2180
|
-
|
|
2181
|
-
// parameter of destLine on the start and end points
|
|
2182
|
-
var sk = Math.min(sk1, sk2);
|
|
2183
|
-
var ek = Math.min(ek1, ek2);
|
|
2184
|
-
|
|
2185
|
-
// check the relationship between srcLine and destLine
|
|
2186
|
-
if (sk < 0 && ek < 0 || sk > 1 && ek > 1)
|
|
2187
|
-
// not overlap
|
|
2188
|
-
return {
|
|
2189
|
-
result: _constants.OVERLAP_NONE
|
|
2190
|
-
};
|
|
2191
|
-
if (sk === 0 && ek === 1 || sk === 1 && ek === 0)
|
|
2192
|
-
// same lines
|
|
2193
|
-
return {
|
|
2194
|
-
result: _constants.OVERLAP_SAME
|
|
2195
|
-
};
|
|
2196
|
-
if (sk <= 0 && ek >= 1 || sk >= 1 && ek <= 0)
|
|
2197
|
-
// destLine includes srcLine
|
|
2198
|
-
return {
|
|
2199
|
-
result: _constants.OVERLAP_INCLUDED
|
|
2200
|
-
};
|
|
2201
|
-
if (sk === 0 && ek < 0 || sk === 1 && ek > 1 || ek === 0 && sk < 0 || ek === 1 && sk > 1) {
|
|
2202
|
-
// linked with one common point
|
|
2203
|
-
var linkedLine;
|
|
2204
|
-
if (sk === 0 && ek < 0) {
|
|
2205
|
-
// destE destS srcS srcE
|
|
2206
|
-
// |----------|------------|
|
|
2207
|
-
linkedLine = {
|
|
2208
|
-
x1: destLine.x2,
|
|
2209
|
-
y1: destLine.y2,
|
|
2210
|
-
x2: srcLine.x2,
|
|
2211
|
-
y2: srcLine.y2
|
|
2212
|
-
};
|
|
2213
|
-
} else if (sk === 1 && ek > 1) {
|
|
2214
|
-
// srcS srcE destS destE
|
|
2215
|
-
// |----------|------------|
|
|
2216
|
-
linkedLine = {
|
|
2217
|
-
x1: srcLine.x1,
|
|
2218
|
-
y1: srcLine.y1,
|
|
2219
|
-
x2: destLine.x2,
|
|
2220
|
-
y2: destLine.y2
|
|
2221
|
-
};
|
|
2222
|
-
} else if (ek === 0 && sk < 0) {
|
|
2223
|
-
// destS destE srcS srcE
|
|
2224
|
-
// |----------|------------|
|
|
2225
|
-
linkedLine = {
|
|
2226
|
-
x1: destLine.x1,
|
|
2227
|
-
y1: destLine.y1,
|
|
2228
|
-
x2: srcLine.x2,
|
|
2229
|
-
y2: srcLine.y2
|
|
2230
|
-
};
|
|
2231
|
-
} else if (ek === 1 && sk > 1) {
|
|
2232
|
-
// srcS srcE destE destS
|
|
2233
|
-
// |----------|------------|
|
|
2234
|
-
linkedLine = {
|
|
2235
|
-
x1: srcLine.x1,
|
|
2236
|
-
y1: srcLine.y1,
|
|
2237
|
-
x2: destLine.x1,
|
|
2238
|
-
y2: destLine.y1
|
|
2239
|
-
};
|
|
2240
|
-
}
|
|
2241
|
-
return {
|
|
2242
|
-
result: _constants.OVERLAP_LINK,
|
|
2243
|
-
linkedLine: linkedLine
|
|
2244
|
-
};
|
|
2245
|
-
}
|
|
2246
|
-
var trimmedSegment1 = null;
|
|
2247
|
-
var trimmedSegment2 = null;
|
|
2248
|
-
var ret = {
|
|
2249
|
-
result: _constants.OVERLAP_SOME,
|
|
2250
|
-
trimmedSegs: []
|
|
2251
|
-
};
|
|
2252
|
-
if (0 <= sk && sk <= 1 && 0 <= ek && ek <= 1) {
|
|
2253
|
-
// srcLine includes destLine
|
|
2254
|
-
if (sk < ek) {
|
|
2255
|
-
// srcS destS destE srcE
|
|
2256
|
-
// |------|---------|-------|
|
|
2257
|
-
trimmedSegment1 = {
|
|
2258
|
-
x1: srcLine.x1,
|
|
2259
|
-
y1: srcLine.y1,
|
|
2260
|
-
x2: destLine.x1,
|
|
2261
|
-
y2: destLine.y1
|
|
2262
|
-
};
|
|
2263
|
-
if (ek < 1) trimmedSegment2 = {
|
|
2264
|
-
x1: destLine.x2,
|
|
2265
|
-
y1: destLine.y2,
|
|
2266
|
-
x2: srcLine.x2,
|
|
2267
|
-
y2: srcLine.y2
|
|
2268
|
-
};
|
|
2269
|
-
} else {
|
|
2270
|
-
// srcS destE destS srcE
|
|
2271
|
-
// |------|---------|-------|
|
|
2272
|
-
trimmedSegment1 = {
|
|
2273
|
-
x1: srcLine.x1,
|
|
2274
|
-
y1: srcLine.y1,
|
|
2275
|
-
x2: destLine.x2,
|
|
2276
|
-
y2: destLine.y2
|
|
2277
|
-
};
|
|
2278
|
-
if (sk < 1) trimmedSegment2 = {
|
|
2279
|
-
x1: destLine.x1,
|
|
2280
|
-
y1: destLine.y1,
|
|
2281
|
-
x2: srcLine.x2,
|
|
2282
|
-
y2: srcLine.y2
|
|
2283
|
-
};
|
|
2284
|
-
}
|
|
2285
|
-
} else {
|
|
2286
|
-
// srcLine and destLine are overlapped with some range
|
|
2287
|
-
if (sk < 0) {
|
|
2288
|
-
// destS srcS destE srcE
|
|
2289
|
-
// |------|---------|-------|
|
|
2290
|
-
trimmedSegment1 = {
|
|
2291
|
-
x1: destLine.x2,
|
|
2292
|
-
y1: destLine.y2,
|
|
2293
|
-
x2: srcLine.x2,
|
|
2294
|
-
y2: srcLine.y2
|
|
2295
|
-
};
|
|
2296
|
-
} else if (ek < 0) {
|
|
2297
|
-
// destE srcS destS srcE
|
|
2298
|
-
// |------|---------|-------|
|
|
2299
|
-
trimmedSegment1 = {
|
|
2300
|
-
x1: destLine.x1,
|
|
2301
|
-
y1: destLine.y1,
|
|
2302
|
-
x2: srcLine.x2,
|
|
2303
|
-
y2: srcLine.y2
|
|
2304
|
-
};
|
|
2305
|
-
} else if (sk > 1) {
|
|
2306
|
-
// srcS destE srcE destS
|
|
2307
|
-
// |------|---------|-------|
|
|
2308
|
-
trimmedSegment1 = {
|
|
2309
|
-
x1: srcLine.x1,
|
|
2310
|
-
y1: srcLine.y1,
|
|
2311
|
-
x2: destLine.x2,
|
|
2312
|
-
y2: destLine.y2
|
|
2313
|
-
};
|
|
2314
|
-
} else if (ek > 1) {
|
|
2315
|
-
// srcS destS srcE destE
|
|
2316
|
-
// |------|---------|-------|
|
|
2317
|
-
trimmedSegment1 = {
|
|
2318
|
-
x1: srcLine.x1,
|
|
2319
|
-
y1: srcLine.y1,
|
|
2320
|
-
x2: destLine.x1,
|
|
2321
|
-
y2: destLine.y1
|
|
2322
|
-
};
|
|
2323
|
-
}
|
|
2324
|
-
}
|
|
2325
|
-
if (trimmedSegment1 !== null) ret.trimmedSegs.push(trimmedSegment1);
|
|
2326
|
-
if (trimmedSegment2 !== null) ret.trimmedSegs.push(trimmedSegment2);
|
|
2327
|
-
return ret;
|
|
2328
|
-
}
|
|
2329
|
-
//# sourceMappingURL=geometry.js.map
|