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/src/plugins/SVGLoader.js
DELETED
|
@@ -1,1991 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
BufferGeometry,
|
|
3
|
-
FileLoader,
|
|
4
|
-
Float32BufferAttribute,
|
|
5
|
-
Loader,
|
|
6
|
-
Matrix3,
|
|
7
|
-
Path,
|
|
8
|
-
ShapePath,
|
|
9
|
-
Vector2,
|
|
10
|
-
Vector3
|
|
11
|
-
} from 'three';
|
|
12
|
-
|
|
13
|
-
var SVGLoader = function (manager) {
|
|
14
|
-
Loader.call(this, manager);
|
|
15
|
-
|
|
16
|
-
// Default dots per inch
|
|
17
|
-
this.defaultDPI = 90;
|
|
18
|
-
|
|
19
|
-
// Accepted units: 'mm', 'cm', 'in', 'pt', 'pc', 'px'
|
|
20
|
-
this.defaultUnit = 'px';
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
SVGLoader.prototype = Object.assign(Object.create(Loader.prototype), {
|
|
24
|
-
constructor: SVGLoader,
|
|
25
|
-
|
|
26
|
-
load: function (url, onLoad, onProgress, onError) {
|
|
27
|
-
var scope = this;
|
|
28
|
-
|
|
29
|
-
var loader = new FileLoader(scope.manager);
|
|
30
|
-
loader.setPath(scope.path);
|
|
31
|
-
loader.setRequestHeader(scope.requestHeader);
|
|
32
|
-
loader.setWithCredentials(scope.withCredentials);
|
|
33
|
-
loader.load(
|
|
34
|
-
url,
|
|
35
|
-
function (text) {
|
|
36
|
-
try {
|
|
37
|
-
onLoad(scope.parse(text));
|
|
38
|
-
} catch (e) {
|
|
39
|
-
if (onError) {
|
|
40
|
-
onError(e);
|
|
41
|
-
} else {
|
|
42
|
-
console.error(e);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
scope.manager.itemError(url);
|
|
46
|
-
}
|
|
47
|
-
},
|
|
48
|
-
onProgress,
|
|
49
|
-
onError
|
|
50
|
-
);
|
|
51
|
-
},
|
|
52
|
-
|
|
53
|
-
parse: function (text) {
|
|
54
|
-
var scope = this;
|
|
55
|
-
|
|
56
|
-
function parseNode(node, style) {
|
|
57
|
-
if (node.nodeType !== 1) return;
|
|
58
|
-
|
|
59
|
-
var transform = getNodeTransform(node);
|
|
60
|
-
|
|
61
|
-
var traverseChildNodes = true;
|
|
62
|
-
|
|
63
|
-
var path = null;
|
|
64
|
-
|
|
65
|
-
switch (node.nodeName) {
|
|
66
|
-
case 'svg':
|
|
67
|
-
break;
|
|
68
|
-
|
|
69
|
-
case 'style':
|
|
70
|
-
parseCSSStylesheet(node);
|
|
71
|
-
break;
|
|
72
|
-
|
|
73
|
-
case 'g':
|
|
74
|
-
style = parseStyle(node, style);
|
|
75
|
-
break;
|
|
76
|
-
|
|
77
|
-
case 'path':
|
|
78
|
-
style = parseStyle(node, style);
|
|
79
|
-
if (node.hasAttribute('d')) path = parsePathNode(node);
|
|
80
|
-
break;
|
|
81
|
-
|
|
82
|
-
case 'rect':
|
|
83
|
-
style = parseStyle(node, style);
|
|
84
|
-
path = parseRectNode(node);
|
|
85
|
-
break;
|
|
86
|
-
|
|
87
|
-
case 'polygon':
|
|
88
|
-
style = parseStyle(node, style);
|
|
89
|
-
path = parsePolygonNode(node);
|
|
90
|
-
break;
|
|
91
|
-
|
|
92
|
-
case 'polyline':
|
|
93
|
-
style = parseStyle(node, style);
|
|
94
|
-
path = parsePolylineNode(node);
|
|
95
|
-
break;
|
|
96
|
-
|
|
97
|
-
case 'circle':
|
|
98
|
-
style = parseStyle(node, style);
|
|
99
|
-
path = parseCircleNode(node);
|
|
100
|
-
break;
|
|
101
|
-
|
|
102
|
-
case 'ellipse':
|
|
103
|
-
style = parseStyle(node, style);
|
|
104
|
-
path = parseEllipseNode(node);
|
|
105
|
-
break;
|
|
106
|
-
|
|
107
|
-
case 'line':
|
|
108
|
-
style = parseStyle(node, style);
|
|
109
|
-
path = parseLineNode(node);
|
|
110
|
-
break;
|
|
111
|
-
|
|
112
|
-
case 'defs':
|
|
113
|
-
traverseChildNodes = false;
|
|
114
|
-
break;
|
|
115
|
-
|
|
116
|
-
case 'use':
|
|
117
|
-
style = parseStyle(node, style);
|
|
118
|
-
var usedNodeId = node.href.baseVal.substring(1);
|
|
119
|
-
var usedNode = node.viewportElement.getElementById(usedNodeId);
|
|
120
|
-
if (usedNode) {
|
|
121
|
-
parseNode(usedNode, style);
|
|
122
|
-
} else {
|
|
123
|
-
console.warn(
|
|
124
|
-
"SVGLoader: 'use node' references non-existent node id: " +
|
|
125
|
-
usedNodeId
|
|
126
|
-
);
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
break;
|
|
130
|
-
|
|
131
|
-
default:
|
|
132
|
-
// console.log( node );
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
if (path) {
|
|
136
|
-
if (style.fill !== undefined && style.fill !== 'none') {
|
|
137
|
-
path.color.setStyle(style.fill);
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
transformPath(path, currentTransform);
|
|
141
|
-
|
|
142
|
-
paths.push(path);
|
|
143
|
-
|
|
144
|
-
path.userData = { node: node, style: style };
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
if (traverseChildNodes) {
|
|
148
|
-
var nodes = node.childNodes;
|
|
149
|
-
|
|
150
|
-
for (var i = 0; i < nodes.length; i++) {
|
|
151
|
-
parseNode(nodes[i], style);
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
if (transform) {
|
|
156
|
-
transformStack.pop();
|
|
157
|
-
|
|
158
|
-
if (transformStack.length > 0) {
|
|
159
|
-
currentTransform.copy(transformStack[transformStack.length - 1]);
|
|
160
|
-
} else {
|
|
161
|
-
currentTransform.identity();
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
function parsePathNode(node) {
|
|
167
|
-
var path = new ShapePath();
|
|
168
|
-
|
|
169
|
-
var point = new Vector2();
|
|
170
|
-
var control = new Vector2();
|
|
171
|
-
|
|
172
|
-
var firstPoint = new Vector2();
|
|
173
|
-
var isFirstPoint = true;
|
|
174
|
-
var doSetFirstPoint = false;
|
|
175
|
-
|
|
176
|
-
var d = node.getAttribute('d');
|
|
177
|
-
|
|
178
|
-
// console.log( d );
|
|
179
|
-
|
|
180
|
-
var commands = d.match(/[a-df-z][^a-df-z]*/gi);
|
|
181
|
-
|
|
182
|
-
for (var i = 0, l = commands.length; i < l; i++) {
|
|
183
|
-
var command = commands[i];
|
|
184
|
-
|
|
185
|
-
var type = command.charAt(0);
|
|
186
|
-
var data = command.substr(1).trim();
|
|
187
|
-
|
|
188
|
-
if (isFirstPoint === true) {
|
|
189
|
-
doSetFirstPoint = true;
|
|
190
|
-
isFirstPoint = false;
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
switch (type) {
|
|
194
|
-
case 'M':
|
|
195
|
-
var numbers = parseFloats(data);
|
|
196
|
-
for (var j = 0, jl = numbers.length; j < jl; j += 2) {
|
|
197
|
-
point.x = numbers[j + 0];
|
|
198
|
-
point.y = numbers[j + 1];
|
|
199
|
-
control.x = point.x;
|
|
200
|
-
control.y = point.y;
|
|
201
|
-
|
|
202
|
-
if (j === 0) {
|
|
203
|
-
path.moveTo(point.x, point.y);
|
|
204
|
-
} else {
|
|
205
|
-
path.lineTo(point.x, point.y);
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
if (j === 0 && doSetFirstPoint === true) firstPoint.copy(point);
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
break;
|
|
212
|
-
|
|
213
|
-
case 'H':
|
|
214
|
-
var numbers = parseFloats(data);
|
|
215
|
-
|
|
216
|
-
for (var j = 0, jl = numbers.length; j < jl; j++) {
|
|
217
|
-
point.x = numbers[j];
|
|
218
|
-
control.x = point.x;
|
|
219
|
-
control.y = point.y;
|
|
220
|
-
path.lineTo(point.x, point.y);
|
|
221
|
-
|
|
222
|
-
if (j === 0 && doSetFirstPoint === true) firstPoint.copy(point);
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
break;
|
|
226
|
-
|
|
227
|
-
case 'V':
|
|
228
|
-
var numbers = parseFloats(data);
|
|
229
|
-
|
|
230
|
-
for (var j = 0, jl = numbers.length; j < jl; j++) {
|
|
231
|
-
point.y = numbers[j];
|
|
232
|
-
control.x = point.x;
|
|
233
|
-
control.y = point.y;
|
|
234
|
-
path.lineTo(point.x, point.y);
|
|
235
|
-
|
|
236
|
-
if (j === 0 && doSetFirstPoint === true) firstPoint.copy(point);
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
break;
|
|
240
|
-
|
|
241
|
-
case 'L':
|
|
242
|
-
var numbers = parseFloats(data);
|
|
243
|
-
|
|
244
|
-
for (var j = 0, jl = numbers.length; j < jl; j += 2) {
|
|
245
|
-
point.x = numbers[j + 0];
|
|
246
|
-
point.y = numbers[j + 1];
|
|
247
|
-
control.x = point.x;
|
|
248
|
-
control.y = point.y;
|
|
249
|
-
path.lineTo(point.x, point.y);
|
|
250
|
-
|
|
251
|
-
if (j === 0 && doSetFirstPoint === true) firstPoint.copy(point);
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
break;
|
|
255
|
-
|
|
256
|
-
case 'C':
|
|
257
|
-
var numbers = parseFloats(data);
|
|
258
|
-
|
|
259
|
-
for (var j = 0, jl = numbers.length; j < jl; j += 6) {
|
|
260
|
-
path.bezierCurveTo(
|
|
261
|
-
numbers[j + 0],
|
|
262
|
-
numbers[j + 1],
|
|
263
|
-
numbers[j + 2],
|
|
264
|
-
numbers[j + 3],
|
|
265
|
-
numbers[j + 4],
|
|
266
|
-
numbers[j + 5]
|
|
267
|
-
);
|
|
268
|
-
control.x = numbers[j + 2];
|
|
269
|
-
control.y = numbers[j + 3];
|
|
270
|
-
point.x = numbers[j + 4];
|
|
271
|
-
point.y = numbers[j + 5];
|
|
272
|
-
|
|
273
|
-
if (j === 0 && doSetFirstPoint === true) firstPoint.copy(point);
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
break;
|
|
277
|
-
|
|
278
|
-
case 'S':
|
|
279
|
-
var numbers = parseFloats(data);
|
|
280
|
-
|
|
281
|
-
for (var j = 0, jl = numbers.length; j < jl; j += 4) {
|
|
282
|
-
path.bezierCurveTo(
|
|
283
|
-
getReflection(point.x, control.x),
|
|
284
|
-
getReflection(point.y, control.y),
|
|
285
|
-
numbers[j + 0],
|
|
286
|
-
numbers[j + 1],
|
|
287
|
-
numbers[j + 2],
|
|
288
|
-
numbers[j + 3]
|
|
289
|
-
);
|
|
290
|
-
control.x = numbers[j + 0];
|
|
291
|
-
control.y = numbers[j + 1];
|
|
292
|
-
point.x = numbers[j + 2];
|
|
293
|
-
point.y = numbers[j + 3];
|
|
294
|
-
|
|
295
|
-
if (j === 0 && doSetFirstPoint === true) firstPoint.copy(point);
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
break;
|
|
299
|
-
|
|
300
|
-
case 'Q':
|
|
301
|
-
var numbers = parseFloats(data);
|
|
302
|
-
|
|
303
|
-
for (var j = 0, jl = numbers.length; j < jl; j += 4) {
|
|
304
|
-
path.quadraticCurveTo(
|
|
305
|
-
numbers[j + 0],
|
|
306
|
-
numbers[j + 1],
|
|
307
|
-
numbers[j + 2],
|
|
308
|
-
numbers[j + 3]
|
|
309
|
-
);
|
|
310
|
-
control.x = numbers[j + 0];
|
|
311
|
-
control.y = numbers[j + 1];
|
|
312
|
-
point.x = numbers[j + 2];
|
|
313
|
-
point.y = numbers[j + 3];
|
|
314
|
-
|
|
315
|
-
if (j === 0 && doSetFirstPoint === true) firstPoint.copy(point);
|
|
316
|
-
}
|
|
317
|
-
|
|
318
|
-
break;
|
|
319
|
-
|
|
320
|
-
case 'T':
|
|
321
|
-
var numbers = parseFloats(data);
|
|
322
|
-
|
|
323
|
-
for (var j = 0, jl = numbers.length; j < jl; j += 2) {
|
|
324
|
-
var rx = getReflection(point.x, control.x);
|
|
325
|
-
var ry = getReflection(point.y, control.y);
|
|
326
|
-
path.quadraticCurveTo(rx, ry, numbers[j + 0], numbers[j + 1]);
|
|
327
|
-
control.x = rx;
|
|
328
|
-
control.y = ry;
|
|
329
|
-
point.x = numbers[j + 0];
|
|
330
|
-
point.y = numbers[j + 1];
|
|
331
|
-
|
|
332
|
-
if (j === 0 && doSetFirstPoint === true) firstPoint.copy(point);
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
break;
|
|
336
|
-
|
|
337
|
-
case 'A':
|
|
338
|
-
var numbers = parseFloats(data);
|
|
339
|
-
|
|
340
|
-
for (var j = 0, jl = numbers.length; j < jl; j += 7) {
|
|
341
|
-
var start = point.clone();
|
|
342
|
-
point.x = numbers[j + 5];
|
|
343
|
-
point.y = numbers[j + 6];
|
|
344
|
-
control.x = point.x;
|
|
345
|
-
control.y = point.y;
|
|
346
|
-
parseArcCommand(
|
|
347
|
-
path,
|
|
348
|
-
numbers[j],
|
|
349
|
-
numbers[j + 1],
|
|
350
|
-
numbers[j + 2],
|
|
351
|
-
numbers[j + 3],
|
|
352
|
-
numbers[j + 4],
|
|
353
|
-
start,
|
|
354
|
-
point
|
|
355
|
-
);
|
|
356
|
-
|
|
357
|
-
if (j === 0 && doSetFirstPoint === true) firstPoint.copy(point);
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
break;
|
|
361
|
-
|
|
362
|
-
case 'm':
|
|
363
|
-
var numbers = parseFloats(data);
|
|
364
|
-
|
|
365
|
-
for (var j = 0, jl = numbers.length; j < jl; j += 2) {
|
|
366
|
-
point.x += numbers[j + 0];
|
|
367
|
-
point.y += numbers[j + 1];
|
|
368
|
-
control.x = point.x;
|
|
369
|
-
control.y = point.y;
|
|
370
|
-
|
|
371
|
-
if (j === 0) {
|
|
372
|
-
path.moveTo(point.x, point.y);
|
|
373
|
-
} else {
|
|
374
|
-
path.lineTo(point.x, point.y);
|
|
375
|
-
}
|
|
376
|
-
|
|
377
|
-
if (j === 0 && doSetFirstPoint === true) firstPoint.copy(point);
|
|
378
|
-
}
|
|
379
|
-
|
|
380
|
-
break;
|
|
381
|
-
|
|
382
|
-
case 'h':
|
|
383
|
-
var numbers = parseFloats(data);
|
|
384
|
-
|
|
385
|
-
for (var j = 0, jl = numbers.length; j < jl; j++) {
|
|
386
|
-
point.x += numbers[j];
|
|
387
|
-
control.x = point.x;
|
|
388
|
-
control.y = point.y;
|
|
389
|
-
path.lineTo(point.x, point.y);
|
|
390
|
-
|
|
391
|
-
if (j === 0 && doSetFirstPoint === true) firstPoint.copy(point);
|
|
392
|
-
}
|
|
393
|
-
|
|
394
|
-
break;
|
|
395
|
-
|
|
396
|
-
case 'v':
|
|
397
|
-
var numbers = parseFloats(data);
|
|
398
|
-
|
|
399
|
-
for (var j = 0, jl = numbers.length; j < jl; j++) {
|
|
400
|
-
point.y += numbers[j];
|
|
401
|
-
control.x = point.x;
|
|
402
|
-
control.y = point.y;
|
|
403
|
-
path.lineTo(point.x, point.y);
|
|
404
|
-
|
|
405
|
-
if (j === 0 && doSetFirstPoint === true) firstPoint.copy(point);
|
|
406
|
-
}
|
|
407
|
-
|
|
408
|
-
break;
|
|
409
|
-
|
|
410
|
-
case 'l':
|
|
411
|
-
var numbers = parseFloats(data);
|
|
412
|
-
|
|
413
|
-
for (var j = 0, jl = numbers.length; j < jl; j += 2) {
|
|
414
|
-
point.x += numbers[j + 0];
|
|
415
|
-
point.y += numbers[j + 1];
|
|
416
|
-
control.x = point.x;
|
|
417
|
-
control.y = point.y;
|
|
418
|
-
path.lineTo(point.x, point.y);
|
|
419
|
-
|
|
420
|
-
if (j === 0 && doSetFirstPoint === true) firstPoint.copy(point);
|
|
421
|
-
}
|
|
422
|
-
|
|
423
|
-
break;
|
|
424
|
-
|
|
425
|
-
case 'c':
|
|
426
|
-
var numbers = parseFloats(data);
|
|
427
|
-
|
|
428
|
-
for (var j = 0, jl = numbers.length; j < jl; j += 6) {
|
|
429
|
-
path.bezierCurveTo(
|
|
430
|
-
point.x + numbers[j + 0],
|
|
431
|
-
point.y + numbers[j + 1],
|
|
432
|
-
point.x + numbers[j + 2],
|
|
433
|
-
point.y + numbers[j + 3],
|
|
434
|
-
point.x + numbers[j + 4],
|
|
435
|
-
point.y + numbers[j + 5]
|
|
436
|
-
);
|
|
437
|
-
control.x = point.x + numbers[j + 2];
|
|
438
|
-
control.y = point.y + numbers[j + 3];
|
|
439
|
-
point.x += numbers[j + 4];
|
|
440
|
-
point.y += numbers[j + 5];
|
|
441
|
-
|
|
442
|
-
if (j === 0 && doSetFirstPoint === true) firstPoint.copy(point);
|
|
443
|
-
}
|
|
444
|
-
|
|
445
|
-
break;
|
|
446
|
-
|
|
447
|
-
case 's':
|
|
448
|
-
var numbers = parseFloats(data);
|
|
449
|
-
|
|
450
|
-
for (var j = 0, jl = numbers.length; j < jl; j += 4) {
|
|
451
|
-
path.bezierCurveTo(
|
|
452
|
-
getReflection(point.x, control.x),
|
|
453
|
-
getReflection(point.y, control.y),
|
|
454
|
-
point.x + numbers[j + 0],
|
|
455
|
-
point.y + numbers[j + 1],
|
|
456
|
-
point.x + numbers[j + 2],
|
|
457
|
-
point.y + numbers[j + 3]
|
|
458
|
-
);
|
|
459
|
-
control.x = point.x + numbers[j + 0];
|
|
460
|
-
control.y = point.y + numbers[j + 1];
|
|
461
|
-
point.x += numbers[j + 2];
|
|
462
|
-
point.y += numbers[j + 3];
|
|
463
|
-
|
|
464
|
-
if (j === 0 && doSetFirstPoint === true) firstPoint.copy(point);
|
|
465
|
-
}
|
|
466
|
-
|
|
467
|
-
break;
|
|
468
|
-
|
|
469
|
-
case 'q':
|
|
470
|
-
var numbers = parseFloats(data);
|
|
471
|
-
|
|
472
|
-
for (var j = 0, jl = numbers.length; j < jl; j += 4) {
|
|
473
|
-
path.quadraticCurveTo(
|
|
474
|
-
point.x + numbers[j + 0],
|
|
475
|
-
point.y + numbers[j + 1],
|
|
476
|
-
point.x + numbers[j + 2],
|
|
477
|
-
point.y + numbers[j + 3]
|
|
478
|
-
);
|
|
479
|
-
control.x = point.x + numbers[j + 0];
|
|
480
|
-
control.y = point.y + numbers[j + 1];
|
|
481
|
-
point.x += numbers[j + 2];
|
|
482
|
-
point.y += numbers[j + 3];
|
|
483
|
-
|
|
484
|
-
if (j === 0 && doSetFirstPoint === true) firstPoint.copy(point);
|
|
485
|
-
}
|
|
486
|
-
|
|
487
|
-
break;
|
|
488
|
-
|
|
489
|
-
case 't':
|
|
490
|
-
var numbers = parseFloats(data);
|
|
491
|
-
|
|
492
|
-
for (var j = 0, jl = numbers.length; j < jl; j += 2) {
|
|
493
|
-
var rx = getReflection(point.x, control.x);
|
|
494
|
-
var ry = getReflection(point.y, control.y);
|
|
495
|
-
path.quadraticCurveTo(
|
|
496
|
-
rx,
|
|
497
|
-
ry,
|
|
498
|
-
point.x + numbers[j + 0],
|
|
499
|
-
point.y + numbers[j + 1]
|
|
500
|
-
);
|
|
501
|
-
control.x = rx;
|
|
502
|
-
control.y = ry;
|
|
503
|
-
point.x = point.x + numbers[j + 0];
|
|
504
|
-
point.y = point.y + numbers[j + 1];
|
|
505
|
-
|
|
506
|
-
if (j === 0 && doSetFirstPoint === true) firstPoint.copy(point);
|
|
507
|
-
}
|
|
508
|
-
|
|
509
|
-
break;
|
|
510
|
-
|
|
511
|
-
case 'a':
|
|
512
|
-
var numbers = parseFloats(data);
|
|
513
|
-
|
|
514
|
-
for (var j = 0, jl = numbers.length; j < jl; j += 7) {
|
|
515
|
-
var start = point.clone();
|
|
516
|
-
point.x += numbers[j + 5];
|
|
517
|
-
point.y += numbers[j + 6];
|
|
518
|
-
control.x = point.x;
|
|
519
|
-
control.y = point.y;
|
|
520
|
-
parseArcCommand(
|
|
521
|
-
path,
|
|
522
|
-
numbers[j],
|
|
523
|
-
numbers[j + 1],
|
|
524
|
-
numbers[j + 2],
|
|
525
|
-
numbers[j + 3],
|
|
526
|
-
numbers[j + 4],
|
|
527
|
-
start,
|
|
528
|
-
point
|
|
529
|
-
);
|
|
530
|
-
|
|
531
|
-
if (j === 0 && doSetFirstPoint === true) firstPoint.copy(point);
|
|
532
|
-
}
|
|
533
|
-
|
|
534
|
-
break;
|
|
535
|
-
|
|
536
|
-
case 'Z':
|
|
537
|
-
case 'z':
|
|
538
|
-
path.currentPath.autoClose = true;
|
|
539
|
-
|
|
540
|
-
if (path.currentPath.curves.length > 0) {
|
|
541
|
-
// Reset point to beginning of Path
|
|
542
|
-
point.copy(firstPoint);
|
|
543
|
-
path.currentPath.currentPoint.copy(point);
|
|
544
|
-
isFirstPoint = true;
|
|
545
|
-
}
|
|
546
|
-
|
|
547
|
-
break;
|
|
548
|
-
|
|
549
|
-
default:
|
|
550
|
-
console.warn(command);
|
|
551
|
-
}
|
|
552
|
-
|
|
553
|
-
// console.log( type, parseFloats( data ), parseFloats( data ).length )
|
|
554
|
-
|
|
555
|
-
doSetFirstPoint = false;
|
|
556
|
-
}
|
|
557
|
-
|
|
558
|
-
return path;
|
|
559
|
-
}
|
|
560
|
-
|
|
561
|
-
function parseCSSStylesheet(node) {
|
|
562
|
-
if (!node.sheet || !node.sheet.cssRules || !node.sheet.cssRules.length)
|
|
563
|
-
return;
|
|
564
|
-
|
|
565
|
-
for (var i = 0; i < node.sheet.cssRules.length; i++) {
|
|
566
|
-
var stylesheet = node.sheet.cssRules[i];
|
|
567
|
-
|
|
568
|
-
if (stylesheet.type !== 1) continue;
|
|
569
|
-
|
|
570
|
-
var selectorList = stylesheet.selectorText
|
|
571
|
-
.split(/,/gm)
|
|
572
|
-
.filter(Boolean)
|
|
573
|
-
.map(i => i.trim());
|
|
574
|
-
|
|
575
|
-
for (var j = 0; j < selectorList.length; j++) {
|
|
576
|
-
stylesheets[selectorList[j]] = Object.assign(
|
|
577
|
-
stylesheets[selectorList[j]] || {},
|
|
578
|
-
stylesheet.style
|
|
579
|
-
);
|
|
580
|
-
}
|
|
581
|
-
}
|
|
582
|
-
}
|
|
583
|
-
|
|
584
|
-
/**
|
|
585
|
-
* https://www.w3.org/TR/SVG/implnote.html#ArcImplementationNotes
|
|
586
|
-
* https://mortoray.com/2017/02/16/rendering-an-svg-elliptical-arc-as-bezier-curves/ Appendix: Endpoint to center arc conversion
|
|
587
|
-
* From
|
|
588
|
-
* rx ry x-axis-rotation large-arc-flag sweep-flag x y
|
|
589
|
-
* To
|
|
590
|
-
* aX, aY, xRadius, yRadius, aStartAngle, aEndAngle, aClockwise, aRotation
|
|
591
|
-
*/
|
|
592
|
-
|
|
593
|
-
function parseArcCommand(
|
|
594
|
-
path,
|
|
595
|
-
rx,
|
|
596
|
-
ry,
|
|
597
|
-
x_axis_rotation,
|
|
598
|
-
large_arc_flag,
|
|
599
|
-
sweep_flag,
|
|
600
|
-
start,
|
|
601
|
-
end
|
|
602
|
-
) {
|
|
603
|
-
x_axis_rotation = (x_axis_rotation * Math.PI) / 180;
|
|
604
|
-
|
|
605
|
-
// Ensure radii are positive
|
|
606
|
-
rx = Math.abs(rx);
|
|
607
|
-
ry = Math.abs(ry);
|
|
608
|
-
|
|
609
|
-
// Compute (x1', y1')
|
|
610
|
-
var dx2 = (start.x - end.x) / 2.0;
|
|
611
|
-
var dy2 = (start.y - end.y) / 2.0;
|
|
612
|
-
var x1p =
|
|
613
|
-
Math.cos(x_axis_rotation) * dx2 + Math.sin(x_axis_rotation) * dy2;
|
|
614
|
-
var y1p =
|
|
615
|
-
-Math.sin(x_axis_rotation) * dx2 + Math.cos(x_axis_rotation) * dy2;
|
|
616
|
-
|
|
617
|
-
// Compute (cx', cy')
|
|
618
|
-
var rxs = rx * rx;
|
|
619
|
-
var rys = ry * ry;
|
|
620
|
-
var x1ps = x1p * x1p;
|
|
621
|
-
var y1ps = y1p * y1p;
|
|
622
|
-
|
|
623
|
-
// Ensure radii are large enough
|
|
624
|
-
var cr = x1ps / rxs + y1ps / rys;
|
|
625
|
-
|
|
626
|
-
if (cr > 1) {
|
|
627
|
-
// scale up rx,ry equally so cr == 1
|
|
628
|
-
var s = Math.sqrt(cr);
|
|
629
|
-
rx = s * rx;
|
|
630
|
-
ry = s * ry;
|
|
631
|
-
rxs = rx * rx;
|
|
632
|
-
rys = ry * ry;
|
|
633
|
-
}
|
|
634
|
-
|
|
635
|
-
var dq = rxs * y1ps + rys * x1ps;
|
|
636
|
-
var pq = (rxs * rys - dq) / dq;
|
|
637
|
-
var q = Math.sqrt(Math.max(0, pq));
|
|
638
|
-
if (large_arc_flag === sweep_flag) q = -q;
|
|
639
|
-
var cxp = (q * rx * y1p) / ry;
|
|
640
|
-
var cyp = (-q * ry * x1p) / rx;
|
|
641
|
-
|
|
642
|
-
// Step 3: Compute (cx, cy) from (cx', cy')
|
|
643
|
-
var cx =
|
|
644
|
-
Math.cos(x_axis_rotation) * cxp -
|
|
645
|
-
Math.sin(x_axis_rotation) * cyp +
|
|
646
|
-
(start.x + end.x) / 2;
|
|
647
|
-
var cy =
|
|
648
|
-
Math.sin(x_axis_rotation) * cxp +
|
|
649
|
-
Math.cos(x_axis_rotation) * cyp +
|
|
650
|
-
(start.y + end.y) / 2;
|
|
651
|
-
|
|
652
|
-
// Step 4: Compute ��1 and ����
|
|
653
|
-
var theta = svgAngle(1, 0, (x1p - cxp) / rx, (y1p - cyp) / ry);
|
|
654
|
-
var delta =
|
|
655
|
-
svgAngle(
|
|
656
|
-
(x1p - cxp) / rx,
|
|
657
|
-
(y1p - cyp) / ry,
|
|
658
|
-
(-x1p - cxp) / rx,
|
|
659
|
-
(-y1p - cyp) / ry
|
|
660
|
-
) %
|
|
661
|
-
(Math.PI * 2);
|
|
662
|
-
|
|
663
|
-
path.currentPath.absellipse(
|
|
664
|
-
cx,
|
|
665
|
-
cy,
|
|
666
|
-
rx,
|
|
667
|
-
ry,
|
|
668
|
-
theta,
|
|
669
|
-
theta + delta,
|
|
670
|
-
sweep_flag === 0,
|
|
671
|
-
x_axis_rotation
|
|
672
|
-
);
|
|
673
|
-
}
|
|
674
|
-
|
|
675
|
-
function svgAngle(ux, uy, vx, vy) {
|
|
676
|
-
var dot = ux * vx + uy * vy;
|
|
677
|
-
var len = Math.sqrt(ux * ux + uy * uy) * Math.sqrt(vx * vx + vy * vy);
|
|
678
|
-
var ang = Math.acos(Math.max(-1, Math.min(1, dot / len))); // floating point precision, slightly over values appear
|
|
679
|
-
if (ux * vy - uy * vx < 0) ang = -ang;
|
|
680
|
-
return ang;
|
|
681
|
-
}
|
|
682
|
-
|
|
683
|
-
/*
|
|
684
|
-
* According to https://www.w3.org/TR/SVG/shapes.html#RectElementRXAttribute
|
|
685
|
-
* rounded corner should be rendered to elliptical arc, but bezier curve does the job well enough
|
|
686
|
-
*/
|
|
687
|
-
function parseRectNode(node) {
|
|
688
|
-
var x = parseFloatWithUnits(node.getAttribute('x') || 0);
|
|
689
|
-
var y = parseFloatWithUnits(node.getAttribute('y') || 0);
|
|
690
|
-
var rx = parseFloatWithUnits(node.getAttribute('rx') || 0);
|
|
691
|
-
var ry = parseFloatWithUnits(node.getAttribute('ry') || 0);
|
|
692
|
-
var w = parseFloatWithUnits(node.getAttribute('width'));
|
|
693
|
-
var h = parseFloatWithUnits(node.getAttribute('height'));
|
|
694
|
-
|
|
695
|
-
var path = new ShapePath();
|
|
696
|
-
path.moveTo(x + 2 * rx, y);
|
|
697
|
-
path.lineTo(x + w - 2 * rx, y);
|
|
698
|
-
if (rx !== 0 || ry !== 0)
|
|
699
|
-
path.bezierCurveTo(x + w, y, x + w, y, x + w, y + 2 * ry);
|
|
700
|
-
path.lineTo(x + w, y + h - 2 * ry);
|
|
701
|
-
if (rx !== 0 || ry !== 0)
|
|
702
|
-
path.bezierCurveTo(x + w, y + h, x + w, y + h, x + w - 2 * rx, y + h);
|
|
703
|
-
path.lineTo(x + 2 * rx, y + h);
|
|
704
|
-
|
|
705
|
-
if (rx !== 0 || ry !== 0) {
|
|
706
|
-
path.bezierCurveTo(x, y + h, x, y + h, x, y + h - 2 * ry);
|
|
707
|
-
}
|
|
708
|
-
|
|
709
|
-
path.lineTo(x, y + 2 * ry);
|
|
710
|
-
|
|
711
|
-
if (rx !== 0 || ry !== 0) {
|
|
712
|
-
path.bezierCurveTo(x, y, x, y, x + 2 * rx, y);
|
|
713
|
-
}
|
|
714
|
-
|
|
715
|
-
return path;
|
|
716
|
-
}
|
|
717
|
-
|
|
718
|
-
function parsePolygonNode(node) {
|
|
719
|
-
function iterator(match, a, b) {
|
|
720
|
-
var x = parseFloatWithUnits(a);
|
|
721
|
-
var y = parseFloatWithUnits(b);
|
|
722
|
-
|
|
723
|
-
if (index === 0) {
|
|
724
|
-
path.moveTo(x, y);
|
|
725
|
-
} else {
|
|
726
|
-
path.lineTo(x, y);
|
|
727
|
-
}
|
|
728
|
-
|
|
729
|
-
index++;
|
|
730
|
-
}
|
|
731
|
-
|
|
732
|
-
var regex = /(-?[\d\.?]+)[,|\s](-?[\d\.?]+)/g;
|
|
733
|
-
|
|
734
|
-
var path = new ShapePath();
|
|
735
|
-
|
|
736
|
-
var index = 0;
|
|
737
|
-
|
|
738
|
-
node.getAttribute('points').replace(regex, iterator);
|
|
739
|
-
|
|
740
|
-
path.currentPath.autoClose = true;
|
|
741
|
-
|
|
742
|
-
return path;
|
|
743
|
-
}
|
|
744
|
-
|
|
745
|
-
function parsePolylineNode(node) {
|
|
746
|
-
function iterator(match, a, b) {
|
|
747
|
-
var x = parseFloatWithUnits(a);
|
|
748
|
-
var y = parseFloatWithUnits(b);
|
|
749
|
-
|
|
750
|
-
if (index === 0) {
|
|
751
|
-
path.moveTo(x, y);
|
|
752
|
-
} else {
|
|
753
|
-
path.lineTo(x, y);
|
|
754
|
-
}
|
|
755
|
-
|
|
756
|
-
index++;
|
|
757
|
-
}
|
|
758
|
-
|
|
759
|
-
var regex = /(-?[\d\.?]+)[,|\s](-?[\d\.?]+)/g;
|
|
760
|
-
|
|
761
|
-
var path = new ShapePath();
|
|
762
|
-
|
|
763
|
-
var index = 0;
|
|
764
|
-
|
|
765
|
-
node.getAttribute('points').replace(regex, iterator);
|
|
766
|
-
|
|
767
|
-
path.currentPath.autoClose = false;
|
|
768
|
-
|
|
769
|
-
return path;
|
|
770
|
-
}
|
|
771
|
-
|
|
772
|
-
function parseCircleNode(node) {
|
|
773
|
-
var x = parseFloatWithUnits(node.getAttribute('cx'));
|
|
774
|
-
var y = parseFloatWithUnits(node.getAttribute('cy'));
|
|
775
|
-
var r = parseFloatWithUnits(node.getAttribute('r'));
|
|
776
|
-
|
|
777
|
-
var subpath = new Path();
|
|
778
|
-
subpath.absarc(x, y, r, 0, Math.PI * 2);
|
|
779
|
-
|
|
780
|
-
var path = new ShapePath();
|
|
781
|
-
path.subPaths.push(subpath);
|
|
782
|
-
|
|
783
|
-
return path;
|
|
784
|
-
}
|
|
785
|
-
|
|
786
|
-
function parseEllipseNode(node) {
|
|
787
|
-
var x = parseFloatWithUnits(node.getAttribute('cx'));
|
|
788
|
-
var y = parseFloatWithUnits(node.getAttribute('cy'));
|
|
789
|
-
var rx = parseFloatWithUnits(node.getAttribute('rx'));
|
|
790
|
-
var ry = parseFloatWithUnits(node.getAttribute('ry'));
|
|
791
|
-
|
|
792
|
-
var subpath = new Path();
|
|
793
|
-
subpath.absellipse(x, y, rx, ry, 0, Math.PI * 2);
|
|
794
|
-
|
|
795
|
-
var path = new ShapePath();
|
|
796
|
-
path.subPaths.push(subpath);
|
|
797
|
-
|
|
798
|
-
return path;
|
|
799
|
-
}
|
|
800
|
-
|
|
801
|
-
function parseLineNode(node) {
|
|
802
|
-
var x1 = parseFloatWithUnits(node.getAttribute('x1'));
|
|
803
|
-
var y1 = parseFloatWithUnits(node.getAttribute('y1'));
|
|
804
|
-
var x2 = parseFloatWithUnits(node.getAttribute('x2'));
|
|
805
|
-
var y2 = parseFloatWithUnits(node.getAttribute('y2'));
|
|
806
|
-
|
|
807
|
-
var path = new ShapePath();
|
|
808
|
-
path.moveTo(x1, y1);
|
|
809
|
-
path.lineTo(x2, y2);
|
|
810
|
-
path.currentPath.autoClose = false;
|
|
811
|
-
|
|
812
|
-
return path;
|
|
813
|
-
}
|
|
814
|
-
|
|
815
|
-
//
|
|
816
|
-
|
|
817
|
-
function parseStyle(node, style) {
|
|
818
|
-
style = Object.assign({}, style); // clone style
|
|
819
|
-
|
|
820
|
-
var stylesheetStyles = {};
|
|
821
|
-
|
|
822
|
-
if (node.hasAttribute('class')) {
|
|
823
|
-
var classSelectors = node
|
|
824
|
-
.getAttribute('class')
|
|
825
|
-
.split(/\s/)
|
|
826
|
-
.filter(Boolean)
|
|
827
|
-
.map(i => i.trim());
|
|
828
|
-
|
|
829
|
-
for (var i = 0; i < classSelectors.length; i++) {
|
|
830
|
-
stylesheetStyles = Object.assign(
|
|
831
|
-
stylesheetStyles,
|
|
832
|
-
stylesheets['.' + classSelectors[i]]
|
|
833
|
-
);
|
|
834
|
-
}
|
|
835
|
-
}
|
|
836
|
-
|
|
837
|
-
if (node.hasAttribute('id')) {
|
|
838
|
-
stylesheetStyles = Object.assign(
|
|
839
|
-
stylesheetStyles,
|
|
840
|
-
stylesheets['#' + node.getAttribute('id')]
|
|
841
|
-
);
|
|
842
|
-
}
|
|
843
|
-
|
|
844
|
-
function addStyle(svgName, jsName, adjustFunction) {
|
|
845
|
-
if (adjustFunction === undefined)
|
|
846
|
-
adjustFunction = function copy(v) {
|
|
847
|
-
if (v.startsWith('url'))
|
|
848
|
-
console.warn(
|
|
849
|
-
'SVGLoader: url access in attributes is not implemented.'
|
|
850
|
-
);
|
|
851
|
-
|
|
852
|
-
return v;
|
|
853
|
-
};
|
|
854
|
-
|
|
855
|
-
if (node.hasAttribute(svgName))
|
|
856
|
-
style[jsName] = adjustFunction(node.getAttribute(svgName));
|
|
857
|
-
if (stylesheetStyles[svgName])
|
|
858
|
-
style[jsName] = adjustFunction(stylesheetStyles[svgName]);
|
|
859
|
-
if (node.style && node.style[svgName] !== '')
|
|
860
|
-
style[jsName] = adjustFunction(node.style[svgName]);
|
|
861
|
-
}
|
|
862
|
-
|
|
863
|
-
function clamp(v) {
|
|
864
|
-
return Math.max(0, Math.min(1, parseFloatWithUnits(v)));
|
|
865
|
-
}
|
|
866
|
-
|
|
867
|
-
function positive(v) {
|
|
868
|
-
return Math.max(0, parseFloatWithUnits(v));
|
|
869
|
-
}
|
|
870
|
-
|
|
871
|
-
addStyle('fill', 'fill');
|
|
872
|
-
addStyle('fill-opacity', 'fillOpacity', clamp);
|
|
873
|
-
addStyle('opacity', 'opacity', clamp);
|
|
874
|
-
addStyle('stroke', 'stroke');
|
|
875
|
-
addStyle('stroke-opacity', 'strokeOpacity', clamp);
|
|
876
|
-
addStyle('stroke-width', 'strokeWidth', positive);
|
|
877
|
-
addStyle('stroke-linejoin', 'strokeLineJoin');
|
|
878
|
-
addStyle('stroke-linecap', 'strokeLineCap');
|
|
879
|
-
addStyle('stroke-miterlimit', 'strokeMiterLimit', positive);
|
|
880
|
-
addStyle('visibility', 'visibility');
|
|
881
|
-
|
|
882
|
-
return style;
|
|
883
|
-
}
|
|
884
|
-
|
|
885
|
-
// http://www.w3.org/TR/SVG11/implnote.html#PathElementImplementationNotes
|
|
886
|
-
|
|
887
|
-
function getReflection(a, b) {
|
|
888
|
-
return a - (b - a);
|
|
889
|
-
}
|
|
890
|
-
|
|
891
|
-
function parseFloats(string) {
|
|
892
|
-
var array = string.split(/[\s,]+|(?=\s?[+\-])/);
|
|
893
|
-
|
|
894
|
-
for (var i = 0; i < array.length; i++) {
|
|
895
|
-
var number = array[i];
|
|
896
|
-
|
|
897
|
-
// Handle values like 48.6037.7.8
|
|
898
|
-
// TODO Find a regex for this
|
|
899
|
-
|
|
900
|
-
if (number.indexOf('.') !== number.lastIndexOf('.')) {
|
|
901
|
-
var split = number.split('.');
|
|
902
|
-
|
|
903
|
-
for (var s = 2; s < split.length; s++) {
|
|
904
|
-
array.splice(i + s - 1, 0, '0.' + split[s]);
|
|
905
|
-
}
|
|
906
|
-
}
|
|
907
|
-
|
|
908
|
-
array[i] = parseFloatWithUnits(number);
|
|
909
|
-
}
|
|
910
|
-
|
|
911
|
-
return array;
|
|
912
|
-
}
|
|
913
|
-
|
|
914
|
-
// Units
|
|
915
|
-
|
|
916
|
-
var units = ['mm', 'cm', 'in', 'pt', 'pc', 'px'];
|
|
917
|
-
|
|
918
|
-
// Conversion: [ fromUnit ][ toUnit ] (-1 means dpi dependent)
|
|
919
|
-
var unitConversion = {
|
|
920
|
-
mm: {
|
|
921
|
-
mm: 1,
|
|
922
|
-
cm: 0.1,
|
|
923
|
-
in: 1 / 25.4,
|
|
924
|
-
pt: 72 / 25.4,
|
|
925
|
-
pc: 6 / 25.4,
|
|
926
|
-
px: -1
|
|
927
|
-
},
|
|
928
|
-
cm: {
|
|
929
|
-
mm: 10,
|
|
930
|
-
cm: 1,
|
|
931
|
-
in: 1 / 2.54,
|
|
932
|
-
pt: 72 / 2.54,
|
|
933
|
-
pc: 6 / 2.54,
|
|
934
|
-
px: -1
|
|
935
|
-
},
|
|
936
|
-
in: {
|
|
937
|
-
mm: 25.4,
|
|
938
|
-
cm: 2.54,
|
|
939
|
-
in: 1,
|
|
940
|
-
pt: 72,
|
|
941
|
-
pc: 6,
|
|
942
|
-
px: -1
|
|
943
|
-
},
|
|
944
|
-
pt: {
|
|
945
|
-
mm: 25.4 / 72,
|
|
946
|
-
cm: 2.54 / 72,
|
|
947
|
-
in: 1 / 72,
|
|
948
|
-
pt: 1,
|
|
949
|
-
pc: 6 / 72,
|
|
950
|
-
px: -1
|
|
951
|
-
},
|
|
952
|
-
pc: {
|
|
953
|
-
mm: 25.4 / 6,
|
|
954
|
-
cm: 2.54 / 6,
|
|
955
|
-
in: 1 / 6,
|
|
956
|
-
pt: 72 / 6,
|
|
957
|
-
pc: 1,
|
|
958
|
-
px: -1
|
|
959
|
-
},
|
|
960
|
-
px: {
|
|
961
|
-
px: 1
|
|
962
|
-
}
|
|
963
|
-
};
|
|
964
|
-
|
|
965
|
-
function parseFloatWithUnits(string) {
|
|
966
|
-
var theUnit = 'px';
|
|
967
|
-
|
|
968
|
-
if (typeof string === 'string' || string instanceof String) {
|
|
969
|
-
for (var i = 0, n = units.length; i < n; i++) {
|
|
970
|
-
var u = units[i];
|
|
971
|
-
|
|
972
|
-
if (string.endsWith(u)) {
|
|
973
|
-
theUnit = u;
|
|
974
|
-
string = string.substring(0, string.length - u.length);
|
|
975
|
-
break;
|
|
976
|
-
}
|
|
977
|
-
}
|
|
978
|
-
}
|
|
979
|
-
|
|
980
|
-
var scale = undefined;
|
|
981
|
-
|
|
982
|
-
if (theUnit === 'px' && scope.defaultUnit !== 'px') {
|
|
983
|
-
// Conversion scale from pixels to inches, then to default units
|
|
984
|
-
|
|
985
|
-
scale = unitConversion['in'][scope.defaultUnit] / scope.defaultDPI;
|
|
986
|
-
} else {
|
|
987
|
-
scale = unitConversion[theUnit][scope.defaultUnit];
|
|
988
|
-
|
|
989
|
-
if (scale < 0) {
|
|
990
|
-
// Conversion scale to pixels
|
|
991
|
-
|
|
992
|
-
scale = unitConversion[theUnit]['in'] * scope.defaultDPI;
|
|
993
|
-
}
|
|
994
|
-
}
|
|
995
|
-
|
|
996
|
-
return scale * parseFloat(string);
|
|
997
|
-
}
|
|
998
|
-
|
|
999
|
-
// Transforms
|
|
1000
|
-
|
|
1001
|
-
function getNodeTransform(node) {
|
|
1002
|
-
if (
|
|
1003
|
-
!(
|
|
1004
|
-
node.hasAttribute('transform') ||
|
|
1005
|
-
(node.nodeName === 'use' &&
|
|
1006
|
-
(node.hasAttribute('x') || node.hasAttribute('y')))
|
|
1007
|
-
)
|
|
1008
|
-
) {
|
|
1009
|
-
return null;
|
|
1010
|
-
}
|
|
1011
|
-
|
|
1012
|
-
var transform = parseNodeTransform(node);
|
|
1013
|
-
|
|
1014
|
-
if (transformStack.length > 0) {
|
|
1015
|
-
transform.premultiply(transformStack[transformStack.length - 1]);
|
|
1016
|
-
}
|
|
1017
|
-
|
|
1018
|
-
currentTransform.copy(transform);
|
|
1019
|
-
transformStack.push(transform);
|
|
1020
|
-
|
|
1021
|
-
return transform;
|
|
1022
|
-
}
|
|
1023
|
-
|
|
1024
|
-
function parseNodeTransform(node) {
|
|
1025
|
-
var transform = new Matrix3();
|
|
1026
|
-
var currentTransform = tempTransform0;
|
|
1027
|
-
|
|
1028
|
-
if (
|
|
1029
|
-
node.nodeName === 'use' &&
|
|
1030
|
-
(node.hasAttribute('x') || node.hasAttribute('y'))
|
|
1031
|
-
) {
|
|
1032
|
-
var tx = parseFloatWithUnits(node.getAttribute('x'));
|
|
1033
|
-
var ty = parseFloatWithUnits(node.getAttribute('y'));
|
|
1034
|
-
|
|
1035
|
-
transform.translate(tx, ty);
|
|
1036
|
-
}
|
|
1037
|
-
|
|
1038
|
-
if (node.hasAttribute('transform')) {
|
|
1039
|
-
var transformsTexts = node.getAttribute('transform').split(')');
|
|
1040
|
-
|
|
1041
|
-
for (var tIndex = transformsTexts.length - 1; tIndex >= 0; tIndex--) {
|
|
1042
|
-
var transformText = transformsTexts[tIndex].trim();
|
|
1043
|
-
|
|
1044
|
-
if (transformText === '') continue;
|
|
1045
|
-
|
|
1046
|
-
var openParPos = transformText.indexOf('(');
|
|
1047
|
-
var closeParPos = transformText.length;
|
|
1048
|
-
|
|
1049
|
-
if (openParPos > 0 && openParPos < closeParPos) {
|
|
1050
|
-
var transformType = transformText.substr(0, openParPos);
|
|
1051
|
-
|
|
1052
|
-
var array = parseFloats(
|
|
1053
|
-
transformText.substr(openParPos + 1, closeParPos - openParPos - 1)
|
|
1054
|
-
);
|
|
1055
|
-
|
|
1056
|
-
currentTransform.identity();
|
|
1057
|
-
|
|
1058
|
-
switch (transformType) {
|
|
1059
|
-
case 'translate':
|
|
1060
|
-
if (array.length >= 1) {
|
|
1061
|
-
var tx = array[0];
|
|
1062
|
-
var ty = tx;
|
|
1063
|
-
|
|
1064
|
-
if (array.length >= 2) {
|
|
1065
|
-
ty = array[1];
|
|
1066
|
-
}
|
|
1067
|
-
|
|
1068
|
-
currentTransform.translate(tx, ty);
|
|
1069
|
-
}
|
|
1070
|
-
|
|
1071
|
-
break;
|
|
1072
|
-
|
|
1073
|
-
case 'rotate':
|
|
1074
|
-
if (array.length >= 1) {
|
|
1075
|
-
var angle = 0;
|
|
1076
|
-
var cx = 0;
|
|
1077
|
-
var cy = 0;
|
|
1078
|
-
|
|
1079
|
-
// Angle
|
|
1080
|
-
angle = (-array[0] * Math.PI) / 180;
|
|
1081
|
-
|
|
1082
|
-
if (array.length >= 3) {
|
|
1083
|
-
// Center x, y
|
|
1084
|
-
cx = array[1];
|
|
1085
|
-
cy = array[2];
|
|
1086
|
-
}
|
|
1087
|
-
|
|
1088
|
-
// Rotate around center (cx, cy)
|
|
1089
|
-
tempTransform1.identity().translate(-cx, -cy);
|
|
1090
|
-
tempTransform2.identity().rotate(angle);
|
|
1091
|
-
tempTransform3.multiplyMatrices(
|
|
1092
|
-
tempTransform2,
|
|
1093
|
-
tempTransform1
|
|
1094
|
-
);
|
|
1095
|
-
tempTransform1.identity().translate(cx, cy);
|
|
1096
|
-
currentTransform.multiplyMatrices(
|
|
1097
|
-
tempTransform1,
|
|
1098
|
-
tempTransform3
|
|
1099
|
-
);
|
|
1100
|
-
}
|
|
1101
|
-
|
|
1102
|
-
break;
|
|
1103
|
-
|
|
1104
|
-
case 'scale':
|
|
1105
|
-
if (array.length >= 1) {
|
|
1106
|
-
var scaleX = array[0];
|
|
1107
|
-
var scaleY = scaleX;
|
|
1108
|
-
|
|
1109
|
-
if (array.length >= 2) {
|
|
1110
|
-
scaleY = array[1];
|
|
1111
|
-
}
|
|
1112
|
-
|
|
1113
|
-
currentTransform.scale(scaleX, scaleY);
|
|
1114
|
-
}
|
|
1115
|
-
|
|
1116
|
-
break;
|
|
1117
|
-
|
|
1118
|
-
case 'skewX':
|
|
1119
|
-
if (array.length === 1) {
|
|
1120
|
-
currentTransform.set(
|
|
1121
|
-
1,
|
|
1122
|
-
Math.tan((array[0] * Math.PI) / 180),
|
|
1123
|
-
0,
|
|
1124
|
-
0,
|
|
1125
|
-
1,
|
|
1126
|
-
0,
|
|
1127
|
-
0,
|
|
1128
|
-
0,
|
|
1129
|
-
1
|
|
1130
|
-
);
|
|
1131
|
-
}
|
|
1132
|
-
|
|
1133
|
-
break;
|
|
1134
|
-
|
|
1135
|
-
case 'skewY':
|
|
1136
|
-
if (array.length === 1) {
|
|
1137
|
-
currentTransform.set(
|
|
1138
|
-
1,
|
|
1139
|
-
0,
|
|
1140
|
-
0,
|
|
1141
|
-
Math.tan((array[0] * Math.PI) / 180),
|
|
1142
|
-
1,
|
|
1143
|
-
0,
|
|
1144
|
-
0,
|
|
1145
|
-
0,
|
|
1146
|
-
1
|
|
1147
|
-
);
|
|
1148
|
-
}
|
|
1149
|
-
|
|
1150
|
-
break;
|
|
1151
|
-
|
|
1152
|
-
case 'matrix':
|
|
1153
|
-
if (array.length === 6) {
|
|
1154
|
-
currentTransform.set(
|
|
1155
|
-
array[0],
|
|
1156
|
-
array[2],
|
|
1157
|
-
array[4],
|
|
1158
|
-
array[1],
|
|
1159
|
-
array[3],
|
|
1160
|
-
array[5],
|
|
1161
|
-
0,
|
|
1162
|
-
0,
|
|
1163
|
-
1
|
|
1164
|
-
);
|
|
1165
|
-
}
|
|
1166
|
-
|
|
1167
|
-
break;
|
|
1168
|
-
}
|
|
1169
|
-
}
|
|
1170
|
-
|
|
1171
|
-
transform.premultiply(currentTransform);
|
|
1172
|
-
}
|
|
1173
|
-
}
|
|
1174
|
-
|
|
1175
|
-
return transform;
|
|
1176
|
-
}
|
|
1177
|
-
|
|
1178
|
-
function transformPath(path, m) {
|
|
1179
|
-
function transfVec2(v2) {
|
|
1180
|
-
tempV3.set(v2.x, v2.y, 1).applyMatrix3(m);
|
|
1181
|
-
|
|
1182
|
-
v2.set(tempV3.x, tempV3.y);
|
|
1183
|
-
}
|
|
1184
|
-
|
|
1185
|
-
var isRotated = isTransformRotated(m);
|
|
1186
|
-
|
|
1187
|
-
var subPaths = path.subPaths;
|
|
1188
|
-
|
|
1189
|
-
for (var i = 0, n = subPaths.length; i < n; i++) {
|
|
1190
|
-
var subPath = subPaths[i];
|
|
1191
|
-
var curves = subPath.curves;
|
|
1192
|
-
|
|
1193
|
-
for (var j = 0; j < curves.length; j++) {
|
|
1194
|
-
var curve = curves[j];
|
|
1195
|
-
|
|
1196
|
-
if (curve.isLineCurve) {
|
|
1197
|
-
transfVec2(curve.v1);
|
|
1198
|
-
transfVec2(curve.v2);
|
|
1199
|
-
} else if (curve.isCubicBezierCurve) {
|
|
1200
|
-
transfVec2(curve.v0);
|
|
1201
|
-
transfVec2(curve.v1);
|
|
1202
|
-
transfVec2(curve.v2);
|
|
1203
|
-
transfVec2(curve.v3);
|
|
1204
|
-
} else if (curve.isQuadraticBezierCurve) {
|
|
1205
|
-
transfVec2(curve.v0);
|
|
1206
|
-
transfVec2(curve.v1);
|
|
1207
|
-
transfVec2(curve.v2);
|
|
1208
|
-
} else if (curve.isEllipseCurve) {
|
|
1209
|
-
if (isRotated) {
|
|
1210
|
-
console.warn(
|
|
1211
|
-
'SVGLoader: Elliptic arc or ellipse rotation or skewing is not implemented.'
|
|
1212
|
-
);
|
|
1213
|
-
}
|
|
1214
|
-
|
|
1215
|
-
tempV2.set(curve.aX, curve.aY);
|
|
1216
|
-
transfVec2(tempV2);
|
|
1217
|
-
curve.aX = tempV2.x;
|
|
1218
|
-
curve.aY = tempV2.y;
|
|
1219
|
-
|
|
1220
|
-
curve.xRadius *= getTransformScaleX(m);
|
|
1221
|
-
curve.yRadius *= getTransformScaleY(m);
|
|
1222
|
-
}
|
|
1223
|
-
}
|
|
1224
|
-
}
|
|
1225
|
-
}
|
|
1226
|
-
|
|
1227
|
-
function isTransformRotated(m) {
|
|
1228
|
-
return m.elements[1] !== 0 || m.elements[3] !== 0;
|
|
1229
|
-
}
|
|
1230
|
-
|
|
1231
|
-
function getTransformScaleX(m) {
|
|
1232
|
-
var te = m.elements;
|
|
1233
|
-
return Math.sqrt(te[0] * te[0] + te[1] * te[1]);
|
|
1234
|
-
}
|
|
1235
|
-
|
|
1236
|
-
function getTransformScaleY(m) {
|
|
1237
|
-
var te = m.elements;
|
|
1238
|
-
return Math.sqrt(te[3] * te[3] + te[4] * te[4]);
|
|
1239
|
-
}
|
|
1240
|
-
|
|
1241
|
-
//
|
|
1242
|
-
|
|
1243
|
-
var paths = [];
|
|
1244
|
-
var stylesheets = {};
|
|
1245
|
-
|
|
1246
|
-
var transformStack = [];
|
|
1247
|
-
|
|
1248
|
-
var tempTransform0 = new Matrix3();
|
|
1249
|
-
var tempTransform1 = new Matrix3();
|
|
1250
|
-
var tempTransform2 = new Matrix3();
|
|
1251
|
-
var tempTransform3 = new Matrix3();
|
|
1252
|
-
var tempV2 = new Vector2();
|
|
1253
|
-
var tempV3 = new Vector3();
|
|
1254
|
-
|
|
1255
|
-
var currentTransform = new Matrix3();
|
|
1256
|
-
|
|
1257
|
-
var xml = new DOMParser().parseFromString(text, 'image/svg+xml'); // application/xml
|
|
1258
|
-
|
|
1259
|
-
parseNode(xml.documentElement, {
|
|
1260
|
-
fill: '#000',
|
|
1261
|
-
fillOpacity: 1,
|
|
1262
|
-
strokeOpacity: 1,
|
|
1263
|
-
strokeWidth: 1,
|
|
1264
|
-
strokeLineJoin: 'miter',
|
|
1265
|
-
strokeLineCap: 'butt',
|
|
1266
|
-
strokeMiterLimit: 4
|
|
1267
|
-
});
|
|
1268
|
-
|
|
1269
|
-
var data = { paths: paths, xml: xml.documentElement };
|
|
1270
|
-
|
|
1271
|
-
// console.log( paths );
|
|
1272
|
-
return data;
|
|
1273
|
-
}
|
|
1274
|
-
});
|
|
1275
|
-
|
|
1276
|
-
SVGLoader.getStrokeStyle = function (
|
|
1277
|
-
width,
|
|
1278
|
-
color,
|
|
1279
|
-
lineJoin,
|
|
1280
|
-
lineCap,
|
|
1281
|
-
miterLimit
|
|
1282
|
-
) {
|
|
1283
|
-
// Param width: Stroke width
|
|
1284
|
-
// Param color: As returned by THREE.Color.getStyle()
|
|
1285
|
-
// Param lineJoin: One of "round", "bevel", "miter" or "miter-limit"
|
|
1286
|
-
// Param lineCap: One of "round", "square" or "butt"
|
|
1287
|
-
// Param miterLimit: Maximum join length, in multiples of the "width" parameter (join is truncated if it exceeds that distance)
|
|
1288
|
-
// Returns style object
|
|
1289
|
-
|
|
1290
|
-
width = width !== undefined ? width : 1;
|
|
1291
|
-
color = color !== undefined ? color : '#000';
|
|
1292
|
-
lineJoin = lineJoin !== undefined ? lineJoin : 'miter';
|
|
1293
|
-
lineCap = lineCap !== undefined ? lineCap : 'butt';
|
|
1294
|
-
miterLimit = miterLimit !== undefined ? miterLimit : 4;
|
|
1295
|
-
|
|
1296
|
-
return {
|
|
1297
|
-
strokeColor: color,
|
|
1298
|
-
strokeWidth: width,
|
|
1299
|
-
strokeLineJoin: lineJoin,
|
|
1300
|
-
strokeLineCap: lineCap,
|
|
1301
|
-
strokeMiterLimit: miterLimit
|
|
1302
|
-
};
|
|
1303
|
-
};
|
|
1304
|
-
|
|
1305
|
-
SVGLoader.pointsToStroke = function (points, style, arcDivisions, minDistance) {
|
|
1306
|
-
// Generates a stroke with some witdh around the given path.
|
|
1307
|
-
// The path can be open or closed (last point equals to first point)
|
|
1308
|
-
// Param points: Array of Vector2D (the path). Minimum 2 points.
|
|
1309
|
-
// Param style: Object with SVG properties as returned by SVGLoader.getStrokeStyle(), or SVGLoader.parse() in the path.userData.style object
|
|
1310
|
-
// Params arcDivisions: Arc divisions for round joins and endcaps. (Optional)
|
|
1311
|
-
// Param minDistance: Points closer to this distance will be merged. (Optional)
|
|
1312
|
-
// Returns BufferGeometry with stroke triangles (In plane z = 0). UV coordinates are generated ('u' along path. 'v' across it, from left to right)
|
|
1313
|
-
|
|
1314
|
-
var vertices = [];
|
|
1315
|
-
var normals = [];
|
|
1316
|
-
var uvs = [];
|
|
1317
|
-
|
|
1318
|
-
if (
|
|
1319
|
-
SVGLoader.pointsToStrokeWithBuffers(
|
|
1320
|
-
points,
|
|
1321
|
-
style,
|
|
1322
|
-
arcDivisions,
|
|
1323
|
-
minDistance,
|
|
1324
|
-
vertices,
|
|
1325
|
-
normals,
|
|
1326
|
-
uvs
|
|
1327
|
-
) === 0
|
|
1328
|
-
) {
|
|
1329
|
-
return null;
|
|
1330
|
-
}
|
|
1331
|
-
|
|
1332
|
-
var geometry = new BufferGeometry();
|
|
1333
|
-
geometry.setAttribute('position', new Float32BufferAttribute(vertices, 3));
|
|
1334
|
-
geometry.setAttribute('normal', new Float32BufferAttribute(normals, 3));
|
|
1335
|
-
geometry.setAttribute('uv', new Float32BufferAttribute(uvs, 2));
|
|
1336
|
-
|
|
1337
|
-
return geometry;
|
|
1338
|
-
};
|
|
1339
|
-
|
|
1340
|
-
SVGLoader.pointsToStrokeWithBuffers = (function () {
|
|
1341
|
-
var tempV2_1 = new Vector2();
|
|
1342
|
-
var tempV2_2 = new Vector2();
|
|
1343
|
-
var tempV2_3 = new Vector2();
|
|
1344
|
-
var tempV2_4 = new Vector2();
|
|
1345
|
-
var tempV2_5 = new Vector2();
|
|
1346
|
-
var tempV2_6 = new Vector2();
|
|
1347
|
-
var tempV2_7 = new Vector2();
|
|
1348
|
-
var lastPointL = new Vector2();
|
|
1349
|
-
var lastPointR = new Vector2();
|
|
1350
|
-
var point0L = new Vector2();
|
|
1351
|
-
var point0R = new Vector2();
|
|
1352
|
-
var currentPointL = new Vector2();
|
|
1353
|
-
var currentPointR = new Vector2();
|
|
1354
|
-
var nextPointL = new Vector2();
|
|
1355
|
-
var nextPointR = new Vector2();
|
|
1356
|
-
var innerPoint = new Vector2();
|
|
1357
|
-
var outerPoint = new Vector2();
|
|
1358
|
-
|
|
1359
|
-
return function (
|
|
1360
|
-
points,
|
|
1361
|
-
style,
|
|
1362
|
-
arcDivisions,
|
|
1363
|
-
minDistance,
|
|
1364
|
-
vertices,
|
|
1365
|
-
normals,
|
|
1366
|
-
uvs,
|
|
1367
|
-
vertexOffset
|
|
1368
|
-
) {
|
|
1369
|
-
// This function can be called to update existing arrays or buffers.
|
|
1370
|
-
// Accepts same parameters as pointsToStroke, plus the buffers and optional offset.
|
|
1371
|
-
// Param vertexOffset: Offset vertices to start writing in the buffers (3 elements/vertex for vertices and normals, and 2 elements/vertex for uvs)
|
|
1372
|
-
// Returns number of written vertices / normals / uvs pairs
|
|
1373
|
-
// if 'vertices' parameter is undefined no triangles will be generated, but the returned vertices count will still be valid (useful to preallocate the buffers)
|
|
1374
|
-
// 'normals' and 'uvs' buffers are optional
|
|
1375
|
-
|
|
1376
|
-
arcDivisions = arcDivisions !== undefined ? arcDivisions : 12;
|
|
1377
|
-
minDistance = minDistance !== undefined ? minDistance : 0.001;
|
|
1378
|
-
vertexOffset = vertexOffset !== undefined ? vertexOffset : 0;
|
|
1379
|
-
|
|
1380
|
-
// First ensure there are no duplicated points
|
|
1381
|
-
points = removeDuplicatedPoints(points);
|
|
1382
|
-
|
|
1383
|
-
var numPoints = points.length;
|
|
1384
|
-
|
|
1385
|
-
if (numPoints < 2) return 0;
|
|
1386
|
-
|
|
1387
|
-
var isClosed = points[0].equals(points[numPoints - 1]);
|
|
1388
|
-
|
|
1389
|
-
var currentPoint;
|
|
1390
|
-
var previousPoint = points[0];
|
|
1391
|
-
var nextPoint;
|
|
1392
|
-
|
|
1393
|
-
var strokeWidth2 = style.strokeWidth / 2;
|
|
1394
|
-
|
|
1395
|
-
var deltaU = 1 / (numPoints - 1);
|
|
1396
|
-
var u0 = 0;
|
|
1397
|
-
|
|
1398
|
-
var innerSideModified;
|
|
1399
|
-
var joinIsOnLeftSide;
|
|
1400
|
-
var isMiter;
|
|
1401
|
-
var initialJoinIsOnLeftSide = false;
|
|
1402
|
-
|
|
1403
|
-
var numVertices = 0;
|
|
1404
|
-
var currentCoordinate = vertexOffset * 3;
|
|
1405
|
-
var currentCoordinateUV = vertexOffset * 2;
|
|
1406
|
-
|
|
1407
|
-
// Get initial left and right stroke points
|
|
1408
|
-
getNormal(points[0], points[1], tempV2_1).multiplyScalar(strokeWidth2);
|
|
1409
|
-
lastPointL.copy(points[0]).sub(tempV2_1);
|
|
1410
|
-
lastPointR.copy(points[0]).add(tempV2_1);
|
|
1411
|
-
point0L.copy(lastPointL);
|
|
1412
|
-
point0R.copy(lastPointR);
|
|
1413
|
-
|
|
1414
|
-
for (var iPoint = 1; iPoint < numPoints; iPoint++) {
|
|
1415
|
-
currentPoint = points[iPoint];
|
|
1416
|
-
|
|
1417
|
-
// Get next point
|
|
1418
|
-
if (iPoint === numPoints - 1) {
|
|
1419
|
-
if (isClosed) {
|
|
1420
|
-
// Skip duplicated initial point
|
|
1421
|
-
nextPoint = points[1];
|
|
1422
|
-
} else nextPoint = undefined;
|
|
1423
|
-
} else {
|
|
1424
|
-
nextPoint = points[iPoint + 1];
|
|
1425
|
-
}
|
|
1426
|
-
|
|
1427
|
-
// Normal of previous segment in tempV2_1
|
|
1428
|
-
var normal1 = tempV2_1;
|
|
1429
|
-
getNormal(previousPoint, currentPoint, normal1);
|
|
1430
|
-
|
|
1431
|
-
tempV2_3.copy(normal1).multiplyScalar(strokeWidth2);
|
|
1432
|
-
currentPointL.copy(currentPoint).sub(tempV2_3);
|
|
1433
|
-
currentPointR.copy(currentPoint).add(tempV2_3);
|
|
1434
|
-
|
|
1435
|
-
var u1 = u0 + deltaU;
|
|
1436
|
-
|
|
1437
|
-
innerSideModified = false;
|
|
1438
|
-
|
|
1439
|
-
if (nextPoint !== undefined) {
|
|
1440
|
-
// Normal of next segment in tempV2_2
|
|
1441
|
-
getNormal(currentPoint, nextPoint, tempV2_2);
|
|
1442
|
-
|
|
1443
|
-
tempV2_3.copy(tempV2_2).multiplyScalar(strokeWidth2);
|
|
1444
|
-
nextPointL.copy(currentPoint).sub(tempV2_3);
|
|
1445
|
-
nextPointR.copy(currentPoint).add(tempV2_3);
|
|
1446
|
-
|
|
1447
|
-
joinIsOnLeftSide = true;
|
|
1448
|
-
tempV2_3.subVectors(nextPoint, previousPoint);
|
|
1449
|
-
if (normal1.dot(tempV2_3) < 0) {
|
|
1450
|
-
joinIsOnLeftSide = false;
|
|
1451
|
-
}
|
|
1452
|
-
|
|
1453
|
-
if (iPoint === 1) initialJoinIsOnLeftSide = joinIsOnLeftSide;
|
|
1454
|
-
|
|
1455
|
-
tempV2_3.subVectors(nextPoint, currentPoint);
|
|
1456
|
-
tempV2_3.normalize();
|
|
1457
|
-
var dot = Math.abs(normal1.dot(tempV2_3));
|
|
1458
|
-
|
|
1459
|
-
// If path is straight, don't create join
|
|
1460
|
-
if (dot !== 0) {
|
|
1461
|
-
// Compute inner and outer segment intersections
|
|
1462
|
-
var miterSide = strokeWidth2 / dot;
|
|
1463
|
-
tempV2_3.multiplyScalar(-miterSide);
|
|
1464
|
-
tempV2_4.subVectors(currentPoint, previousPoint);
|
|
1465
|
-
tempV2_5.copy(tempV2_4).setLength(miterSide).add(tempV2_3);
|
|
1466
|
-
innerPoint.copy(tempV2_5).negate();
|
|
1467
|
-
var miterLength2 = tempV2_5.length();
|
|
1468
|
-
var segmentLengthPrev = tempV2_4.length();
|
|
1469
|
-
tempV2_4.divideScalar(segmentLengthPrev);
|
|
1470
|
-
tempV2_6.subVectors(nextPoint, currentPoint);
|
|
1471
|
-
var segmentLengthNext = tempV2_6.length();
|
|
1472
|
-
tempV2_6.divideScalar(segmentLengthNext);
|
|
1473
|
-
// Check that previous and next segments doesn't overlap with the innerPoint of intersection
|
|
1474
|
-
if (
|
|
1475
|
-
tempV2_4.dot(innerPoint) < segmentLengthPrev &&
|
|
1476
|
-
tempV2_6.dot(innerPoint) < segmentLengthNext
|
|
1477
|
-
) {
|
|
1478
|
-
innerSideModified = true;
|
|
1479
|
-
}
|
|
1480
|
-
|
|
1481
|
-
outerPoint.copy(tempV2_5).add(currentPoint);
|
|
1482
|
-
innerPoint.add(currentPoint);
|
|
1483
|
-
|
|
1484
|
-
isMiter = false;
|
|
1485
|
-
|
|
1486
|
-
if (innerSideModified) {
|
|
1487
|
-
if (joinIsOnLeftSide) {
|
|
1488
|
-
nextPointR.copy(innerPoint);
|
|
1489
|
-
currentPointR.copy(innerPoint);
|
|
1490
|
-
} else {
|
|
1491
|
-
nextPointL.copy(innerPoint);
|
|
1492
|
-
currentPointL.copy(innerPoint);
|
|
1493
|
-
}
|
|
1494
|
-
} else {
|
|
1495
|
-
// The segment triangles are generated here if there was overlapping
|
|
1496
|
-
|
|
1497
|
-
makeSegmentTriangles();
|
|
1498
|
-
}
|
|
1499
|
-
|
|
1500
|
-
switch (style.strokeLineJoin) {
|
|
1501
|
-
case 'bevel':
|
|
1502
|
-
makeSegmentWithBevelJoin(joinIsOnLeftSide, innerSideModified, u1);
|
|
1503
|
-
|
|
1504
|
-
break;
|
|
1505
|
-
|
|
1506
|
-
case 'round':
|
|
1507
|
-
// Segment triangles
|
|
1508
|
-
|
|
1509
|
-
createSegmentTrianglesWithMiddleSection(
|
|
1510
|
-
joinIsOnLeftSide,
|
|
1511
|
-
innerSideModified
|
|
1512
|
-
);
|
|
1513
|
-
|
|
1514
|
-
// Join triangles
|
|
1515
|
-
|
|
1516
|
-
if (joinIsOnLeftSide) {
|
|
1517
|
-
makeCircularSector(
|
|
1518
|
-
currentPoint,
|
|
1519
|
-
currentPointL,
|
|
1520
|
-
nextPointL,
|
|
1521
|
-
u1,
|
|
1522
|
-
0
|
|
1523
|
-
);
|
|
1524
|
-
} else {
|
|
1525
|
-
makeCircularSector(
|
|
1526
|
-
currentPoint,
|
|
1527
|
-
nextPointR,
|
|
1528
|
-
currentPointR,
|
|
1529
|
-
u1,
|
|
1530
|
-
1
|
|
1531
|
-
);
|
|
1532
|
-
}
|
|
1533
|
-
|
|
1534
|
-
break;
|
|
1535
|
-
|
|
1536
|
-
case 'miter':
|
|
1537
|
-
case 'miter-clip':
|
|
1538
|
-
default:
|
|
1539
|
-
var miterFraction =
|
|
1540
|
-
(strokeWidth2 * style.strokeMiterLimit) / miterLength2;
|
|
1541
|
-
|
|
1542
|
-
if (miterFraction < 1) {
|
|
1543
|
-
// The join miter length exceeds the miter limit
|
|
1544
|
-
|
|
1545
|
-
if (style.strokeLineJoin !== 'miter-clip') {
|
|
1546
|
-
makeSegmentWithBevelJoin(
|
|
1547
|
-
joinIsOnLeftSide,
|
|
1548
|
-
innerSideModified,
|
|
1549
|
-
u1
|
|
1550
|
-
);
|
|
1551
|
-
break;
|
|
1552
|
-
} else {
|
|
1553
|
-
// Segment triangles
|
|
1554
|
-
|
|
1555
|
-
createSegmentTrianglesWithMiddleSection(
|
|
1556
|
-
joinIsOnLeftSide,
|
|
1557
|
-
innerSideModified
|
|
1558
|
-
);
|
|
1559
|
-
|
|
1560
|
-
// Miter-clip join triangles
|
|
1561
|
-
|
|
1562
|
-
if (joinIsOnLeftSide) {
|
|
1563
|
-
tempV2_6
|
|
1564
|
-
.subVectors(outerPoint, currentPointL)
|
|
1565
|
-
.multiplyScalar(miterFraction)
|
|
1566
|
-
.add(currentPointL);
|
|
1567
|
-
tempV2_7
|
|
1568
|
-
.subVectors(outerPoint, nextPointL)
|
|
1569
|
-
.multiplyScalar(miterFraction)
|
|
1570
|
-
.add(nextPointL);
|
|
1571
|
-
|
|
1572
|
-
addVertex(currentPointL, u1, 0);
|
|
1573
|
-
addVertex(tempV2_6, u1, 0);
|
|
1574
|
-
addVertex(currentPoint, u1, 0.5);
|
|
1575
|
-
|
|
1576
|
-
addVertex(currentPoint, u1, 0.5);
|
|
1577
|
-
addVertex(tempV2_6, u1, 0);
|
|
1578
|
-
addVertex(tempV2_7, u1, 0);
|
|
1579
|
-
|
|
1580
|
-
addVertex(currentPoint, u1, 0.5);
|
|
1581
|
-
addVertex(tempV2_7, u1, 0);
|
|
1582
|
-
addVertex(nextPointL, u1, 0);
|
|
1583
|
-
} else {
|
|
1584
|
-
tempV2_6
|
|
1585
|
-
.subVectors(outerPoint, currentPointR)
|
|
1586
|
-
.multiplyScalar(miterFraction)
|
|
1587
|
-
.add(currentPointR);
|
|
1588
|
-
tempV2_7
|
|
1589
|
-
.subVectors(outerPoint, nextPointR)
|
|
1590
|
-
.multiplyScalar(miterFraction)
|
|
1591
|
-
.add(nextPointR);
|
|
1592
|
-
|
|
1593
|
-
addVertex(currentPointR, u1, 1);
|
|
1594
|
-
addVertex(tempV2_6, u1, 1);
|
|
1595
|
-
addVertex(currentPoint, u1, 0.5);
|
|
1596
|
-
|
|
1597
|
-
addVertex(currentPoint, u1, 0.5);
|
|
1598
|
-
addVertex(tempV2_6, u1, 1);
|
|
1599
|
-
addVertex(tempV2_7, u1, 1);
|
|
1600
|
-
|
|
1601
|
-
addVertex(currentPoint, u1, 0.5);
|
|
1602
|
-
addVertex(tempV2_7, u1, 1);
|
|
1603
|
-
addVertex(nextPointR, u1, 1);
|
|
1604
|
-
}
|
|
1605
|
-
}
|
|
1606
|
-
} else {
|
|
1607
|
-
// Miter join segment triangles
|
|
1608
|
-
|
|
1609
|
-
if (innerSideModified) {
|
|
1610
|
-
// Optimized segment + join triangles
|
|
1611
|
-
|
|
1612
|
-
if (joinIsOnLeftSide) {
|
|
1613
|
-
addVertex(lastPointR, u0, 1);
|
|
1614
|
-
addVertex(lastPointL, u0, 0);
|
|
1615
|
-
addVertex(outerPoint, u1, 0);
|
|
1616
|
-
|
|
1617
|
-
addVertex(lastPointR, u0, 1);
|
|
1618
|
-
addVertex(outerPoint, u1, 0);
|
|
1619
|
-
addVertex(innerPoint, u1, 1);
|
|
1620
|
-
} else {
|
|
1621
|
-
addVertex(lastPointR, u0, 1);
|
|
1622
|
-
addVertex(lastPointL, u0, 0);
|
|
1623
|
-
addVertex(outerPoint, u1, 1);
|
|
1624
|
-
|
|
1625
|
-
addVertex(lastPointL, u0, 0);
|
|
1626
|
-
addVertex(innerPoint, u1, 0);
|
|
1627
|
-
addVertex(outerPoint, u1, 1);
|
|
1628
|
-
}
|
|
1629
|
-
|
|
1630
|
-
if (joinIsOnLeftSide) {
|
|
1631
|
-
nextPointL.copy(outerPoint);
|
|
1632
|
-
} else {
|
|
1633
|
-
nextPointR.copy(outerPoint);
|
|
1634
|
-
}
|
|
1635
|
-
} else {
|
|
1636
|
-
// Add extra miter join triangles
|
|
1637
|
-
|
|
1638
|
-
if (joinIsOnLeftSide) {
|
|
1639
|
-
addVertex(currentPointL, u1, 0);
|
|
1640
|
-
addVertex(outerPoint, u1, 0);
|
|
1641
|
-
addVertex(currentPoint, u1, 0.5);
|
|
1642
|
-
|
|
1643
|
-
addVertex(currentPoint, u1, 0.5);
|
|
1644
|
-
addVertex(outerPoint, u1, 0);
|
|
1645
|
-
addVertex(nextPointL, u1, 0);
|
|
1646
|
-
} else {
|
|
1647
|
-
addVertex(currentPointR, u1, 1);
|
|
1648
|
-
addVertex(outerPoint, u1, 1);
|
|
1649
|
-
addVertex(currentPoint, u1, 0.5);
|
|
1650
|
-
|
|
1651
|
-
addVertex(currentPoint, u1, 0.5);
|
|
1652
|
-
addVertex(outerPoint, u1, 1);
|
|
1653
|
-
addVertex(nextPointR, u1, 1);
|
|
1654
|
-
}
|
|
1655
|
-
}
|
|
1656
|
-
|
|
1657
|
-
isMiter = true;
|
|
1658
|
-
}
|
|
1659
|
-
|
|
1660
|
-
break;
|
|
1661
|
-
}
|
|
1662
|
-
} else {
|
|
1663
|
-
// The segment triangles are generated here when two consecutive points are collinear
|
|
1664
|
-
|
|
1665
|
-
makeSegmentTriangles();
|
|
1666
|
-
}
|
|
1667
|
-
} else {
|
|
1668
|
-
// The segment triangles are generated here if it is the ending segment
|
|
1669
|
-
|
|
1670
|
-
makeSegmentTriangles();
|
|
1671
|
-
}
|
|
1672
|
-
|
|
1673
|
-
if (!isClosed && iPoint === numPoints - 1) {
|
|
1674
|
-
// Start line endcap
|
|
1675
|
-
addCapGeometry(points[0], point0L, point0R, joinIsOnLeftSide, true, u0);
|
|
1676
|
-
}
|
|
1677
|
-
|
|
1678
|
-
// Increment loop variables
|
|
1679
|
-
|
|
1680
|
-
u0 = u1;
|
|
1681
|
-
|
|
1682
|
-
previousPoint = currentPoint;
|
|
1683
|
-
|
|
1684
|
-
lastPointL.copy(nextPointL);
|
|
1685
|
-
lastPointR.copy(nextPointR);
|
|
1686
|
-
}
|
|
1687
|
-
|
|
1688
|
-
if (!isClosed) {
|
|
1689
|
-
// Ending line endcap
|
|
1690
|
-
addCapGeometry(
|
|
1691
|
-
currentPoint,
|
|
1692
|
-
currentPointL,
|
|
1693
|
-
currentPointR,
|
|
1694
|
-
joinIsOnLeftSide,
|
|
1695
|
-
false,
|
|
1696
|
-
u1
|
|
1697
|
-
);
|
|
1698
|
-
} else if (innerSideModified && vertices) {
|
|
1699
|
-
// Modify path first segment vertices to adjust to the segments inner and outer intersections
|
|
1700
|
-
|
|
1701
|
-
var lastOuter = outerPoint;
|
|
1702
|
-
var lastInner = innerPoint;
|
|
1703
|
-
|
|
1704
|
-
if (initialJoinIsOnLeftSide !== joinIsOnLeftSide) {
|
|
1705
|
-
lastOuter = innerPoint;
|
|
1706
|
-
lastInner = outerPoint;
|
|
1707
|
-
}
|
|
1708
|
-
|
|
1709
|
-
if (joinIsOnLeftSide) {
|
|
1710
|
-
if (isMiter || initialJoinIsOnLeftSide) {
|
|
1711
|
-
lastInner.toArray(vertices, 0 * 3);
|
|
1712
|
-
lastInner.toArray(vertices, 3 * 3);
|
|
1713
|
-
|
|
1714
|
-
if (isMiter) {
|
|
1715
|
-
lastOuter.toArray(vertices, 1 * 3);
|
|
1716
|
-
}
|
|
1717
|
-
}
|
|
1718
|
-
} else {
|
|
1719
|
-
if (isMiter || !initialJoinIsOnLeftSide) {
|
|
1720
|
-
lastInner.toArray(vertices, 1 * 3);
|
|
1721
|
-
lastInner.toArray(vertices, 3 * 3);
|
|
1722
|
-
|
|
1723
|
-
if (isMiter) {
|
|
1724
|
-
lastOuter.toArray(vertices, 0 * 3);
|
|
1725
|
-
}
|
|
1726
|
-
}
|
|
1727
|
-
}
|
|
1728
|
-
}
|
|
1729
|
-
|
|
1730
|
-
return numVertices;
|
|
1731
|
-
|
|
1732
|
-
// -- End of algorithm
|
|
1733
|
-
|
|
1734
|
-
// -- Functions
|
|
1735
|
-
|
|
1736
|
-
function getNormal(p1, p2, result) {
|
|
1737
|
-
result.subVectors(p2, p1);
|
|
1738
|
-
return result.set(-result.y, result.x).normalize();
|
|
1739
|
-
}
|
|
1740
|
-
|
|
1741
|
-
function addVertex(position, u, v) {
|
|
1742
|
-
if (vertices) {
|
|
1743
|
-
vertices[currentCoordinate] = position.x;
|
|
1744
|
-
vertices[currentCoordinate + 1] = position.y;
|
|
1745
|
-
vertices[currentCoordinate + 2] = 0;
|
|
1746
|
-
|
|
1747
|
-
if (normals) {
|
|
1748
|
-
normals[currentCoordinate] = 0;
|
|
1749
|
-
normals[currentCoordinate + 1] = 0;
|
|
1750
|
-
normals[currentCoordinate + 2] = 1;
|
|
1751
|
-
}
|
|
1752
|
-
|
|
1753
|
-
currentCoordinate += 3;
|
|
1754
|
-
|
|
1755
|
-
if (uvs) {
|
|
1756
|
-
uvs[currentCoordinateUV] = u;
|
|
1757
|
-
uvs[currentCoordinateUV + 1] = v;
|
|
1758
|
-
|
|
1759
|
-
currentCoordinateUV += 2;
|
|
1760
|
-
}
|
|
1761
|
-
}
|
|
1762
|
-
|
|
1763
|
-
numVertices += 3;
|
|
1764
|
-
}
|
|
1765
|
-
|
|
1766
|
-
function makeCircularSector(center, p1, p2, u, v) {
|
|
1767
|
-
// param p1, p2: Points in the circle arc.
|
|
1768
|
-
// p1 and p2 are in clockwise direction.
|
|
1769
|
-
|
|
1770
|
-
tempV2_1.copy(p1).sub(center).normalize();
|
|
1771
|
-
tempV2_2.copy(p2).sub(center).normalize();
|
|
1772
|
-
|
|
1773
|
-
var angle = Math.PI;
|
|
1774
|
-
var dot = tempV2_1.dot(tempV2_2);
|
|
1775
|
-
if (Math.abs(dot) < 1) angle = Math.abs(Math.acos(dot));
|
|
1776
|
-
|
|
1777
|
-
angle /= arcDivisions;
|
|
1778
|
-
|
|
1779
|
-
tempV2_3.copy(p1);
|
|
1780
|
-
|
|
1781
|
-
for (var i = 0, il = arcDivisions - 1; i < il; i++) {
|
|
1782
|
-
tempV2_4.copy(tempV2_3).rotateAround(center, angle);
|
|
1783
|
-
|
|
1784
|
-
addVertex(tempV2_3, u, v);
|
|
1785
|
-
addVertex(tempV2_4, u, v);
|
|
1786
|
-
addVertex(center, u, 0.5);
|
|
1787
|
-
|
|
1788
|
-
tempV2_3.copy(tempV2_4);
|
|
1789
|
-
}
|
|
1790
|
-
|
|
1791
|
-
addVertex(tempV2_4, u, v);
|
|
1792
|
-
addVertex(p2, u, v);
|
|
1793
|
-
addVertex(center, u, 0.5);
|
|
1794
|
-
}
|
|
1795
|
-
|
|
1796
|
-
function makeSegmentTriangles() {
|
|
1797
|
-
addVertex(lastPointR, u0, 1);
|
|
1798
|
-
addVertex(lastPointL, u0, 0);
|
|
1799
|
-
addVertex(currentPointL, u1, 0);
|
|
1800
|
-
|
|
1801
|
-
addVertex(lastPointR, u0, 1);
|
|
1802
|
-
addVertex(currentPointL, u1, 1);
|
|
1803
|
-
addVertex(currentPointR, u1, 0);
|
|
1804
|
-
}
|
|
1805
|
-
|
|
1806
|
-
function makeSegmentWithBevelJoin(joinIsOnLeftSide, innerSideModified, u) {
|
|
1807
|
-
if (innerSideModified) {
|
|
1808
|
-
// Optimized segment + bevel triangles
|
|
1809
|
-
|
|
1810
|
-
if (joinIsOnLeftSide) {
|
|
1811
|
-
// Path segments triangles
|
|
1812
|
-
|
|
1813
|
-
addVertex(lastPointR, u0, 1);
|
|
1814
|
-
addVertex(lastPointL, u0, 0);
|
|
1815
|
-
addVertex(currentPointL, u1, 0);
|
|
1816
|
-
|
|
1817
|
-
addVertex(lastPointR, u0, 1);
|
|
1818
|
-
addVertex(currentPointL, u1, 0);
|
|
1819
|
-
addVertex(innerPoint, u1, 1);
|
|
1820
|
-
|
|
1821
|
-
// Bevel join triangle
|
|
1822
|
-
|
|
1823
|
-
addVertex(currentPointL, u, 0);
|
|
1824
|
-
addVertex(nextPointL, u, 0);
|
|
1825
|
-
addVertex(innerPoint, u, 0.5);
|
|
1826
|
-
} else {
|
|
1827
|
-
// Path segments triangles
|
|
1828
|
-
|
|
1829
|
-
addVertex(lastPointR, u0, 1);
|
|
1830
|
-
addVertex(lastPointL, u0, 0);
|
|
1831
|
-
addVertex(currentPointR, u1, 1);
|
|
1832
|
-
|
|
1833
|
-
addVertex(lastPointL, u0, 0);
|
|
1834
|
-
addVertex(innerPoint, u1, 0);
|
|
1835
|
-
addVertex(currentPointR, u1, 1);
|
|
1836
|
-
|
|
1837
|
-
// Bevel join triangle
|
|
1838
|
-
|
|
1839
|
-
addVertex(currentPointR, u, 1);
|
|
1840
|
-
addVertex(nextPointR, u, 0);
|
|
1841
|
-
addVertex(innerPoint, u, 0.5);
|
|
1842
|
-
}
|
|
1843
|
-
} else {
|
|
1844
|
-
// Bevel join triangle. The segment triangles are done in the main loop
|
|
1845
|
-
|
|
1846
|
-
if (joinIsOnLeftSide) {
|
|
1847
|
-
addVertex(currentPointL, u, 0);
|
|
1848
|
-
addVertex(nextPointL, u, 0);
|
|
1849
|
-
addVertex(currentPoint, u, 0.5);
|
|
1850
|
-
} else {
|
|
1851
|
-
addVertex(currentPointR, u, 1);
|
|
1852
|
-
addVertex(nextPointR, u, 0);
|
|
1853
|
-
addVertex(currentPoint, u, 0.5);
|
|
1854
|
-
}
|
|
1855
|
-
}
|
|
1856
|
-
}
|
|
1857
|
-
|
|
1858
|
-
function createSegmentTrianglesWithMiddleSection(
|
|
1859
|
-
joinIsOnLeftSide,
|
|
1860
|
-
innerSideModified
|
|
1861
|
-
) {
|
|
1862
|
-
if (innerSideModified) {
|
|
1863
|
-
if (joinIsOnLeftSide) {
|
|
1864
|
-
addVertex(lastPointR, u0, 1);
|
|
1865
|
-
addVertex(lastPointL, u0, 0);
|
|
1866
|
-
addVertex(currentPointL, u1, 0);
|
|
1867
|
-
|
|
1868
|
-
addVertex(lastPointR, u0, 1);
|
|
1869
|
-
addVertex(currentPointL, u1, 0);
|
|
1870
|
-
addVertex(innerPoint, u1, 1);
|
|
1871
|
-
|
|
1872
|
-
addVertex(currentPointL, u0, 0);
|
|
1873
|
-
addVertex(currentPoint, u1, 0.5);
|
|
1874
|
-
addVertex(innerPoint, u1, 1);
|
|
1875
|
-
|
|
1876
|
-
addVertex(currentPoint, u1, 0.5);
|
|
1877
|
-
addVertex(nextPointL, u0, 0);
|
|
1878
|
-
addVertex(innerPoint, u1, 1);
|
|
1879
|
-
} else {
|
|
1880
|
-
addVertex(lastPointR, u0, 1);
|
|
1881
|
-
addVertex(lastPointL, u0, 0);
|
|
1882
|
-
addVertex(currentPointR, u1, 1);
|
|
1883
|
-
|
|
1884
|
-
addVertex(lastPointL, u0, 0);
|
|
1885
|
-
addVertex(innerPoint, u1, 0);
|
|
1886
|
-
addVertex(currentPointR, u1, 1);
|
|
1887
|
-
|
|
1888
|
-
addVertex(currentPointR, u0, 1);
|
|
1889
|
-
addVertex(innerPoint, u1, 0);
|
|
1890
|
-
addVertex(currentPoint, u1, 0.5);
|
|
1891
|
-
|
|
1892
|
-
addVertex(currentPoint, u1, 0.5);
|
|
1893
|
-
addVertex(innerPoint, u1, 0);
|
|
1894
|
-
addVertex(nextPointR, u0, 1);
|
|
1895
|
-
}
|
|
1896
|
-
}
|
|
1897
|
-
}
|
|
1898
|
-
|
|
1899
|
-
function addCapGeometry(center, p1, p2, joinIsOnLeftSide, start, u) {
|
|
1900
|
-
// param center: End point of the path
|
|
1901
|
-
// param p1, p2: Left and right cap points
|
|
1902
|
-
|
|
1903
|
-
switch (style.strokeLineCap) {
|
|
1904
|
-
case 'round':
|
|
1905
|
-
if (start) {
|
|
1906
|
-
makeCircularSector(center, p2, p1, u, 0.5);
|
|
1907
|
-
} else {
|
|
1908
|
-
makeCircularSector(center, p1, p2, u, 0.5);
|
|
1909
|
-
}
|
|
1910
|
-
|
|
1911
|
-
break;
|
|
1912
|
-
|
|
1913
|
-
case 'square':
|
|
1914
|
-
if (start) {
|
|
1915
|
-
tempV2_1.subVectors(p1, center);
|
|
1916
|
-
tempV2_2.set(tempV2_1.y, -tempV2_1.x);
|
|
1917
|
-
|
|
1918
|
-
tempV2_3.addVectors(tempV2_1, tempV2_2).add(center);
|
|
1919
|
-
tempV2_4.subVectors(tempV2_2, tempV2_1).add(center);
|
|
1920
|
-
|
|
1921
|
-
// Modify already existing vertices
|
|
1922
|
-
if (joinIsOnLeftSide) {
|
|
1923
|
-
tempV2_3.toArray(vertices, 1 * 3);
|
|
1924
|
-
tempV2_4.toArray(vertices, 0 * 3);
|
|
1925
|
-
tempV2_4.toArray(vertices, 3 * 3);
|
|
1926
|
-
} else {
|
|
1927
|
-
tempV2_3.toArray(vertices, 1 * 3);
|
|
1928
|
-
tempV2_3.toArray(vertices, 3 * 3);
|
|
1929
|
-
tempV2_4.toArray(vertices, 0 * 3);
|
|
1930
|
-
}
|
|
1931
|
-
} else {
|
|
1932
|
-
tempV2_1.subVectors(p2, center);
|
|
1933
|
-
tempV2_2.set(tempV2_1.y, -tempV2_1.x);
|
|
1934
|
-
|
|
1935
|
-
tempV2_3.addVectors(tempV2_1, tempV2_2).add(center);
|
|
1936
|
-
tempV2_4.subVectors(tempV2_2, tempV2_1).add(center);
|
|
1937
|
-
|
|
1938
|
-
var vl = vertices.length;
|
|
1939
|
-
|
|
1940
|
-
// Modify already existing vertices
|
|
1941
|
-
if (joinIsOnLeftSide) {
|
|
1942
|
-
tempV2_3.toArray(vertices, vl - 1 * 3);
|
|
1943
|
-
tempV2_4.toArray(vertices, vl - 2 * 3);
|
|
1944
|
-
tempV2_4.toArray(vertices, vl - 4 * 3);
|
|
1945
|
-
} else {
|
|
1946
|
-
tempV2_3.toArray(vertices, vl - 2 * 3);
|
|
1947
|
-
tempV2_4.toArray(vertices, vl - 1 * 3);
|
|
1948
|
-
tempV2_4.toArray(vertices, vl - 4 * 3);
|
|
1949
|
-
}
|
|
1950
|
-
}
|
|
1951
|
-
|
|
1952
|
-
break;
|
|
1953
|
-
|
|
1954
|
-
case 'butt':
|
|
1955
|
-
default:
|
|
1956
|
-
// Nothing to do here
|
|
1957
|
-
break;
|
|
1958
|
-
}
|
|
1959
|
-
}
|
|
1960
|
-
|
|
1961
|
-
function removeDuplicatedPoints(points) {
|
|
1962
|
-
// Creates a new array if necessary with duplicated points removed.
|
|
1963
|
-
// This does not remove duplicated initial and ending points of a closed path.
|
|
1964
|
-
|
|
1965
|
-
var dupPoints = false;
|
|
1966
|
-
for (var i = 1, n = points.length - 1; i < n; i++) {
|
|
1967
|
-
if (points[i].distanceTo(points[i + 1]) < minDistance) {
|
|
1968
|
-
dupPoints = true;
|
|
1969
|
-
break;
|
|
1970
|
-
}
|
|
1971
|
-
}
|
|
1972
|
-
|
|
1973
|
-
if (!dupPoints) return points;
|
|
1974
|
-
|
|
1975
|
-
var newPoints = [];
|
|
1976
|
-
newPoints.push(points[0]);
|
|
1977
|
-
|
|
1978
|
-
for (var i = 1, n = points.length - 1; i < n; i++) {
|
|
1979
|
-
if (points[i].distanceTo(points[i + 1]) >= minDistance) {
|
|
1980
|
-
newPoints.push(points[i]);
|
|
1981
|
-
}
|
|
1982
|
-
}
|
|
1983
|
-
|
|
1984
|
-
newPoints.push(points[points.length - 1]);
|
|
1985
|
-
|
|
1986
|
-
return newPoints;
|
|
1987
|
-
}
|
|
1988
|
-
};
|
|
1989
|
-
})();
|
|
1990
|
-
|
|
1991
|
-
export { SVGLoader };
|