kitchen-simulator 2.0.0 → 2.0.1
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/README.md +24 -1
- package/es/@history.js +2 -0
- package/es/AppContext.js +3 -0
- package/es/LiteKitchenConfigurator.js +480 -0
- package/es/LiteRenderer.js +503 -0
- package/es/actions/area-actions.js +14 -0
- package/es/actions/export.js +36 -0
- package/es/actions/groups-actions.js +89 -0
- package/es/actions/holes-actions.js +119 -0
- package/es/actions/items-actions.js +318 -0
- package/es/actions/lines-actions.js +81 -0
- package/es/actions/project-actions.js +286 -0
- package/es/actions/scene-actions.js +33 -0
- package/es/actions/vertices-actions.js +27 -0
- package/es/actions/viewer2d-actions.js +58 -0
- package/es/actions/viewer3d-actions.js +23 -0
- package/es/analytics/ga4.js +188 -0
- package/es/analytics/posthog.js +60 -0
- package/es/assets/Window.hdr +2100 -0
- package/es/assets/brown_photostudio_02_1k.hdr +0 -0
- package/es/assets/fonts/Rene Bieder Milliard Black Italic.woff +0 -0
- package/es/assets/fonts/Rene Bieder Milliard Black.woff +0 -0
- package/es/assets/fonts/Rene Bieder Milliard Bold Italic.woff +0 -0
- package/es/assets/fonts/Rene Bieder Milliard Bold.woff +0 -0
- package/es/assets/fonts/Rene Bieder Milliard Book Italic.woff +0 -0
- package/es/assets/fonts/Rene Bieder Milliard Book.woff +0 -0
- package/es/assets/fonts/Rene Bieder Milliard ExtraBold Italic.woff +0 -0
- package/es/assets/fonts/Rene Bieder Milliard ExtraBold.woff +0 -0
- package/es/assets/fonts/Rene Bieder Milliard ExtraLight Italic.woff +0 -0
- package/es/assets/fonts/Rene Bieder Milliard ExtraLight.woff +0 -0
- package/es/assets/fonts/Rene Bieder Milliard Hairline Italic.woff +0 -0
- package/es/assets/fonts/Rene Bieder Milliard Hairline.woff +0 -0
- package/es/assets/fonts/Rene Bieder Milliard Heavy Italic.woff +0 -0
- package/es/assets/fonts/Rene Bieder Milliard Heavy.woff +0 -0
- package/es/assets/fonts/Rene Bieder Milliard Light Italic.woff +0 -0
- package/es/assets/fonts/Rene Bieder Milliard Light.woff +0 -0
- package/es/assets/fonts/Rene Bieder Milliard Medium Italic.woff +0 -0
- package/es/assets/fonts/Rene Bieder Milliard Medium.woff +0 -0
- package/es/assets/fonts/Rene Bieder Milliard SemiBold Italic.woff +0 -0
- package/es/assets/fonts/Rene Bieder Milliard SemiBold.woff +0 -0
- package/es/assets/fonts/Rene Bieder Milliard Thin Italic.woff +0 -0
- package/es/assets/fonts/Rene Bieder Milliard Thin.woff +0 -0
- package/es/assets/fonts/style.css +177 -0
- package/es/assets/gltf/door_closet.bin +0 -0
- package/es/assets/gltf/door_closet.fbx +0 -0
- package/es/assets/gltf/door_closet.gltf +1 -0
- package/es/assets/gltf/door_exterior.bin +0 -0
- package/es/assets/gltf/door_exterior.fbx +0 -0
- package/es/assets/gltf/door_exterior.gltf +1 -0
- package/es/assets/gltf/door_interior.bin +0 -0
- package/es/assets/gltf/door_interior.fbx +0 -0
- package/es/assets/gltf/door_interior.gltf +1 -0
- package/es/assets/gltf/door_sliding.bin +0 -0
- package/es/assets/gltf/door_sliding.fbx +0 -0
- package/es/assets/gltf/door_sliding.gltf +1 -0
- package/es/assets/gltf/doorway_framed.bin +0 -0
- package/es/assets/gltf/doorway_framed.fbx +0 -0
- package/es/assets/gltf/doorway_framed.gltf +1 -0
- package/es/assets/gltf/window_clear.bin +0 -0
- package/es/assets/gltf/window_clear.fbx +0 -0
- package/es/assets/gltf/window_clear.gltf +1 -0
- package/es/assets/gltf/window_cross.bin +0 -0
- package/es/assets/gltf/window_cross.fbx +0 -0
- package/es/assets/gltf/window_cross.gltf +1 -0
- package/es/assets/gltf/window_double_hung.bin +0 -0
- package/es/assets/gltf/window_double_hung.fbx +0 -0
- package/es/assets/gltf/window_double_hung.gltf +1 -0
- package/es/assets/gltf/window_vertical.bin +0 -0
- package/es/assets/gltf/window_vertical.fbx +0 -0
- package/es/assets/gltf/window_vertical.gltf +1 -0
- package/es/assets/img/1.jpg +0 -0
- package/es/assets/img/TKC_thumbnail.png +0 -0
- package/es/assets/img/Toggle.png +0 -0
- package/es/assets/img/loading/loading.gif +0 -0
- package/es/assets/img/loading/loading_1.svg +11 -0
- package/es/assets/img/loading_large.gif +0 -0
- package/es/assets/img/png/door/closet.png +0 -0
- package/es/assets/img/png/door/doorwaysframed.png +0 -0
- package/es/assets/img/png/door/doorwaysframeles.png +0 -0
- package/es/assets/img/png/door/doorwaysframeless.png +0 -0
- package/es/assets/img/png/door/exterior.png +0 -0
- package/es/assets/img/png/door/interior.png +0 -0
- package/es/assets/img/png/door/sliding.png +0 -0
- package/es/assets/img/png/helper/outcome.png +0 -0
- package/es/assets/img/png/helper/video_preview_3d.png +0 -0
- package/es/assets/img/png/helper/video_preview_start.png +0 -0
- package/es/assets/img/project_img.png +0 -0
- package/es/assets/img/rta/rta_logo_box_blue.jpg +0 -0
- package/es/assets/img/rta/rta_logo_box_blue_ico.jpg +0 -0
- package/es/assets/img/rta/rta_logo_box_blue_ico.svg +55 -0
- package/es/assets/img/rta/rta_logo_box_darkGray.jpg +0 -0
- package/es/assets/img/rta/rta_logo_box_lightblue.png +0 -0
- package/es/assets/img/rta/rta_logo_box_lightmaroon.png +0 -0
- package/es/assets/img/rta/rta_logo_box_maroon.png +0 -0
- package/es/assets/img/rta/rta_logo_box_white.png +0 -0
- package/es/assets/img/rta_menu.png +0 -0
- package/es/assets/img/step2.jpg +0 -0
- package/es/assets/img/step3.jpg +0 -0
- package/es/assets/img/step4.jpg +0 -0
- package/es/assets/img/step5.jpg +0 -0
- package/es/assets/img/step6.jpg +0 -0
- package/es/assets/img/step7.jpg +0 -0
- package/es/assets/img/step8.jpg +0 -0
- package/es/assets/img/svg/2d_delete_object.svg +33 -0
- package/es/assets/img/svg/2d_delete_object1.svg +33 -0
- package/es/assets/img/svg/2d_lock_object.svg +33 -0
- package/es/assets/img/svg/3d_item_move.svg +106 -0
- package/es/assets/img/svg/3d_item_rotation.svg +76 -0
- package/es/assets/img/svg/3d_item_warning_edit.svg +77 -0
- package/es/assets/img/svg/3d_item_warning_info.svg +81 -0
- package/es/assets/img/svg/accessories.svg +4 -0
- package/es/assets/img/svg/angle_icon.svg +39 -0
- package/es/assets/img/svg/blank_div.svg +14 -0
- package/es/assets/img/svg/bottombar/2d3d_button.svg +3 -0
- package/es/assets/img/svg/bottombar/2d3d_button_active.svg +3 -0
- package/es/assets/img/svg/bottombar/2d3d_toggle.svg +4 -0
- package/es/assets/img/svg/bottombar/2d3d_toggle_active.svg +4 -0
- package/es/assets/img/svg/bottombar/arrow-down.svg +3 -0
- package/es/assets/img/svg/bottombar/arrow-left.svg +3 -0
- package/es/assets/img/svg/bottombar/arrow-minus.svg +3 -0
- package/es/assets/img/svg/bottombar/arrow-plus.svg +11 -0
- package/es/assets/img/svg/bottombar/arrow-right.svg +3 -0
- package/es/assets/img/svg/bottombar/arrow-up.svg +3 -0
- package/es/assets/img/svg/bottombar/collapse.svg +3 -0
- package/es/assets/img/svg/bottombar/elevation-back.svg +6 -0
- package/es/assets/img/svg/bottombar/elevation-front.svg +6 -0
- package/es/assets/img/svg/bottombar/elevation-left.svg +6 -0
- package/es/assets/img/svg/bottombar/elevation-right.svg +7 -0
- package/es/assets/img/svg/bottombar/elevation.svg +6 -0
- package/es/assets/img/svg/bottombar/expand.svg +3 -0
- package/es/assets/img/svg/bottombar/help.svg +72 -0
- package/es/assets/img/svg/bottombar/incm_toggle.svg +39 -0
- package/es/assets/img/svg/bottombar/pan_1.svg +57 -0
- package/es/assets/img/svg/bottombar/pan_2.svg +27 -0
- package/es/assets/img/svg/bottombar/pan_3.svg +27 -0
- package/es/assets/img/svg/bottombar/pan_4.svg +27 -0
- package/es/assets/img/svg/bottombar/pan_5.svg +27 -0
- package/es/assets/img/svg/bottombar/settings.svg +23 -0
- package/es/assets/img/svg/bottombar/spin-down.svg +76 -0
- package/es/assets/img/svg/bottombar/spin-left.svg +75 -0
- package/es/assets/img/svg/bottombar/spin-right.svg +75 -0
- package/es/assets/img/svg/bottombar/spin-up.svg +76 -0
- package/es/assets/img/svg/bottombar/spin_1.svg +48 -0
- package/es/assets/img/svg/bottombar/spin_2.svg +31 -0
- package/es/assets/img/svg/bottombar/spin_3.svg +31 -0
- package/es/assets/img/svg/bottombar/spin_4.svg +31 -0
- package/es/assets/img/svg/bottombar/spin_5.svg +31 -0
- package/es/assets/img/svg/bottombar/zoomin.svg +29 -0
- package/es/assets/img/svg/bottombar/zoomout.svg +26 -0
- package/es/assets/img/svg/check.svg +10 -0
- package/es/assets/img/svg/close.svg +11 -0
- package/es/assets/img/svg/color/Black.svg +3 -0
- package/es/assets/img/svg/color/Blue.svg +3 -0
- package/es/assets/img/svg/color/Brown.svg +9 -0
- package/es/assets/img/svg/color/Cream.svg +3 -0
- package/es/assets/img/svg/color/Dark.svg +9 -0
- package/es/assets/img/svg/color/Gray.svg +3 -0
- package/es/assets/img/svg/color/Green.svg +3 -0
- package/es/assets/img/svg/color/Light.svg +9 -0
- package/es/assets/img/svg/color/Medium.svg +9 -0
- package/es/assets/img/svg/color/Unfinished.svg +9 -0
- package/es/assets/img/svg/color/White.svg +3 -0
- package/es/assets/img/svg/color/White.svg.bak +3 -0
- package/es/assets/img/svg/color/stone2.jpg +0 -0
- package/es/assets/img/svg/color/wood2.jpg +0 -0
- package/es/assets/img/svg/copy.svg +11 -0
- package/es/assets/img/svg/delete.svg +3 -0
- package/es/assets/img/svg/detail.svg +77 -0
- package/es/assets/img/svg/disclaimer/background.svg +758 -0
- package/es/assets/img/svg/disclaimer/logo-dots.svg +11 -0
- package/es/assets/img/svg/door/Closet.svg +11 -0
- package/es/assets/img/svg/door/Exterior.svg +5 -0
- package/es/assets/img/svg/door/Framed_dorway.svg +5 -0
- package/es/assets/img/svg/door/Frameless_dorway.svg +5 -0
- package/es/assets/img/svg/door/Interior.svg +7 -0
- package/es/assets/img/svg/door/Sliding.svg +5 -0
- package/es/assets/img/svg/doors_closet.svg +47 -0
- package/es/assets/img/svg/doors_exterior.svg +25 -0
- package/es/assets/img/svg/doors_interior.svg +29 -0
- package/es/assets/img/svg/doors_patio.svg +26 -0
- package/es/assets/img/svg/duplicate.svg +11 -0
- package/es/assets/img/svg/duplicate_object_left.svg +32 -0
- package/es/assets/img/svg/duplicate_object_right.svg +32 -0
- package/es/assets/img/svg/filtersActive.svg +19 -0
- package/es/assets/img/svg/firstsetting/L.svg +3 -0
- package/es/assets/img/svg/firstsetting/L2.svg +3 -0
- package/es/assets/img/svg/firstsetting/Open.svg +3 -0
- package/es/assets/img/svg/firstsetting/Square.svg +3 -0
- package/es/assets/img/svg/firstsetting/bar-active.svg +9 -0
- package/es/assets/img/svg/firstsetting/bar-normal.svg +3 -0
- package/es/assets/img/svg/firstsetting/bullet-current.svg +3 -0
- package/es/assets/img/svg/firstsetting/bullet-done.svg +3 -0
- package/es/assets/img/svg/firstsetting/bullet-not-done.svg +3 -0
- package/es/assets/img/svg/firstsetting/check-active.svg +3 -0
- package/es/assets/img/svg/firstsetting/check-normal.svg +3 -0
- package/es/assets/img/svg/firstsetting/pencil.svg +11 -0
- package/es/assets/img/svg/green_checkmark.svg +27 -0
- package/es/assets/img/svg/headerbar/assist.svg +3 -0
- package/es/assets/img/svg/headerbar/cart.svg +3 -0
- package/es/assets/img/svg/headerbar/check.svg +10 -0
- package/es/assets/img/svg/headerbar/consult_designer.svg +45 -0
- package/es/assets/img/svg/headerbar/edit_name.svg +26 -0
- package/es/assets/img/svg/headerbar/file-dollar.svg +13 -0
- package/es/assets/img/svg/headerbar/hamburger_menu.svg +32 -0
- package/es/assets/img/svg/headerbar/plus.svg +11 -0
- package/es/assets/img/svg/headerbar/review_quote.svg +44 -0
- package/es/assets/img/svg/headerbar/ruler-measure.svg +11 -0
- package/es/assets/img/svg/headerbar/save.svg +3 -0
- package/es/assets/img/svg/headerbar/setting.svg +75 -0
- package/es/assets/img/svg/help/check.svg +10 -0
- package/es/assets/img/svg/help/search.svg +76 -0
- package/es/assets/img/svg/intro/1-start-with-floorplan-whole.svg +27 -0
- package/es/assets/img/svg/intro/1-start-with-floorplan.svg +26 -0
- package/es/assets/img/svg/intro/2-start-from-scratch-whole.svg +28 -0
- package/es/assets/img/svg/intro/2-start-from-scratch.svg +27 -0
- package/es/assets/img/svg/intro/3-retrieve-project-whole.svg +19 -0
- package/es/assets/img/svg/intro/3-retrieve-project.svg +18 -0
- package/es/assets/img/svg/invert.svg +127 -0
- package/es/assets/img/svg/lefttoolbar/appliance-active.svg +13 -0
- package/es/assets/img/svg/lefttoolbar/appliance.svg +13 -0
- package/es/assets/img/svg/lefttoolbar/cabinet-active.svg +10 -0
- package/es/assets/img/svg/lefttoolbar/cabinet-category.svg +3 -0
- package/es/assets/img/svg/lefttoolbar/cabinet-one.svg +3 -0
- package/es/assets/img/svg/lefttoolbar/cabinet.svg +10 -0
- package/es/assets/img/svg/lefttoolbar/disigner_assistance.svg +89 -0
- package/es/assets/img/svg/lefttoolbar/door-style-active.svg +20 -0
- package/es/assets/img/svg/lefttoolbar/door-style.svg +20 -0
- package/es/assets/img/svg/lefttoolbar/door.svg +12 -0
- package/es/assets/img/svg/lefttoolbar/error_icon.svg +81 -0
- package/es/assets/img/svg/lefttoolbar/finishing-active.svg +13 -0
- package/es/assets/img/svg/lefttoolbar/finishing.svg +13 -0
- package/es/assets/img/svg/lefttoolbar/reviewforquote-active.svg +86 -0
- package/es/assets/img/svg/lefttoolbar/reviewforquote.svg +12 -0
- package/es/assets/img/svg/lefttoolbar/room-shape-L.svg +3 -0
- package/es/assets/img/svg/lefttoolbar/room-shape-active.svg +18 -0
- package/es/assets/img/svg/lefttoolbar/room-shape-custom.svg +12 -0
- package/es/assets/img/svg/lefttoolbar/room-shape-irregular.svg +3 -0
- package/es/assets/img/svg/lefttoolbar/room-shape-open.svg +3 -0
- package/es/assets/img/svg/lefttoolbar/room-shape-square.svg +3 -0
- package/es/assets/img/svg/lefttoolbar/room-shape.svg +18 -0
- package/es/assets/img/svg/lefttoolbar/search.svg +76 -0
- package/es/assets/img/svg/lefttoolbar/view_more.svg +86 -0
- package/es/assets/img/svg/lefttoolbar/warning_icon.svg +81 -0
- package/es/assets/img/svg/lefttoolbar/window.svg +12 -0
- package/es/assets/img/svg/logo.svg +11 -0
- package/es/assets/img/svg/logo_with_text.svg +25 -0
- package/es/assets/img/svg/menubar/login.svg +84 -0
- package/es/assets/img/svg/menubar/my_projects.svg +85 -0
- package/es/assets/img/svg/menubar/new_project.svg +110 -0
- package/es/assets/img/svg/menubar/save_project.svg +84 -0
- package/es/assets/img/svg/options.svg +3 -0
- package/es/assets/img/svg/positioning.svg +3 -0
- package/es/assets/img/svg/rotate.png +0 -0
- package/es/assets/img/svg/rotate.svg +17 -0
- package/es/assets/img/svg/rotate_object_clockwise.svg +26 -0
- package/es/assets/img/svg/rotate_object_counterclockwise.svg +26 -0
- package/es/assets/img/svg/toggleFilters.svg +19 -0
- package/es/assets/img/svg/toolbar/add_appliances_active.svg +64 -0
- package/es/assets/img/svg/toolbar/add_appliances_inactive.svg +52 -0
- package/es/assets/img/svg/toolbar/add_button.svg +36 -0
- package/es/assets/img/svg/toolbar/add_cabinets_active.svg +59 -0
- package/es/assets/img/svg/toolbar/add_cabinets_inactive.svg +49 -0
- package/es/assets/img/svg/toolbar/add_items_doors.svg +25 -0
- package/es/assets/img/svg/toolbar/add_items_doorways.svg +24 -0
- package/es/assets/img/svg/toolbar/add_items_refrigerator.svg +32 -0
- package/es/assets/img/svg/toolbar/add_items_windows.svg +28 -0
- package/es/assets/img/svg/toolbar/apply_button.svg +38 -0
- package/es/assets/img/svg/toolbar/arrow-plus.svg +11 -0
- package/es/assets/img/svg/toolbar/backsplash.svg +8 -0
- package/es/assets/img/svg/toolbar/cancel_button.svg +37 -0
- package/es/assets/img/svg/toolbar/consult_a_designer_button.svg +47 -0
- package/es/assets/img/svg/toolbar/countertop.svg +7 -0
- package/es/assets/img/svg/toolbar/dcm.png +0 -0
- package/es/assets/img/svg/toolbar/dcm_off.svg +12 -0
- package/es/assets/img/svg/toolbar/dcm_on.svg +474 -0
- package/es/assets/img/svg/toolbar/delete_button.svg +37 -0
- package/es/assets/img/svg/toolbar/download.svg +77 -0
- package/es/assets/img/svg/toolbar/draw_custom_floor.svg +31 -0
- package/es/assets/img/svg/toolbar/edit_button.svg +75 -0
- package/es/assets/img/svg/toolbar/email_quote_button.svg +44 -0
- package/es/assets/img/svg/toolbar/fbm.png +0 -0
- package/es/assets/img/svg/toolbar/finishing_touches_active.svg +54 -0
- package/es/assets/img/svg/toolbar/finishing_touches_inactive.svg +42 -0
- package/es/assets/img/svg/toolbar/floorstyle.svg +9 -0
- package/es/assets/img/svg/toolbar/fmb.png +0 -0
- package/es/assets/img/svg/toolbar/fmb_off.svg +12 -0
- package/es/assets/img/svg/toolbar/fmb_on.svg +489 -0
- package/es/assets/img/svg/toolbar/furnishings_icon.svg +6 -0
- package/es/assets/img/svg/toolbar/get_started_button.svg +41 -0
- package/es/assets/img/svg/toolbar/handles.svg +5 -0
- package/es/assets/img/svg/toolbar/lighting.svg +7 -0
- package/es/assets/img/svg/toolbar/lrm.png +0 -0
- package/es/assets/img/svg/toolbar/lrm_off.svg +12 -0
- package/es/assets/img/svg/toolbar/lrm_on.svg +470 -0
- package/es/assets/img/svg/toolbar/make_floorplan_active.svg +66 -0
- package/es/assets/img/svg/toolbar/make_floorplan_inactive.svg +52 -0
- package/es/assets/img/svg/toolbar/predefined_room_l_shaped.svg +20 -0
- package/es/assets/img/svg/toolbar/predefined_room_layout.svg +20 -0
- package/es/assets/img/svg/toolbar/predefined_room_long_narrow.svg +20 -0
- package/es/assets/img/svg/toolbar/predefined_room_open_l_shape.svg +20 -0
- package/es/assets/img/svg/toolbar/predefined_room_open_pentagon.svg +20 -0
- package/es/assets/img/svg/toolbar/predefined_room_open_rectangle.svg +20 -0
- package/es/assets/img/svg/toolbar/predefined_room_open_rectangle_2.svg +20 -0
- package/es/assets/img/svg/toolbar/predefined_room_pentagon.svg +20 -0
- package/es/assets/img/svg/toolbar/predefined_room_rectangle.svg +20 -0
- package/es/assets/img/svg/toolbar/predefined_room_rectangle_with_alcove.svg +20 -0
- package/es/assets/img/svg/toolbar/redo_button.svg +75 -0
- package/es/assets/img/svg/toolbar/redo_button1.svg +75 -0
- package/es/assets/img/svg/toolbar/review_quote_active.svg +14 -0
- package/es/assets/img/svg/toolbar/review_quote_inactive.svg +44 -0
- package/es/assets/img/svg/toolbar/save_project_button.svg +44 -0
- package/es/assets/img/svg/toolbar/select_doorstyle_active.svg +67 -0
- package/es/assets/img/svg/toolbar/select_doorstyle_inactive.svg +57 -0
- package/es/assets/img/svg/toolbar/shopping-cart.svg +13 -0
- package/es/assets/img/svg/toolbar/style_change_button.svg +47 -0
- package/es/assets/img/svg/toolbar/take_picture.svg +75 -0
- package/es/assets/img/svg/toolbar/undo_button.svg +76 -0
- package/es/assets/img/svg/toolbar/undo_button1.svg +76 -0
- package/es/assets/img/svg/toolbar/use_button.svg +37 -0
- package/es/assets/img/svg/toolbar/wall_color_icon.svg +6 -0
- package/es/assets/img/svg/topbar/edit_active.svg +10 -0
- package/es/assets/img/svg/topbar/edit_inactive.svg +10 -0
- package/es/assets/img/svg/topbar/redo_active.svg +42 -0
- package/es/assets/img/svg/topbar/redo_inactive.svg +23 -0
- package/es/assets/img/svg/topbar/select_all_active.svg +50 -0
- package/es/assets/img/svg/topbar/select_all_inactive.svg +32 -0
- package/es/assets/img/svg/topbar/take_picture_active.svg +51 -0
- package/es/assets/img/svg/topbar/take_picture_inactive.svg +26 -0
- package/es/assets/img/svg/topbar/undo_active.svg +42 -0
- package/es/assets/img/svg/topbar/undo_inactive.svg +23 -0
- package/es/assets/img/svg/warning_info_2d.svg +81 -0
- package/es/assets/img/svg/window/Clear.svg +3 -0
- package/es/assets/img/svg/window/Cross.svg +5 -0
- package/es/assets/img/svg/window/Double_hung.svg +4 -0
- package/es/assets/img/svg/window/Vertical.svg +4 -0
- package/es/assets/img/svg/windows_clear.svg +23 -0
- package/es/assets/img/svg/windows_cross.svg +28 -0
- package/es/assets/img/svg/windows_double_hung.svg +24 -0
- package/es/assets/img/svg/windows_vertical.svg +24 -0
- package/es/assets/img/svg/wizardstep/Custom.svg +3 -0
- package/es/assets/img/svg/wizardstep/Dashed_line.svg +3 -0
- package/es/assets/img/svg/wizardstep/L.svg +3 -0
- package/es/assets/img/svg/wizardstep/L2.svg +3 -0
- package/es/assets/img/svg/wizardstep/Open.svg +3 -0
- package/es/assets/img/svg/wizardstep/Square.svg +3 -0
- package/es/assets/img/svg/wizardstep/bar-active.svg +9 -0
- package/es/assets/img/svg/wizardstep/bar-normal.svg +3 -0
- package/es/assets/img/svg/wizardstep/bullet-current.svg +3 -0
- package/es/assets/img/svg/wizardstep/bullet-done.svg +3 -0
- package/es/assets/img/svg/wizardstep/bullet-not-done.svg +3 -0
- package/es/assets/img/svg/wizardstep/check-active.svg +3 -0
- package/es/assets/img/svg/wizardstep/check-normal.svg +3 -0
- package/es/assets/img/svg/wizardstep/detail_view.svg +87 -0
- package/es/assets/img/svg/wizardstep/pencil.svg +11 -0
- package/es/assets/img/svg/wizardstep/tile_view.svg +95 -0
- package/es/assets/img/texture/glass.jpg +0 -0
- package/es/assets/img/texture/steel.jpg +0 -0
- package/es/assets/img/texture/white1px.jpg +0 -0
- package/es/assets/img/texture/wood.jpg +0 -0
- package/es/assets/model/DCM.bin +0 -0
- package/es/assets/model/DCM.fbx +0 -0
- package/es/assets/model/DCM.gltf +1 -0
- package/es/assets/model/FBM.bin +0 -0
- package/es/assets/model/FBM.fbx +0 -0
- package/es/assets/model/FBM.gltf +1 -0
- package/es/assets/model/LRM.bin +0 -0
- package/es/assets/model/LRM.fbx +0 -0
- package/es/assets/model/LRM.gltf +1 -0
- package/es/assets/rtastore_logo.png +0 -0
- package/es/catalog/areas/area/planner-element.js +45 -0
- package/es/catalog/areas/area/textures/ceramic-tile.jpg +0 -0
- package/es/catalog/areas/area/textures/grass.jpg +0 -0
- package/es/catalog/areas/area/textures/parquet.jpg +0 -0
- package/es/catalog/areas/area/textures/strand-porcelain.jpg +0 -0
- package/es/catalog/areas/area/textures/tile1.jpg +0 -0
- package/es/catalog/back.png +0 -0
- package/es/catalog/catalog.js +265 -0
- package/es/catalog/doors.png +0 -0
- package/es/catalog/doorways.png +0 -0
- package/es/catalog/envMap/nx.hdr +0 -0
- package/es/catalog/envMap/ny.hdr +0 -0
- package/es/catalog/envMap/nz.hdr +0 -0
- package/es/catalog/envMap/px.hdr +0 -0
- package/es/catalog/envMap/py.hdr +0 -0
- package/es/catalog/envMap/pz.hdr +0 -0
- package/es/catalog/export.js +0 -0
- package/es/catalog/factories/area-factory-3d.js +181 -0
- package/es/catalog/factories/area-factory.js +78 -0
- package/es/catalog/factories/export.js +7 -0
- package/es/catalog/factories/wall-factory-3d.js +202 -0
- package/es/catalog/factories/wall-factory.js +267 -0
- package/es/catalog/holes/door-closet/planner-element.js +222 -0
- package/es/catalog/holes/door-double/door_double.png +0 -0
- package/es/catalog/holes/door-double/planner-element.js +315 -0
- package/es/catalog/holes/door-exterior/planner-element.js +215 -0
- package/es/catalog/holes/door-interior/planner-element.js +227 -0
- package/es/catalog/holes/door-panic/panicDoor.png +0 -0
- package/es/catalog/holes/door-panic/planner-element.js +503 -0
- package/es/catalog/holes/door-panic-double/panicDoorDouble.png +0 -0
- package/es/catalog/holes/door-panic-double/planner-element.js +463 -0
- package/es/catalog/holes/door-sliding/planner-element.js +225 -0
- package/es/catalog/holes/doorway-framed/planner-element.js +145 -0
- package/es/catalog/holes/doorway-frameless/planner-element.js +104 -0
- package/es/catalog/holes/export.js +13 -0
- package/es/catalog/holes/gate/gate.jpg +0 -0
- package/es/catalog/holes/window-clear/planner-element.js +166 -0
- package/es/catalog/holes/window-clear/texture.png +0 -0
- package/es/catalog/holes/window-cross/planner-element.js +165 -0
- package/es/catalog/holes/window-cross/texture.png +0 -0
- package/es/catalog/holes/window-double-hung/planner-element.js +303 -0
- package/es/catalog/holes/window-double-hung/texture.png +0 -0
- package/es/catalog/holes/window-vertical/planner-element.js +276 -0
- package/es/catalog/holes/window-vertical/texture.png +0 -0
- package/es/catalog/lines/wall/planner-element.js +79 -0
- package/es/catalog/lines/wall/textures/bricks-normal.jpg +0 -0
- package/es/catalog/lines/wall/textures/bricks-normal2.jpg +0 -0
- package/es/catalog/lines/wall/textures/bricks.jpg +0 -0
- package/es/catalog/lines/wall/textures/bricks2.jpg +0 -0
- package/es/catalog/lines/wall/textures/bricks3.jpg +0 -0
- package/es/catalog/lines/wall/textures/morden-normal.jpg +0 -0
- package/es/catalog/lines/wall/textures/morden.jpg +0 -0
- package/es/catalog/lines/wall/textures/painted-normal.jpg +0 -0
- package/es/catalog/lines/wall/textures/painted.jpg +0 -0
- package/es/catalog/lines/wall/textures/plaster-normal.jpg +0 -0
- package/es/catalog/lines/wall/textures/plaster.jpg +0 -0
- package/es/catalog/lines/wall/wall.png +0 -0
- package/es/catalog/molding/molding-dcm/planner-element.js +26 -0
- package/es/catalog/molding/molding-dcm/texture.png +0 -0
- package/es/catalog/molding/molding-fbm/planner-element.js +26 -0
- package/es/catalog/molding/molding-fbm/texture.png +0 -0
- package/es/catalog/molding/molding-lrm/planner-element.js +26 -0
- package/es/catalog/molding/molding-lrm/texture.png +0 -0
- package/es/catalog/properties/export.js +21 -0
- package/es/catalog/properties/property-checkbox.js +68 -0
- package/es/catalog/properties/property-color.js +39 -0
- package/es/catalog/properties/property-enum.js +50 -0
- package/es/catalog/properties/property-hidden.js +19 -0
- package/es/catalog/properties/property-lenght-measure.js +100 -0
- package/es/catalog/properties/property-length-measure.js +84 -0
- package/es/catalog/properties/property-length-measure_hole.js +100 -0
- package/es/catalog/properties/property-number.js +48 -0
- package/es/catalog/properties/property-read-only.js +26 -0
- package/es/catalog/properties/property-string.js +48 -0
- package/es/catalog/properties/property-toggle.js +39 -0
- package/es/catalog/properties/shared-property-style.js +14 -0
- package/es/catalog/utils/FuseUtils.js +79 -0
- package/es/catalog/utils/exporter.js +149 -0
- package/es/catalog/utils/geom-utils.js +189 -0
- package/es/catalog/utils/item-loader.js +1594 -0
- package/es/catalog/utils/load-obj.js +91 -0
- package/es/catalog/utils/mtl-loader.js +357 -0
- package/es/catalog/utils/obj-loader.js +476 -0
- package/es/catalog/windows.png +0 -0
- package/es/class/FuseUtils.js +79 -0
- package/es/class/area.js +141 -0
- package/es/class/export.js +24 -0
- package/es/class/group.js +431 -0
- package/es/class/guide.js +58 -0
- package/es/class/hole.js +926 -0
- package/es/class/item.js +1845 -0
- package/es/class/layer.js +663 -0
- package/es/class/line.js +1221 -0
- package/es/class/project.js +795 -0
- package/es/class/vertex.js +198 -0
- package/es/components/content.js +131 -0
- package/es/components/export.js +7 -0
- package/es/components/style/button.js +106 -0
- package/es/components/style/cancel-button.js +21 -0
- package/es/components/style/content-container.js +30 -0
- package/es/components/style/content-title.js +25 -0
- package/es/components/style/delete-button.js +24 -0
- package/es/components/style/export.js +31 -0
- package/es/components/style/form-block.js +20 -0
- package/es/components/style/form-color-input.js +26 -0
- package/es/components/style/form-label.js +22 -0
- package/es/components/style/form-number-input.js +183 -0
- package/es/components/style/form-number-input_2.js +200 -0
- package/es/components/style/form-select.js +19 -0
- package/es/components/style/form-slider.js +60 -0
- package/es/components/style/form-submit-button.js +25 -0
- package/es/components/style/form-text-input.js +69 -0
- package/es/components/viewer2d/area.js +81 -0
- package/es/components/viewer2d/export.js +31 -0
- package/es/components/viewer2d/grids/grid-horizontal-streak.js +36 -0
- package/es/components/viewer2d/grids/grid-streak.js +36 -0
- package/es/components/viewer2d/grids/grid-vertical-streak.js +36 -0
- package/es/components/viewer2d/grids/grids.js +30 -0
- package/es/components/viewer2d/group.js +53 -0
- package/es/components/viewer2d/item.js +447 -0
- package/es/components/viewer2d/layer.js +164 -0
- package/es/components/viewer2d/line.js +964 -0
- package/es/components/viewer2d/ruler.js +79 -0
- package/es/components/viewer2d/rulerDist.js +132 -0
- package/es/components/viewer2d/rulerX.js +145 -0
- package/es/components/viewer2d/rulerY.js +147 -0
- package/es/components/viewer2d/scene.js +128 -0
- package/es/components/viewer2d/snap.js +74 -0
- package/es/components/viewer2d/state.js +73 -0
- package/es/components/viewer2d/utils.js +187 -0
- package/es/components/viewer2d/vertex.js +65 -0
- package/es/components/viewer2d/viewer2d.js +1433 -0
- package/es/components/viewer3d/camera-controls-module/camera-controls.module.js +2585 -0
- package/es/components/viewer3d/dcm.js +401 -0
- package/es/components/viewer3d/fbm.js +414 -0
- package/es/components/viewer3d/front3D.js +61 -0
- package/es/components/viewer3d/grid-creator.js +25 -0
- package/es/components/viewer3d/grids/grid-horizontal-streak.js +36 -0
- package/es/components/viewer3d/grids/grid-streak.js +27 -0
- package/es/components/viewer3d/grids/grid-vertical-streak.js +36 -0
- package/es/components/viewer3d/libs/first-person-controls.js +67 -0
- package/es/components/viewer3d/libs/helvetiker_regular.typeface.js +1281 -0
- package/es/components/viewer3d/libs/mtl-loader.js +357 -0
- package/es/components/viewer3d/libs/obj-loader.js +462 -0
- package/es/components/viewer3d/libs/orbit-controls.js +697 -0
- package/es/components/viewer3d/libs/pointer-lock-controls.js +44 -0
- package/es/components/viewer3d/lrm.js +305 -0
- package/es/components/viewer3d/model.js +708 -0
- package/es/components/viewer3d/pointer-lock-navigation.js +115 -0
- package/es/components/viewer3d/ruler-utils/itemRect.js +61 -0
- package/es/components/viewer3d/ruler-utils/layer3D.js +495 -0
- package/es/components/viewer3d/ruler-utils/ruler3D.js +224 -0
- package/es/components/viewer3d/ruler-utils/scene3D.js +59 -0
- package/es/components/viewer3d/ruler-utils/state3D.js +18 -0
- package/es/components/viewer3d/scene-creator.js +3617 -0
- package/es/components/viewer3d/three-memory-cleaner.js +51 -0
- package/es/components/viewer3d/viewer3d-first-person.js +309 -0
- package/es/components/viewer3d/viewer3d.js +2654 -0
- package/es/constants.js +688 -0
- package/es/devLiteRenderer.js +316 -0
- package/es/index.js +56 -0
- package/es/models.js +506 -0
- package/es/plugins/SVGLoader.js +1412 -0
- package/es/plugins/console-debugger.js +34 -0
- package/es/plugins/export.js +7 -0
- package/es/plugins/keyboard.js +101 -0
- package/es/reducers/areas-reducer.js +12 -0
- package/es/reducers/export.js +25 -0
- package/es/reducers/groups-reducer.js +38 -0
- package/es/reducers/holes-reducer.js +62 -0
- package/es/reducers/items-reducer.js +147 -0
- package/es/reducers/lines-reducer.js +45 -0
- package/es/reducers/project-reducer.js +131 -0
- package/es/reducers/reducer.js +19 -0
- package/es/reducers/scene-reducer.js +28 -0
- package/es/reducers/user-reducer.js +41 -0
- package/es/reducers/vertices-reducer.js +19 -0
- package/es/reducers/viewer2d-reducer.js +75 -0
- package/es/reducers/viewer3d-reducer.js +56 -0
- package/es/shared-style.js +66 -0
- package/es/styles/export.js +5 -0
- package/es/styles/tabs.css +40 -0
- package/es/translator/en.js +104 -0
- package/es/translator/it.js +79 -0
- package/es/translator/ru.js +79 -0
- package/es/translator/translator.js +80 -0
- package/es/utils/browser.js +33 -0
- package/es/utils/convert-units-lite.js +29 -0
- package/es/utils/email-validator.js +4 -0
- package/es/utils/export.js +25 -0
- package/es/utils/geometry.js +2446 -0
- package/es/utils/get-edges-of-subgraphs.js +26 -0
- package/es/utils/graph-cycles.js +238 -0
- package/es/utils/graph-inner-cycles.js +46 -0
- package/es/utils/graph.js +145 -0
- package/es/utils/helper.js +334 -0
- package/es/utils/history.js +29 -0
- package/es/utils/id-broker.js +15 -0
- package/es/utils/isolate-event-handler.js +683 -0
- package/es/utils/logger.js +8 -0
- package/es/utils/math.js +50 -0
- package/es/utils/molding.js +865 -0
- package/es/utils/name-generator.js +14 -0
- package/es/utils/objects-utils.js +50 -0
- package/es/utils/phone-validator.js +4 -0
- package/es/utils/process-black-list.js +15 -0
- package/es/utils/react-if.js +18 -0
- package/es/utils/snap-scene.js +94 -0
- package/es/utils/snap.js +231 -0
- package/es/utils/summarizeCart.js +24 -0
- package/es/utils/threeCSG.es6.js +494 -0
- package/es/version.js +1 -0
- package/lib/@history.js +11 -0
- package/lib/AppContext.js +11 -0
- package/lib/LiteKitchenConfigurator.js +490 -0
- package/lib/LiteRenderer.js +513 -0
- package/lib/actions/area-actions.js +21 -0
- package/lib/actions/export.js +36 -0
- package/lib/actions/groups-actions.js +107 -0
- package/lib/actions/holes-actions.js +140 -0
- package/lib/actions/items-actions.js +370 -0
- package/lib/actions/lines-actions.js +96 -0
- package/lib/actions/project-actions.js +338 -0
- package/lib/actions/scene-actions.js +43 -0
- package/lib/actions/vertices-actions.js +35 -0
- package/lib/actions/viewer2d-actions.js +73 -0
- package/lib/actions/viewer3d-actions.js +32 -0
- package/lib/analytics/ga4.js +194 -0
- package/lib/analytics/posthog.js +68 -0
- package/lib/assets/Window.hdr +2100 -0
- package/lib/assets/brown_photostudio_02_1k.hdr +0 -0
- package/lib/assets/fonts/Rene Bieder Milliard Black Italic.woff +0 -0
- package/lib/assets/fonts/Rene Bieder Milliard Black.woff +0 -0
- package/lib/assets/fonts/Rene Bieder Milliard Bold Italic.woff +0 -0
- package/lib/assets/fonts/Rene Bieder Milliard Bold.woff +0 -0
- package/lib/assets/fonts/Rene Bieder Milliard Book Italic.woff +0 -0
- package/lib/assets/fonts/Rene Bieder Milliard Book.woff +0 -0
- package/lib/assets/fonts/Rene Bieder Milliard ExtraBold Italic.woff +0 -0
- package/lib/assets/fonts/Rene Bieder Milliard ExtraBold.woff +0 -0
- package/lib/assets/fonts/Rene Bieder Milliard ExtraLight Italic.woff +0 -0
- package/lib/assets/fonts/Rene Bieder Milliard ExtraLight.woff +0 -0
- package/lib/assets/fonts/Rene Bieder Milliard Hairline Italic.woff +0 -0
- package/lib/assets/fonts/Rene Bieder Milliard Hairline.woff +0 -0
- package/lib/assets/fonts/Rene Bieder Milliard Heavy Italic.woff +0 -0
- package/lib/assets/fonts/Rene Bieder Milliard Heavy.woff +0 -0
- package/lib/assets/fonts/Rene Bieder Milliard Light Italic.woff +0 -0
- package/lib/assets/fonts/Rene Bieder Milliard Light.woff +0 -0
- package/lib/assets/fonts/Rene Bieder Milliard Medium Italic.woff +0 -0
- package/lib/assets/fonts/Rene Bieder Milliard Medium.woff +0 -0
- package/lib/assets/fonts/Rene Bieder Milliard SemiBold Italic.woff +0 -0
- package/lib/assets/fonts/Rene Bieder Milliard SemiBold.woff +0 -0
- package/lib/assets/fonts/Rene Bieder Milliard Thin Italic.woff +0 -0
- package/lib/assets/fonts/Rene Bieder Milliard Thin.woff +0 -0
- package/lib/assets/fonts/style.css +177 -0
- package/lib/assets/gltf/door_closet.bin +0 -0
- package/lib/assets/gltf/door_closet.fbx +0 -0
- package/lib/assets/gltf/door_closet.gltf +1 -0
- package/lib/assets/gltf/door_exterior.bin +0 -0
- package/lib/assets/gltf/door_exterior.fbx +0 -0
- package/lib/assets/gltf/door_exterior.gltf +1 -0
- package/lib/assets/gltf/door_interior.bin +0 -0
- package/lib/assets/gltf/door_interior.fbx +0 -0
- package/lib/assets/gltf/door_interior.gltf +1 -0
- package/lib/assets/gltf/door_sliding.bin +0 -0
- package/lib/assets/gltf/door_sliding.fbx +0 -0
- package/lib/assets/gltf/door_sliding.gltf +1 -0
- package/lib/assets/gltf/doorway_framed.bin +0 -0
- package/lib/assets/gltf/doorway_framed.fbx +0 -0
- package/lib/assets/gltf/doorway_framed.gltf +1 -0
- package/lib/assets/gltf/window_clear.bin +0 -0
- package/lib/assets/gltf/window_clear.fbx +0 -0
- package/lib/assets/gltf/window_clear.gltf +1 -0
- package/lib/assets/gltf/window_cross.bin +0 -0
- package/lib/assets/gltf/window_cross.fbx +0 -0
- package/lib/assets/gltf/window_cross.gltf +1 -0
- package/lib/assets/gltf/window_double_hung.bin +0 -0
- package/lib/assets/gltf/window_double_hung.fbx +0 -0
- package/lib/assets/gltf/window_double_hung.gltf +1 -0
- package/lib/assets/gltf/window_vertical.bin +0 -0
- package/lib/assets/gltf/window_vertical.fbx +0 -0
- package/lib/assets/gltf/window_vertical.gltf +1 -0
- package/lib/assets/img/1.jpg +0 -0
- package/lib/assets/img/TKC_thumbnail.png +0 -0
- package/lib/assets/img/Toggle.png +0 -0
- package/lib/assets/img/loading/loading.gif +0 -0
- package/lib/assets/img/loading/loading_1.svg +11 -0
- package/lib/assets/img/loading_large.gif +0 -0
- package/lib/assets/img/png/door/closet.png +0 -0
- package/lib/assets/img/png/door/doorwaysframed.png +0 -0
- package/lib/assets/img/png/door/doorwaysframeles.png +0 -0
- package/lib/assets/img/png/door/doorwaysframeless.png +0 -0
- package/lib/assets/img/png/door/exterior.png +0 -0
- package/lib/assets/img/png/door/interior.png +0 -0
- package/lib/assets/img/png/door/sliding.png +0 -0
- package/lib/assets/img/png/helper/outcome.png +0 -0
- package/lib/assets/img/png/helper/video_preview_3d.png +0 -0
- package/lib/assets/img/png/helper/video_preview_start.png +0 -0
- package/lib/assets/img/project_img.png +0 -0
- package/lib/assets/img/rta/rta_logo_box_blue.jpg +0 -0
- package/lib/assets/img/rta/rta_logo_box_blue_ico.jpg +0 -0
- package/lib/assets/img/rta/rta_logo_box_blue_ico.svg +55 -0
- package/lib/assets/img/rta/rta_logo_box_darkGray.jpg +0 -0
- package/lib/assets/img/rta/rta_logo_box_lightblue.png +0 -0
- package/lib/assets/img/rta/rta_logo_box_lightmaroon.png +0 -0
- package/lib/assets/img/rta/rta_logo_box_maroon.png +0 -0
- package/lib/assets/img/rta/rta_logo_box_white.png +0 -0
- package/lib/assets/img/rta_menu.png +0 -0
- package/lib/assets/img/step2.jpg +0 -0
- package/lib/assets/img/step3.jpg +0 -0
- package/lib/assets/img/step4.jpg +0 -0
- package/lib/assets/img/step5.jpg +0 -0
- package/lib/assets/img/step6.jpg +0 -0
- package/lib/assets/img/step7.jpg +0 -0
- package/lib/assets/img/step8.jpg +0 -0
- package/lib/assets/img/svg/2d_delete_object.svg +33 -0
- package/lib/assets/img/svg/2d_delete_object1.svg +33 -0
- package/lib/assets/img/svg/2d_lock_object.svg +33 -0
- package/lib/assets/img/svg/3d_item_move.svg +106 -0
- package/lib/assets/img/svg/3d_item_rotation.svg +76 -0
- package/lib/assets/img/svg/3d_item_warning_edit.svg +77 -0
- package/lib/assets/img/svg/3d_item_warning_info.svg +81 -0
- package/lib/assets/img/svg/accessories.svg +4 -0
- package/lib/assets/img/svg/angle_icon.svg +39 -0
- package/lib/assets/img/svg/blank_div.svg +14 -0
- package/lib/assets/img/svg/bottombar/2d3d_button.svg +3 -0
- package/lib/assets/img/svg/bottombar/2d3d_button_active.svg +3 -0
- package/lib/assets/img/svg/bottombar/2d3d_toggle.svg +4 -0
- package/lib/assets/img/svg/bottombar/2d3d_toggle_active.svg +4 -0
- package/lib/assets/img/svg/bottombar/arrow-down.svg +3 -0
- package/lib/assets/img/svg/bottombar/arrow-left.svg +3 -0
- package/lib/assets/img/svg/bottombar/arrow-minus.svg +3 -0
- package/lib/assets/img/svg/bottombar/arrow-plus.svg +11 -0
- package/lib/assets/img/svg/bottombar/arrow-right.svg +3 -0
- package/lib/assets/img/svg/bottombar/arrow-up.svg +3 -0
- package/lib/assets/img/svg/bottombar/collapse.svg +3 -0
- package/lib/assets/img/svg/bottombar/elevation-back.svg +6 -0
- package/lib/assets/img/svg/bottombar/elevation-front.svg +6 -0
- package/lib/assets/img/svg/bottombar/elevation-left.svg +6 -0
- package/lib/assets/img/svg/bottombar/elevation-right.svg +7 -0
- package/lib/assets/img/svg/bottombar/elevation.svg +6 -0
- package/lib/assets/img/svg/bottombar/expand.svg +3 -0
- package/lib/assets/img/svg/bottombar/help.svg +72 -0
- package/lib/assets/img/svg/bottombar/incm_toggle.svg +39 -0
- package/lib/assets/img/svg/bottombar/pan_1.svg +57 -0
- package/lib/assets/img/svg/bottombar/pan_2.svg +27 -0
- package/lib/assets/img/svg/bottombar/pan_3.svg +27 -0
- package/lib/assets/img/svg/bottombar/pan_4.svg +27 -0
- package/lib/assets/img/svg/bottombar/pan_5.svg +27 -0
- package/lib/assets/img/svg/bottombar/settings.svg +23 -0
- package/lib/assets/img/svg/bottombar/spin-down.svg +76 -0
- package/lib/assets/img/svg/bottombar/spin-left.svg +75 -0
- package/lib/assets/img/svg/bottombar/spin-right.svg +75 -0
- package/lib/assets/img/svg/bottombar/spin-up.svg +76 -0
- package/lib/assets/img/svg/bottombar/spin_1.svg +48 -0
- package/lib/assets/img/svg/bottombar/spin_2.svg +31 -0
- package/lib/assets/img/svg/bottombar/spin_3.svg +31 -0
- package/lib/assets/img/svg/bottombar/spin_4.svg +31 -0
- package/lib/assets/img/svg/bottombar/spin_5.svg +31 -0
- package/lib/assets/img/svg/bottombar/zoomin.svg +29 -0
- package/lib/assets/img/svg/bottombar/zoomout.svg +26 -0
- package/lib/assets/img/svg/check.svg +10 -0
- package/lib/assets/img/svg/close.svg +11 -0
- package/lib/assets/img/svg/color/Black.svg +3 -0
- package/lib/assets/img/svg/color/Blue.svg +3 -0
- package/lib/assets/img/svg/color/Brown.svg +9 -0
- package/lib/assets/img/svg/color/Cream.svg +3 -0
- package/lib/assets/img/svg/color/Dark.svg +9 -0
- package/lib/assets/img/svg/color/Gray.svg +3 -0
- package/lib/assets/img/svg/color/Green.svg +3 -0
- package/lib/assets/img/svg/color/Light.svg +9 -0
- package/lib/assets/img/svg/color/Medium.svg +9 -0
- package/lib/assets/img/svg/color/Unfinished.svg +9 -0
- package/lib/assets/img/svg/color/White.svg +3 -0
- package/lib/assets/img/svg/color/White.svg.bak +3 -0
- package/lib/assets/img/svg/color/stone2.jpg +0 -0
- package/lib/assets/img/svg/color/wood2.jpg +0 -0
- package/lib/assets/img/svg/copy.svg +11 -0
- package/lib/assets/img/svg/delete.svg +3 -0
- package/lib/assets/img/svg/detail.svg +77 -0
- package/lib/assets/img/svg/disclaimer/background.svg +758 -0
- package/lib/assets/img/svg/disclaimer/logo-dots.svg +11 -0
- package/lib/assets/img/svg/door/Closet.svg +11 -0
- package/lib/assets/img/svg/door/Exterior.svg +5 -0
- package/lib/assets/img/svg/door/Framed_dorway.svg +5 -0
- package/lib/assets/img/svg/door/Frameless_dorway.svg +5 -0
- package/lib/assets/img/svg/door/Interior.svg +7 -0
- package/lib/assets/img/svg/door/Sliding.svg +5 -0
- package/lib/assets/img/svg/doors_closet.svg +47 -0
- package/lib/assets/img/svg/doors_exterior.svg +25 -0
- package/lib/assets/img/svg/doors_interior.svg +29 -0
- package/lib/assets/img/svg/doors_patio.svg +26 -0
- package/lib/assets/img/svg/duplicate.svg +11 -0
- package/lib/assets/img/svg/duplicate_object_left.svg +32 -0
- package/lib/assets/img/svg/duplicate_object_right.svg +32 -0
- package/lib/assets/img/svg/filtersActive.svg +19 -0
- package/lib/assets/img/svg/firstsetting/L.svg +3 -0
- package/lib/assets/img/svg/firstsetting/L2.svg +3 -0
- package/lib/assets/img/svg/firstsetting/Open.svg +3 -0
- package/lib/assets/img/svg/firstsetting/Square.svg +3 -0
- package/lib/assets/img/svg/firstsetting/bar-active.svg +9 -0
- package/lib/assets/img/svg/firstsetting/bar-normal.svg +3 -0
- package/lib/assets/img/svg/firstsetting/bullet-current.svg +3 -0
- package/lib/assets/img/svg/firstsetting/bullet-done.svg +3 -0
- package/lib/assets/img/svg/firstsetting/bullet-not-done.svg +3 -0
- package/lib/assets/img/svg/firstsetting/check-active.svg +3 -0
- package/lib/assets/img/svg/firstsetting/check-normal.svg +3 -0
- package/lib/assets/img/svg/firstsetting/pencil.svg +11 -0
- package/lib/assets/img/svg/green_checkmark.svg +27 -0
- package/lib/assets/img/svg/headerbar/assist.svg +3 -0
- package/lib/assets/img/svg/headerbar/cart.svg +3 -0
- package/lib/assets/img/svg/headerbar/check.svg +10 -0
- package/lib/assets/img/svg/headerbar/consult_designer.svg +45 -0
- package/lib/assets/img/svg/headerbar/edit_name.svg +26 -0
- package/lib/assets/img/svg/headerbar/file-dollar.svg +13 -0
- package/lib/assets/img/svg/headerbar/hamburger_menu.svg +32 -0
- package/lib/assets/img/svg/headerbar/plus.svg +11 -0
- package/lib/assets/img/svg/headerbar/review_quote.svg +44 -0
- package/lib/assets/img/svg/headerbar/ruler-measure.svg +11 -0
- package/lib/assets/img/svg/headerbar/save.svg +3 -0
- package/lib/assets/img/svg/headerbar/setting.svg +75 -0
- package/lib/assets/img/svg/help/check.svg +10 -0
- package/lib/assets/img/svg/help/search.svg +76 -0
- package/lib/assets/img/svg/intro/1-start-with-floorplan-whole.svg +27 -0
- package/lib/assets/img/svg/intro/1-start-with-floorplan.svg +26 -0
- package/lib/assets/img/svg/intro/2-start-from-scratch-whole.svg +28 -0
- package/lib/assets/img/svg/intro/2-start-from-scratch.svg +27 -0
- package/lib/assets/img/svg/intro/3-retrieve-project-whole.svg +19 -0
- package/lib/assets/img/svg/intro/3-retrieve-project.svg +18 -0
- package/lib/assets/img/svg/invert.svg +127 -0
- package/lib/assets/img/svg/lefttoolbar/appliance-active.svg +13 -0
- package/lib/assets/img/svg/lefttoolbar/appliance.svg +13 -0
- package/lib/assets/img/svg/lefttoolbar/cabinet-active.svg +10 -0
- package/lib/assets/img/svg/lefttoolbar/cabinet-category.svg +3 -0
- package/lib/assets/img/svg/lefttoolbar/cabinet-one.svg +3 -0
- package/lib/assets/img/svg/lefttoolbar/cabinet.svg +10 -0
- package/lib/assets/img/svg/lefttoolbar/disigner_assistance.svg +89 -0
- package/lib/assets/img/svg/lefttoolbar/door-style-active.svg +20 -0
- package/lib/assets/img/svg/lefttoolbar/door-style.svg +20 -0
- package/lib/assets/img/svg/lefttoolbar/door.svg +12 -0
- package/lib/assets/img/svg/lefttoolbar/error_icon.svg +81 -0
- package/lib/assets/img/svg/lefttoolbar/finishing-active.svg +13 -0
- package/lib/assets/img/svg/lefttoolbar/finishing.svg +13 -0
- package/lib/assets/img/svg/lefttoolbar/reviewforquote-active.svg +86 -0
- package/lib/assets/img/svg/lefttoolbar/reviewforquote.svg +12 -0
- package/lib/assets/img/svg/lefttoolbar/room-shape-L.svg +3 -0
- package/lib/assets/img/svg/lefttoolbar/room-shape-active.svg +18 -0
- package/lib/assets/img/svg/lefttoolbar/room-shape-custom.svg +12 -0
- package/lib/assets/img/svg/lefttoolbar/room-shape-irregular.svg +3 -0
- package/lib/assets/img/svg/lefttoolbar/room-shape-open.svg +3 -0
- package/lib/assets/img/svg/lefttoolbar/room-shape-square.svg +3 -0
- package/lib/assets/img/svg/lefttoolbar/room-shape.svg +18 -0
- package/lib/assets/img/svg/lefttoolbar/search.svg +76 -0
- package/lib/assets/img/svg/lefttoolbar/view_more.svg +86 -0
- package/lib/assets/img/svg/lefttoolbar/warning_icon.svg +81 -0
- package/lib/assets/img/svg/lefttoolbar/window.svg +12 -0
- package/lib/assets/img/svg/logo.svg +11 -0
- package/lib/assets/img/svg/logo_with_text.svg +25 -0
- package/lib/assets/img/svg/menubar/login.svg +84 -0
- package/lib/assets/img/svg/menubar/my_projects.svg +85 -0
- package/lib/assets/img/svg/menubar/new_project.svg +110 -0
- package/lib/assets/img/svg/menubar/save_project.svg +84 -0
- package/lib/assets/img/svg/options.svg +3 -0
- package/lib/assets/img/svg/positioning.svg +3 -0
- package/lib/assets/img/svg/rotate.png +0 -0
- package/lib/assets/img/svg/rotate.svg +17 -0
- package/lib/assets/img/svg/rotate_object_clockwise.svg +26 -0
- package/lib/assets/img/svg/rotate_object_counterclockwise.svg +26 -0
- package/lib/assets/img/svg/toggleFilters.svg +19 -0
- package/lib/assets/img/svg/toolbar/add_appliances_active.svg +64 -0
- package/lib/assets/img/svg/toolbar/add_appliances_inactive.svg +52 -0
- package/lib/assets/img/svg/toolbar/add_button.svg +36 -0
- package/lib/assets/img/svg/toolbar/add_cabinets_active.svg +59 -0
- package/lib/assets/img/svg/toolbar/add_cabinets_inactive.svg +49 -0
- package/lib/assets/img/svg/toolbar/add_items_doors.svg +25 -0
- package/lib/assets/img/svg/toolbar/add_items_doorways.svg +24 -0
- package/lib/assets/img/svg/toolbar/add_items_refrigerator.svg +32 -0
- package/lib/assets/img/svg/toolbar/add_items_windows.svg +28 -0
- package/lib/assets/img/svg/toolbar/apply_button.svg +38 -0
- package/lib/assets/img/svg/toolbar/arrow-plus.svg +11 -0
- package/lib/assets/img/svg/toolbar/backsplash.svg +8 -0
- package/lib/assets/img/svg/toolbar/cancel_button.svg +37 -0
- package/lib/assets/img/svg/toolbar/consult_a_designer_button.svg +47 -0
- package/lib/assets/img/svg/toolbar/countertop.svg +7 -0
- package/lib/assets/img/svg/toolbar/dcm.png +0 -0
- package/lib/assets/img/svg/toolbar/dcm_off.svg +12 -0
- package/lib/assets/img/svg/toolbar/dcm_on.svg +474 -0
- package/lib/assets/img/svg/toolbar/delete_button.svg +37 -0
- package/lib/assets/img/svg/toolbar/download.svg +77 -0
- package/lib/assets/img/svg/toolbar/draw_custom_floor.svg +31 -0
- package/lib/assets/img/svg/toolbar/edit_button.svg +75 -0
- package/lib/assets/img/svg/toolbar/email_quote_button.svg +44 -0
- package/lib/assets/img/svg/toolbar/fbm.png +0 -0
- package/lib/assets/img/svg/toolbar/finishing_touches_active.svg +54 -0
- package/lib/assets/img/svg/toolbar/finishing_touches_inactive.svg +42 -0
- package/lib/assets/img/svg/toolbar/floorstyle.svg +9 -0
- package/lib/assets/img/svg/toolbar/fmb.png +0 -0
- package/lib/assets/img/svg/toolbar/fmb_off.svg +12 -0
- package/lib/assets/img/svg/toolbar/fmb_on.svg +489 -0
- package/lib/assets/img/svg/toolbar/furnishings_icon.svg +6 -0
- package/lib/assets/img/svg/toolbar/get_started_button.svg +41 -0
- package/lib/assets/img/svg/toolbar/handles.svg +5 -0
- package/lib/assets/img/svg/toolbar/lighting.svg +7 -0
- package/lib/assets/img/svg/toolbar/lrm.png +0 -0
- package/lib/assets/img/svg/toolbar/lrm_off.svg +12 -0
- package/lib/assets/img/svg/toolbar/lrm_on.svg +470 -0
- package/lib/assets/img/svg/toolbar/make_floorplan_active.svg +66 -0
- package/lib/assets/img/svg/toolbar/make_floorplan_inactive.svg +52 -0
- package/lib/assets/img/svg/toolbar/predefined_room_l_shaped.svg +20 -0
- package/lib/assets/img/svg/toolbar/predefined_room_layout.svg +20 -0
- package/lib/assets/img/svg/toolbar/predefined_room_long_narrow.svg +20 -0
- package/lib/assets/img/svg/toolbar/predefined_room_open_l_shape.svg +20 -0
- package/lib/assets/img/svg/toolbar/predefined_room_open_pentagon.svg +20 -0
- package/lib/assets/img/svg/toolbar/predefined_room_open_rectangle.svg +20 -0
- package/lib/assets/img/svg/toolbar/predefined_room_open_rectangle_2.svg +20 -0
- package/lib/assets/img/svg/toolbar/predefined_room_pentagon.svg +20 -0
- package/lib/assets/img/svg/toolbar/predefined_room_rectangle.svg +20 -0
- package/lib/assets/img/svg/toolbar/predefined_room_rectangle_with_alcove.svg +20 -0
- package/lib/assets/img/svg/toolbar/redo_button.svg +75 -0
- package/lib/assets/img/svg/toolbar/redo_button1.svg +75 -0
- package/lib/assets/img/svg/toolbar/review_quote_active.svg +14 -0
- package/lib/assets/img/svg/toolbar/review_quote_inactive.svg +44 -0
- package/lib/assets/img/svg/toolbar/save_project_button.svg +44 -0
- package/lib/assets/img/svg/toolbar/select_doorstyle_active.svg +67 -0
- package/lib/assets/img/svg/toolbar/select_doorstyle_inactive.svg +57 -0
- package/lib/assets/img/svg/toolbar/shopping-cart.svg +13 -0
- package/lib/assets/img/svg/toolbar/style_change_button.svg +47 -0
- package/lib/assets/img/svg/toolbar/take_picture.svg +75 -0
- package/lib/assets/img/svg/toolbar/undo_button.svg +76 -0
- package/lib/assets/img/svg/toolbar/undo_button1.svg +76 -0
- package/lib/assets/img/svg/toolbar/use_button.svg +37 -0
- package/lib/assets/img/svg/toolbar/wall_color_icon.svg +6 -0
- package/lib/assets/img/svg/topbar/edit_active.svg +10 -0
- package/lib/assets/img/svg/topbar/edit_inactive.svg +10 -0
- package/lib/assets/img/svg/topbar/redo_active.svg +42 -0
- package/lib/assets/img/svg/topbar/redo_inactive.svg +23 -0
- package/lib/assets/img/svg/topbar/select_all_active.svg +50 -0
- package/lib/assets/img/svg/topbar/select_all_inactive.svg +32 -0
- package/lib/assets/img/svg/topbar/take_picture_active.svg +51 -0
- package/lib/assets/img/svg/topbar/take_picture_inactive.svg +26 -0
- package/lib/assets/img/svg/topbar/undo_active.svg +42 -0
- package/lib/assets/img/svg/topbar/undo_inactive.svg +23 -0
- package/lib/assets/img/svg/warning_info_2d.svg +81 -0
- package/lib/assets/img/svg/window/Clear.svg +3 -0
- package/lib/assets/img/svg/window/Cross.svg +5 -0
- package/lib/assets/img/svg/window/Double_hung.svg +4 -0
- package/lib/assets/img/svg/window/Vertical.svg +4 -0
- package/lib/assets/img/svg/windows_clear.svg +23 -0
- package/lib/assets/img/svg/windows_cross.svg +28 -0
- package/lib/assets/img/svg/windows_double_hung.svg +24 -0
- package/lib/assets/img/svg/windows_vertical.svg +24 -0
- package/lib/assets/img/svg/wizardstep/Custom.svg +3 -0
- package/lib/assets/img/svg/wizardstep/Dashed_line.svg +3 -0
- package/lib/assets/img/svg/wizardstep/L.svg +3 -0
- package/lib/assets/img/svg/wizardstep/L2.svg +3 -0
- package/lib/assets/img/svg/wizardstep/Open.svg +3 -0
- package/lib/assets/img/svg/wizardstep/Square.svg +3 -0
- package/lib/assets/img/svg/wizardstep/bar-active.svg +9 -0
- package/lib/assets/img/svg/wizardstep/bar-normal.svg +3 -0
- package/lib/assets/img/svg/wizardstep/bullet-current.svg +3 -0
- package/lib/assets/img/svg/wizardstep/bullet-done.svg +3 -0
- package/lib/assets/img/svg/wizardstep/bullet-not-done.svg +3 -0
- package/lib/assets/img/svg/wizardstep/check-active.svg +3 -0
- package/lib/assets/img/svg/wizardstep/check-normal.svg +3 -0
- package/lib/assets/img/svg/wizardstep/detail_view.svg +87 -0
- package/lib/assets/img/svg/wizardstep/pencil.svg +11 -0
- package/lib/assets/img/svg/wizardstep/tile_view.svg +95 -0
- package/lib/assets/img/texture/glass.jpg +0 -0
- package/lib/assets/img/texture/steel.jpg +0 -0
- package/lib/assets/img/texture/white1px.jpg +0 -0
- package/lib/assets/img/texture/wood.jpg +0 -0
- package/lib/assets/model/DCM.bin +0 -0
- package/lib/assets/model/DCM.fbx +0 -0
- package/lib/assets/model/DCM.gltf +1 -0
- package/lib/assets/model/FBM.bin +0 -0
- package/lib/assets/model/FBM.fbx +0 -0
- package/lib/assets/model/FBM.gltf +1 -0
- package/lib/assets/model/LRM.bin +0 -0
- package/lib/assets/model/LRM.fbx +0 -0
- package/lib/assets/model/LRM.gltf +1 -0
- package/lib/assets/rtastore_logo.png +0 -0
- package/lib/catalog/areas/area/planner-element.js +53 -0
- package/lib/catalog/areas/area/textures/ceramic-tile.jpg +0 -0
- package/lib/catalog/areas/area/textures/grass.jpg +0 -0
- package/lib/catalog/areas/area/textures/parquet.jpg +0 -0
- package/lib/catalog/areas/area/textures/strand-porcelain.jpg +0 -0
- package/lib/catalog/areas/area/textures/tile1.jpg +0 -0
- package/lib/catalog/back.png +0 -0
- package/lib/catalog/catalog.js +272 -0
- package/lib/catalog/doors.png +0 -0
- package/lib/catalog/doorways.png +0 -0
- package/lib/catalog/envMap/nx.hdr +0 -0
- package/lib/catalog/envMap/ny.hdr +0 -0
- package/lib/catalog/envMap/nz.hdr +0 -0
- package/lib/catalog/envMap/px.hdr +0 -0
- package/lib/catalog/envMap/py.hdr +0 -0
- package/lib/catalog/envMap/pz.hdr +0 -0
- package/lib/catalog/export.js +1 -0
- package/lib/catalog/factories/area-factory-3d.js +190 -0
- package/lib/catalog/factories/area-factory.js +88 -0
- package/lib/catalog/factories/export.js +25 -0
- package/lib/catalog/factories/wall-factory-3d.js +212 -0
- package/lib/catalog/factories/wall-factory.js +279 -0
- package/lib/catalog/holes/door-closet/planner-element.js +232 -0
- package/lib/catalog/holes/door-double/door_double.png +0 -0
- package/lib/catalog/holes/door-double/planner-element.js +325 -0
- package/lib/catalog/holes/door-exterior/planner-element.js +225 -0
- package/lib/catalog/holes/door-interior/planner-element.js +237 -0
- package/lib/catalog/holes/door-panic/panicDoor.png +0 -0
- package/lib/catalog/holes/door-panic/planner-element.js +513 -0
- package/lib/catalog/holes/door-panic-double/panicDoorDouble.png +0 -0
- package/lib/catalog/holes/door-panic-double/planner-element.js +473 -0
- package/lib/catalog/holes/door-sliding/planner-element.js +235 -0
- package/lib/catalog/holes/doorway-framed/planner-element.js +155 -0
- package/lib/catalog/holes/doorway-frameless/planner-element.js +114 -0
- package/lib/catalog/holes/export.js +97 -0
- package/lib/catalog/holes/gate/gate.jpg +0 -0
- package/lib/catalog/holes/window-clear/planner-element.js +176 -0
- package/lib/catalog/holes/window-clear/texture.png +0 -0
- package/lib/catalog/holes/window-cross/planner-element.js +175 -0
- package/lib/catalog/holes/window-cross/texture.png +0 -0
- package/lib/catalog/holes/window-double-hung/planner-element.js +313 -0
- package/lib/catalog/holes/window-double-hung/texture.png +0 -0
- package/lib/catalog/holes/window-vertical/planner-element.js +286 -0
- package/lib/catalog/holes/window-vertical/texture.png +0 -0
- package/lib/catalog/lines/wall/planner-element.js +87 -0
- package/lib/catalog/lines/wall/textures/bricks-normal.jpg +0 -0
- package/lib/catalog/lines/wall/textures/bricks-normal2.jpg +0 -0
- package/lib/catalog/lines/wall/textures/bricks.jpg +0 -0
- package/lib/catalog/lines/wall/textures/bricks2.jpg +0 -0
- package/lib/catalog/lines/wall/textures/bricks3.jpg +0 -0
- package/lib/catalog/lines/wall/textures/morden-normal.jpg +0 -0
- package/lib/catalog/lines/wall/textures/morden.jpg +0 -0
- package/lib/catalog/lines/wall/textures/painted-normal.jpg +0 -0
- package/lib/catalog/lines/wall/textures/painted.jpg +0 -0
- package/lib/catalog/lines/wall/textures/plaster-normal.jpg +0 -0
- package/lib/catalog/lines/wall/textures/plaster.jpg +0 -0
- package/lib/catalog/lines/wall/wall.png +0 -0
- package/lib/catalog/molding/molding-dcm/planner-element.js +33 -0
- package/lib/catalog/molding/molding-dcm/texture.png +0 -0
- package/lib/catalog/molding/molding-fbm/planner-element.js +33 -0
- package/lib/catalog/molding/molding-fbm/texture.png +0 -0
- package/lib/catalog/molding/molding-lrm/planner-element.js +33 -0
- package/lib/catalog/molding/molding-lrm/texture.png +0 -0
- package/lib/catalog/properties/export.js +81 -0
- package/lib/catalog/properties/property-checkbox.js +76 -0
- package/lib/catalog/properties/property-color.js +47 -0
- package/lib/catalog/properties/property-enum.js +58 -0
- package/lib/catalog/properties/property-hidden.js +27 -0
- package/lib/catalog/properties/property-lenght-measure.js +108 -0
- package/lib/catalog/properties/property-length-measure.js +92 -0
- package/lib/catalog/properties/property-length-measure_hole.js +108 -0
- package/lib/catalog/properties/property-number.js +56 -0
- package/lib/catalog/properties/property-read-only.js +34 -0
- package/lib/catalog/properties/property-string.js +56 -0
- package/lib/catalog/properties/property-toggle.js +47 -0
- package/lib/catalog/properties/shared-property-style.js +21 -0
- package/lib/catalog/utils/FuseUtils.js +87 -0
- package/lib/catalog/utils/exporter.js +157 -0
- package/lib/catalog/utils/geom-utils.js +205 -0
- package/lib/catalog/utils/item-loader.js +1608 -0
- package/lib/catalog/utils/load-obj.js +99 -0
- package/lib/catalog/utils/mtl-loader.js +366 -0
- package/lib/catalog/utils/obj-loader.js +486 -0
- package/lib/catalog/windows.png +0 -0
- package/lib/class/FuseUtils.js +87 -0
- package/lib/class/area.js +148 -0
- package/lib/class/export.js +96 -0
- package/lib/class/group.js +438 -0
- package/lib/class/guide.js +64 -0
- package/lib/class/hole.js +932 -0
- package/lib/class/item.js +1852 -0
- package/lib/class/layer.js +670 -0
- package/lib/class/line.js +1230 -0
- package/lib/class/project.js +804 -0
- package/lib/class/vertex.js +205 -0
- package/lib/components/content.js +142 -0
- package/lib/components/export.js +7 -0
- package/lib/components/style/button.js +115 -0
- package/lib/components/style/cancel-button.js +29 -0
- package/lib/components/style/content-container.js +38 -0
- package/lib/components/style/content-title.js +35 -0
- package/lib/components/style/delete-button.js +34 -0
- package/lib/components/style/export.js +121 -0
- package/lib/components/style/form-block.js +28 -0
- package/lib/components/style/form-color-input.js +34 -0
- package/lib/components/style/form-label.js +30 -0
- package/lib/components/style/form-number-input.js +192 -0
- package/lib/components/style/form-number-input_2.js +209 -0
- package/lib/components/style/form-select.js +29 -0
- package/lib/components/style/form-slider.js +68 -0
- package/lib/components/style/form-submit-button.js +35 -0
- package/lib/components/style/form-text-input.js +78 -0
- package/lib/components/viewer2d/area.js +89 -0
- package/lib/components/viewer2d/export.js +121 -0
- package/lib/components/viewer2d/grids/grid-horizontal-streak.js +44 -0
- package/lib/components/viewer2d/grids/grid-streak.js +44 -0
- package/lib/components/viewer2d/grids/grid-vertical-streak.js +44 -0
- package/lib/components/viewer2d/grids/grids.js +40 -0
- package/lib/components/viewer2d/group.js +63 -0
- package/lib/components/viewer2d/item.js +457 -0
- package/lib/components/viewer2d/layer.js +172 -0
- package/lib/components/viewer2d/line.js +975 -0
- package/lib/components/viewer2d/ruler.js +87 -0
- package/lib/components/viewer2d/rulerDist.js +140 -0
- package/lib/components/viewer2d/rulerX.js +154 -0
- package/lib/components/viewer2d/rulerY.js +156 -0
- package/lib/components/viewer2d/scene.js +137 -0
- package/lib/components/viewer2d/snap.js +84 -0
- package/lib/components/viewer2d/state.js +83 -0
- package/lib/components/viewer2d/utils.js +200 -0
- package/lib/components/viewer2d/vertex.js +75 -0
- package/lib/components/viewer2d/viewer2d.js +1444 -0
- package/lib/components/viewer3d/camera-controls-module/camera-controls.module.js +2591 -0
- package/lib/components/viewer3d/dcm.js +408 -0
- package/lib/components/viewer3d/fbm.js +421 -0
- package/lib/components/viewer3d/front3D.js +71 -0
- package/lib/components/viewer3d/grid-creator.js +35 -0
- package/lib/components/viewer3d/grids/grid-horizontal-streak.js +45 -0
- package/lib/components/viewer3d/grids/grid-streak.js +36 -0
- package/lib/components/viewer3d/grids/grid-vertical-streak.js +45 -0
- package/lib/components/viewer3d/libs/first-person-controls.js +74 -0
- package/lib/components/viewer3d/libs/helvetiker_regular.typeface.js +1287 -0
- package/lib/components/viewer3d/libs/mtl-loader.js +366 -0
- package/lib/components/viewer3d/libs/obj-loader.js +471 -0
- package/lib/components/viewer3d/libs/orbit-controls.js +706 -0
- package/lib/components/viewer3d/libs/pointer-lock-controls.js +53 -0
- package/lib/components/viewer3d/lrm.js +312 -0
- package/lib/components/viewer3d/model.js +714 -0
- package/lib/components/viewer3d/pointer-lock-navigation.js +122 -0
- package/lib/components/viewer3d/ruler-utils/itemRect.js +69 -0
- package/lib/components/viewer3d/ruler-utils/layer3D.js +503 -0
- package/lib/components/viewer3d/ruler-utils/ruler3D.js +232 -0
- package/lib/components/viewer3d/ruler-utils/scene3D.js +67 -0
- package/lib/components/viewer3d/ruler-utils/state3D.js +26 -0
- package/lib/components/viewer3d/scene-creator.js +3652 -0
- package/lib/components/viewer3d/three-memory-cleaner.js +60 -0
- package/lib/components/viewer3d/viewer3d-first-person.js +316 -0
- package/lib/components/viewer3d/viewer3d.js +2661 -0
- package/lib/constants.js +697 -0
- package/lib/devLiteRenderer.js +320 -0
- package/lib/index.js +64 -0
- package/lib/models.js +513 -0
- package/lib/plugins/SVGLoader.js +1417 -0
- package/lib/plugins/console-debugger.js +42 -0
- package/lib/plugins/export.js +25 -0
- package/lib/plugins/keyboard.js +108 -0
- package/lib/reducers/areas-reducer.js +19 -0
- package/lib/reducers/export.js +97 -0
- package/lib/reducers/groups-reducer.js +45 -0
- package/lib/reducers/holes-reducer.js +69 -0
- package/lib/reducers/items-reducer.js +151 -0
- package/lib/reducers/lines-reducer.js +52 -0
- package/lib/reducers/project-reducer.js +138 -0
- package/lib/reducers/reducer.js +26 -0
- package/lib/reducers/scene-reducer.js +35 -0
- package/lib/reducers/user-reducer.js +48 -0
- package/lib/reducers/vertices-reducer.js +26 -0
- package/lib/reducers/viewer2d-reducer.js +82 -0
- package/lib/reducers/viewer3d-reducer.js +63 -0
- package/lib/shared-style.js +72 -0
- package/lib/styles/export.js +13 -0
- package/lib/styles/tabs.css +40 -0
- package/lib/translator/en.js +111 -0
- package/lib/translator/it.js +86 -0
- package/lib/translator/ru.js +86 -0
- package/lib/translator/translator.js +87 -0
- package/lib/utils/browser.js +40 -0
- package/lib/utils/convert-units-lite.js +35 -0
- package/lib/utils/email-validator.js +10 -0
- package/lib/utils/export.js +56 -0
- package/lib/utils/geometry.js +2545 -0
- package/lib/utils/get-edges-of-subgraphs.js +33 -0
- package/lib/utils/graph-cycles.js +239 -0
- package/lib/utils/graph-inner-cycles.js +54 -0
- package/lib/utils/graph.js +153 -0
- package/lib/utils/helper.js +358 -0
- package/lib/utils/history.js +36 -0
- package/lib/utils/id-broker.js +22 -0
- package/lib/utils/isolate-event-handler.js +691 -0
- package/lib/utils/logger.js +14 -0
- package/lib/utils/math.js +57 -0
- package/lib/utils/molding.js +890 -0
- package/lib/utils/name-generator.js +21 -0
- package/lib/utils/objects-utils.js +62 -0
- package/lib/utils/phone-validator.js +10 -0
- package/lib/utils/process-black-list.js +22 -0
- package/lib/utils/react-if.js +25 -0
- package/lib/utils/snap-scene.js +101 -0
- package/lib/utils/snap.js +245 -0
- package/lib/utils/summarizeCart.js +30 -0
- package/lib/utils/threeCSG.es6.js +504 -0
- package/lib/version.js +7 -0
- package/package.json +93 -86
- package/dist/index.js +0 -3
- package/dist/index.js.LICENSE.txt +0 -55
- package/dist/index.js.map +0 -1
|
@@ -0,0 +1,1412 @@
|
|
|
1
|
+
import { BufferGeometry, FileLoader, Float32BufferAttribute, Loader, Matrix3, Path, ShapePath, Vector2, Vector3 } from 'three';
|
|
2
|
+
var SVGLoader = function SVGLoader(manager) {
|
|
3
|
+
Loader.call(this, manager);
|
|
4
|
+
|
|
5
|
+
// Default dots per inch
|
|
6
|
+
this.defaultDPI = 90;
|
|
7
|
+
|
|
8
|
+
// Accepted units: 'mm', 'cm', 'in', 'pt', 'pc', 'px'
|
|
9
|
+
this.defaultUnit = 'px';
|
|
10
|
+
};
|
|
11
|
+
SVGLoader.prototype = Object.assign(Object.create(Loader.prototype), {
|
|
12
|
+
constructor: SVGLoader,
|
|
13
|
+
load: function load(url, onLoad, onProgress, onError) {
|
|
14
|
+
var scope = this;
|
|
15
|
+
var loader = new FileLoader(scope.manager);
|
|
16
|
+
loader.setPath(scope.path);
|
|
17
|
+
loader.setRequestHeader(scope.requestHeader);
|
|
18
|
+
loader.setWithCredentials(scope.withCredentials);
|
|
19
|
+
loader.load(url, function (text) {
|
|
20
|
+
try {
|
|
21
|
+
onLoad(scope.parse(text));
|
|
22
|
+
} catch (e) {
|
|
23
|
+
if (onError) {
|
|
24
|
+
onError(e);
|
|
25
|
+
} else {
|
|
26
|
+
console.error(e);
|
|
27
|
+
}
|
|
28
|
+
scope.manager.itemError(url);
|
|
29
|
+
}
|
|
30
|
+
}, onProgress, onError);
|
|
31
|
+
},
|
|
32
|
+
parse: function parse(text) {
|
|
33
|
+
var scope = this;
|
|
34
|
+
function parseNode(node, style) {
|
|
35
|
+
if (node.nodeType !== 1) return;
|
|
36
|
+
var transform = getNodeTransform(node);
|
|
37
|
+
var traverseChildNodes = true;
|
|
38
|
+
var path = null;
|
|
39
|
+
switch (node.nodeName) {
|
|
40
|
+
case 'svg':
|
|
41
|
+
break;
|
|
42
|
+
case 'style':
|
|
43
|
+
parseCSSStylesheet(node);
|
|
44
|
+
break;
|
|
45
|
+
case 'g':
|
|
46
|
+
style = parseStyle(node, style);
|
|
47
|
+
break;
|
|
48
|
+
case 'path':
|
|
49
|
+
style = parseStyle(node, style);
|
|
50
|
+
if (node.hasAttribute('d')) path = parsePathNode(node);
|
|
51
|
+
break;
|
|
52
|
+
case 'rect':
|
|
53
|
+
style = parseStyle(node, style);
|
|
54
|
+
path = parseRectNode(node);
|
|
55
|
+
break;
|
|
56
|
+
case 'polygon':
|
|
57
|
+
style = parseStyle(node, style);
|
|
58
|
+
path = parsePolygonNode(node);
|
|
59
|
+
break;
|
|
60
|
+
case 'polyline':
|
|
61
|
+
style = parseStyle(node, style);
|
|
62
|
+
path = parsePolylineNode(node);
|
|
63
|
+
break;
|
|
64
|
+
case 'circle':
|
|
65
|
+
style = parseStyle(node, style);
|
|
66
|
+
path = parseCircleNode(node);
|
|
67
|
+
break;
|
|
68
|
+
case 'ellipse':
|
|
69
|
+
style = parseStyle(node, style);
|
|
70
|
+
path = parseEllipseNode(node);
|
|
71
|
+
break;
|
|
72
|
+
case 'line':
|
|
73
|
+
style = parseStyle(node, style);
|
|
74
|
+
path = parseLineNode(node);
|
|
75
|
+
break;
|
|
76
|
+
case 'defs':
|
|
77
|
+
traverseChildNodes = false;
|
|
78
|
+
break;
|
|
79
|
+
case 'use':
|
|
80
|
+
style = parseStyle(node, style);
|
|
81
|
+
var usedNodeId = node.href.baseVal.substring(1);
|
|
82
|
+
var usedNode = node.viewportElement.getElementById(usedNodeId);
|
|
83
|
+
if (usedNode) {
|
|
84
|
+
parseNode(usedNode, style);
|
|
85
|
+
} else {
|
|
86
|
+
console.warn("SVGLoader: 'use node' references non-existent node id: " + usedNodeId);
|
|
87
|
+
}
|
|
88
|
+
break;
|
|
89
|
+
default:
|
|
90
|
+
// console.log( node );
|
|
91
|
+
}
|
|
92
|
+
if (path) {
|
|
93
|
+
if (style.fill !== undefined && style.fill !== 'none') {
|
|
94
|
+
path.color.setStyle(style.fill);
|
|
95
|
+
}
|
|
96
|
+
transformPath(path, currentTransform);
|
|
97
|
+
paths.push(path);
|
|
98
|
+
path.userData = {
|
|
99
|
+
node: node,
|
|
100
|
+
style: style
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
if (traverseChildNodes) {
|
|
104
|
+
var nodes = node.childNodes;
|
|
105
|
+
for (var i = 0; i < nodes.length; i++) {
|
|
106
|
+
parseNode(nodes[i], style);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
if (transform) {
|
|
110
|
+
transformStack.pop();
|
|
111
|
+
if (transformStack.length > 0) {
|
|
112
|
+
currentTransform.copy(transformStack[transformStack.length - 1]);
|
|
113
|
+
} else {
|
|
114
|
+
currentTransform.identity();
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
function parsePathNode(node) {
|
|
119
|
+
var path = new ShapePath();
|
|
120
|
+
var point = new Vector2();
|
|
121
|
+
var control = new Vector2();
|
|
122
|
+
var firstPoint = new Vector2();
|
|
123
|
+
var isFirstPoint = true;
|
|
124
|
+
var doSetFirstPoint = false;
|
|
125
|
+
var d = node.getAttribute('d');
|
|
126
|
+
|
|
127
|
+
// console.log( d );
|
|
128
|
+
|
|
129
|
+
var commands = d.match(/[a-df-z][^a-df-z]*/gi);
|
|
130
|
+
for (var i = 0, l = commands.length; i < l; i++) {
|
|
131
|
+
var command = commands[i];
|
|
132
|
+
var type = command.charAt(0);
|
|
133
|
+
var data = command.substr(1).trim();
|
|
134
|
+
if (isFirstPoint === true) {
|
|
135
|
+
doSetFirstPoint = true;
|
|
136
|
+
isFirstPoint = false;
|
|
137
|
+
}
|
|
138
|
+
switch (type) {
|
|
139
|
+
case 'M':
|
|
140
|
+
var numbers = parseFloats(data);
|
|
141
|
+
for (var j = 0, jl = numbers.length; j < jl; j += 2) {
|
|
142
|
+
point.x = numbers[j + 0];
|
|
143
|
+
point.y = numbers[j + 1];
|
|
144
|
+
control.x = point.x;
|
|
145
|
+
control.y = point.y;
|
|
146
|
+
if (j === 0) {
|
|
147
|
+
path.moveTo(point.x, point.y);
|
|
148
|
+
} else {
|
|
149
|
+
path.lineTo(point.x, point.y);
|
|
150
|
+
}
|
|
151
|
+
if (j === 0 && doSetFirstPoint === true) firstPoint.copy(point);
|
|
152
|
+
}
|
|
153
|
+
break;
|
|
154
|
+
case 'H':
|
|
155
|
+
var numbers = parseFloats(data);
|
|
156
|
+
for (var j = 0, jl = numbers.length; j < jl; j++) {
|
|
157
|
+
point.x = numbers[j];
|
|
158
|
+
control.x = point.x;
|
|
159
|
+
control.y = point.y;
|
|
160
|
+
path.lineTo(point.x, point.y);
|
|
161
|
+
if (j === 0 && doSetFirstPoint === true) firstPoint.copy(point);
|
|
162
|
+
}
|
|
163
|
+
break;
|
|
164
|
+
case 'V':
|
|
165
|
+
var numbers = parseFloats(data);
|
|
166
|
+
for (var j = 0, jl = numbers.length; j < jl; j++) {
|
|
167
|
+
point.y = numbers[j];
|
|
168
|
+
control.x = point.x;
|
|
169
|
+
control.y = point.y;
|
|
170
|
+
path.lineTo(point.x, point.y);
|
|
171
|
+
if (j === 0 && doSetFirstPoint === true) firstPoint.copy(point);
|
|
172
|
+
}
|
|
173
|
+
break;
|
|
174
|
+
case 'L':
|
|
175
|
+
var numbers = parseFloats(data);
|
|
176
|
+
for (var j = 0, jl = numbers.length; j < jl; j += 2) {
|
|
177
|
+
point.x = numbers[j + 0];
|
|
178
|
+
point.y = numbers[j + 1];
|
|
179
|
+
control.x = point.x;
|
|
180
|
+
control.y = point.y;
|
|
181
|
+
path.lineTo(point.x, point.y);
|
|
182
|
+
if (j === 0 && doSetFirstPoint === true) firstPoint.copy(point);
|
|
183
|
+
}
|
|
184
|
+
break;
|
|
185
|
+
case 'C':
|
|
186
|
+
var numbers = parseFloats(data);
|
|
187
|
+
for (var j = 0, jl = numbers.length; j < jl; j += 6) {
|
|
188
|
+
path.bezierCurveTo(numbers[j + 0], numbers[j + 1], numbers[j + 2], numbers[j + 3], numbers[j + 4], numbers[j + 5]);
|
|
189
|
+
control.x = numbers[j + 2];
|
|
190
|
+
control.y = numbers[j + 3];
|
|
191
|
+
point.x = numbers[j + 4];
|
|
192
|
+
point.y = numbers[j + 5];
|
|
193
|
+
if (j === 0 && doSetFirstPoint === true) firstPoint.copy(point);
|
|
194
|
+
}
|
|
195
|
+
break;
|
|
196
|
+
case 'S':
|
|
197
|
+
var numbers = parseFloats(data);
|
|
198
|
+
for (var j = 0, jl = numbers.length; j < jl; j += 4) {
|
|
199
|
+
path.bezierCurveTo(getReflection(point.x, control.x), getReflection(point.y, control.y), numbers[j + 0], numbers[j + 1], numbers[j + 2], numbers[j + 3]);
|
|
200
|
+
control.x = numbers[j + 0];
|
|
201
|
+
control.y = numbers[j + 1];
|
|
202
|
+
point.x = numbers[j + 2];
|
|
203
|
+
point.y = numbers[j + 3];
|
|
204
|
+
if (j === 0 && doSetFirstPoint === true) firstPoint.copy(point);
|
|
205
|
+
}
|
|
206
|
+
break;
|
|
207
|
+
case 'Q':
|
|
208
|
+
var numbers = parseFloats(data);
|
|
209
|
+
for (var j = 0, jl = numbers.length; j < jl; j += 4) {
|
|
210
|
+
path.quadraticCurveTo(numbers[j + 0], numbers[j + 1], numbers[j + 2], numbers[j + 3]);
|
|
211
|
+
control.x = numbers[j + 0];
|
|
212
|
+
control.y = numbers[j + 1];
|
|
213
|
+
point.x = numbers[j + 2];
|
|
214
|
+
point.y = numbers[j + 3];
|
|
215
|
+
if (j === 0 && doSetFirstPoint === true) firstPoint.copy(point);
|
|
216
|
+
}
|
|
217
|
+
break;
|
|
218
|
+
case 'T':
|
|
219
|
+
var numbers = parseFloats(data);
|
|
220
|
+
for (var j = 0, jl = numbers.length; j < jl; j += 2) {
|
|
221
|
+
var rx = getReflection(point.x, control.x);
|
|
222
|
+
var ry = getReflection(point.y, control.y);
|
|
223
|
+
path.quadraticCurveTo(rx, ry, numbers[j + 0], numbers[j + 1]);
|
|
224
|
+
control.x = rx;
|
|
225
|
+
control.y = ry;
|
|
226
|
+
point.x = numbers[j + 0];
|
|
227
|
+
point.y = numbers[j + 1];
|
|
228
|
+
if (j === 0 && doSetFirstPoint === true) firstPoint.copy(point);
|
|
229
|
+
}
|
|
230
|
+
break;
|
|
231
|
+
case 'A':
|
|
232
|
+
var numbers = parseFloats(data);
|
|
233
|
+
for (var j = 0, jl = numbers.length; j < jl; j += 7) {
|
|
234
|
+
var start = point.clone();
|
|
235
|
+
point.x = numbers[j + 5];
|
|
236
|
+
point.y = numbers[j + 6];
|
|
237
|
+
control.x = point.x;
|
|
238
|
+
control.y = point.y;
|
|
239
|
+
parseArcCommand(path, numbers[j], numbers[j + 1], numbers[j + 2], numbers[j + 3], numbers[j + 4], start, point);
|
|
240
|
+
if (j === 0 && doSetFirstPoint === true) firstPoint.copy(point);
|
|
241
|
+
}
|
|
242
|
+
break;
|
|
243
|
+
case 'm':
|
|
244
|
+
var numbers = parseFloats(data);
|
|
245
|
+
for (var j = 0, jl = numbers.length; j < jl; j += 2) {
|
|
246
|
+
point.x += numbers[j + 0];
|
|
247
|
+
point.y += numbers[j + 1];
|
|
248
|
+
control.x = point.x;
|
|
249
|
+
control.y = point.y;
|
|
250
|
+
if (j === 0) {
|
|
251
|
+
path.moveTo(point.x, point.y);
|
|
252
|
+
} else {
|
|
253
|
+
path.lineTo(point.x, point.y);
|
|
254
|
+
}
|
|
255
|
+
if (j === 0 && doSetFirstPoint === true) firstPoint.copy(point);
|
|
256
|
+
}
|
|
257
|
+
break;
|
|
258
|
+
case 'h':
|
|
259
|
+
var numbers = parseFloats(data);
|
|
260
|
+
for (var j = 0, jl = numbers.length; j < jl; j++) {
|
|
261
|
+
point.x += numbers[j];
|
|
262
|
+
control.x = point.x;
|
|
263
|
+
control.y = point.y;
|
|
264
|
+
path.lineTo(point.x, point.y);
|
|
265
|
+
if (j === 0 && doSetFirstPoint === true) firstPoint.copy(point);
|
|
266
|
+
}
|
|
267
|
+
break;
|
|
268
|
+
case 'v':
|
|
269
|
+
var numbers = parseFloats(data);
|
|
270
|
+
for (var j = 0, jl = numbers.length; j < jl; j++) {
|
|
271
|
+
point.y += numbers[j];
|
|
272
|
+
control.x = point.x;
|
|
273
|
+
control.y = point.y;
|
|
274
|
+
path.lineTo(point.x, point.y);
|
|
275
|
+
if (j === 0 && doSetFirstPoint === true) firstPoint.copy(point);
|
|
276
|
+
}
|
|
277
|
+
break;
|
|
278
|
+
case 'l':
|
|
279
|
+
var numbers = parseFloats(data);
|
|
280
|
+
for (var j = 0, jl = numbers.length; j < jl; j += 2) {
|
|
281
|
+
point.x += numbers[j + 0];
|
|
282
|
+
point.y += numbers[j + 1];
|
|
283
|
+
control.x = point.x;
|
|
284
|
+
control.y = point.y;
|
|
285
|
+
path.lineTo(point.x, point.y);
|
|
286
|
+
if (j === 0 && doSetFirstPoint === true) firstPoint.copy(point);
|
|
287
|
+
}
|
|
288
|
+
break;
|
|
289
|
+
case 'c':
|
|
290
|
+
var numbers = parseFloats(data);
|
|
291
|
+
for (var j = 0, jl = numbers.length; j < jl; j += 6) {
|
|
292
|
+
path.bezierCurveTo(point.x + numbers[j + 0], point.y + numbers[j + 1], point.x + numbers[j + 2], point.y + numbers[j + 3], point.x + numbers[j + 4], point.y + numbers[j + 5]);
|
|
293
|
+
control.x = point.x + numbers[j + 2];
|
|
294
|
+
control.y = point.y + numbers[j + 3];
|
|
295
|
+
point.x += numbers[j + 4];
|
|
296
|
+
point.y += numbers[j + 5];
|
|
297
|
+
if (j === 0 && doSetFirstPoint === true) firstPoint.copy(point);
|
|
298
|
+
}
|
|
299
|
+
break;
|
|
300
|
+
case 's':
|
|
301
|
+
var numbers = parseFloats(data);
|
|
302
|
+
for (var j = 0, jl = numbers.length; j < jl; j += 4) {
|
|
303
|
+
path.bezierCurveTo(getReflection(point.x, control.x), getReflection(point.y, control.y), point.x + numbers[j + 0], point.y + numbers[j + 1], point.x + numbers[j + 2], point.y + numbers[j + 3]);
|
|
304
|
+
control.x = point.x + numbers[j + 0];
|
|
305
|
+
control.y = point.y + numbers[j + 1];
|
|
306
|
+
point.x += numbers[j + 2];
|
|
307
|
+
point.y += numbers[j + 3];
|
|
308
|
+
if (j === 0 && doSetFirstPoint === true) firstPoint.copy(point);
|
|
309
|
+
}
|
|
310
|
+
break;
|
|
311
|
+
case 'q':
|
|
312
|
+
var numbers = parseFloats(data);
|
|
313
|
+
for (var j = 0, jl = numbers.length; j < jl; j += 4) {
|
|
314
|
+
path.quadraticCurveTo(point.x + numbers[j + 0], point.y + numbers[j + 1], point.x + numbers[j + 2], point.y + numbers[j + 3]);
|
|
315
|
+
control.x = point.x + numbers[j + 0];
|
|
316
|
+
control.y = point.y + numbers[j + 1];
|
|
317
|
+
point.x += numbers[j + 2];
|
|
318
|
+
point.y += numbers[j + 3];
|
|
319
|
+
if (j === 0 && doSetFirstPoint === true) firstPoint.copy(point);
|
|
320
|
+
}
|
|
321
|
+
break;
|
|
322
|
+
case 't':
|
|
323
|
+
var numbers = parseFloats(data);
|
|
324
|
+
for (var j = 0, jl = numbers.length; j < jl; j += 2) {
|
|
325
|
+
var rx = getReflection(point.x, control.x);
|
|
326
|
+
var ry = getReflection(point.y, control.y);
|
|
327
|
+
path.quadraticCurveTo(rx, ry, point.x + numbers[j + 0], point.y + numbers[j + 1]);
|
|
328
|
+
control.x = rx;
|
|
329
|
+
control.y = ry;
|
|
330
|
+
point.x = point.x + numbers[j + 0];
|
|
331
|
+
point.y = point.y + numbers[j + 1];
|
|
332
|
+
if (j === 0 && doSetFirstPoint === true) firstPoint.copy(point);
|
|
333
|
+
}
|
|
334
|
+
break;
|
|
335
|
+
case 'a':
|
|
336
|
+
var numbers = parseFloats(data);
|
|
337
|
+
for (var j = 0, jl = numbers.length; j < jl; j += 7) {
|
|
338
|
+
var start = point.clone();
|
|
339
|
+
point.x += numbers[j + 5];
|
|
340
|
+
point.y += numbers[j + 6];
|
|
341
|
+
control.x = point.x;
|
|
342
|
+
control.y = point.y;
|
|
343
|
+
parseArcCommand(path, numbers[j], numbers[j + 1], numbers[j + 2], numbers[j + 3], numbers[j + 4], start, point);
|
|
344
|
+
if (j === 0 && doSetFirstPoint === true) firstPoint.copy(point);
|
|
345
|
+
}
|
|
346
|
+
break;
|
|
347
|
+
case 'Z':
|
|
348
|
+
case 'z':
|
|
349
|
+
path.currentPath.autoClose = true;
|
|
350
|
+
if (path.currentPath.curves.length > 0) {
|
|
351
|
+
// Reset point to beginning of Path
|
|
352
|
+
point.copy(firstPoint);
|
|
353
|
+
path.currentPath.currentPoint.copy(point);
|
|
354
|
+
isFirstPoint = true;
|
|
355
|
+
}
|
|
356
|
+
break;
|
|
357
|
+
default:
|
|
358
|
+
console.warn(command);
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
// console.log( type, parseFloats( data ), parseFloats( data ).length )
|
|
362
|
+
|
|
363
|
+
doSetFirstPoint = false;
|
|
364
|
+
}
|
|
365
|
+
return path;
|
|
366
|
+
}
|
|
367
|
+
function parseCSSStylesheet(node) {
|
|
368
|
+
if (!node.sheet || !node.sheet.cssRules || !node.sheet.cssRules.length) return;
|
|
369
|
+
for (var i = 0; i < node.sheet.cssRules.length; i++) {
|
|
370
|
+
var stylesheet = node.sheet.cssRules[i];
|
|
371
|
+
if (stylesheet.type !== 1) continue;
|
|
372
|
+
var selectorList = stylesheet.selectorText.split(/,/gm).filter(Boolean).map(function (i) {
|
|
373
|
+
return i.trim();
|
|
374
|
+
});
|
|
375
|
+
for (var j = 0; j < selectorList.length; j++) {
|
|
376
|
+
stylesheets[selectorList[j]] = Object.assign(stylesheets[selectorList[j]] || {}, stylesheet.style);
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
/**
|
|
382
|
+
* https://www.w3.org/TR/SVG/implnote.html#ArcImplementationNotes
|
|
383
|
+
* https://mortoray.com/2017/02/16/rendering-an-svg-elliptical-arc-as-bezier-curves/ Appendix: Endpoint to center arc conversion
|
|
384
|
+
* From
|
|
385
|
+
* rx ry x-axis-rotation large-arc-flag sweep-flag x y
|
|
386
|
+
* To
|
|
387
|
+
* aX, aY, xRadius, yRadius, aStartAngle, aEndAngle, aClockwise, aRotation
|
|
388
|
+
*/
|
|
389
|
+
|
|
390
|
+
function parseArcCommand(path, rx, ry, x_axis_rotation, large_arc_flag, sweep_flag, start, end) {
|
|
391
|
+
x_axis_rotation = x_axis_rotation * Math.PI / 180;
|
|
392
|
+
|
|
393
|
+
// Ensure radii are positive
|
|
394
|
+
rx = Math.abs(rx);
|
|
395
|
+
ry = Math.abs(ry);
|
|
396
|
+
|
|
397
|
+
// Compute (x1', y1')
|
|
398
|
+
var dx2 = (start.x - end.x) / 2.0;
|
|
399
|
+
var dy2 = (start.y - end.y) / 2.0;
|
|
400
|
+
var x1p = Math.cos(x_axis_rotation) * dx2 + Math.sin(x_axis_rotation) * dy2;
|
|
401
|
+
var y1p = -Math.sin(x_axis_rotation) * dx2 + Math.cos(x_axis_rotation) * dy2;
|
|
402
|
+
|
|
403
|
+
// Compute (cx', cy')
|
|
404
|
+
var rxs = rx * rx;
|
|
405
|
+
var rys = ry * ry;
|
|
406
|
+
var x1ps = x1p * x1p;
|
|
407
|
+
var y1ps = y1p * y1p;
|
|
408
|
+
|
|
409
|
+
// Ensure radii are large enough
|
|
410
|
+
var cr = x1ps / rxs + y1ps / rys;
|
|
411
|
+
if (cr > 1) {
|
|
412
|
+
// scale up rx,ry equally so cr == 1
|
|
413
|
+
var s = Math.sqrt(cr);
|
|
414
|
+
rx = s * rx;
|
|
415
|
+
ry = s * ry;
|
|
416
|
+
rxs = rx * rx;
|
|
417
|
+
rys = ry * ry;
|
|
418
|
+
}
|
|
419
|
+
var dq = rxs * y1ps + rys * x1ps;
|
|
420
|
+
var pq = (rxs * rys - dq) / dq;
|
|
421
|
+
var q = Math.sqrt(Math.max(0, pq));
|
|
422
|
+
if (large_arc_flag === sweep_flag) q = -q;
|
|
423
|
+
var cxp = q * rx * y1p / ry;
|
|
424
|
+
var cyp = -q * ry * x1p / rx;
|
|
425
|
+
|
|
426
|
+
// Step 3: Compute (cx, cy) from (cx', cy')
|
|
427
|
+
var cx = Math.cos(x_axis_rotation) * cxp - Math.sin(x_axis_rotation) * cyp + (start.x + end.x) / 2;
|
|
428
|
+
var cy = Math.sin(x_axis_rotation) * cxp + Math.cos(x_axis_rotation) * cyp + (start.y + end.y) / 2;
|
|
429
|
+
|
|
430
|
+
// Step 4: Compute ��1 and ����
|
|
431
|
+
var theta = svgAngle(1, 0, (x1p - cxp) / rx, (y1p - cyp) / ry);
|
|
432
|
+
var delta = svgAngle((x1p - cxp) / rx, (y1p - cyp) / ry, (-x1p - cxp) / rx, (-y1p - cyp) / ry) % (Math.PI * 2);
|
|
433
|
+
path.currentPath.absellipse(cx, cy, rx, ry, theta, theta + delta, sweep_flag === 0, x_axis_rotation);
|
|
434
|
+
}
|
|
435
|
+
function svgAngle(ux, uy, vx, vy) {
|
|
436
|
+
var dot = ux * vx + uy * vy;
|
|
437
|
+
var len = Math.sqrt(ux * ux + uy * uy) * Math.sqrt(vx * vx + vy * vy);
|
|
438
|
+
var ang = Math.acos(Math.max(-1, Math.min(1, dot / len))); // floating point precision, slightly over values appear
|
|
439
|
+
if (ux * vy - uy * vx < 0) ang = -ang;
|
|
440
|
+
return ang;
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
/*
|
|
444
|
+
* According to https://www.w3.org/TR/SVG/shapes.html#RectElementRXAttribute
|
|
445
|
+
* rounded corner should be rendered to elliptical arc, but bezier curve does the job well enough
|
|
446
|
+
*/
|
|
447
|
+
function parseRectNode(node) {
|
|
448
|
+
var x = parseFloatWithUnits(node.getAttribute('x') || 0);
|
|
449
|
+
var y = parseFloatWithUnits(node.getAttribute('y') || 0);
|
|
450
|
+
var rx = parseFloatWithUnits(node.getAttribute('rx') || 0);
|
|
451
|
+
var ry = parseFloatWithUnits(node.getAttribute('ry') || 0);
|
|
452
|
+
var w = parseFloatWithUnits(node.getAttribute('width'));
|
|
453
|
+
var h = parseFloatWithUnits(node.getAttribute('height'));
|
|
454
|
+
var path = new ShapePath();
|
|
455
|
+
path.moveTo(x + 2 * rx, y);
|
|
456
|
+
path.lineTo(x + w - 2 * rx, y);
|
|
457
|
+
if (rx !== 0 || ry !== 0) path.bezierCurveTo(x + w, y, x + w, y, x + w, y + 2 * ry);
|
|
458
|
+
path.lineTo(x + w, y + h - 2 * ry);
|
|
459
|
+
if (rx !== 0 || ry !== 0) path.bezierCurveTo(x + w, y + h, x + w, y + h, x + w - 2 * rx, y + h);
|
|
460
|
+
path.lineTo(x + 2 * rx, y + h);
|
|
461
|
+
if (rx !== 0 || ry !== 0) {
|
|
462
|
+
path.bezierCurveTo(x, y + h, x, y + h, x, y + h - 2 * ry);
|
|
463
|
+
}
|
|
464
|
+
path.lineTo(x, y + 2 * ry);
|
|
465
|
+
if (rx !== 0 || ry !== 0) {
|
|
466
|
+
path.bezierCurveTo(x, y, x, y, x + 2 * rx, y);
|
|
467
|
+
}
|
|
468
|
+
return path;
|
|
469
|
+
}
|
|
470
|
+
function parsePolygonNode(node) {
|
|
471
|
+
function iterator(match, a, b) {
|
|
472
|
+
var x = parseFloatWithUnits(a);
|
|
473
|
+
var y = parseFloatWithUnits(b);
|
|
474
|
+
if (index === 0) {
|
|
475
|
+
path.moveTo(x, y);
|
|
476
|
+
} else {
|
|
477
|
+
path.lineTo(x, y);
|
|
478
|
+
}
|
|
479
|
+
index++;
|
|
480
|
+
}
|
|
481
|
+
var regex = /(-?[\d\.?]+)[,|\s](-?[\d\.?]+)/g;
|
|
482
|
+
var path = new ShapePath();
|
|
483
|
+
var index = 0;
|
|
484
|
+
node.getAttribute('points').replace(regex, iterator);
|
|
485
|
+
path.currentPath.autoClose = true;
|
|
486
|
+
return path;
|
|
487
|
+
}
|
|
488
|
+
function parsePolylineNode(node) {
|
|
489
|
+
function iterator(match, a, b) {
|
|
490
|
+
var x = parseFloatWithUnits(a);
|
|
491
|
+
var y = parseFloatWithUnits(b);
|
|
492
|
+
if (index === 0) {
|
|
493
|
+
path.moveTo(x, y);
|
|
494
|
+
} else {
|
|
495
|
+
path.lineTo(x, y);
|
|
496
|
+
}
|
|
497
|
+
index++;
|
|
498
|
+
}
|
|
499
|
+
var regex = /(-?[\d\.?]+)[,|\s](-?[\d\.?]+)/g;
|
|
500
|
+
var path = new ShapePath();
|
|
501
|
+
var index = 0;
|
|
502
|
+
node.getAttribute('points').replace(regex, iterator);
|
|
503
|
+
path.currentPath.autoClose = false;
|
|
504
|
+
return path;
|
|
505
|
+
}
|
|
506
|
+
function parseCircleNode(node) {
|
|
507
|
+
var x = parseFloatWithUnits(node.getAttribute('cx'));
|
|
508
|
+
var y = parseFloatWithUnits(node.getAttribute('cy'));
|
|
509
|
+
var r = parseFloatWithUnits(node.getAttribute('r'));
|
|
510
|
+
var subpath = new Path();
|
|
511
|
+
subpath.absarc(x, y, r, 0, Math.PI * 2);
|
|
512
|
+
var path = new ShapePath();
|
|
513
|
+
path.subPaths.push(subpath);
|
|
514
|
+
return path;
|
|
515
|
+
}
|
|
516
|
+
function parseEllipseNode(node) {
|
|
517
|
+
var x = parseFloatWithUnits(node.getAttribute('cx'));
|
|
518
|
+
var y = parseFloatWithUnits(node.getAttribute('cy'));
|
|
519
|
+
var rx = parseFloatWithUnits(node.getAttribute('rx'));
|
|
520
|
+
var ry = parseFloatWithUnits(node.getAttribute('ry'));
|
|
521
|
+
var subpath = new Path();
|
|
522
|
+
subpath.absellipse(x, y, rx, ry, 0, Math.PI * 2);
|
|
523
|
+
var path = new ShapePath();
|
|
524
|
+
path.subPaths.push(subpath);
|
|
525
|
+
return path;
|
|
526
|
+
}
|
|
527
|
+
function parseLineNode(node) {
|
|
528
|
+
var x1 = parseFloatWithUnits(node.getAttribute('x1'));
|
|
529
|
+
var y1 = parseFloatWithUnits(node.getAttribute('y1'));
|
|
530
|
+
var x2 = parseFloatWithUnits(node.getAttribute('x2'));
|
|
531
|
+
var y2 = parseFloatWithUnits(node.getAttribute('y2'));
|
|
532
|
+
var path = new ShapePath();
|
|
533
|
+
path.moveTo(x1, y1);
|
|
534
|
+
path.lineTo(x2, y2);
|
|
535
|
+
path.currentPath.autoClose = false;
|
|
536
|
+
return path;
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
//
|
|
540
|
+
|
|
541
|
+
function parseStyle(node, style) {
|
|
542
|
+
style = Object.assign({}, style); // clone style
|
|
543
|
+
|
|
544
|
+
var stylesheetStyles = {};
|
|
545
|
+
if (node.hasAttribute('class')) {
|
|
546
|
+
var classSelectors = node.getAttribute('class').split(/\s/).filter(Boolean).map(function (i) {
|
|
547
|
+
return i.trim();
|
|
548
|
+
});
|
|
549
|
+
for (var i = 0; i < classSelectors.length; i++) {
|
|
550
|
+
stylesheetStyles = Object.assign(stylesheetStyles, stylesheets['.' + classSelectors[i]]);
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
if (node.hasAttribute('id')) {
|
|
554
|
+
stylesheetStyles = Object.assign(stylesheetStyles, stylesheets['#' + node.getAttribute('id')]);
|
|
555
|
+
}
|
|
556
|
+
function addStyle(svgName, jsName, adjustFunction) {
|
|
557
|
+
if (adjustFunction === undefined) adjustFunction = function copy(v) {
|
|
558
|
+
if (v.startsWith('url')) console.warn('SVGLoader: url access in attributes is not implemented.');
|
|
559
|
+
return v;
|
|
560
|
+
};
|
|
561
|
+
if (node.hasAttribute(svgName)) style[jsName] = adjustFunction(node.getAttribute(svgName));
|
|
562
|
+
if (stylesheetStyles[svgName]) style[jsName] = adjustFunction(stylesheetStyles[svgName]);
|
|
563
|
+
if (node.style && node.style[svgName] !== '') style[jsName] = adjustFunction(node.style[svgName]);
|
|
564
|
+
}
|
|
565
|
+
function clamp(v) {
|
|
566
|
+
return Math.max(0, Math.min(1, parseFloatWithUnits(v)));
|
|
567
|
+
}
|
|
568
|
+
function positive(v) {
|
|
569
|
+
return Math.max(0, parseFloatWithUnits(v));
|
|
570
|
+
}
|
|
571
|
+
addStyle('fill', 'fill');
|
|
572
|
+
addStyle('fill-opacity', 'fillOpacity', clamp);
|
|
573
|
+
addStyle('opacity', 'opacity', clamp);
|
|
574
|
+
addStyle('stroke', 'stroke');
|
|
575
|
+
addStyle('stroke-opacity', 'strokeOpacity', clamp);
|
|
576
|
+
addStyle('stroke-width', 'strokeWidth', positive);
|
|
577
|
+
addStyle('stroke-linejoin', 'strokeLineJoin');
|
|
578
|
+
addStyle('stroke-linecap', 'strokeLineCap');
|
|
579
|
+
addStyle('stroke-miterlimit', 'strokeMiterLimit', positive);
|
|
580
|
+
addStyle('visibility', 'visibility');
|
|
581
|
+
return style;
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
// http://www.w3.org/TR/SVG11/implnote.html#PathElementImplementationNotes
|
|
585
|
+
|
|
586
|
+
function getReflection(a, b) {
|
|
587
|
+
return a - (b - a);
|
|
588
|
+
}
|
|
589
|
+
function parseFloats(string) {
|
|
590
|
+
var array = string.split(/[\s,]+|(?=\s?[+\-])/);
|
|
591
|
+
for (var i = 0; i < array.length; i++) {
|
|
592
|
+
var number = array[i];
|
|
593
|
+
|
|
594
|
+
// Handle values like 48.6037.7.8
|
|
595
|
+
// TODO Find a regex for this
|
|
596
|
+
|
|
597
|
+
if (number.indexOf('.') !== number.lastIndexOf('.')) {
|
|
598
|
+
var split = number.split('.');
|
|
599
|
+
for (var s = 2; s < split.length; s++) {
|
|
600
|
+
array.splice(i + s - 1, 0, '0.' + split[s]);
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
array[i] = parseFloatWithUnits(number);
|
|
604
|
+
}
|
|
605
|
+
return array;
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
// Units
|
|
609
|
+
|
|
610
|
+
var units = ['mm', 'cm', 'in', 'pt', 'pc', 'px'];
|
|
611
|
+
|
|
612
|
+
// Conversion: [ fromUnit ][ toUnit ] (-1 means dpi dependent)
|
|
613
|
+
var unitConversion = {
|
|
614
|
+
mm: {
|
|
615
|
+
mm: 1,
|
|
616
|
+
cm: 0.1,
|
|
617
|
+
"in": 1 / 25.4,
|
|
618
|
+
pt: 72 / 25.4,
|
|
619
|
+
pc: 6 / 25.4,
|
|
620
|
+
px: -1
|
|
621
|
+
},
|
|
622
|
+
cm: {
|
|
623
|
+
mm: 10,
|
|
624
|
+
cm: 1,
|
|
625
|
+
"in": 1 / 2.54,
|
|
626
|
+
pt: 72 / 2.54,
|
|
627
|
+
pc: 6 / 2.54,
|
|
628
|
+
px: -1
|
|
629
|
+
},
|
|
630
|
+
"in": {
|
|
631
|
+
mm: 25.4,
|
|
632
|
+
cm: 2.54,
|
|
633
|
+
"in": 1,
|
|
634
|
+
pt: 72,
|
|
635
|
+
pc: 6,
|
|
636
|
+
px: -1
|
|
637
|
+
},
|
|
638
|
+
pt: {
|
|
639
|
+
mm: 25.4 / 72,
|
|
640
|
+
cm: 2.54 / 72,
|
|
641
|
+
"in": 1 / 72,
|
|
642
|
+
pt: 1,
|
|
643
|
+
pc: 6 / 72,
|
|
644
|
+
px: -1
|
|
645
|
+
},
|
|
646
|
+
pc: {
|
|
647
|
+
mm: 25.4 / 6,
|
|
648
|
+
cm: 2.54 / 6,
|
|
649
|
+
"in": 1 / 6,
|
|
650
|
+
pt: 72 / 6,
|
|
651
|
+
pc: 1,
|
|
652
|
+
px: -1
|
|
653
|
+
},
|
|
654
|
+
px: {
|
|
655
|
+
px: 1
|
|
656
|
+
}
|
|
657
|
+
};
|
|
658
|
+
function parseFloatWithUnits(string) {
|
|
659
|
+
var theUnit = 'px';
|
|
660
|
+
if (typeof string === 'string' || string instanceof String) {
|
|
661
|
+
for (var i = 0, n = units.length; i < n; i++) {
|
|
662
|
+
var u = units[i];
|
|
663
|
+
if (string.endsWith(u)) {
|
|
664
|
+
theUnit = u;
|
|
665
|
+
string = string.substring(0, string.length - u.length);
|
|
666
|
+
break;
|
|
667
|
+
}
|
|
668
|
+
}
|
|
669
|
+
}
|
|
670
|
+
var scale = undefined;
|
|
671
|
+
if (theUnit === 'px' && scope.defaultUnit !== 'px') {
|
|
672
|
+
// Conversion scale from pixels to inches, then to default units
|
|
673
|
+
|
|
674
|
+
scale = unitConversion['in'][scope.defaultUnit] / scope.defaultDPI;
|
|
675
|
+
} else {
|
|
676
|
+
scale = unitConversion[theUnit][scope.defaultUnit];
|
|
677
|
+
if (scale < 0) {
|
|
678
|
+
// Conversion scale to pixels
|
|
679
|
+
|
|
680
|
+
scale = unitConversion[theUnit]['in'] * scope.defaultDPI;
|
|
681
|
+
}
|
|
682
|
+
}
|
|
683
|
+
return scale * parseFloat(string);
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
// Transforms
|
|
687
|
+
|
|
688
|
+
function getNodeTransform(node) {
|
|
689
|
+
if (!(node.hasAttribute('transform') || node.nodeName === 'use' && (node.hasAttribute('x') || node.hasAttribute('y')))) {
|
|
690
|
+
return null;
|
|
691
|
+
}
|
|
692
|
+
var transform = parseNodeTransform(node);
|
|
693
|
+
if (transformStack.length > 0) {
|
|
694
|
+
transform.premultiply(transformStack[transformStack.length - 1]);
|
|
695
|
+
}
|
|
696
|
+
currentTransform.copy(transform);
|
|
697
|
+
transformStack.push(transform);
|
|
698
|
+
return transform;
|
|
699
|
+
}
|
|
700
|
+
function parseNodeTransform(node) {
|
|
701
|
+
var transform = new Matrix3();
|
|
702
|
+
var currentTransform = tempTransform0;
|
|
703
|
+
if (node.nodeName === 'use' && (node.hasAttribute('x') || node.hasAttribute('y'))) {
|
|
704
|
+
var tx = parseFloatWithUnits(node.getAttribute('x'));
|
|
705
|
+
var ty = parseFloatWithUnits(node.getAttribute('y'));
|
|
706
|
+
transform.translate(tx, ty);
|
|
707
|
+
}
|
|
708
|
+
if (node.hasAttribute('transform')) {
|
|
709
|
+
var transformsTexts = node.getAttribute('transform').split(')');
|
|
710
|
+
for (var tIndex = transformsTexts.length - 1; tIndex >= 0; tIndex--) {
|
|
711
|
+
var transformText = transformsTexts[tIndex].trim();
|
|
712
|
+
if (transformText === '') continue;
|
|
713
|
+
var openParPos = transformText.indexOf('(');
|
|
714
|
+
var closeParPos = transformText.length;
|
|
715
|
+
if (openParPos > 0 && openParPos < closeParPos) {
|
|
716
|
+
var transformType = transformText.substr(0, openParPos);
|
|
717
|
+
var array = parseFloats(transformText.substr(openParPos + 1, closeParPos - openParPos - 1));
|
|
718
|
+
currentTransform.identity();
|
|
719
|
+
switch (transformType) {
|
|
720
|
+
case 'translate':
|
|
721
|
+
if (array.length >= 1) {
|
|
722
|
+
var tx = array[0];
|
|
723
|
+
var ty = tx;
|
|
724
|
+
if (array.length >= 2) {
|
|
725
|
+
ty = array[1];
|
|
726
|
+
}
|
|
727
|
+
currentTransform.translate(tx, ty);
|
|
728
|
+
}
|
|
729
|
+
break;
|
|
730
|
+
case 'rotate':
|
|
731
|
+
if (array.length >= 1) {
|
|
732
|
+
var angle = 0;
|
|
733
|
+
var cx = 0;
|
|
734
|
+
var cy = 0;
|
|
735
|
+
|
|
736
|
+
// Angle
|
|
737
|
+
angle = -array[0] * Math.PI / 180;
|
|
738
|
+
if (array.length >= 3) {
|
|
739
|
+
// Center x, y
|
|
740
|
+
cx = array[1];
|
|
741
|
+
cy = array[2];
|
|
742
|
+
}
|
|
743
|
+
|
|
744
|
+
// Rotate around center (cx, cy)
|
|
745
|
+
tempTransform1.identity().translate(-cx, -cy);
|
|
746
|
+
tempTransform2.identity().rotate(angle);
|
|
747
|
+
tempTransform3.multiplyMatrices(tempTransform2, tempTransform1);
|
|
748
|
+
tempTransform1.identity().translate(cx, cy);
|
|
749
|
+
currentTransform.multiplyMatrices(tempTransform1, tempTransform3);
|
|
750
|
+
}
|
|
751
|
+
break;
|
|
752
|
+
case 'scale':
|
|
753
|
+
if (array.length >= 1) {
|
|
754
|
+
var scaleX = array[0];
|
|
755
|
+
var scaleY = scaleX;
|
|
756
|
+
if (array.length >= 2) {
|
|
757
|
+
scaleY = array[1];
|
|
758
|
+
}
|
|
759
|
+
currentTransform.scale(scaleX, scaleY);
|
|
760
|
+
}
|
|
761
|
+
break;
|
|
762
|
+
case 'skewX':
|
|
763
|
+
if (array.length === 1) {
|
|
764
|
+
currentTransform.set(1, Math.tan(array[0] * Math.PI / 180), 0, 0, 1, 0, 0, 0, 1);
|
|
765
|
+
}
|
|
766
|
+
break;
|
|
767
|
+
case 'skewY':
|
|
768
|
+
if (array.length === 1) {
|
|
769
|
+
currentTransform.set(1, 0, 0, Math.tan(array[0] * Math.PI / 180), 1, 0, 0, 0, 1);
|
|
770
|
+
}
|
|
771
|
+
break;
|
|
772
|
+
case 'matrix':
|
|
773
|
+
if (array.length === 6) {
|
|
774
|
+
currentTransform.set(array[0], array[2], array[4], array[1], array[3], array[5], 0, 0, 1);
|
|
775
|
+
}
|
|
776
|
+
break;
|
|
777
|
+
}
|
|
778
|
+
}
|
|
779
|
+
transform.premultiply(currentTransform);
|
|
780
|
+
}
|
|
781
|
+
}
|
|
782
|
+
return transform;
|
|
783
|
+
}
|
|
784
|
+
function transformPath(path, m) {
|
|
785
|
+
function transfVec2(v2) {
|
|
786
|
+
tempV3.set(v2.x, v2.y, 1).applyMatrix3(m);
|
|
787
|
+
v2.set(tempV3.x, tempV3.y);
|
|
788
|
+
}
|
|
789
|
+
var isRotated = isTransformRotated(m);
|
|
790
|
+
var subPaths = path.subPaths;
|
|
791
|
+
for (var i = 0, n = subPaths.length; i < n; i++) {
|
|
792
|
+
var subPath = subPaths[i];
|
|
793
|
+
var curves = subPath.curves;
|
|
794
|
+
for (var j = 0; j < curves.length; j++) {
|
|
795
|
+
var curve = curves[j];
|
|
796
|
+
if (curve.isLineCurve) {
|
|
797
|
+
transfVec2(curve.v1);
|
|
798
|
+
transfVec2(curve.v2);
|
|
799
|
+
} else if (curve.isCubicBezierCurve) {
|
|
800
|
+
transfVec2(curve.v0);
|
|
801
|
+
transfVec2(curve.v1);
|
|
802
|
+
transfVec2(curve.v2);
|
|
803
|
+
transfVec2(curve.v3);
|
|
804
|
+
} else if (curve.isQuadraticBezierCurve) {
|
|
805
|
+
transfVec2(curve.v0);
|
|
806
|
+
transfVec2(curve.v1);
|
|
807
|
+
transfVec2(curve.v2);
|
|
808
|
+
} else if (curve.isEllipseCurve) {
|
|
809
|
+
if (isRotated) {
|
|
810
|
+
console.warn('SVGLoader: Elliptic arc or ellipse rotation or skewing is not implemented.');
|
|
811
|
+
}
|
|
812
|
+
tempV2.set(curve.aX, curve.aY);
|
|
813
|
+
transfVec2(tempV2);
|
|
814
|
+
curve.aX = tempV2.x;
|
|
815
|
+
curve.aY = tempV2.y;
|
|
816
|
+
curve.xRadius *= getTransformScaleX(m);
|
|
817
|
+
curve.yRadius *= getTransformScaleY(m);
|
|
818
|
+
}
|
|
819
|
+
}
|
|
820
|
+
}
|
|
821
|
+
}
|
|
822
|
+
function isTransformRotated(m) {
|
|
823
|
+
return m.elements[1] !== 0 || m.elements[3] !== 0;
|
|
824
|
+
}
|
|
825
|
+
function getTransformScaleX(m) {
|
|
826
|
+
var te = m.elements;
|
|
827
|
+
return Math.sqrt(te[0] * te[0] + te[1] * te[1]);
|
|
828
|
+
}
|
|
829
|
+
function getTransformScaleY(m) {
|
|
830
|
+
var te = m.elements;
|
|
831
|
+
return Math.sqrt(te[3] * te[3] + te[4] * te[4]);
|
|
832
|
+
}
|
|
833
|
+
|
|
834
|
+
//
|
|
835
|
+
|
|
836
|
+
var paths = [];
|
|
837
|
+
var stylesheets = {};
|
|
838
|
+
var transformStack = [];
|
|
839
|
+
var tempTransform0 = new Matrix3();
|
|
840
|
+
var tempTransform1 = new Matrix3();
|
|
841
|
+
var tempTransform2 = new Matrix3();
|
|
842
|
+
var tempTransform3 = new Matrix3();
|
|
843
|
+
var tempV2 = new Vector2();
|
|
844
|
+
var tempV3 = new Vector3();
|
|
845
|
+
var currentTransform = new Matrix3();
|
|
846
|
+
var xml = new DOMParser().parseFromString(text, 'image/svg+xml'); // application/xml
|
|
847
|
+
|
|
848
|
+
parseNode(xml.documentElement, {
|
|
849
|
+
fill: '#000',
|
|
850
|
+
fillOpacity: 1,
|
|
851
|
+
strokeOpacity: 1,
|
|
852
|
+
strokeWidth: 1,
|
|
853
|
+
strokeLineJoin: 'miter',
|
|
854
|
+
strokeLineCap: 'butt',
|
|
855
|
+
strokeMiterLimit: 4
|
|
856
|
+
});
|
|
857
|
+
var data = {
|
|
858
|
+
paths: paths,
|
|
859
|
+
xml: xml.documentElement
|
|
860
|
+
};
|
|
861
|
+
|
|
862
|
+
// console.log( paths );
|
|
863
|
+
return data;
|
|
864
|
+
}
|
|
865
|
+
});
|
|
866
|
+
SVGLoader.getStrokeStyle = function (width, color, lineJoin, lineCap, miterLimit) {
|
|
867
|
+
// Param width: Stroke width
|
|
868
|
+
// Param color: As returned by THREE.Color.getStyle()
|
|
869
|
+
// Param lineJoin: One of "round", "bevel", "miter" or "miter-limit"
|
|
870
|
+
// Param lineCap: One of "round", "square" or "butt"
|
|
871
|
+
// Param miterLimit: Maximum join length, in multiples of the "width" parameter (join is truncated if it exceeds that distance)
|
|
872
|
+
// Returns style object
|
|
873
|
+
|
|
874
|
+
width = width !== undefined ? width : 1;
|
|
875
|
+
color = color !== undefined ? color : '#000';
|
|
876
|
+
lineJoin = lineJoin !== undefined ? lineJoin : 'miter';
|
|
877
|
+
lineCap = lineCap !== undefined ? lineCap : 'butt';
|
|
878
|
+
miterLimit = miterLimit !== undefined ? miterLimit : 4;
|
|
879
|
+
return {
|
|
880
|
+
strokeColor: color,
|
|
881
|
+
strokeWidth: width,
|
|
882
|
+
strokeLineJoin: lineJoin,
|
|
883
|
+
strokeLineCap: lineCap,
|
|
884
|
+
strokeMiterLimit: miterLimit
|
|
885
|
+
};
|
|
886
|
+
};
|
|
887
|
+
SVGLoader.pointsToStroke = function (points, style, arcDivisions, minDistance) {
|
|
888
|
+
// Generates a stroke with some witdh around the given path.
|
|
889
|
+
// The path can be open or closed (last point equals to first point)
|
|
890
|
+
// Param points: Array of Vector2D (the path). Minimum 2 points.
|
|
891
|
+
// Param style: Object with SVG properties as returned by SVGLoader.getStrokeStyle(), or SVGLoader.parse() in the path.userData.style object
|
|
892
|
+
// Params arcDivisions: Arc divisions for round joins and endcaps. (Optional)
|
|
893
|
+
// Param minDistance: Points closer to this distance will be merged. (Optional)
|
|
894
|
+
// Returns BufferGeometry with stroke triangles (In plane z = 0). UV coordinates are generated ('u' along path. 'v' across it, from left to right)
|
|
895
|
+
|
|
896
|
+
var vertices = [];
|
|
897
|
+
var normals = [];
|
|
898
|
+
var uvs = [];
|
|
899
|
+
if (SVGLoader.pointsToStrokeWithBuffers(points, style, arcDivisions, minDistance, vertices, normals, uvs) === 0) {
|
|
900
|
+
return null;
|
|
901
|
+
}
|
|
902
|
+
var geometry = new BufferGeometry();
|
|
903
|
+
geometry.setAttribute('position', new Float32BufferAttribute(vertices, 3));
|
|
904
|
+
geometry.setAttribute('normal', new Float32BufferAttribute(normals, 3));
|
|
905
|
+
geometry.setAttribute('uv', new Float32BufferAttribute(uvs, 2));
|
|
906
|
+
return geometry;
|
|
907
|
+
};
|
|
908
|
+
SVGLoader.pointsToStrokeWithBuffers = function () {
|
|
909
|
+
var tempV2_1 = new Vector2();
|
|
910
|
+
var tempV2_2 = new Vector2();
|
|
911
|
+
var tempV2_3 = new Vector2();
|
|
912
|
+
var tempV2_4 = new Vector2();
|
|
913
|
+
var tempV2_5 = new Vector2();
|
|
914
|
+
var tempV2_6 = new Vector2();
|
|
915
|
+
var tempV2_7 = new Vector2();
|
|
916
|
+
var lastPointL = new Vector2();
|
|
917
|
+
var lastPointR = new Vector2();
|
|
918
|
+
var point0L = new Vector2();
|
|
919
|
+
var point0R = new Vector2();
|
|
920
|
+
var currentPointL = new Vector2();
|
|
921
|
+
var currentPointR = new Vector2();
|
|
922
|
+
var nextPointL = new Vector2();
|
|
923
|
+
var nextPointR = new Vector2();
|
|
924
|
+
var innerPoint = new Vector2();
|
|
925
|
+
var outerPoint = new Vector2();
|
|
926
|
+
return function (points, style, arcDivisions, minDistance, vertices, normals, uvs, vertexOffset) {
|
|
927
|
+
// This function can be called to update existing arrays or buffers.
|
|
928
|
+
// Accepts same parameters as pointsToStroke, plus the buffers and optional offset.
|
|
929
|
+
// Param vertexOffset: Offset vertices to start writing in the buffers (3 elements/vertex for vertices and normals, and 2 elements/vertex for uvs)
|
|
930
|
+
// Returns number of written vertices / normals / uvs pairs
|
|
931
|
+
// if 'vertices' parameter is undefined no triangles will be generated, but the returned vertices count will still be valid (useful to preallocate the buffers)
|
|
932
|
+
// 'normals' and 'uvs' buffers are optional
|
|
933
|
+
|
|
934
|
+
arcDivisions = arcDivisions !== undefined ? arcDivisions : 12;
|
|
935
|
+
minDistance = minDistance !== undefined ? minDistance : 0.001;
|
|
936
|
+
vertexOffset = vertexOffset !== undefined ? vertexOffset : 0;
|
|
937
|
+
|
|
938
|
+
// First ensure there are no duplicated points
|
|
939
|
+
points = removeDuplicatedPoints(points);
|
|
940
|
+
var numPoints = points.length;
|
|
941
|
+
if (numPoints < 2) return 0;
|
|
942
|
+
var isClosed = points[0].equals(points[numPoints - 1]);
|
|
943
|
+
var currentPoint;
|
|
944
|
+
var previousPoint = points[0];
|
|
945
|
+
var nextPoint;
|
|
946
|
+
var strokeWidth2 = style.strokeWidth / 2;
|
|
947
|
+
var deltaU = 1 / (numPoints - 1);
|
|
948
|
+
var u0 = 0;
|
|
949
|
+
var innerSideModified;
|
|
950
|
+
var joinIsOnLeftSide;
|
|
951
|
+
var isMiter;
|
|
952
|
+
var initialJoinIsOnLeftSide = false;
|
|
953
|
+
var numVertices = 0;
|
|
954
|
+
var currentCoordinate = vertexOffset * 3;
|
|
955
|
+
var currentCoordinateUV = vertexOffset * 2;
|
|
956
|
+
|
|
957
|
+
// Get initial left and right stroke points
|
|
958
|
+
getNormal(points[0], points[1], tempV2_1).multiplyScalar(strokeWidth2);
|
|
959
|
+
lastPointL.copy(points[0]).sub(tempV2_1);
|
|
960
|
+
lastPointR.copy(points[0]).add(tempV2_1);
|
|
961
|
+
point0L.copy(lastPointL);
|
|
962
|
+
point0R.copy(lastPointR);
|
|
963
|
+
for (var iPoint = 1; iPoint < numPoints; iPoint++) {
|
|
964
|
+
currentPoint = points[iPoint];
|
|
965
|
+
|
|
966
|
+
// Get next point
|
|
967
|
+
if (iPoint === numPoints - 1) {
|
|
968
|
+
if (isClosed) {
|
|
969
|
+
// Skip duplicated initial point
|
|
970
|
+
nextPoint = points[1];
|
|
971
|
+
} else nextPoint = undefined;
|
|
972
|
+
} else {
|
|
973
|
+
nextPoint = points[iPoint + 1];
|
|
974
|
+
}
|
|
975
|
+
|
|
976
|
+
// Normal of previous segment in tempV2_1
|
|
977
|
+
var normal1 = tempV2_1;
|
|
978
|
+
getNormal(previousPoint, currentPoint, normal1);
|
|
979
|
+
tempV2_3.copy(normal1).multiplyScalar(strokeWidth2);
|
|
980
|
+
currentPointL.copy(currentPoint).sub(tempV2_3);
|
|
981
|
+
currentPointR.copy(currentPoint).add(tempV2_3);
|
|
982
|
+
var u1 = u0 + deltaU;
|
|
983
|
+
innerSideModified = false;
|
|
984
|
+
if (nextPoint !== undefined) {
|
|
985
|
+
// Normal of next segment in tempV2_2
|
|
986
|
+
getNormal(currentPoint, nextPoint, tempV2_2);
|
|
987
|
+
tempV2_3.copy(tempV2_2).multiplyScalar(strokeWidth2);
|
|
988
|
+
nextPointL.copy(currentPoint).sub(tempV2_3);
|
|
989
|
+
nextPointR.copy(currentPoint).add(tempV2_3);
|
|
990
|
+
joinIsOnLeftSide = true;
|
|
991
|
+
tempV2_3.subVectors(nextPoint, previousPoint);
|
|
992
|
+
if (normal1.dot(tempV2_3) < 0) {
|
|
993
|
+
joinIsOnLeftSide = false;
|
|
994
|
+
}
|
|
995
|
+
if (iPoint === 1) initialJoinIsOnLeftSide = joinIsOnLeftSide;
|
|
996
|
+
tempV2_3.subVectors(nextPoint, currentPoint);
|
|
997
|
+
tempV2_3.normalize();
|
|
998
|
+
var dot = Math.abs(normal1.dot(tempV2_3));
|
|
999
|
+
|
|
1000
|
+
// If path is straight, don't create join
|
|
1001
|
+
if (dot !== 0) {
|
|
1002
|
+
// Compute inner and outer segment intersections
|
|
1003
|
+
var miterSide = strokeWidth2 / dot;
|
|
1004
|
+
tempV2_3.multiplyScalar(-miterSide);
|
|
1005
|
+
tempV2_4.subVectors(currentPoint, previousPoint);
|
|
1006
|
+
tempV2_5.copy(tempV2_4).setLength(miterSide).add(tempV2_3);
|
|
1007
|
+
innerPoint.copy(tempV2_5).negate();
|
|
1008
|
+
var miterLength2 = tempV2_5.length();
|
|
1009
|
+
var segmentLengthPrev = tempV2_4.length();
|
|
1010
|
+
tempV2_4.divideScalar(segmentLengthPrev);
|
|
1011
|
+
tempV2_6.subVectors(nextPoint, currentPoint);
|
|
1012
|
+
var segmentLengthNext = tempV2_6.length();
|
|
1013
|
+
tempV2_6.divideScalar(segmentLengthNext);
|
|
1014
|
+
// Check that previous and next segments doesn't overlap with the innerPoint of intersection
|
|
1015
|
+
if (tempV2_4.dot(innerPoint) < segmentLengthPrev && tempV2_6.dot(innerPoint) < segmentLengthNext) {
|
|
1016
|
+
innerSideModified = true;
|
|
1017
|
+
}
|
|
1018
|
+
outerPoint.copy(tempV2_5).add(currentPoint);
|
|
1019
|
+
innerPoint.add(currentPoint);
|
|
1020
|
+
isMiter = false;
|
|
1021
|
+
if (innerSideModified) {
|
|
1022
|
+
if (joinIsOnLeftSide) {
|
|
1023
|
+
nextPointR.copy(innerPoint);
|
|
1024
|
+
currentPointR.copy(innerPoint);
|
|
1025
|
+
} else {
|
|
1026
|
+
nextPointL.copy(innerPoint);
|
|
1027
|
+
currentPointL.copy(innerPoint);
|
|
1028
|
+
}
|
|
1029
|
+
} else {
|
|
1030
|
+
// The segment triangles are generated here if there was overlapping
|
|
1031
|
+
|
|
1032
|
+
makeSegmentTriangles();
|
|
1033
|
+
}
|
|
1034
|
+
switch (style.strokeLineJoin) {
|
|
1035
|
+
case 'bevel':
|
|
1036
|
+
makeSegmentWithBevelJoin(joinIsOnLeftSide, innerSideModified, u1);
|
|
1037
|
+
break;
|
|
1038
|
+
case 'round':
|
|
1039
|
+
// Segment triangles
|
|
1040
|
+
|
|
1041
|
+
createSegmentTrianglesWithMiddleSection(joinIsOnLeftSide, innerSideModified);
|
|
1042
|
+
|
|
1043
|
+
// Join triangles
|
|
1044
|
+
|
|
1045
|
+
if (joinIsOnLeftSide) {
|
|
1046
|
+
makeCircularSector(currentPoint, currentPointL, nextPointL, u1, 0);
|
|
1047
|
+
} else {
|
|
1048
|
+
makeCircularSector(currentPoint, nextPointR, currentPointR, u1, 1);
|
|
1049
|
+
}
|
|
1050
|
+
break;
|
|
1051
|
+
case 'miter':
|
|
1052
|
+
case 'miter-clip':
|
|
1053
|
+
default:
|
|
1054
|
+
var miterFraction = strokeWidth2 * style.strokeMiterLimit / miterLength2;
|
|
1055
|
+
if (miterFraction < 1) {
|
|
1056
|
+
// The join miter length exceeds the miter limit
|
|
1057
|
+
|
|
1058
|
+
if (style.strokeLineJoin !== 'miter-clip') {
|
|
1059
|
+
makeSegmentWithBevelJoin(joinIsOnLeftSide, innerSideModified, u1);
|
|
1060
|
+
break;
|
|
1061
|
+
} else {
|
|
1062
|
+
// Segment triangles
|
|
1063
|
+
|
|
1064
|
+
createSegmentTrianglesWithMiddleSection(joinIsOnLeftSide, innerSideModified);
|
|
1065
|
+
|
|
1066
|
+
// Miter-clip join triangles
|
|
1067
|
+
|
|
1068
|
+
if (joinIsOnLeftSide) {
|
|
1069
|
+
tempV2_6.subVectors(outerPoint, currentPointL).multiplyScalar(miterFraction).add(currentPointL);
|
|
1070
|
+
tempV2_7.subVectors(outerPoint, nextPointL).multiplyScalar(miterFraction).add(nextPointL);
|
|
1071
|
+
addVertex(currentPointL, u1, 0);
|
|
1072
|
+
addVertex(tempV2_6, u1, 0);
|
|
1073
|
+
addVertex(currentPoint, u1, 0.5);
|
|
1074
|
+
addVertex(currentPoint, u1, 0.5);
|
|
1075
|
+
addVertex(tempV2_6, u1, 0);
|
|
1076
|
+
addVertex(tempV2_7, u1, 0);
|
|
1077
|
+
addVertex(currentPoint, u1, 0.5);
|
|
1078
|
+
addVertex(tempV2_7, u1, 0);
|
|
1079
|
+
addVertex(nextPointL, u1, 0);
|
|
1080
|
+
} else {
|
|
1081
|
+
tempV2_6.subVectors(outerPoint, currentPointR).multiplyScalar(miterFraction).add(currentPointR);
|
|
1082
|
+
tempV2_7.subVectors(outerPoint, nextPointR).multiplyScalar(miterFraction).add(nextPointR);
|
|
1083
|
+
addVertex(currentPointR, u1, 1);
|
|
1084
|
+
addVertex(tempV2_6, u1, 1);
|
|
1085
|
+
addVertex(currentPoint, u1, 0.5);
|
|
1086
|
+
addVertex(currentPoint, u1, 0.5);
|
|
1087
|
+
addVertex(tempV2_6, u1, 1);
|
|
1088
|
+
addVertex(tempV2_7, u1, 1);
|
|
1089
|
+
addVertex(currentPoint, u1, 0.5);
|
|
1090
|
+
addVertex(tempV2_7, u1, 1);
|
|
1091
|
+
addVertex(nextPointR, u1, 1);
|
|
1092
|
+
}
|
|
1093
|
+
}
|
|
1094
|
+
} else {
|
|
1095
|
+
// Miter join segment triangles
|
|
1096
|
+
|
|
1097
|
+
if (innerSideModified) {
|
|
1098
|
+
// Optimized segment + join triangles
|
|
1099
|
+
|
|
1100
|
+
if (joinIsOnLeftSide) {
|
|
1101
|
+
addVertex(lastPointR, u0, 1);
|
|
1102
|
+
addVertex(lastPointL, u0, 0);
|
|
1103
|
+
addVertex(outerPoint, u1, 0);
|
|
1104
|
+
addVertex(lastPointR, u0, 1);
|
|
1105
|
+
addVertex(outerPoint, u1, 0);
|
|
1106
|
+
addVertex(innerPoint, u1, 1);
|
|
1107
|
+
} else {
|
|
1108
|
+
addVertex(lastPointR, u0, 1);
|
|
1109
|
+
addVertex(lastPointL, u0, 0);
|
|
1110
|
+
addVertex(outerPoint, u1, 1);
|
|
1111
|
+
addVertex(lastPointL, u0, 0);
|
|
1112
|
+
addVertex(innerPoint, u1, 0);
|
|
1113
|
+
addVertex(outerPoint, u1, 1);
|
|
1114
|
+
}
|
|
1115
|
+
if (joinIsOnLeftSide) {
|
|
1116
|
+
nextPointL.copy(outerPoint);
|
|
1117
|
+
} else {
|
|
1118
|
+
nextPointR.copy(outerPoint);
|
|
1119
|
+
}
|
|
1120
|
+
} else {
|
|
1121
|
+
// Add extra miter join triangles
|
|
1122
|
+
|
|
1123
|
+
if (joinIsOnLeftSide) {
|
|
1124
|
+
addVertex(currentPointL, u1, 0);
|
|
1125
|
+
addVertex(outerPoint, u1, 0);
|
|
1126
|
+
addVertex(currentPoint, u1, 0.5);
|
|
1127
|
+
addVertex(currentPoint, u1, 0.5);
|
|
1128
|
+
addVertex(outerPoint, u1, 0);
|
|
1129
|
+
addVertex(nextPointL, u1, 0);
|
|
1130
|
+
} else {
|
|
1131
|
+
addVertex(currentPointR, u1, 1);
|
|
1132
|
+
addVertex(outerPoint, u1, 1);
|
|
1133
|
+
addVertex(currentPoint, u1, 0.5);
|
|
1134
|
+
addVertex(currentPoint, u1, 0.5);
|
|
1135
|
+
addVertex(outerPoint, u1, 1);
|
|
1136
|
+
addVertex(nextPointR, u1, 1);
|
|
1137
|
+
}
|
|
1138
|
+
}
|
|
1139
|
+
isMiter = true;
|
|
1140
|
+
}
|
|
1141
|
+
break;
|
|
1142
|
+
}
|
|
1143
|
+
} else {
|
|
1144
|
+
// The segment triangles are generated here when two consecutive points are collinear
|
|
1145
|
+
|
|
1146
|
+
makeSegmentTriangles();
|
|
1147
|
+
}
|
|
1148
|
+
} else {
|
|
1149
|
+
// The segment triangles are generated here if it is the ending segment
|
|
1150
|
+
|
|
1151
|
+
makeSegmentTriangles();
|
|
1152
|
+
}
|
|
1153
|
+
if (!isClosed && iPoint === numPoints - 1) {
|
|
1154
|
+
// Start line endcap
|
|
1155
|
+
addCapGeometry(points[0], point0L, point0R, joinIsOnLeftSide, true, u0);
|
|
1156
|
+
}
|
|
1157
|
+
|
|
1158
|
+
// Increment loop variables
|
|
1159
|
+
|
|
1160
|
+
u0 = u1;
|
|
1161
|
+
previousPoint = currentPoint;
|
|
1162
|
+
lastPointL.copy(nextPointL);
|
|
1163
|
+
lastPointR.copy(nextPointR);
|
|
1164
|
+
}
|
|
1165
|
+
if (!isClosed) {
|
|
1166
|
+
// Ending line endcap
|
|
1167
|
+
addCapGeometry(currentPoint, currentPointL, currentPointR, joinIsOnLeftSide, false, u1);
|
|
1168
|
+
} else if (innerSideModified && vertices) {
|
|
1169
|
+
// Modify path first segment vertices to adjust to the segments inner and outer intersections
|
|
1170
|
+
|
|
1171
|
+
var lastOuter = outerPoint;
|
|
1172
|
+
var lastInner = innerPoint;
|
|
1173
|
+
if (initialJoinIsOnLeftSide !== joinIsOnLeftSide) {
|
|
1174
|
+
lastOuter = innerPoint;
|
|
1175
|
+
lastInner = outerPoint;
|
|
1176
|
+
}
|
|
1177
|
+
if (joinIsOnLeftSide) {
|
|
1178
|
+
if (isMiter || initialJoinIsOnLeftSide) {
|
|
1179
|
+
lastInner.toArray(vertices, 0 * 3);
|
|
1180
|
+
lastInner.toArray(vertices, 3 * 3);
|
|
1181
|
+
if (isMiter) {
|
|
1182
|
+
lastOuter.toArray(vertices, 1 * 3);
|
|
1183
|
+
}
|
|
1184
|
+
}
|
|
1185
|
+
} else {
|
|
1186
|
+
if (isMiter || !initialJoinIsOnLeftSide) {
|
|
1187
|
+
lastInner.toArray(vertices, 1 * 3);
|
|
1188
|
+
lastInner.toArray(vertices, 3 * 3);
|
|
1189
|
+
if (isMiter) {
|
|
1190
|
+
lastOuter.toArray(vertices, 0 * 3);
|
|
1191
|
+
}
|
|
1192
|
+
}
|
|
1193
|
+
}
|
|
1194
|
+
}
|
|
1195
|
+
return numVertices;
|
|
1196
|
+
|
|
1197
|
+
// -- End of algorithm
|
|
1198
|
+
|
|
1199
|
+
// -- Functions
|
|
1200
|
+
|
|
1201
|
+
function getNormal(p1, p2, result) {
|
|
1202
|
+
result.subVectors(p2, p1);
|
|
1203
|
+
return result.set(-result.y, result.x).normalize();
|
|
1204
|
+
}
|
|
1205
|
+
function addVertex(position, u, v) {
|
|
1206
|
+
if (vertices) {
|
|
1207
|
+
vertices[currentCoordinate] = position.x;
|
|
1208
|
+
vertices[currentCoordinate + 1] = position.y;
|
|
1209
|
+
vertices[currentCoordinate + 2] = 0;
|
|
1210
|
+
if (normals) {
|
|
1211
|
+
normals[currentCoordinate] = 0;
|
|
1212
|
+
normals[currentCoordinate + 1] = 0;
|
|
1213
|
+
normals[currentCoordinate + 2] = 1;
|
|
1214
|
+
}
|
|
1215
|
+
currentCoordinate += 3;
|
|
1216
|
+
if (uvs) {
|
|
1217
|
+
uvs[currentCoordinateUV] = u;
|
|
1218
|
+
uvs[currentCoordinateUV + 1] = v;
|
|
1219
|
+
currentCoordinateUV += 2;
|
|
1220
|
+
}
|
|
1221
|
+
}
|
|
1222
|
+
numVertices += 3;
|
|
1223
|
+
}
|
|
1224
|
+
function makeCircularSector(center, p1, p2, u, v) {
|
|
1225
|
+
// param p1, p2: Points in the circle arc.
|
|
1226
|
+
// p1 and p2 are in clockwise direction.
|
|
1227
|
+
|
|
1228
|
+
tempV2_1.copy(p1).sub(center).normalize();
|
|
1229
|
+
tempV2_2.copy(p2).sub(center).normalize();
|
|
1230
|
+
var angle = Math.PI;
|
|
1231
|
+
var dot = tempV2_1.dot(tempV2_2);
|
|
1232
|
+
if (Math.abs(dot) < 1) angle = Math.abs(Math.acos(dot));
|
|
1233
|
+
angle /= arcDivisions;
|
|
1234
|
+
tempV2_3.copy(p1);
|
|
1235
|
+
for (var i = 0, il = arcDivisions - 1; i < il; i++) {
|
|
1236
|
+
tempV2_4.copy(tempV2_3).rotateAround(center, angle);
|
|
1237
|
+
addVertex(tempV2_3, u, v);
|
|
1238
|
+
addVertex(tempV2_4, u, v);
|
|
1239
|
+
addVertex(center, u, 0.5);
|
|
1240
|
+
tempV2_3.copy(tempV2_4);
|
|
1241
|
+
}
|
|
1242
|
+
addVertex(tempV2_4, u, v);
|
|
1243
|
+
addVertex(p2, u, v);
|
|
1244
|
+
addVertex(center, u, 0.5);
|
|
1245
|
+
}
|
|
1246
|
+
function makeSegmentTriangles() {
|
|
1247
|
+
addVertex(lastPointR, u0, 1);
|
|
1248
|
+
addVertex(lastPointL, u0, 0);
|
|
1249
|
+
addVertex(currentPointL, u1, 0);
|
|
1250
|
+
addVertex(lastPointR, u0, 1);
|
|
1251
|
+
addVertex(currentPointL, u1, 1);
|
|
1252
|
+
addVertex(currentPointR, u1, 0);
|
|
1253
|
+
}
|
|
1254
|
+
function makeSegmentWithBevelJoin(joinIsOnLeftSide, innerSideModified, u) {
|
|
1255
|
+
if (innerSideModified) {
|
|
1256
|
+
// Optimized segment + bevel triangles
|
|
1257
|
+
|
|
1258
|
+
if (joinIsOnLeftSide) {
|
|
1259
|
+
// Path segments triangles
|
|
1260
|
+
|
|
1261
|
+
addVertex(lastPointR, u0, 1);
|
|
1262
|
+
addVertex(lastPointL, u0, 0);
|
|
1263
|
+
addVertex(currentPointL, u1, 0);
|
|
1264
|
+
addVertex(lastPointR, u0, 1);
|
|
1265
|
+
addVertex(currentPointL, u1, 0);
|
|
1266
|
+
addVertex(innerPoint, u1, 1);
|
|
1267
|
+
|
|
1268
|
+
// Bevel join triangle
|
|
1269
|
+
|
|
1270
|
+
addVertex(currentPointL, u, 0);
|
|
1271
|
+
addVertex(nextPointL, u, 0);
|
|
1272
|
+
addVertex(innerPoint, u, 0.5);
|
|
1273
|
+
} else {
|
|
1274
|
+
// Path segments triangles
|
|
1275
|
+
|
|
1276
|
+
addVertex(lastPointR, u0, 1);
|
|
1277
|
+
addVertex(lastPointL, u0, 0);
|
|
1278
|
+
addVertex(currentPointR, u1, 1);
|
|
1279
|
+
addVertex(lastPointL, u0, 0);
|
|
1280
|
+
addVertex(innerPoint, u1, 0);
|
|
1281
|
+
addVertex(currentPointR, u1, 1);
|
|
1282
|
+
|
|
1283
|
+
// Bevel join triangle
|
|
1284
|
+
|
|
1285
|
+
addVertex(currentPointR, u, 1);
|
|
1286
|
+
addVertex(nextPointR, u, 0);
|
|
1287
|
+
addVertex(innerPoint, u, 0.5);
|
|
1288
|
+
}
|
|
1289
|
+
} else {
|
|
1290
|
+
// Bevel join triangle. The segment triangles are done in the main loop
|
|
1291
|
+
|
|
1292
|
+
if (joinIsOnLeftSide) {
|
|
1293
|
+
addVertex(currentPointL, u, 0);
|
|
1294
|
+
addVertex(nextPointL, u, 0);
|
|
1295
|
+
addVertex(currentPoint, u, 0.5);
|
|
1296
|
+
} else {
|
|
1297
|
+
addVertex(currentPointR, u, 1);
|
|
1298
|
+
addVertex(nextPointR, u, 0);
|
|
1299
|
+
addVertex(currentPoint, u, 0.5);
|
|
1300
|
+
}
|
|
1301
|
+
}
|
|
1302
|
+
}
|
|
1303
|
+
function createSegmentTrianglesWithMiddleSection(joinIsOnLeftSide, innerSideModified) {
|
|
1304
|
+
if (innerSideModified) {
|
|
1305
|
+
if (joinIsOnLeftSide) {
|
|
1306
|
+
addVertex(lastPointR, u0, 1);
|
|
1307
|
+
addVertex(lastPointL, u0, 0);
|
|
1308
|
+
addVertex(currentPointL, u1, 0);
|
|
1309
|
+
addVertex(lastPointR, u0, 1);
|
|
1310
|
+
addVertex(currentPointL, u1, 0);
|
|
1311
|
+
addVertex(innerPoint, u1, 1);
|
|
1312
|
+
addVertex(currentPointL, u0, 0);
|
|
1313
|
+
addVertex(currentPoint, u1, 0.5);
|
|
1314
|
+
addVertex(innerPoint, u1, 1);
|
|
1315
|
+
addVertex(currentPoint, u1, 0.5);
|
|
1316
|
+
addVertex(nextPointL, u0, 0);
|
|
1317
|
+
addVertex(innerPoint, u1, 1);
|
|
1318
|
+
} else {
|
|
1319
|
+
addVertex(lastPointR, u0, 1);
|
|
1320
|
+
addVertex(lastPointL, u0, 0);
|
|
1321
|
+
addVertex(currentPointR, u1, 1);
|
|
1322
|
+
addVertex(lastPointL, u0, 0);
|
|
1323
|
+
addVertex(innerPoint, u1, 0);
|
|
1324
|
+
addVertex(currentPointR, u1, 1);
|
|
1325
|
+
addVertex(currentPointR, u0, 1);
|
|
1326
|
+
addVertex(innerPoint, u1, 0);
|
|
1327
|
+
addVertex(currentPoint, u1, 0.5);
|
|
1328
|
+
addVertex(currentPoint, u1, 0.5);
|
|
1329
|
+
addVertex(innerPoint, u1, 0);
|
|
1330
|
+
addVertex(nextPointR, u0, 1);
|
|
1331
|
+
}
|
|
1332
|
+
}
|
|
1333
|
+
}
|
|
1334
|
+
function addCapGeometry(center, p1, p2, joinIsOnLeftSide, start, u) {
|
|
1335
|
+
// param center: End point of the path
|
|
1336
|
+
// param p1, p2: Left and right cap points
|
|
1337
|
+
|
|
1338
|
+
switch (style.strokeLineCap) {
|
|
1339
|
+
case 'round':
|
|
1340
|
+
if (start) {
|
|
1341
|
+
makeCircularSector(center, p2, p1, u, 0.5);
|
|
1342
|
+
} else {
|
|
1343
|
+
makeCircularSector(center, p1, p2, u, 0.5);
|
|
1344
|
+
}
|
|
1345
|
+
break;
|
|
1346
|
+
case 'square':
|
|
1347
|
+
if (start) {
|
|
1348
|
+
tempV2_1.subVectors(p1, center);
|
|
1349
|
+
tempV2_2.set(tempV2_1.y, -tempV2_1.x);
|
|
1350
|
+
tempV2_3.addVectors(tempV2_1, tempV2_2).add(center);
|
|
1351
|
+
tempV2_4.subVectors(tempV2_2, tempV2_1).add(center);
|
|
1352
|
+
|
|
1353
|
+
// Modify already existing vertices
|
|
1354
|
+
if (joinIsOnLeftSide) {
|
|
1355
|
+
tempV2_3.toArray(vertices, 1 * 3);
|
|
1356
|
+
tempV2_4.toArray(vertices, 0 * 3);
|
|
1357
|
+
tempV2_4.toArray(vertices, 3 * 3);
|
|
1358
|
+
} else {
|
|
1359
|
+
tempV2_3.toArray(vertices, 1 * 3);
|
|
1360
|
+
tempV2_3.toArray(vertices, 3 * 3);
|
|
1361
|
+
tempV2_4.toArray(vertices, 0 * 3);
|
|
1362
|
+
}
|
|
1363
|
+
} else {
|
|
1364
|
+
tempV2_1.subVectors(p2, center);
|
|
1365
|
+
tempV2_2.set(tempV2_1.y, -tempV2_1.x);
|
|
1366
|
+
tempV2_3.addVectors(tempV2_1, tempV2_2).add(center);
|
|
1367
|
+
tempV2_4.subVectors(tempV2_2, tempV2_1).add(center);
|
|
1368
|
+
var vl = vertices.length;
|
|
1369
|
+
|
|
1370
|
+
// Modify already existing vertices
|
|
1371
|
+
if (joinIsOnLeftSide) {
|
|
1372
|
+
tempV2_3.toArray(vertices, vl - 1 * 3);
|
|
1373
|
+
tempV2_4.toArray(vertices, vl - 2 * 3);
|
|
1374
|
+
tempV2_4.toArray(vertices, vl - 4 * 3);
|
|
1375
|
+
} else {
|
|
1376
|
+
tempV2_3.toArray(vertices, vl - 2 * 3);
|
|
1377
|
+
tempV2_4.toArray(vertices, vl - 1 * 3);
|
|
1378
|
+
tempV2_4.toArray(vertices, vl - 4 * 3);
|
|
1379
|
+
}
|
|
1380
|
+
}
|
|
1381
|
+
break;
|
|
1382
|
+
case 'butt':
|
|
1383
|
+
default:
|
|
1384
|
+
// Nothing to do here
|
|
1385
|
+
break;
|
|
1386
|
+
}
|
|
1387
|
+
}
|
|
1388
|
+
function removeDuplicatedPoints(points) {
|
|
1389
|
+
// Creates a new array if necessary with duplicated points removed.
|
|
1390
|
+
// This does not remove duplicated initial and ending points of a closed path.
|
|
1391
|
+
|
|
1392
|
+
var dupPoints = false;
|
|
1393
|
+
for (var i = 1, n = points.length - 1; i < n; i++) {
|
|
1394
|
+
if (points[i].distanceTo(points[i + 1]) < minDistance) {
|
|
1395
|
+
dupPoints = true;
|
|
1396
|
+
break;
|
|
1397
|
+
}
|
|
1398
|
+
}
|
|
1399
|
+
if (!dupPoints) return points;
|
|
1400
|
+
var newPoints = [];
|
|
1401
|
+
newPoints.push(points[0]);
|
|
1402
|
+
for (var i = 1, n = points.length - 1; i < n; i++) {
|
|
1403
|
+
if (points[i].distanceTo(points[i + 1]) >= minDistance) {
|
|
1404
|
+
newPoints.push(points[i]);
|
|
1405
|
+
}
|
|
1406
|
+
}
|
|
1407
|
+
newPoints.push(points[points.length - 1]);
|
|
1408
|
+
return newPoints;
|
|
1409
|
+
}
|
|
1410
|
+
};
|
|
1411
|
+
}();
|
|
1412
|
+
export { SVGLoader };
|