fluidcad 0.0.2
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/LICENSE.txt +504 -0
- package/README.md +175 -0
- package/bin/fluidcad.js +94 -0
- package/bin/watcher.js +55 -0
- package/lib/dist/common/edge.d.ts +14 -0
- package/lib/dist/common/edge.js +32 -0
- package/lib/dist/common/face.d.ts +31 -0
- package/lib/dist/common/face.js +83 -0
- package/lib/dist/common/materials.d.ts +7 -0
- package/lib/dist/common/materials.js +22 -0
- package/lib/dist/common/scene-object.d.ts +111 -0
- package/lib/dist/common/scene-object.js +380 -0
- package/lib/dist/common/shape-factory.d.ts +8 -0
- package/lib/dist/common/shape-factory.js +31 -0
- package/lib/dist/common/shape-type.d.ts +1 -0
- package/lib/dist/common/shape-type.js +1 -0
- package/lib/dist/common/shape.d.ts +43 -0
- package/lib/dist/common/shape.js +95 -0
- package/lib/dist/common/shapes.d.ts +6 -0
- package/lib/dist/common/shapes.js +6 -0
- package/lib/dist/common/solid-face.d.ts +9 -0
- package/lib/dist/common/solid-face.js +22 -0
- package/lib/dist/common/solid.d.ts +20 -0
- package/lib/dist/common/solid.js +68 -0
- package/lib/dist/common/vertex.d.ts +17 -0
- package/lib/dist/common/vertex.js +44 -0
- package/lib/dist/common/wire.d.ts +22 -0
- package/lib/dist/common/wire.js +97 -0
- package/lib/dist/constraints/constraint.d.ts +11 -0
- package/lib/dist/constraints/constraint.js +51 -0
- package/lib/dist/constraints/outside.d.ts +3 -0
- package/lib/dist/constraints/outside.js +4 -0
- package/lib/dist/core/2d/aline.d.ts +28 -0
- package/lib/dist/core/2d/aline.js +26 -0
- package/lib/dist/core/2d/arc.d.ts +77 -0
- package/lib/dist/core/2d/arc.js +49 -0
- package/lib/dist/core/2d/aslot.d.ts +12 -0
- package/lib/dist/core/2d/aslot.js +40 -0
- package/lib/dist/core/2d/bezier.d.ts +16 -0
- package/lib/dist/core/2d/bezier.js +15 -0
- package/lib/dist/core/2d/circle.d.ts +24 -0
- package/lib/dist/core/2d/circle.js +44 -0
- package/lib/dist/core/2d/connect.d.ts +11 -0
- package/lib/dist/core/2d/connect.js +10 -0
- package/lib/dist/core/2d/crect.d.ts +12 -0
- package/lib/dist/core/2d/crect.js +74 -0
- package/lib/dist/core/2d/face-driller.d.ts +8 -0
- package/lib/dist/core/2d/face-driller.js +70 -0
- package/lib/dist/core/2d/face-maker.d.ts +13 -0
- package/lib/dist/core/2d/face-maker.js +119 -0
- package/lib/dist/core/2d/face-maker2.d.ts +6 -0
- package/lib/dist/core/2d/face-maker2.js +54 -0
- package/lib/dist/core/2d/hline.d.ts +33 -0
- package/lib/dist/core/2d/hline.js +37 -0
- package/lib/dist/core/2d/hmove.d.ts +9 -0
- package/lib/dist/core/2d/hmove.js +11 -0
- package/lib/dist/core/2d/index.d.ts +22 -0
- package/lib/dist/core/2d/index.js +22 -0
- package/lib/dist/core/2d/line.d.ts +24 -0
- package/lib/dist/core/2d/line.js +40 -0
- package/lib/dist/core/2d/move.d.ts +13 -0
- package/lib/dist/core/2d/move.js +13 -0
- package/lib/dist/core/2d/offset.d.ts +21 -0
- package/lib/dist/core/2d/offset.js +24 -0
- package/lib/dist/core/2d/pmove.d.ts +11 -0
- package/lib/dist/core/2d/pmove.js +12 -0
- package/lib/dist/core/2d/polygon.d.ts +38 -0
- package/lib/dist/core/2d/polygon.js +63 -0
- package/lib/dist/core/2d/project.d.ts +17 -0
- package/lib/dist/core/2d/project.js +20 -0
- package/lib/dist/core/2d/rect.d.ts +27 -0
- package/lib/dist/core/2d/rect.js +58 -0
- package/lib/dist/core/2d/rmove.d.ts +17 -0
- package/lib/dist/core/2d/rmove.js +14 -0
- package/lib/dist/core/2d/slot.d.ts +49 -0
- package/lib/dist/core/2d/slot.js +65 -0
- package/lib/dist/core/2d/tarc.d.ts +46 -0
- package/lib/dist/core/2d/tarc.js +61 -0
- package/lib/dist/core/2d/tcircle.d.ts +15 -0
- package/lib/dist/core/2d/tcircle.js +24 -0
- package/lib/dist/core/2d/tline.d.ts +24 -0
- package/lib/dist/core/2d/tline.js +30 -0
- package/lib/dist/core/2d/vline.d.ts +33 -0
- package/lib/dist/core/2d/vline.js +37 -0
- package/lib/dist/core/2d/vmove.d.ts +9 -0
- package/lib/dist/core/2d/vmove.js +11 -0
- package/lib/dist/core/2d/wire.d.ts +11 -0
- package/lib/dist/core/2d/wire.js +29 -0
- package/lib/dist/core/axis.d.ts +41 -0
- package/lib/dist/core/axis.js +104 -0
- package/lib/dist/core/chamfer.d.ts +31 -0
- package/lib/dist/core/chamfer.js +32 -0
- package/lib/dist/core/color.d.ts +16 -0
- package/lib/dist/core/color.js +19 -0
- package/lib/dist/core/common.d.ts +12 -0
- package/lib/dist/core/common.js +36 -0
- package/lib/dist/core/copy.d.ts +58 -0
- package/lib/dist/core/copy.js +49 -0
- package/lib/dist/core/cut.d.ts +46 -0
- package/lib/dist/core/cut.js +53 -0
- package/lib/dist/core/cylinder.d.ts +11 -0
- package/lib/dist/core/cylinder.js +10 -0
- package/lib/dist/core/extrude.d.ts +36 -0
- package/lib/dist/core/extrude.js +55 -0
- package/lib/dist/core/fillet.d.ts +33 -0
- package/lib/dist/core/fillet.js +58 -0
- package/lib/dist/core/fuse.d.ts +14 -0
- package/lib/dist/core/fuse.js +36 -0
- package/lib/dist/core/index.d.ts +32 -0
- package/lib/dist/core/index.js +30 -0
- package/lib/dist/core/interfaces.d.ts +411 -0
- package/lib/dist/core/interfaces.js +1 -0
- package/lib/dist/core/load.d.ts +10 -0
- package/lib/dist/core/load.js +10 -0
- package/lib/dist/core/loft.d.ts +10 -0
- package/lib/dist/core/loft.js +21 -0
- package/lib/dist/core/mirror.d.ts +40 -0
- package/lib/dist/core/mirror.js +95 -0
- package/lib/dist/core/part.d.ts +7 -0
- package/lib/dist/core/part.js +29 -0
- package/lib/dist/core/plane.d.ts +56 -0
- package/lib/dist/core/plane.js +111 -0
- package/lib/dist/core/region.d.ts +13 -0
- package/lib/dist/core/region.js +18 -0
- package/lib/dist/core/remove.d.ts +10 -0
- package/lib/dist/core/remove.js +10 -0
- package/lib/dist/core/repeat.d.ts +41 -0
- package/lib/dist/core/repeat.js +146 -0
- package/lib/dist/core/revolve.d.ts +19 -0
- package/lib/dist/core/revolve.js +39 -0
- package/lib/dist/core/rotate.d.ts +34 -0
- package/lib/dist/core/rotate.js +48 -0
- package/lib/dist/core/select.d.ts +12 -0
- package/lib/dist/core/select.js +21 -0
- package/lib/dist/core/shell.d.ts +16 -0
- package/lib/dist/core/shell.js +28 -0
- package/lib/dist/core/sketch.d.ts +18 -0
- package/lib/dist/core/sketch.js +34 -0
- package/lib/dist/core/sphere.d.ts +16 -0
- package/lib/dist/core/sphere.js +11 -0
- package/lib/dist/core/split.d.ts +12 -0
- package/lib/dist/core/split.js +26 -0
- package/lib/dist/core/subtract.d.ts +11 -0
- package/lib/dist/core/subtract.js +10 -0
- package/lib/dist/core/sweep.d.ts +16 -0
- package/lib/dist/core/sweep.js +29 -0
- package/lib/dist/core/translate.d.ts +64 -0
- package/lib/dist/core/translate.js +39 -0
- package/lib/dist/core/trim.d.ts +13 -0
- package/lib/dist/core/trim.js +18 -0
- package/lib/dist/core/use.d.ts +5 -0
- package/lib/dist/core/use.js +22 -0
- package/lib/dist/features/2d/aline.d.ts +18 -0
- package/lib/dist/features/2d/aline.js +78 -0
- package/lib/dist/features/2d/amove.d.ts +14 -0
- package/lib/dist/features/2d/amove.js +33 -0
- package/lib/dist/features/2d/arc-from-center.d.ts +16 -0
- package/lib/dist/features/2d/arc-from-center.js +69 -0
- package/lib/dist/features/2d/arc-to-point.d.ts +17 -0
- package/lib/dist/features/2d/arc-to-point.js +95 -0
- package/lib/dist/features/2d/arc.d.ts +19 -0
- package/lib/dist/features/2d/arc.js +94 -0
- package/lib/dist/features/2d/bezier.d.ts +15 -0
- package/lib/dist/features/2d/bezier.js +77 -0
- package/lib/dist/features/2d/circle.d.ts +17 -0
- package/lib/dist/features/2d/circle.js +58 -0
- package/lib/dist/features/2d/connect.d.ts +12 -0
- package/lib/dist/features/2d/connect.js +105 -0
- package/lib/dist/features/2d/constraints/constraint.d.ts +11 -0
- package/lib/dist/features/2d/constraints/constraint.js +49 -0
- package/lib/dist/features/2d/constraints/geometry-qualifier.d.ts +6 -0
- package/lib/dist/features/2d/constraints/geometry-qualifier.js +13 -0
- package/lib/dist/features/2d/constraints/outside.d.ts +3 -0
- package/lib/dist/features/2d/constraints/outside.js +4 -0
- package/lib/dist/features/2d/constraints/qualified-geometry.d.ts +16 -0
- package/lib/dist/features/2d/constraints/qualified-geometry.js +36 -0
- package/lib/dist/features/2d/extrudable-base.d.ts +15 -0
- package/lib/dist/features/2d/extrudable-base.js +27 -0
- package/lib/dist/features/2d/geometry.d.ts +20 -0
- package/lib/dist/features/2d/geometry.js +77 -0
- package/lib/dist/features/2d/hline.d.ts +16 -0
- package/lib/dist/features/2d/hline.js +66 -0
- package/lib/dist/features/2d/hmove.d.ts +14 -0
- package/lib/dist/features/2d/hmove.js +37 -0
- package/lib/dist/features/2d/line.d.ts +15 -0
- package/lib/dist/features/2d/line.js +59 -0
- package/lib/dist/features/2d/move.d.ts +15 -0
- package/lib/dist/features/2d/move.js +36 -0
- package/lib/dist/features/2d/offset.d.ts +18 -0
- package/lib/dist/features/2d/offset.js +117 -0
- package/lib/dist/features/2d/pmove.d.ts +16 -0
- package/lib/dist/features/2d/pmove.js +40 -0
- package/lib/dist/features/2d/polygon.d.ts +25 -0
- package/lib/dist/features/2d/polygon.js +107 -0
- package/lib/dist/features/2d/projection.d.ts +15 -0
- package/lib/dist/features/2d/projection.js +94 -0
- package/lib/dist/features/2d/rect.d.ts +45 -0
- package/lib/dist/features/2d/rect.js +262 -0
- package/lib/dist/features/2d/rmove.d.ts +17 -0
- package/lib/dist/features/2d/rmove.js +39 -0
- package/lib/dist/features/2d/sketch.d.ts +34 -0
- package/lib/dist/features/2d/sketch.js +171 -0
- package/lib/dist/features/2d/slot-from-edge.d.ts +19 -0
- package/lib/dist/features/2d/slot-from-edge.js +66 -0
- package/lib/dist/features/2d/slot.d.ts +24 -0
- package/lib/dist/features/2d/slot.js +119 -0
- package/lib/dist/features/2d/tarc-constrained.d.ts +20 -0
- package/lib/dist/features/2d/tarc-constrained.js +64 -0
- package/lib/dist/features/2d/tarc-to-point-tangent.d.ts +15 -0
- package/lib/dist/features/2d/tarc-to-point-tangent.js +86 -0
- package/lib/dist/features/2d/tarc-to-point.d.ts +13 -0
- package/lib/dist/features/2d/tarc-to-point.js +86 -0
- package/lib/dist/features/2d/tarc-two-circles.d.ts +18 -0
- package/lib/dist/features/2d/tarc-two-circles.js +61 -0
- package/lib/dist/features/2d/tarc-with-tangent.d.ts +17 -0
- package/lib/dist/features/2d/tarc-with-tangent.js +71 -0
- package/lib/dist/features/2d/tarc.d.ts +13 -0
- package/lib/dist/features/2d/tarc.js +71 -0
- package/lib/dist/features/2d/tcircle-constrained.d.ts +14 -0
- package/lib/dist/features/2d/tcircle-constrained.js +37 -0
- package/lib/dist/features/2d/tcircle-three-tan.d.ts +13 -0
- package/lib/dist/features/2d/tcircle-three-tan.js +33 -0
- package/lib/dist/features/2d/tcircle-two-tan.d.ts +13 -0
- package/lib/dist/features/2d/tcircle-two-tan.js +33 -0
- package/lib/dist/features/2d/tline-constrained.d.ts +27 -0
- package/lib/dist/features/2d/tline-constrained.js +82 -0
- package/lib/dist/features/2d/tline.d.ts +12 -0
- package/lib/dist/features/2d/tline.js +49 -0
- package/lib/dist/features/2d/vline.d.ts +16 -0
- package/lib/dist/features/2d/vline.js +65 -0
- package/lib/dist/features/2d/vmove.d.ts +14 -0
- package/lib/dist/features/2d/vmove.js +37 -0
- package/lib/dist/features/2d/wire.d.ts +12 -0
- package/lib/dist/features/2d/wire.js +76 -0
- package/lib/dist/features/Extrude.d.ts +1 -0
- package/lib/dist/features/Extrude.js +1 -0
- package/lib/dist/features/axis-from-edge.d.ts +15 -0
- package/lib/dist/features/axis-from-edge.js +82 -0
- package/lib/dist/features/axis-mid.d.ts +16 -0
- package/lib/dist/features/axis-mid.js +59 -0
- package/lib/dist/features/axis-renderable-base.d.ts +8 -0
- package/lib/dist/features/axis-renderable-base.js +12 -0
- package/lib/dist/features/axis.d.ts +14 -0
- package/lib/dist/features/axis.js +43 -0
- package/lib/dist/features/chamfer.d.ts +20 -0
- package/lib/dist/features/chamfer.js +129 -0
- package/lib/dist/features/color.d.ts +11 -0
- package/lib/dist/features/color.js +93 -0
- package/lib/dist/features/common.d.ts +12 -0
- package/lib/dist/features/common.js +70 -0
- package/lib/dist/features/common2d.d.ts +15 -0
- package/lib/dist/features/common2d.js +96 -0
- package/lib/dist/features/copy-circular.d.ts +23 -0
- package/lib/dist/features/copy-circular.js +73 -0
- package/lib/dist/features/copy-circular2d.d.ts +15 -0
- package/lib/dist/features/copy-circular2d.js +84 -0
- package/lib/dist/features/copy-linear.d.ts +23 -0
- package/lib/dist/features/copy-linear.js +101 -0
- package/lib/dist/features/copy-linear2d.d.ts +15 -0
- package/lib/dist/features/copy-linear2d.js +108 -0
- package/lib/dist/features/cut-base.d.ts +49 -0
- package/lib/dist/features/cut-base.js +312 -0
- package/lib/dist/features/cut-symmetric.d.ts +23 -0
- package/lib/dist/features/cut-symmetric.js +119 -0
- package/lib/dist/features/cut-two-distances.d.ts +24 -0
- package/lib/dist/features/cut-two-distances.js +110 -0
- package/lib/dist/features/cut.d.ts +27 -0
- package/lib/dist/features/cut.js +101 -0
- package/lib/dist/features/cylinder.d.ts +13 -0
- package/lib/dist/features/cylinder.js +33 -0
- package/lib/dist/features/extrude-base.d.ts +56 -0
- package/lib/dist/features/extrude-base.js +331 -0
- package/lib/dist/features/extrude-options.d.ts +8 -0
- package/lib/dist/features/extrude-options.js +1 -0
- package/lib/dist/features/extrude-symmetric.d.ts +28 -0
- package/lib/dist/features/extrude-symmetric.js +177 -0
- package/lib/dist/features/extrude-to-face.d.ts +35 -0
- package/lib/dist/features/extrude-to-face.js +275 -0
- package/lib/dist/features/extrude-two-distances.d.ts +21 -0
- package/lib/dist/features/extrude-two-distances.js +116 -0
- package/lib/dist/features/extrude.d.ts +25 -0
- package/lib/dist/features/extrude.js +182 -0
- package/lib/dist/features/fillet.d.ts +24 -0
- package/lib/dist/features/fillet.js +125 -0
- package/lib/dist/features/fillet2d.d.ts +16 -0
- package/lib/dist/features/fillet2d.js +98 -0
- package/lib/dist/features/fuse.d.ts +10 -0
- package/lib/dist/features/fuse.js +63 -0
- package/lib/dist/features/fuse2d.d.ts +13 -0
- package/lib/dist/features/fuse2d.js +86 -0
- package/lib/dist/features/infinite-extrude.d.ts +10 -0
- package/lib/dist/features/infinite-extrude.js +44 -0
- package/lib/dist/features/lazy-scene-object.d.ts +16 -0
- package/lib/dist/features/lazy-scene-object.js +52 -0
- package/lib/dist/features/lazy-vertex.d.ts +19 -0
- package/lib/dist/features/lazy-vertex.js +62 -0
- package/lib/dist/features/load.d.ts +9 -0
- package/lib/dist/features/load.js +31 -0
- package/lib/dist/features/loft.d.ts +27 -0
- package/lib/dist/features/loft.js +273 -0
- package/lib/dist/features/mirror-feature.d.ts +15 -0
- package/lib/dist/features/mirror-feature.js +39 -0
- package/lib/dist/features/mirror-shape.d.ts +14 -0
- package/lib/dist/features/mirror-shape.js +86 -0
- package/lib/dist/features/mirror-shape2d.d.ts +18 -0
- package/lib/dist/features/mirror-shape2d.js +110 -0
- package/lib/dist/features/part.d.ts +12 -0
- package/lib/dist/features/part.js +36 -0
- package/lib/dist/features/plane-from-object.d.ts +29 -0
- package/lib/dist/features/plane-from-object.js +103 -0
- package/lib/dist/features/plane-mid.d.ts +18 -0
- package/lib/dist/features/plane-mid.js +54 -0
- package/lib/dist/features/plane-renderable-base.d.ts +9 -0
- package/lib/dist/features/plane-renderable-base.js +15 -0
- package/lib/dist/features/plane.d.ts +21 -0
- package/lib/dist/features/plane.js +64 -0
- package/lib/dist/features/region2d.d.ts +25 -0
- package/lib/dist/features/region2d.js +185 -0
- package/lib/dist/features/remove.d.ts +9 -0
- package/lib/dist/features/remove.js +33 -0
- package/lib/dist/features/repeat-circular.d.ts +23 -0
- package/lib/dist/features/repeat-circular.js +47 -0
- package/lib/dist/features/repeat-circular2d.d.ts +17 -0
- package/lib/dist/features/repeat-circular2d.js +90 -0
- package/lib/dist/features/repeat-linear.d.ts +23 -0
- package/lib/dist/features/repeat-linear.js +52 -0
- package/lib/dist/features/repeat-linear2d.d.ts +17 -0
- package/lib/dist/features/repeat-linear2d.js +114 -0
- package/lib/dist/features/revolve-options.d.ts +6 -0
- package/lib/dist/features/revolve-options.js +1 -0
- package/lib/dist/features/revolve.d.ts +23 -0
- package/lib/dist/features/revolve.js +150 -0
- package/lib/dist/features/rotate.d.ts +16 -0
- package/lib/dist/features/rotate.js +89 -0
- package/lib/dist/features/rotate2d.d.ts +15 -0
- package/lib/dist/features/rotate2d.js +83 -0
- package/lib/dist/features/select.d.ts +26 -0
- package/lib/dist/features/select.js +113 -0
- package/lib/dist/features/shell.d.ts +24 -0
- package/lib/dist/features/shell.js +214 -0
- package/lib/dist/features/simple-extruder.d.ts +22 -0
- package/lib/dist/features/simple-extruder.js +108 -0
- package/lib/dist/features/sphere.d.ts +13 -0
- package/lib/dist/features/sphere.js +33 -0
- package/lib/dist/features/split.d.ts +14 -0
- package/lib/dist/features/split.js +74 -0
- package/lib/dist/features/split2d.d.ts +13 -0
- package/lib/dist/features/split2d.js +69 -0
- package/lib/dist/features/state-scene-object.d.ts +15 -0
- package/lib/dist/features/state-scene-object.js +44 -0
- package/lib/dist/features/state-select.d.ts +21 -0
- package/lib/dist/features/state-select.js +73 -0
- package/lib/dist/features/static-scene-object.d.ts +10 -0
- package/lib/dist/features/static-scene-object.js +21 -0
- package/lib/dist/features/subtract.d.ts +13 -0
- package/lib/dist/features/subtract.js +56 -0
- package/lib/dist/features/sweep.d.ts +22 -0
- package/lib/dist/features/sweep.js +129 -0
- package/lib/dist/features/translate.d.ts +17 -0
- package/lib/dist/features/translate.js +76 -0
- package/lib/dist/features/translate2d.d.ts +16 -0
- package/lib/dist/features/translate2d.js +61 -0
- package/lib/dist/features/trim2d.d.ts +15 -0
- package/lib/dist/features/trim2d.js +154 -0
- package/lib/dist/filters/all-filter.d.ts +8 -0
- package/lib/dist/filters/all-filter.js +12 -0
- package/lib/dist/filters/edge/at-index.d.ts +21 -0
- package/lib/dist/filters/edge/at-index.js +82 -0
- package/lib/dist/filters/edge/circle-filter.d.ts +17 -0
- package/lib/dist/filters/edge/circle-filter.js +34 -0
- package/lib/dist/filters/edge/curve-filter.d.ts +17 -0
- package/lib/dist/filters/edge/curve-filter.js +34 -0
- package/lib/dist/filters/edge/edge-filter.d.ts +22 -0
- package/lib/dist/filters/edge/edge-filter.js +169 -0
- package/lib/dist/filters/edge/line-filter.d.ts +14 -0
- package/lib/dist/filters/edge/line-filter.js +27 -0
- package/lib/dist/filters/edge/on-plane.d.ts +20 -0
- package/lib/dist/filters/edge/on-plane.js +70 -0
- package/lib/dist/filters/edge/parallel.d.ts +18 -0
- package/lib/dist/filters/edge/parallel.js +41 -0
- package/lib/dist/filters/edge/vertical-plane.d.ts +18 -0
- package/lib/dist/filters/edge/vertical-plane.js +41 -0
- package/lib/dist/filters/face/at-index.d.ts +21 -0
- package/lib/dist/filters/face/at-index.js +89 -0
- package/lib/dist/filters/face/circle-filter.d.ts +17 -0
- package/lib/dist/filters/face/circle-filter.js +34 -0
- package/lib/dist/filters/face/cone-filter.d.ts +15 -0
- package/lib/dist/filters/face/cone-filter.js +30 -0
- package/lib/dist/filters/face/cylinder-curve.d.ts +17 -0
- package/lib/dist/filters/face/cylinder-curve.js +34 -0
- package/lib/dist/filters/face/cylinder.d.ts +17 -0
- package/lib/dist/filters/face/cylinder.js +34 -0
- package/lib/dist/filters/face/face-filter.d.ts +21 -0
- package/lib/dist/filters/face/face-filter.js +134 -0
- package/lib/dist/filters/face/on-plane.d.ts +18 -0
- package/lib/dist/filters/face/on-plane.js +41 -0
- package/lib/dist/filters/face/parallel.d.ts +18 -0
- package/lib/dist/filters/face/parallel.js +41 -0
- package/lib/dist/filters/filter-base.d.ts +8 -0
- package/lib/dist/filters/filter-base.js +2 -0
- package/lib/dist/filters/filter-builder-base.d.ts +10 -0
- package/lib/dist/filters/filter-builder-base.js +31 -0
- package/lib/dist/filters/filter.d.ts +8 -0
- package/lib/dist/filters/filter.js +33 -0
- package/lib/dist/filters/index.d.ts +4 -0
- package/lib/dist/filters/index.js +8 -0
- package/lib/dist/filters/near-point-filter.d.ts +11 -0
- package/lib/dist/filters/near-point-filter.js +33 -0
- package/lib/dist/helpers/clone-transform.d.ts +3 -0
- package/lib/dist/helpers/clone-transform.js +46 -0
- package/lib/dist/helpers/cut-helpers.d.ts +13 -0
- package/lib/dist/helpers/cut-helpers.js +79 -0
- package/lib/dist/helpers/math-helpers.d.ts +2 -0
- package/lib/dist/helpers/math-helpers.js +6 -0
- package/lib/dist/helpers/normalize.d.ts +12 -0
- package/lib/dist/helpers/normalize.js +118 -0
- package/lib/dist/helpers/resolve-filters.d.ts +6 -0
- package/lib/dist/helpers/resolve-filters.js +25 -0
- package/lib/dist/helpers/resolve.d.ts +8 -0
- package/lib/dist/helpers/resolve.js +45 -0
- package/lib/dist/helpers/scene-helpers.d.ts +17 -0
- package/lib/dist/helpers/scene-helpers.js +67 -0
- package/lib/dist/helpers/types.d.ts +27 -0
- package/lib/dist/helpers/types.js +1 -0
- package/lib/dist/index.d.ts +37 -0
- package/lib/dist/index.js +75 -0
- package/lib/dist/io/file-export.d.ts +30 -0
- package/lib/dist/io/file-export.js +45 -0
- package/lib/dist/io/file-import.d.ts +8 -0
- package/lib/dist/io/file-import.js +81 -0
- package/lib/dist/load.d.ts +1 -0
- package/lib/dist/load.js +1 -0
- package/lib/dist/math/axis.d.ts +72 -0
- package/lib/dist/math/axis.js +157 -0
- package/lib/dist/math/axis.test.d.ts +1 -0
- package/lib/dist/math/axis.test.js +287 -0
- package/lib/dist/math/convert.d.ts +2 -0
- package/lib/dist/math/convert.js +1 -0
- package/lib/dist/math/coordinate-system.d.ts +43 -0
- package/lib/dist/math/coordinate-system.js +140 -0
- package/lib/dist/math/coordinate-system.test.d.ts +1 -0
- package/lib/dist/math/coordinate-system.test.js +308 -0
- package/lib/dist/math/index.d.ts +8 -0
- package/lib/dist/math/index.js +8 -0
- package/lib/dist/math/matrix4.d.ts +53 -0
- package/lib/dist/math/matrix4.js +336 -0
- package/lib/dist/math/matrix4.test.d.ts +1 -0
- package/lib/dist/math/matrix4.test.js +357 -0
- package/lib/dist/math/plane.d.ts +60 -0
- package/lib/dist/math/plane.js +243 -0
- package/lib/dist/math/plane.test.d.ts +1 -0
- package/lib/dist/math/plane.test.js +398 -0
- package/lib/dist/math/point.d.ts +73 -0
- package/lib/dist/math/point.js +227 -0
- package/lib/dist/math/point.test.d.ts +1 -0
- package/lib/dist/math/point.test.js +385 -0
- package/lib/dist/math/quaternion.d.ts +37 -0
- package/lib/dist/math/quaternion.js +234 -0
- package/lib/dist/math/quaternion.test.d.ts +1 -0
- package/lib/dist/math/quaternion.test.js +278 -0
- package/lib/dist/math/vector3d.d.ts +43 -0
- package/lib/dist/math/vector3d.js +143 -0
- package/lib/dist/math/vector3d.test.d.ts +1 -0
- package/lib/dist/math/vector3d.test.js +276 -0
- package/lib/dist/oc/boolean-ops.d.ts +36 -0
- package/lib/dist/oc/boolean-ops.js +337 -0
- package/lib/dist/oc/constraint-resolver.d.ts +7 -0
- package/lib/dist/oc/constraint-resolver.js +31 -0
- package/lib/dist/oc/constraints/constraint-helpers.d.ts +33 -0
- package/lib/dist/oc/constraints/constraint-helpers.js +252 -0
- package/lib/dist/oc/constraints/constraint-solver-adaptor.d.ts +22 -0
- package/lib/dist/oc/constraints/constraint-solver-adaptor.js +62 -0
- package/lib/dist/oc/constraints/constraint-solver.d.ts +18 -0
- package/lib/dist/oc/constraints/constraint-solver.js +2 -0
- package/lib/dist/oc/constraints/create-solver.d.ts +2 -0
- package/lib/dist/oc/constraints/create-solver.js +6 -0
- package/lib/dist/oc/constraints/curve/curve-constraint-solver.d.ts +13 -0
- package/lib/dist/oc/constraints/curve/curve-constraint-solver.js +18 -0
- package/lib/dist/oc/constraints/curve/tangent-circle-solver.d.ts +16 -0
- package/lib/dist/oc/constraints/curve/tangent-circle-solver.js +112 -0
- package/lib/dist/oc/constraints/curve/tangent-line-solver.d.ts +19 -0
- package/lib/dist/oc/constraints/curve/tangent-line-solver.js +83 -0
- package/lib/dist/oc/constraints/curve-constraint-solver.d.ts +1 -0
- package/lib/dist/oc/constraints/curve-constraint-solver.js +2 -0
- package/lib/dist/oc/constraints/geometric/geometric-constraint-solver.d.ts +12 -0
- package/lib/dist/oc/constraints/geometric/geometric-constraint-solver.js +17 -0
- package/lib/dist/oc/constraints/geometric/tangent-circle-solver.d.ts +21 -0
- package/lib/dist/oc/constraints/geometric/tangent-circle-solver.js +220 -0
- package/lib/dist/oc/constraints/geometric/tangent-line-solver.d.ts +19 -0
- package/lib/dist/oc/constraints/geometric/tangent-line-solver.js +92 -0
- package/lib/dist/oc/constraints/geometric-constraint-solver.d.ts +1 -0
- package/lib/dist/oc/constraints/geometric-constraint-solver.js +5 -0
- package/lib/dist/oc/convert.d.ts +42 -0
- package/lib/dist/oc/convert.js +231 -0
- package/lib/dist/oc/edge-ops.d.ts +37 -0
- package/lib/dist/oc/edge-ops.js +306 -0
- package/lib/dist/oc/edge-props.d.ts +11 -0
- package/lib/dist/oc/edge-props.js +45 -0
- package/lib/dist/oc/edge-query.d.ts +44 -0
- package/lib/dist/oc/edge-query.js +235 -0
- package/lib/dist/oc/explorer.d.ts +34 -0
- package/lib/dist/oc/explorer.js +179 -0
- package/lib/dist/oc/extrude-ops.d.ts +22 -0
- package/lib/dist/oc/extrude-ops.js +149 -0
- package/lib/dist/oc/face-maker.d.ts +14 -0
- package/lib/dist/oc/face-maker.js +191 -0
- package/lib/dist/oc/face-maker2.d.ts +10 -0
- package/lib/dist/oc/face-maker2.js +139 -0
- package/lib/dist/oc/face-ops.d.ts +28 -0
- package/lib/dist/oc/face-ops.js +252 -0
- package/lib/dist/oc/face-props.d.ts +12 -0
- package/lib/dist/oc/face-props.js +81 -0
- package/lib/dist/oc/face-query.d.ts +35 -0
- package/lib/dist/oc/face-query.js +341 -0
- package/lib/dist/oc/fillet-ops.d.ts +13 -0
- package/lib/dist/oc/fillet-ops.js +153 -0
- package/lib/dist/oc/geometry.d.ts +22 -0
- package/lib/dist/oc/geometry.js +231 -0
- package/lib/dist/oc/hit-test.d.ts +11 -0
- package/lib/dist/oc/hit-test.js +85 -0
- package/lib/dist/oc/index.d.ts +24 -0
- package/lib/dist/oc/index.js +21 -0
- package/lib/dist/oc/init.d.ts +3 -0
- package/lib/dist/oc/init.js +17 -0
- package/lib/dist/oc/intersection.d.ts +10 -0
- package/lib/dist/oc/intersection.js +107 -0
- package/lib/dist/oc/io.d.ts +49 -0
- package/lib/dist/oc/io.js +417 -0
- package/lib/dist/oc/loft-ops.d.ts +5 -0
- package/lib/dist/oc/loft-ops.js +26 -0
- package/lib/dist/oc/measure.d.ts +21 -0
- package/lib/dist/oc/measure.js +256 -0
- package/lib/dist/oc/mesh.d.ts +15 -0
- package/lib/dist/oc/mesh.js +110 -0
- package/lib/dist/oc/primitives.d.ts +5 -0
- package/lib/dist/oc/primitives.js +19 -0
- package/lib/dist/oc/props.d.ts +13 -0
- package/lib/dist/oc/props.js +18 -0
- package/lib/dist/oc/shape-ops.d.ts +34 -0
- package/lib/dist/oc/shape-ops.js +208 -0
- package/lib/dist/oc/shell-ops.d.ts +5 -0
- package/lib/dist/oc/shell-ops.js +25 -0
- package/lib/dist/oc/sweep-ops.d.ts +12 -0
- package/lib/dist/oc/sweep-ops.js +39 -0
- package/lib/dist/oc/tangent-circle-solver.d.ts +17 -0
- package/lib/dist/oc/tangent-circle-solver.js +72 -0
- package/lib/dist/oc/tangent-line-solver.d.ts +17 -0
- package/lib/dist/oc/tangent-line-solver.js +83 -0
- package/lib/dist/oc/tangent-solver.d.ts +14 -0
- package/lib/dist/oc/tangent-solver.js +199 -0
- package/lib/dist/oc/vertex-ops.d.ts +11 -0
- package/lib/dist/oc/vertex-ops.js +39 -0
- package/lib/dist/oc/wire-ops.d.ts +21 -0
- package/lib/dist/oc/wire-ops.js +176 -0
- package/lib/dist/rendering/builder-context.d.ts +16 -0
- package/lib/dist/rendering/builder-context.js +63 -0
- package/lib/dist/rendering/mesh-builder.d.ts +5 -0
- package/lib/dist/rendering/mesh-builder.js +43 -0
- package/lib/dist/rendering/render-edge.d.ts +3 -0
- package/lib/dist/rendering/render-edge.js +4 -0
- package/lib/dist/rendering/render-face.d.ts +2 -0
- package/lib/dist/rendering/render-face.js +5 -0
- package/lib/dist/rendering/render-solid.d.ts +3 -0
- package/lib/dist/rendering/render-solid.js +61 -0
- package/lib/dist/rendering/render-wire.d.ts +6 -0
- package/lib/dist/rendering/render-wire.js +27 -0
- package/lib/dist/rendering/render.d.ts +3 -0
- package/lib/dist/rendering/render.js +183 -0
- package/lib/dist/rendering/scene-compare.d.ts +4 -0
- package/lib/dist/rendering/scene-compare.js +41 -0
- package/lib/dist/rendering/scene.d.ts +81 -0
- package/lib/dist/rendering/scene.js +206 -0
- package/lib/dist/scene-manager.d.ts +32 -0
- package/lib/dist/scene-manager.js +120 -0
- package/lib/dist/tests/extrude.test.d.ts +1 -0
- package/lib/dist/tests/extrude.test.js +48 -0
- package/lib/dist/tests/features/2d/arc.test.d.ts +1 -0
- package/lib/dist/tests/features/2d/arc.test.js +40 -0
- package/lib/dist/tests/features/2d/circle.test.d.ts +1 -0
- package/lib/dist/tests/features/2d/circle.test.js +64 -0
- package/lib/dist/tests/features/2d/constrained.test.d.ts +1 -0
- package/lib/dist/tests/features/2d/constrained.test.js +202 -0
- package/lib/dist/tests/features/2d/line.test.d.ts +1 -0
- package/lib/dist/tests/features/2d/line.test.js +86 -0
- package/lib/dist/tests/features/2d/move.test.d.ts +1 -0
- package/lib/dist/tests/features/2d/move.test.js +74 -0
- package/lib/dist/tests/features/2d/offset.test.d.ts +1 -0
- package/lib/dist/tests/features/2d/offset.test.js +111 -0
- package/lib/dist/tests/features/2d/pmove.test.d.ts +1 -0
- package/lib/dist/tests/features/2d/pmove.test.js +43 -0
- package/lib/dist/tests/features/2d/polygon.test.d.ts +1 -0
- package/lib/dist/tests/features/2d/polygon.test.js +150 -0
- package/lib/dist/tests/features/2d/project.test.d.ts +1 -0
- package/lib/dist/tests/features/2d/project.test.js +22 -0
- package/lib/dist/tests/features/2d/rect.test.d.ts +1 -0
- package/lib/dist/tests/features/2d/rect.test.js +66 -0
- package/lib/dist/tests/features/2d/rmove.test.d.ts +1 -0
- package/lib/dist/tests/features/2d/rmove.test.js +29 -0
- package/lib/dist/tests/features/2d/slot-from-edge.test.d.ts +1 -0
- package/lib/dist/tests/features/2d/slot-from-edge.test.js +35 -0
- package/lib/dist/tests/features/2d/slot.test.d.ts +1 -0
- package/lib/dist/tests/features/2d/slot.test.js +44 -0
- package/lib/dist/tests/features/2d/tarc.test.d.ts +1 -0
- package/lib/dist/tests/features/2d/tarc.test.js +237 -0
- package/lib/dist/tests/features/2d/tcircle.test.d.ts +1 -0
- package/lib/dist/tests/features/2d/tcircle.test.js +28 -0
- package/lib/dist/tests/features/2d/tline.test.d.ts +1 -0
- package/lib/dist/tests/features/2d/tline.test.js +34 -0
- package/lib/dist/tests/features/axis.test.d.ts +1 -0
- package/lib/dist/tests/features/axis.test.js +143 -0
- package/lib/dist/tests/features/chamfer.test.d.ts +1 -0
- package/lib/dist/tests/features/chamfer.test.js +159 -0
- package/lib/dist/tests/features/color.test.d.ts +1 -0
- package/lib/dist/tests/features/color.test.js +96 -0
- package/lib/dist/tests/features/common2d.test.d.ts +1 -0
- package/lib/dist/tests/features/common2d.test.js +113 -0
- package/lib/dist/tests/features/copy-circular-2d.test.d.ts +1 -0
- package/lib/dist/tests/features/copy-circular-2d.test.js +40 -0
- package/lib/dist/tests/features/copy-circular.test.d.ts +1 -0
- package/lib/dist/tests/features/copy-circular.test.js +44 -0
- package/lib/dist/tests/features/copy-linear-2d.test.d.ts +1 -0
- package/lib/dist/tests/features/copy-linear-2d.test.js +35 -0
- package/lib/dist/tests/features/copy-linear.test.d.ts +1 -0
- package/lib/dist/tests/features/copy-linear.test.js +95 -0
- package/lib/dist/tests/features/copy.test.d.ts +1 -0
- package/lib/dist/tests/features/copy.test.js +158 -0
- package/lib/dist/tests/features/cut-symmetric.test.d.ts +1 -0
- package/lib/dist/tests/features/cut-symmetric.test.js +120 -0
- package/lib/dist/tests/features/cut-two-distances.test.d.ts +1 -0
- package/lib/dist/tests/features/cut-two-distances.test.js +125 -0
- package/lib/dist/tests/features/cut.test.d.ts +1 -0
- package/lib/dist/tests/features/cut.test.js +311 -0
- package/lib/dist/tests/features/dispose.test.d.ts +1 -0
- package/lib/dist/tests/features/dispose.test.js +189 -0
- package/lib/dist/tests/features/extrude-symmetric.test.d.ts +1 -0
- package/lib/dist/tests/features/extrude-symmetric.test.js +240 -0
- package/lib/dist/tests/features/extrude-to-face.test.d.ts +1 -0
- package/lib/dist/tests/features/extrude-to-face.test.js +256 -0
- package/lib/dist/tests/features/extrude-two-distances.test.d.ts +1 -0
- package/lib/dist/tests/features/extrude-two-distances.test.js +264 -0
- package/lib/dist/tests/features/extrude.test.d.ts +1 -0
- package/lib/dist/tests/features/extrude.test.js +640 -0
- package/lib/dist/tests/features/fillet.test.d.ts +1 -0
- package/lib/dist/tests/features/fillet.test.js +163 -0
- package/lib/dist/tests/features/fillet2d.test.d.ts +1 -0
- package/lib/dist/tests/features/fillet2d.test.js +69 -0
- package/lib/dist/tests/features/fuse.test.d.ts +1 -0
- package/lib/dist/tests/features/fuse.test.js +122 -0
- package/lib/dist/tests/features/fuse2d.test.d.ts +1 -0
- package/lib/dist/tests/features/fuse2d.test.js +80 -0
- package/lib/dist/tests/features/loft.test.d.ts +1 -0
- package/lib/dist/tests/features/loft.test.js +283 -0
- package/lib/dist/tests/features/mirror.test.d.ts +1 -0
- package/lib/dist/tests/features/mirror.test.js +112 -0
- package/lib/dist/tests/features/mirror2d.test.d.ts +1 -0
- package/lib/dist/tests/features/mirror2d.test.js +75 -0
- package/lib/dist/tests/features/part-pick.test.d.ts +1 -0
- package/lib/dist/tests/features/part-pick.test.js +73 -0
- package/lib/dist/tests/features/part-repeat.test.d.ts +1 -0
- package/lib/dist/tests/features/part-repeat.test.js +109 -0
- package/lib/dist/tests/features/part.test.d.ts +1 -0
- package/lib/dist/tests/features/part.test.js +356 -0
- package/lib/dist/tests/features/plane.test.d.ts +1 -0
- package/lib/dist/tests/features/plane.test.js +154 -0
- package/lib/dist/tests/features/repeat-circular.test.d.ts +1 -0
- package/lib/dist/tests/features/repeat-circular.test.js +114 -0
- package/lib/dist/tests/features/repeat-linear.test.d.ts +1 -0
- package/lib/dist/tests/features/repeat-linear.test.js +138 -0
- package/lib/dist/tests/features/revolve.test.d.ts +1 -0
- package/lib/dist/tests/features/revolve.test.js +205 -0
- package/lib/dist/tests/features/rotate.test.d.ts +1 -0
- package/lib/dist/tests/features/rotate.test.js +133 -0
- package/lib/dist/tests/features/rotate2d.test.d.ts +1 -0
- package/lib/dist/tests/features/rotate2d.test.js +74 -0
- package/lib/dist/tests/features/select.test.d.ts +1 -0
- package/lib/dist/tests/features/select.test.js +337 -0
- package/lib/dist/tests/features/shell.test.d.ts +1 -0
- package/lib/dist/tests/features/shell.test.js +230 -0
- package/lib/dist/tests/features/subtract.test.d.ts +1 -0
- package/lib/dist/tests/features/subtract.test.js +103 -0
- package/lib/dist/tests/features/sweep.test.d.ts +1 -0
- package/lib/dist/tests/features/sweep.test.js +312 -0
- package/lib/dist/tests/features/translate.test.d.ts +1 -0
- package/lib/dist/tests/features/translate.test.js +117 -0
- package/lib/dist/tests/global-setup.d.ts +1 -0
- package/lib/dist/tests/global-setup.js +5 -0
- package/lib/dist/tests/math/axis.test.d.ts +1 -0
- package/lib/dist/tests/math/axis.test.js +287 -0
- package/lib/dist/tests/math/coordinate-system.test.d.ts +1 -0
- package/lib/dist/tests/math/coordinate-system.test.js +308 -0
- package/lib/dist/tests/math/matrix4.test.d.ts +1 -0
- package/lib/dist/tests/math/matrix4.test.js +357 -0
- package/lib/dist/tests/math/plane.test.d.ts +1 -0
- package/lib/dist/tests/math/plane.test.js +398 -0
- package/lib/dist/tests/math/point.test.d.ts +1 -0
- package/lib/dist/tests/math/point.test.js +385 -0
- package/lib/dist/tests/math/quaternion.test.d.ts +1 -0
- package/lib/dist/tests/math/quaternion.test.js +278 -0
- package/lib/dist/tests/math/vector3d.test.d.ts +1 -0
- package/lib/dist/tests/math/vector3d.test.js +276 -0
- package/lib/dist/tests/setup.d.ts +5 -0
- package/lib/dist/tests/setup.js +14 -0
- package/lib/dist/tests/utils.d.ts +12 -0
- package/lib/dist/tests/utils.js +36 -0
- package/lib/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +83 -0
- package/server/dist/fluidcad-server.d.ts +32 -0
- package/server/dist/fluidcad-server.js +150 -0
- package/server/dist/index.d.ts +1 -0
- package/server/dist/index.js +290 -0
- package/server/dist/routes/actions.d.ts +3 -0
- package/server/dist/routes/actions.js +100 -0
- package/server/dist/routes/export.d.ts +3 -0
- package/server/dist/routes/export.js +55 -0
- package/server/dist/routes/properties.d.ts +3 -0
- package/server/dist/routes/properties.js +46 -0
- package/server/dist/routes/screenshot.d.ts +2 -0
- package/server/dist/routes/screenshot.js +76 -0
- package/server/dist/vite-manager.d.ts +10 -0
- package/server/dist/vite-manager.js +64 -0
- package/server/dist/ws-protocol.d.ts +138 -0
- package/server/dist/ws-protocol.js +4 -0
- package/ui/dist/assets/index-DXW2yo2v.css +2 -0
- package/ui/dist/assets/index-qqJ_mWi7.js +4732 -0
- package/ui/dist/icons/aline.png +0 -0
- package/ui/dist/icons/arc.png +0 -0
- package/ui/dist/icons/aslot.png +0 -0
- package/ui/dist/icons/axis.png +0 -0
- package/ui/dist/icons/box.png +0 -0
- package/ui/dist/icons/chamfer.png +0 -0
- package/ui/dist/icons/circle.png +0 -0
- package/ui/dist/icons/color.png +0 -0
- package/ui/dist/icons/common.png +0 -0
- package/ui/dist/icons/cone.png +0 -0
- package/ui/dist/icons/connect.png +0 -0
- package/ui/dist/icons/copy-circular.png +0 -0
- package/ui/dist/icons/copy-circular2d.png +0 -0
- package/ui/dist/icons/copy-linear.png +0 -0
- package/ui/dist/icons/copy-linear2d.png +0 -0
- package/ui/dist/icons/cut.png +0 -0
- package/ui/dist/icons/cylinder.png +0 -0
- package/ui/dist/icons/edge.png +0 -0
- package/ui/dist/icons/extrude.png +0 -0
- package/ui/dist/icons/fillet.png +0 -0
- package/ui/dist/icons/fillet2d.png +0 -0
- package/ui/dist/icons/fuse.png +0 -0
- package/ui/dist/icons/hline.png +0 -0
- package/ui/dist/icons/hole.png +0 -0
- package/ui/dist/icons/line.png +0 -0
- package/ui/dist/icons/load.png +0 -0
- package/ui/dist/icons/mirror.png +0 -0
- package/ui/dist/icons/mirror2d.png +0 -0
- package/ui/dist/icons/move.png +0 -0
- package/ui/dist/icons/plane.png +0 -0
- package/ui/dist/icons/polygon.png +0 -0
- package/ui/dist/icons/rect.png +0 -0
- package/ui/dist/icons/revolve.png +0 -0
- package/ui/dist/icons/rotate.png +0 -0
- package/ui/dist/icons/rotate2d.png +0 -0
- package/ui/dist/icons/select.png +0 -0
- package/ui/dist/icons/shell.png +0 -0
- package/ui/dist/icons/sketch.png +0 -0
- package/ui/dist/icons/slot.png +0 -0
- package/ui/dist/icons/solid.png +0 -0
- package/ui/dist/icons/sphere.png +0 -0
- package/ui/dist/icons/subtract.png +0 -0
- package/ui/dist/icons/tarc.png +0 -0
- package/ui/dist/icons/tline.png +0 -0
- package/ui/dist/icons/translate.png +0 -0
- package/ui/dist/icons/vline.png +0 -0
- package/ui/dist/icons/wire.png +0 -0
- package/ui/dist/index.html +13 -0
- package/ui/dist/logo.png +0 -0
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
import { Point2D } from "../../math/point.js";
|
|
2
|
+
import { Geometry } from "../../oc/geometry.js";
|
|
3
|
+
import { LazySelectionSceneObject } from "../lazy-scene-object.js";
|
|
4
|
+
import { LazyVertex } from "../lazy-vertex.js";
|
|
5
|
+
import { ExtrudableGeometryBase } from "./extrudable-base.js";
|
|
6
|
+
export class Rect extends ExtrudableGeometryBase {
|
|
7
|
+
width;
|
|
8
|
+
height;
|
|
9
|
+
_radius;
|
|
10
|
+
_center = false;
|
|
11
|
+
constructor(width, height, targetPlane = null) {
|
|
12
|
+
super(targetPlane);
|
|
13
|
+
this.width = width;
|
|
14
|
+
this.height = height;
|
|
15
|
+
}
|
|
16
|
+
build() {
|
|
17
|
+
const plane = this.targetPlane?.getPlane() || this.getParent().getPlane();
|
|
18
|
+
let start = this.targetPlane
|
|
19
|
+
? plane.worldToLocal(this.targetPlane.getPlaneCenter())
|
|
20
|
+
: this.getCurrentPosition();
|
|
21
|
+
console.log("Rect::build start:", start);
|
|
22
|
+
let end = new Point2D(start.x + this.width, start.y + this.height);
|
|
23
|
+
if (this._center === true) {
|
|
24
|
+
end = start;
|
|
25
|
+
start = start.translate(-this.width / 2, -this.height / 2);
|
|
26
|
+
}
|
|
27
|
+
else if (this._center === 'horizontal') {
|
|
28
|
+
end = start;
|
|
29
|
+
start = start.translate(-this.width / 2, 0);
|
|
30
|
+
}
|
|
31
|
+
else if (this._center === 'vertical') {
|
|
32
|
+
end = start;
|
|
33
|
+
start = start.translate(0, -this.height / 2);
|
|
34
|
+
}
|
|
35
|
+
let edges = [];
|
|
36
|
+
if (this._radius) {
|
|
37
|
+
edges = this.buildRoundedRect(start, plane);
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
edges = this.buildSimpleRect(start, plane);
|
|
41
|
+
}
|
|
42
|
+
this.addShapes(edges);
|
|
43
|
+
if (this.sketch) {
|
|
44
|
+
this.setCurrentPosition(end);
|
|
45
|
+
}
|
|
46
|
+
if (this.targetPlane) {
|
|
47
|
+
this.targetPlane.removeShapes(this);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
buildSimpleRect(start, plane) {
|
|
51
|
+
const bottomLeft = start;
|
|
52
|
+
const topRight = new Point2D(bottomLeft.x + this.width, bottomLeft.y + this.height);
|
|
53
|
+
const bottomRight = new Point2D(topRight.x, bottomLeft.y);
|
|
54
|
+
const topLeft = new Point2D(bottomLeft.x, topRight.y);
|
|
55
|
+
let segment1 = Geometry.makeSegment(plane.localToWorld(bottomLeft), plane.localToWorld(bottomRight));
|
|
56
|
+
let segment2 = Geometry.makeSegment(plane.localToWorld(bottomRight), plane.localToWorld(topRight));
|
|
57
|
+
let segment3 = Geometry.makeSegment(plane.localToWorld(topRight), plane.localToWorld(topLeft));
|
|
58
|
+
let segment4 = Geometry.makeSegment(plane.localToWorld(topLeft), plane.localToWorld(bottomLeft));
|
|
59
|
+
const result = [
|
|
60
|
+
Geometry.makeEdge(segment1),
|
|
61
|
+
Geometry.makeEdge(segment2),
|
|
62
|
+
Geometry.makeEdge(segment3),
|
|
63
|
+
Geometry.makeEdge(segment4),
|
|
64
|
+
];
|
|
65
|
+
this.setState('bottomEdge', result[0]);
|
|
66
|
+
this.setState('rightEdge', result[1]);
|
|
67
|
+
this.setState('topEdge', result[2]);
|
|
68
|
+
this.setState('leftEdge', result[3]);
|
|
69
|
+
return result;
|
|
70
|
+
}
|
|
71
|
+
buildRoundedRect(start, plane) {
|
|
72
|
+
const radius = Array.isArray(this._radius) ? this._radius :
|
|
73
|
+
[this._radius,
|
|
74
|
+
this._radius || 0,
|
|
75
|
+
this._radius || 0,
|
|
76
|
+
this._radius || 0];
|
|
77
|
+
const [bottomLeftRadius, bottomRightRadius, topRightRadius, topLeftRadius] = radius;
|
|
78
|
+
const bottomLeft = start;
|
|
79
|
+
const topRight = new Point2D(bottomLeft.x + this.width, bottomLeft.y + this.height);
|
|
80
|
+
const bottomLeftArcCenter = new Point2D(bottomLeft.x + bottomLeftRadius, bottomLeft.y + bottomLeftRadius);
|
|
81
|
+
const bottomRightArcCenter = new Point2D(topRight.x - bottomRightRadius, bottomLeft.y + bottomRightRadius);
|
|
82
|
+
const topRightArcCenter = new Point2D(topRight.x - topRightRadius, topRight.y - topRightRadius);
|
|
83
|
+
const topLeftArcCenter = new Point2D(bottomLeft.x + topLeftRadius, topRight.y - topLeftRadius);
|
|
84
|
+
const bottomLineStart = new Point2D(bottomLeft.x + bottomLeftRadius, bottomLeft.y);
|
|
85
|
+
const bottomLineEnd = new Point2D(topRight.x - bottomRightRadius, bottomLeft.y);
|
|
86
|
+
const rightLineStart = new Point2D(topRight.x, bottomLeft.y + bottomRightRadius);
|
|
87
|
+
const rightLineEnd = new Point2D(topRight.x, topRight.y - topRightRadius);
|
|
88
|
+
const topLineStart = new Point2D(topRight.x - topRightRadius, topRight.y);
|
|
89
|
+
const topLineEnd = new Point2D(bottomLeft.x + topLeftRadius, topRight.y);
|
|
90
|
+
const leftLineStart = new Point2D(bottomLeft.x, topRight.y - topLeftRadius);
|
|
91
|
+
const leftLineEnd = new Point2D(bottomLeft.x, bottomLeft.y + bottomLeftRadius);
|
|
92
|
+
const localToWorld = plane.localToWorld.bind(plane);
|
|
93
|
+
const bottomLineSegment = Geometry.makeSegment(localToWorld(bottomLineStart), localToWorld(bottomLineEnd));
|
|
94
|
+
const rightLineSegment = Geometry.makeSegment(localToWorld(rightLineStart), localToWorld(rightLineEnd));
|
|
95
|
+
const topLineSegment = Geometry.makeSegment(localToWorld(topLineStart), localToWorld(topLineEnd));
|
|
96
|
+
const leftLineSegment = Geometry.makeSegment(localToWorld(leftLineStart), localToWorld(leftLineEnd));
|
|
97
|
+
let bottomRightArcEdge = null;
|
|
98
|
+
if (bottomRightRadius > 0) {
|
|
99
|
+
const arc = Geometry.makeArc(localToWorld(bottomRightArcCenter), bottomRightRadius, plane.normal, localToWorld(bottomLineEnd), localToWorld(rightLineStart));
|
|
100
|
+
bottomRightArcEdge = Geometry.makeEdgeFromCurve(arc);
|
|
101
|
+
}
|
|
102
|
+
let topRightArcEdge = null;
|
|
103
|
+
if (topRightRadius > 0) {
|
|
104
|
+
const arc = Geometry.makeArc(localToWorld(topRightArcCenter), topRightRadius, plane.normal, localToWorld(rightLineEnd), localToWorld(topLineStart));
|
|
105
|
+
topRightArcEdge = Geometry.makeEdgeFromCurve(arc);
|
|
106
|
+
}
|
|
107
|
+
let topLeftArcEdge = null;
|
|
108
|
+
if (topLeftRadius > 0) {
|
|
109
|
+
const arc = Geometry.makeArc(localToWorld(topLeftArcCenter), topLeftRadius, plane.normal, localToWorld(topLineEnd), localToWorld(leftLineStart));
|
|
110
|
+
topLeftArcEdge = Geometry.makeEdgeFromCurve(arc);
|
|
111
|
+
}
|
|
112
|
+
let bottomLeftArcEdge = null;
|
|
113
|
+
if (bottomLeftRadius > 0) {
|
|
114
|
+
const arc = Geometry.makeArc(localToWorld(bottomLeftArcCenter), bottomLeftRadius, plane.normal, localToWorld(leftLineEnd), localToWorld(bottomLineStart));
|
|
115
|
+
bottomLeftArcEdge = Geometry.makeEdgeFromCurve(arc);
|
|
116
|
+
}
|
|
117
|
+
const bottomEdge = Geometry.makeEdge(bottomLineSegment);
|
|
118
|
+
const rightEdge = Geometry.makeEdge(rightLineSegment);
|
|
119
|
+
const topEdge = Geometry.makeEdge(topLineSegment);
|
|
120
|
+
const leftEdge = Geometry.makeEdge(leftLineSegment);
|
|
121
|
+
this.setState('bottomEdge', bottomEdge);
|
|
122
|
+
this.setState('rightEdge', rightEdge);
|
|
123
|
+
this.setState('topEdge', topEdge);
|
|
124
|
+
this.setState('leftEdge', leftEdge);
|
|
125
|
+
this.setState('bottomRightArcEdge', bottomRightArcEdge);
|
|
126
|
+
this.setState('topRightArcEdge', topRightArcEdge);
|
|
127
|
+
this.setState('topLeftArcEdge', topLeftArcEdge);
|
|
128
|
+
this.setState('bottomLeftArcEdge', bottomLeftArcEdge);
|
|
129
|
+
return [
|
|
130
|
+
bottomEdge,
|
|
131
|
+
bottomRightArcEdge,
|
|
132
|
+
rightEdge,
|
|
133
|
+
topRightArcEdge,
|
|
134
|
+
topEdge,
|
|
135
|
+
topLeftArcEdge,
|
|
136
|
+
leftEdge,
|
|
137
|
+
bottomLeftArcEdge,
|
|
138
|
+
].filter(e => e !== null);
|
|
139
|
+
}
|
|
140
|
+
getType() {
|
|
141
|
+
return 'rect';
|
|
142
|
+
}
|
|
143
|
+
getDependencies() {
|
|
144
|
+
return this.targetPlane ? [this.targetPlane] : [];
|
|
145
|
+
}
|
|
146
|
+
createCopy(remap) {
|
|
147
|
+
const targetPlane = this.targetPlane ? (remap.get(this.targetPlane) || this.targetPlane) : null;
|
|
148
|
+
const rect = new Rect(this.width, this.height, targetPlane);
|
|
149
|
+
if (this._radius) {
|
|
150
|
+
rect.radius(...(Array.isArray(this._radius) ? this._radius : [this._radius]));
|
|
151
|
+
}
|
|
152
|
+
rect.center(this._center);
|
|
153
|
+
return rect;
|
|
154
|
+
}
|
|
155
|
+
compareTo(other) {
|
|
156
|
+
if (!(other instanceof Rect)) {
|
|
157
|
+
return false;
|
|
158
|
+
}
|
|
159
|
+
if (!super.compareTo(other)) {
|
|
160
|
+
return false;
|
|
161
|
+
}
|
|
162
|
+
if (this.targetPlane?.constructor !== other.targetPlane?.constructor) {
|
|
163
|
+
return false;
|
|
164
|
+
}
|
|
165
|
+
if (this.targetPlane && other.targetPlane && !this.targetPlane.compareTo(other.targetPlane)) {
|
|
166
|
+
return false;
|
|
167
|
+
}
|
|
168
|
+
if (this.width !== other.width || this.height !== other.height || this._center !== other._center) {
|
|
169
|
+
return false;
|
|
170
|
+
}
|
|
171
|
+
const thisRadius = Array.isArray(this._radius) ? this._radius : [this._radius || 0,
|
|
172
|
+
this._radius || 0,
|
|
173
|
+
this._radius || 0,
|
|
174
|
+
this._radius || 0];
|
|
175
|
+
const otherRadius = Array.isArray(other._radius) ? other._radius : [other._radius || 0,
|
|
176
|
+
other._radius || 0,
|
|
177
|
+
other._radius || 0,
|
|
178
|
+
other._radius || 0];
|
|
179
|
+
return thisRadius.every((r, i) => r === otherRadius[i]);
|
|
180
|
+
}
|
|
181
|
+
topEdge() {
|
|
182
|
+
return new LazySelectionSceneObject(this.generateUniqueName('top-edge'), (parent) => [parent.getState('topEdge')], this);
|
|
183
|
+
}
|
|
184
|
+
bottomEdge() {
|
|
185
|
+
return new LazySelectionSceneObject(this.generateUniqueName('bottom-edge'), (parent) => [parent.getState('bottomEdge')], this);
|
|
186
|
+
}
|
|
187
|
+
leftEdge() {
|
|
188
|
+
return new LazySelectionSceneObject(this.generateUniqueName('left-edge'), (parent) => [parent.getState('leftEdge')], this);
|
|
189
|
+
}
|
|
190
|
+
rightEdge() {
|
|
191
|
+
return new LazySelectionSceneObject(this.generateUniqueName('right-edge'), (parent) => [parent.getState('rightEdge')], this);
|
|
192
|
+
}
|
|
193
|
+
topLeftArcEdge() {
|
|
194
|
+
return new LazySelectionSceneObject(this.generateUniqueName('top-left-arc'), (parent) => [parent.getState('topLeftArcEdge')], this);
|
|
195
|
+
}
|
|
196
|
+
topRightArcEdge() {
|
|
197
|
+
return new LazySelectionSceneObject(this.generateUniqueName('top-right-arc'), (parent) => [parent.getState('topRightArcEdge')], this);
|
|
198
|
+
}
|
|
199
|
+
bottomLeftArcEdge() {
|
|
200
|
+
return new LazySelectionSceneObject(this.generateUniqueName('bottom-left-arc'), (parent) => [parent.getState('bottomLeftArcEdge')], this);
|
|
201
|
+
}
|
|
202
|
+
bottomRightArcEdge() {
|
|
203
|
+
return new LazySelectionSceneObject(this.generateUniqueName('bottom-right-arc'), (parent) => [parent.getState('bottomRightArcEdge')], this);
|
|
204
|
+
}
|
|
205
|
+
topLeft() {
|
|
206
|
+
return new LazyVertex(this.generateUniqueName('top-left-vertex'), () => {
|
|
207
|
+
const edge = this.getState('topEdge');
|
|
208
|
+
if (!edge) {
|
|
209
|
+
return [];
|
|
210
|
+
}
|
|
211
|
+
return [edge.getLastVertex()];
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
topRight() {
|
|
215
|
+
return new LazyVertex(this.generateUniqueName('top-right-vertex'), () => {
|
|
216
|
+
const edge = this.getState('topEdge');
|
|
217
|
+
if (!edge) {
|
|
218
|
+
return [];
|
|
219
|
+
}
|
|
220
|
+
return [edge.getFirstVertex()];
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
bottomLeft() {
|
|
224
|
+
return new LazyVertex(this.generateUniqueName('bottom-left-vertex'), () => {
|
|
225
|
+
const edge = this.getState('bottomEdge');
|
|
226
|
+
if (!edge) {
|
|
227
|
+
return [];
|
|
228
|
+
}
|
|
229
|
+
return [edge.getFirstVertex()];
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
bottomRight() {
|
|
233
|
+
return new LazyVertex(this.generateUniqueName('bottom-right-vertex'), () => {
|
|
234
|
+
const edge = this.getState('bottomEdge');
|
|
235
|
+
if (!edge) {
|
|
236
|
+
return [];
|
|
237
|
+
}
|
|
238
|
+
return [edge.getLastVertex()];
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
radius(...r) {
|
|
242
|
+
if (r.length === 1) {
|
|
243
|
+
this._radius = r[0];
|
|
244
|
+
}
|
|
245
|
+
else {
|
|
246
|
+
this._radius = r;
|
|
247
|
+
}
|
|
248
|
+
return this;
|
|
249
|
+
}
|
|
250
|
+
center(value = true) {
|
|
251
|
+
this._center = value;
|
|
252
|
+
return this;
|
|
253
|
+
}
|
|
254
|
+
serialize() {
|
|
255
|
+
return {
|
|
256
|
+
width: this.width,
|
|
257
|
+
height: this.height,
|
|
258
|
+
radius: this._radius,
|
|
259
|
+
center: this._center
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { SceneObject } from "../../common/scene-object.js";
|
|
2
|
+
import { GeometrySceneObject } from "./geometry.js";
|
|
3
|
+
import { LazyVertex } from "../lazy-vertex.js";
|
|
4
|
+
export declare class RMove extends GeometrySceneObject {
|
|
5
|
+
pivot: LazyVertex;
|
|
6
|
+
angle: number;
|
|
7
|
+
constructor(pivot: LazyVertex, angle: number);
|
|
8
|
+
getType(): string;
|
|
9
|
+
build(): void;
|
|
10
|
+
getDependencies(): SceneObject[];
|
|
11
|
+
createCopy(remap: Map<SceneObject, SceneObject>): SceneObject;
|
|
12
|
+
compareTo(other: this): boolean;
|
|
13
|
+
serialize(): {
|
|
14
|
+
pivot: LazyVertex;
|
|
15
|
+
angle: number;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { GeometrySceneObject } from "./geometry.js";
|
|
2
|
+
export class RMove extends GeometrySceneObject {
|
|
3
|
+
pivot;
|
|
4
|
+
angle;
|
|
5
|
+
constructor(pivot, angle) {
|
|
6
|
+
super();
|
|
7
|
+
this.pivot = pivot;
|
|
8
|
+
this.angle = angle;
|
|
9
|
+
}
|
|
10
|
+
getType() {
|
|
11
|
+
return 'rmove';
|
|
12
|
+
}
|
|
13
|
+
build() {
|
|
14
|
+
const pos = this.getCurrentPosition();
|
|
15
|
+
const newPos = pos.rotate(this.angle, this.pivot.asPoint2D());
|
|
16
|
+
this.setCurrentPosition(newPos);
|
|
17
|
+
}
|
|
18
|
+
getDependencies() {
|
|
19
|
+
return [];
|
|
20
|
+
}
|
|
21
|
+
createCopy(remap) {
|
|
22
|
+
return new RMove(this.pivot, this.angle);
|
|
23
|
+
}
|
|
24
|
+
compareTo(other) {
|
|
25
|
+
if (!(other instanceof RMove)) {
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
28
|
+
if (!super.compareTo(other)) {
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
return this.pivot.compareTo(other.pivot) && this.angle === other.angle;
|
|
32
|
+
}
|
|
33
|
+
serialize() {
|
|
34
|
+
return {
|
|
35
|
+
pivot: this.pivot,
|
|
36
|
+
angle: this.angle
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Plane } from "../../math/plane.js";
|
|
2
|
+
import { Point2D } from "../../math/point.js";
|
|
3
|
+
import { GeometrySceneObject } from "./geometry.js";
|
|
4
|
+
import { PlaneObjectBase } from "../plane-renderable-base.js";
|
|
5
|
+
import { SceneObject } from "../../common/scene-object.js";
|
|
6
|
+
import { Edge } from "../../common/edge.js";
|
|
7
|
+
import { Extrudable } from "../../helpers/types.js";
|
|
8
|
+
export declare class Sketch extends SceneObject implements Extrudable {
|
|
9
|
+
planeObj: PlaneObjectBase;
|
|
10
|
+
constructor(planeObj: PlaneObjectBase);
|
|
11
|
+
isContainer(): boolean;
|
|
12
|
+
isExtrudable(): boolean;
|
|
13
|
+
getPlane(): Plane;
|
|
14
|
+
getStartPoint(): Point2D;
|
|
15
|
+
getTangentAt(currentObj: GeometrySceneObject): Point2D | null;
|
|
16
|
+
getPositionAt(currentObj: GeometrySceneObject): Point2D;
|
|
17
|
+
getLastPosition(): Point2D;
|
|
18
|
+
build(): void;
|
|
19
|
+
getEdges(): Edge[];
|
|
20
|
+
getEdgesWithOwner(): Map<Edge, GeometrySceneObject>;
|
|
21
|
+
getGeometriesWithOwner(): Map<Edge, GeometrySceneObject>;
|
|
22
|
+
getGeometries(): Edge[];
|
|
23
|
+
getDependencies(): SceneObject[];
|
|
24
|
+
createCopy(remap: Map<SceneObject, SceneObject>): SceneObject;
|
|
25
|
+
compareTo(other: Sketch): boolean;
|
|
26
|
+
getTangent(): Point2D | null;
|
|
27
|
+
getType(): string;
|
|
28
|
+
serialize(): {
|
|
29
|
+
currentPosition: import("../../math/point.js").Point;
|
|
30
|
+
currentTangent: import("../../math/point.js").Point;
|
|
31
|
+
plane: any;
|
|
32
|
+
};
|
|
33
|
+
toString(): string;
|
|
34
|
+
}
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { Point2D } from "../../math/point.js";
|
|
2
|
+
import { GeometrySceneObject } from "./geometry.js";
|
|
3
|
+
import { SceneObject } from "../../common/scene-object.js";
|
|
4
|
+
import { Edge } from "../../common/edge.js";
|
|
5
|
+
import { Wire } from "../../common/wire.js";
|
|
6
|
+
export class Sketch extends SceneObject {
|
|
7
|
+
planeObj;
|
|
8
|
+
constructor(planeObj) {
|
|
9
|
+
super();
|
|
10
|
+
this.planeObj = planeObj;
|
|
11
|
+
}
|
|
12
|
+
isContainer() {
|
|
13
|
+
return true;
|
|
14
|
+
}
|
|
15
|
+
isExtrudable() {
|
|
16
|
+
return true;
|
|
17
|
+
}
|
|
18
|
+
getPlane() {
|
|
19
|
+
return this.planeObj.getPlane();
|
|
20
|
+
}
|
|
21
|
+
getStartPoint() {
|
|
22
|
+
const center = this.planeObj.getPlaneCenter();
|
|
23
|
+
if (center) {
|
|
24
|
+
const plane = this.getPlane();
|
|
25
|
+
return plane.worldToLocal(center);
|
|
26
|
+
}
|
|
27
|
+
return new Point2D(0, 0);
|
|
28
|
+
}
|
|
29
|
+
getTangentAt(currentObj) {
|
|
30
|
+
const children = this.getChildren();
|
|
31
|
+
const previous = children.slice(0, children.indexOf(currentObj));
|
|
32
|
+
let last = previous[previous.length - 1];
|
|
33
|
+
while (last) {
|
|
34
|
+
const tangent = last.getTangent();
|
|
35
|
+
if (tangent) {
|
|
36
|
+
return tangent;
|
|
37
|
+
}
|
|
38
|
+
previous.pop();
|
|
39
|
+
last = previous[previous.length - 1];
|
|
40
|
+
}
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
getPositionAt(currentObj) {
|
|
44
|
+
const children = this.getChildren();
|
|
45
|
+
if (children.length === 1) {
|
|
46
|
+
return this.getStartPoint();
|
|
47
|
+
}
|
|
48
|
+
const previous = children.slice(0, children.indexOf(currentObj));
|
|
49
|
+
let last = previous[previous.length - 1];
|
|
50
|
+
while (last) {
|
|
51
|
+
const pos = last.getState('current-position');
|
|
52
|
+
if (pos) {
|
|
53
|
+
return pos;
|
|
54
|
+
}
|
|
55
|
+
previous.pop();
|
|
56
|
+
last = previous[previous.length - 1];
|
|
57
|
+
}
|
|
58
|
+
return this.getStartPoint();
|
|
59
|
+
}
|
|
60
|
+
getLastPosition() {
|
|
61
|
+
const children = this.getChildren().slice();
|
|
62
|
+
if (children.length === 0) {
|
|
63
|
+
return this.getStartPoint();
|
|
64
|
+
}
|
|
65
|
+
while (true) {
|
|
66
|
+
const last = children[children.length - 1];
|
|
67
|
+
if (!last) {
|
|
68
|
+
return this.getStartPoint();
|
|
69
|
+
}
|
|
70
|
+
const pos = last.getState('current-position');
|
|
71
|
+
if (pos) {
|
|
72
|
+
return pos;
|
|
73
|
+
}
|
|
74
|
+
children.pop();
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
build() {
|
|
78
|
+
this.planeObj.removeShapes(this);
|
|
79
|
+
}
|
|
80
|
+
getEdges() {
|
|
81
|
+
return [...this.getEdgesWithOwner().keys()];
|
|
82
|
+
}
|
|
83
|
+
getEdgesWithOwner() {
|
|
84
|
+
const children = this.getChildren();
|
|
85
|
+
const result = new Map();
|
|
86
|
+
// get edges and filter out the ones that were removed by non-siblings
|
|
87
|
+
for (const child of children) {
|
|
88
|
+
const shapes = child.getAddedShapes();
|
|
89
|
+
const removedShapes = child.getRemovedShapes();
|
|
90
|
+
for (const shape of shapes) {
|
|
91
|
+
if (shape.isMetaShape() || shape.isGuideShape()) {
|
|
92
|
+
continue;
|
|
93
|
+
}
|
|
94
|
+
const isRemovedBySibling = removedShapes.some(s => s.shape === shape && s.removedBy?.parentId === this.id);
|
|
95
|
+
if (isRemovedBySibling) {
|
|
96
|
+
continue;
|
|
97
|
+
}
|
|
98
|
+
if (shape instanceof Edge) {
|
|
99
|
+
result.set(shape, child);
|
|
100
|
+
}
|
|
101
|
+
else if (shape instanceof Wire) {
|
|
102
|
+
for (const edge of shape.getEdges()) {
|
|
103
|
+
result.set(edge, child);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
return result;
|
|
109
|
+
}
|
|
110
|
+
getGeometriesWithOwner() {
|
|
111
|
+
return this.getEdgesWithOwner();
|
|
112
|
+
}
|
|
113
|
+
getGeometries() {
|
|
114
|
+
return this.getEdges();
|
|
115
|
+
}
|
|
116
|
+
getDependencies() {
|
|
117
|
+
return [this.planeObj];
|
|
118
|
+
}
|
|
119
|
+
createCopy(remap) {
|
|
120
|
+
const planeObj = remap.get(this.planeObj) || this.planeObj;
|
|
121
|
+
return new Sketch(planeObj);
|
|
122
|
+
}
|
|
123
|
+
compareTo(other) {
|
|
124
|
+
if (!(other instanceof Sketch)) {
|
|
125
|
+
return false;
|
|
126
|
+
}
|
|
127
|
+
if (!super.compareTo(other)) {
|
|
128
|
+
return false;
|
|
129
|
+
}
|
|
130
|
+
if (this.getOrder() !== other.getOrder()) {
|
|
131
|
+
return false;
|
|
132
|
+
}
|
|
133
|
+
return true;
|
|
134
|
+
}
|
|
135
|
+
getTangent() {
|
|
136
|
+
let children = this.getChildren()?.slice();
|
|
137
|
+
if (children.length === 0) {
|
|
138
|
+
return null;
|
|
139
|
+
}
|
|
140
|
+
let last = children[children.length - 1];
|
|
141
|
+
while (last) {
|
|
142
|
+
if (!(last instanceof GeometrySceneObject)) {
|
|
143
|
+
children.pop();
|
|
144
|
+
last = children[children.length - 1];
|
|
145
|
+
continue;
|
|
146
|
+
}
|
|
147
|
+
const tangent = last.getTangent();
|
|
148
|
+
if (tangent) {
|
|
149
|
+
return tangent;
|
|
150
|
+
}
|
|
151
|
+
children.pop();
|
|
152
|
+
last = children[children.length - 1];
|
|
153
|
+
}
|
|
154
|
+
return null;
|
|
155
|
+
}
|
|
156
|
+
getType() {
|
|
157
|
+
return "sketch";
|
|
158
|
+
}
|
|
159
|
+
serialize() {
|
|
160
|
+
const plane = this.getPlane();
|
|
161
|
+
const tangent = this.getTangent();
|
|
162
|
+
return {
|
|
163
|
+
currentPosition: plane.localToWorld(this.getLastPosition()),
|
|
164
|
+
currentTangent: tangent ? plane.localToWorld(tangent) : null,
|
|
165
|
+
plane: this.planeObj.serialize(),
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
toString() {
|
|
169
|
+
return `Sketch`;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { GeometrySceneObject } from "./geometry.js";
|
|
2
|
+
import { SceneObject } from "../../common/scene-object.js";
|
|
3
|
+
import { PlaneObjectBase } from "../plane-renderable-base.js";
|
|
4
|
+
import { ExtrudableGeometryBase } from "./extrudable-base.js";
|
|
5
|
+
export declare class SlotFromEdge extends ExtrudableGeometryBase {
|
|
6
|
+
sourceGeometry: GeometrySceneObject;
|
|
7
|
+
radius: number;
|
|
8
|
+
deleteSource: boolean;
|
|
9
|
+
constructor(sourceGeometry: GeometrySceneObject, radius: number, deleteSource?: boolean, targetPlane?: PlaneObjectBase);
|
|
10
|
+
build(): void;
|
|
11
|
+
getType(): string;
|
|
12
|
+
getUniqueType(): string;
|
|
13
|
+
getDependencies(): SceneObject[];
|
|
14
|
+
createCopy(remap: Map<SceneObject, SceneObject>): SceneObject;
|
|
15
|
+
compareTo(other: SlotFromEdge): boolean;
|
|
16
|
+
serialize(): {
|
|
17
|
+
radius: number;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { WireOps } from "../../oc/wire-ops.js";
|
|
2
|
+
import { ExtrudableGeometryBase } from "./extrudable-base.js";
|
|
3
|
+
export class SlotFromEdge extends ExtrudableGeometryBase {
|
|
4
|
+
sourceGeometry;
|
|
5
|
+
radius;
|
|
6
|
+
deleteSource;
|
|
7
|
+
constructor(sourceGeometry, radius, deleteSource = true, targetPlane = null) {
|
|
8
|
+
super(targetPlane);
|
|
9
|
+
this.sourceGeometry = sourceGeometry;
|
|
10
|
+
this.radius = radius;
|
|
11
|
+
this.deleteSource = deleteSource;
|
|
12
|
+
}
|
|
13
|
+
build() {
|
|
14
|
+
const shapes = this.sourceGeometry.getShapes({ excludeGuide: false });
|
|
15
|
+
if (shapes.length === 0) {
|
|
16
|
+
throw new Error("SlotFromEdge: source geometry has no edges or wires");
|
|
17
|
+
}
|
|
18
|
+
for (const shape of shapes) {
|
|
19
|
+
if (shape.isEdge() || shape.isWire()) {
|
|
20
|
+
const wire = WireOps.offsetWire(shape, this.radius, false);
|
|
21
|
+
this.addShapes(wire.getEdges());
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
if (this.deleteSource) {
|
|
25
|
+
this.sourceGeometry.removeShapes(this);
|
|
26
|
+
}
|
|
27
|
+
if (this.targetPlane) {
|
|
28
|
+
this.targetPlane.removeShapes(this);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
getType() {
|
|
32
|
+
return 'slot';
|
|
33
|
+
}
|
|
34
|
+
getUniqueType() {
|
|
35
|
+
return 'slot-from-edge';
|
|
36
|
+
}
|
|
37
|
+
getDependencies() {
|
|
38
|
+
return this.targetPlane ? [this.targetPlane] : [];
|
|
39
|
+
}
|
|
40
|
+
createCopy(remap) {
|
|
41
|
+
const targetPlane = this.targetPlane ? (remap.get(this.targetPlane) || this.targetPlane) : null;
|
|
42
|
+
return new SlotFromEdge(this.sourceGeometry, this.radius, this.deleteSource, targetPlane);
|
|
43
|
+
}
|
|
44
|
+
compareTo(other) {
|
|
45
|
+
if (!(other instanceof SlotFromEdge)) {
|
|
46
|
+
return false;
|
|
47
|
+
}
|
|
48
|
+
if (!super.compareTo(other)) {
|
|
49
|
+
return false;
|
|
50
|
+
}
|
|
51
|
+
if (this.targetPlane?.constructor !== other.targetPlane?.constructor) {
|
|
52
|
+
return false;
|
|
53
|
+
}
|
|
54
|
+
if (this.targetPlane && other.targetPlane && !this.targetPlane.compareTo(other.targetPlane)) {
|
|
55
|
+
return false;
|
|
56
|
+
}
|
|
57
|
+
return this.sourceGeometry.compareTo(other.sourceGeometry) &&
|
|
58
|
+
this.radius === other.radius &&
|
|
59
|
+
this.deleteSource === other.deleteSource;
|
|
60
|
+
}
|
|
61
|
+
serialize() {
|
|
62
|
+
return {
|
|
63
|
+
radius: this.radius,
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { SceneObject } from "../../common/scene-object.js";
|
|
2
|
+
import { PlaneObjectBase } from "../plane-renderable-base.js";
|
|
3
|
+
import { ExtrudableGeometryBase } from "./extrudable-base.js";
|
|
4
|
+
import { ISlot } from "../../core/interfaces.js";
|
|
5
|
+
export declare class Slot extends ExtrudableGeometryBase implements ISlot {
|
|
6
|
+
distance: number;
|
|
7
|
+
radius: number;
|
|
8
|
+
private _center;
|
|
9
|
+
private _angle;
|
|
10
|
+
constructor(distance: number, radius: number, targetPlane?: PlaneObjectBase);
|
|
11
|
+
center(value?: boolean): this;
|
|
12
|
+
rotate(angle: number): this;
|
|
13
|
+
build(): void;
|
|
14
|
+
getType(): string;
|
|
15
|
+
getDependencies(): SceneObject[];
|
|
16
|
+
createCopy(remap: Map<SceneObject, SceneObject>): SceneObject;
|
|
17
|
+
compareTo(other: Slot): boolean;
|
|
18
|
+
serialize(): {
|
|
19
|
+
distance: number;
|
|
20
|
+
radius: number;
|
|
21
|
+
center: boolean;
|
|
22
|
+
angle: number;
|
|
23
|
+
};
|
|
24
|
+
}
|