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,38 @@
|
|
|
1
|
+
import { Point2DLike } from "../../math/point.js";
|
|
2
|
+
import { PolygonMode } from "../../features/2d/polygon.js";
|
|
3
|
+
import { PlaneLike } from "../../math/plane.js";
|
|
4
|
+
import { IPolygon, ISceneObject } from "../interfaces.js";
|
|
5
|
+
interface PolygonFunction {
|
|
6
|
+
/**
|
|
7
|
+
* Draws a regular polygon with the given number of sides and diameter.
|
|
8
|
+
* @param numberOfSides - The number of sides
|
|
9
|
+
* @param diameter - The circumscribed or inscribed diameter
|
|
10
|
+
* @param mode - `'inscribed'` or `'circumscribed'` (defaults to `'inscribed'`)
|
|
11
|
+
*/
|
|
12
|
+
(numberOfSides: number, diameter: number, mode?: PolygonMode): IPolygon;
|
|
13
|
+
/**
|
|
14
|
+
* Draws a regular polygon at a given center point.
|
|
15
|
+
* @param center - The center point
|
|
16
|
+
* @param numberOfSides - The number of sides
|
|
17
|
+
* @param diameter - The circumscribed or inscribed diameter
|
|
18
|
+
* @param mode - `'inscribed'` or `'circumscribed'` (defaults to `'inscribed'`)
|
|
19
|
+
*/
|
|
20
|
+
(center: Point2DLike, numberOfSides: number, diameter: number, mode?: PolygonMode): IPolygon;
|
|
21
|
+
/**
|
|
22
|
+
* Draws a regular polygon on a specific plane.
|
|
23
|
+
* @param numberOfSides - The number of sides
|
|
24
|
+
* @param diameter - The circumscribed or inscribed diameter
|
|
25
|
+
* @param targetPlane - The plane to draw on
|
|
26
|
+
*/
|
|
27
|
+
(numberOfSides: number, diameter: number, targetPlane: PlaneLike | ISceneObject): IPolygon;
|
|
28
|
+
/**
|
|
29
|
+
* Draws a regular polygon with a given mode on a specific plane.
|
|
30
|
+
* @param numberOfSides - The number of sides
|
|
31
|
+
* @param diameter - The circumscribed or inscribed diameter
|
|
32
|
+
* @param mode - `'inscribed'` or `'circumscribed'`
|
|
33
|
+
* @param targetPlane - The plane to draw on
|
|
34
|
+
*/
|
|
35
|
+
(numberOfSides: number, diameter: number, mode: PolygonMode, targetPlane: PlaneLike | ISceneObject): IPolygon;
|
|
36
|
+
}
|
|
37
|
+
declare const _default: PolygonFunction;
|
|
38
|
+
export default _default;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { isPoint2DLike } from "../../math/point.js";
|
|
2
|
+
import { Polygon } from "../../features/2d/polygon.js";
|
|
3
|
+
import { Move } from "../../features/2d/move.js";
|
|
4
|
+
import { normalizePoint2D } from "../../helpers/normalize.js";
|
|
5
|
+
import { registerBuilder } from "../../index.js";
|
|
6
|
+
import { isPlaneLike } from "../../math/plane.js";
|
|
7
|
+
import { SceneObject } from "../../common/scene-object.js";
|
|
8
|
+
import { resolvePlane } from "../../helpers/resolve.js";
|
|
9
|
+
function build(context) {
|
|
10
|
+
return function polygon() {
|
|
11
|
+
let numberOfSides;
|
|
12
|
+
let diameter;
|
|
13
|
+
let mode;
|
|
14
|
+
let center;
|
|
15
|
+
let poly;
|
|
16
|
+
let planeObj = null;
|
|
17
|
+
let argCount = arguments.length;
|
|
18
|
+
// Detect plane as last argument
|
|
19
|
+
// PolygonMode strings ('inscribed'/'circumscribed') don't overlap with StandardPlane strings
|
|
20
|
+
if (argCount > 0) {
|
|
21
|
+
const lastArg = arguments[argCount - 1];
|
|
22
|
+
if (isPlaneLike(lastArg) || (lastArg instanceof SceneObject && !isPoint2DLike(lastArg))) {
|
|
23
|
+
planeObj = resolvePlane(lastArg, context);
|
|
24
|
+
context.addSceneObject(planeObj);
|
|
25
|
+
argCount--;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
if (argCount === 2) {
|
|
29
|
+
numberOfSides = arguments[0];
|
|
30
|
+
diameter = arguments[1];
|
|
31
|
+
mode = 'inscribed';
|
|
32
|
+
poly = new Polygon(numberOfSides, diameter, mode, planeObj);
|
|
33
|
+
context.addSceneObject(poly);
|
|
34
|
+
}
|
|
35
|
+
else if (argCount === 3) {
|
|
36
|
+
if (typeof arguments[0] === 'number') {
|
|
37
|
+
numberOfSides = arguments[0];
|
|
38
|
+
diameter = arguments[1];
|
|
39
|
+
mode = arguments[2];
|
|
40
|
+
poly = new Polygon(numberOfSides, diameter, mode, planeObj);
|
|
41
|
+
context.addSceneObject(poly);
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
center = normalizePoint2D(arguments[0]);
|
|
45
|
+
numberOfSides = arguments[1];
|
|
46
|
+
diameter = arguments[2];
|
|
47
|
+
mode = 'inscribed';
|
|
48
|
+
poly = new Polygon(numberOfSides, diameter, mode, planeObj);
|
|
49
|
+
context.addSceneObjects([new Move(center), poly]);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
else if (argCount === 4) {
|
|
53
|
+
center = normalizePoint2D(arguments[0]);
|
|
54
|
+
numberOfSides = arguments[1];
|
|
55
|
+
diameter = arguments[2];
|
|
56
|
+
mode = arguments[3];
|
|
57
|
+
poly = new Polygon(numberOfSides, diameter, mode, planeObj);
|
|
58
|
+
context.addSceneObjects([new Move(center), poly]);
|
|
59
|
+
}
|
|
60
|
+
return poly;
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
export default registerBuilder(build);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { PlaneLike } from "../../math/plane.js";
|
|
2
|
+
import { IExtrudableGeometry, ISceneObject } from "../interfaces.js";
|
|
3
|
+
interface ProjectFunction {
|
|
4
|
+
/**
|
|
5
|
+
* Projects 3D objects onto the current sketch plane.
|
|
6
|
+
* @param sourceObjects - The 3D objects to project
|
|
7
|
+
*/
|
|
8
|
+
(...sourceObjects: ISceneObject[]): IExtrudableGeometry;
|
|
9
|
+
/**
|
|
10
|
+
* Projects 3D objects onto a target plane.
|
|
11
|
+
* @param sourceObjects - The 3D objects to project
|
|
12
|
+
* @param targetPlane - The plane to project onto
|
|
13
|
+
*/
|
|
14
|
+
(sourceObjects: ISceneObject[], targetPlane: PlaneLike | ISceneObject): IExtrudableGeometry;
|
|
15
|
+
}
|
|
16
|
+
declare const _default: ProjectFunction;
|
|
17
|
+
export default _default;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Projection } from "../../features/2d/projection.js";
|
|
2
|
+
import { resolvePlane } from "../../helpers/resolve.js";
|
|
3
|
+
import { registerBuilder } from "../../index.js";
|
|
4
|
+
function build(context) {
|
|
5
|
+
return function project(...args) {
|
|
6
|
+
if (Array.isArray(args[0])) {
|
|
7
|
+
const sourceObjects = args[0];
|
|
8
|
+
context.addSceneObjects(sourceObjects);
|
|
9
|
+
const planeObj = resolvePlane(args[1], context);
|
|
10
|
+
const projection = new Projection(sourceObjects, planeObj);
|
|
11
|
+
context.addSceneObject(projection);
|
|
12
|
+
return projection;
|
|
13
|
+
}
|
|
14
|
+
const projection = new Projection(args);
|
|
15
|
+
context.addSceneObjects(args);
|
|
16
|
+
context.addSceneObject(projection);
|
|
17
|
+
return projection;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
export default registerBuilder(build);
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Point2DLike } from "../../math/point.js";
|
|
2
|
+
import { PlaneLike } from "../../math/plane.js";
|
|
3
|
+
import { IRect, ISceneObject } from "../interfaces.js";
|
|
4
|
+
interface RectFunction {
|
|
5
|
+
/**
|
|
6
|
+
* Draws a rectangle with the given width and optional height.
|
|
7
|
+
* @param width - The rectangle width
|
|
8
|
+
* @param height - The rectangle height (defaults to width)
|
|
9
|
+
*/
|
|
10
|
+
(width: number, height?: number): IRect;
|
|
11
|
+
/**
|
|
12
|
+
* Draws a rectangle at a given start point.
|
|
13
|
+
* @param start - The start point (bottom-left corner)
|
|
14
|
+
* @param width - The rectangle width
|
|
15
|
+
* @param height - The rectangle height (defaults to width)
|
|
16
|
+
*/
|
|
17
|
+
(start: Point2DLike, width: number, height?: number): IRect;
|
|
18
|
+
/**
|
|
19
|
+
* Draws a rectangle with given dimensions on a specific plane.
|
|
20
|
+
* @param width - The rectangle width
|
|
21
|
+
* @param height - The rectangle height
|
|
22
|
+
* @param targetPlane - The plane to draw on
|
|
23
|
+
*/
|
|
24
|
+
(width: number, height: number, targetPlane: PlaneLike | ISceneObject): IRect;
|
|
25
|
+
}
|
|
26
|
+
declare const _default: RectFunction;
|
|
27
|
+
export default _default;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { isPoint2DLike } from "../../math/point.js";
|
|
2
|
+
import { Move } from "../../features/2d/move.js";
|
|
3
|
+
import { Rect } from "../../features/2d/rect.js";
|
|
4
|
+
import { normalizePoint2D } from "../../helpers/normalize.js";
|
|
5
|
+
import { registerBuilder } from "../../index.js";
|
|
6
|
+
import { isPlaneLike } from "../../math/plane.js";
|
|
7
|
+
import { SceneObject } from "../../common/scene-object.js";
|
|
8
|
+
import { resolvePlane } from "../../helpers/resolve.js";
|
|
9
|
+
function build(context) {
|
|
10
|
+
return function cRect() {
|
|
11
|
+
let argCount = arguments.length;
|
|
12
|
+
if (argCount === 1) {
|
|
13
|
+
const width = arguments[0];
|
|
14
|
+
const rect = new Rect(width, width);
|
|
15
|
+
context.addSceneObject(rect);
|
|
16
|
+
return rect;
|
|
17
|
+
}
|
|
18
|
+
else if (argCount === 2) {
|
|
19
|
+
if (typeof arguments[0] === 'number') {
|
|
20
|
+
const width = arguments[0];
|
|
21
|
+
const height = arguments[1];
|
|
22
|
+
const rect = new Rect(width, height);
|
|
23
|
+
context.addSceneObject(rect);
|
|
24
|
+
return rect;
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
const start = normalizePoint2D(arguments[0]);
|
|
28
|
+
const width = arguments[1];
|
|
29
|
+
const rect = new Rect(width, width);
|
|
30
|
+
context.addSceneObjects([new Move(start), rect]);
|
|
31
|
+
return rect;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
else if (argCount === 3) {
|
|
35
|
+
if (typeof arguments[0] === 'number') {
|
|
36
|
+
const width = arguments[0];
|
|
37
|
+
const height = arguments[1];
|
|
38
|
+
const lastArg = arguments[argCount - 1];
|
|
39
|
+
let planeObj;
|
|
40
|
+
if (isPlaneLike(lastArg) || (lastArg instanceof SceneObject && !isPoint2DLike(lastArg))) {
|
|
41
|
+
planeObj = resolvePlane(lastArg, context);
|
|
42
|
+
}
|
|
43
|
+
const rect = new Rect(width, height, planeObj);
|
|
44
|
+
context.addSceneObject(rect);
|
|
45
|
+
return rect;
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
const start = normalizePoint2D(arguments[0]);
|
|
49
|
+
const width = arguments[1];
|
|
50
|
+
const height = arguments[2];
|
|
51
|
+
const rect = new Rect(width, height);
|
|
52
|
+
context.addSceneObjects([new Move(start), rect]);
|
|
53
|
+
return rect;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
export default registerBuilder(build);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Point2DLike } from "../../math/point.js";
|
|
2
|
+
import { IGeometry } from "../interfaces.js";
|
|
3
|
+
interface RMoveFunction {
|
|
4
|
+
/**
|
|
5
|
+
* Rotates the cursor direction by the given angle in degrees.
|
|
6
|
+
* @param angle - The rotation angle in degrees
|
|
7
|
+
*/
|
|
8
|
+
(angle: number): IGeometry;
|
|
9
|
+
/**
|
|
10
|
+
* Rotates the cursor direction by the given angle around a pivot point.
|
|
11
|
+
* @param angle - The rotation angle in degrees
|
|
12
|
+
* @param pivot - The pivot point to rotate around
|
|
13
|
+
*/
|
|
14
|
+
(angle: number, pivot: Point2DLike): IGeometry;
|
|
15
|
+
}
|
|
16
|
+
declare const _default: RMoveFunction;
|
|
17
|
+
export default _default;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Point2D } from "../../math/point.js";
|
|
2
|
+
import { RMove } from "../../features/2d/rmove.js";
|
|
3
|
+
import { normalizePoint2D } from "../../helpers/normalize.js";
|
|
4
|
+
import { registerBuilder } from "../../index.js";
|
|
5
|
+
function build(context) {
|
|
6
|
+
return function rmove() {
|
|
7
|
+
const angle = arguments[0] * Math.PI / 180;
|
|
8
|
+
const pivot = normalizePoint2D(arguments[1] || new Point2D(0, 0));
|
|
9
|
+
const rmove = new RMove(pivot, angle);
|
|
10
|
+
context.addSceneObject(rmove);
|
|
11
|
+
return rmove;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
export default registerBuilder(build);
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { Point2DLike } from "../../math/point.js";
|
|
2
|
+
import { PlaneLike } from "../../math/plane.js";
|
|
3
|
+
import { ISlot, ISceneObject } from "../interfaces.js";
|
|
4
|
+
interface SlotFunction {
|
|
5
|
+
/**
|
|
6
|
+
* Draws a slot with the given length and end radius.
|
|
7
|
+
* @param distance - The slot length
|
|
8
|
+
* @param radius - The end cap radius
|
|
9
|
+
*/
|
|
10
|
+
(distance: number, radius: number): ISlot;
|
|
11
|
+
/**
|
|
12
|
+
* Draws a slot on a specific plane.
|
|
13
|
+
* @param distance - The slot length
|
|
14
|
+
* @param radius - The end cap radius
|
|
15
|
+
* @param targetPlane - The plane to draw on
|
|
16
|
+
*/
|
|
17
|
+
(distance: number, radius: number, targetPlane: PlaneLike | ISceneObject): ISlot;
|
|
18
|
+
/**
|
|
19
|
+
* Draws a slot from a start point with the given length and end radius.
|
|
20
|
+
* @param start - The start point
|
|
21
|
+
* @param distance - The slot length
|
|
22
|
+
* @param radius - The end cap radius
|
|
23
|
+
*/
|
|
24
|
+
(start: Point2DLike, distance: number, radius: number): ISlot;
|
|
25
|
+
/**
|
|
26
|
+
* Creates a slot from a geometry edge with the given radius.
|
|
27
|
+
* @param geometry - The source geometry edge
|
|
28
|
+
* @param radius - The end cap radius
|
|
29
|
+
* @param deleteSource - Whether to delete the source geometry (defaults to true)
|
|
30
|
+
*/
|
|
31
|
+
(geometry: ISceneObject, radius: number, deleteSource?: boolean): ISlot;
|
|
32
|
+
/**
|
|
33
|
+
* Creates a slot from a geometry edge on a specific plane.
|
|
34
|
+
* @param geometry - The source geometry edge
|
|
35
|
+
* @param radius - The end cap radius
|
|
36
|
+
* @param targetPlane - The plane to draw on
|
|
37
|
+
*/
|
|
38
|
+
(geometry: ISceneObject, radius: number, targetPlane: PlaneLike | ISceneObject): ISlot;
|
|
39
|
+
/**
|
|
40
|
+
* Creates a slot from a geometry edge, optionally keeping the source, on a specific plane.
|
|
41
|
+
* @param geometry - The source geometry edge
|
|
42
|
+
* @param radius - The end cap radius
|
|
43
|
+
* @param deleteSource - Whether to delete the source geometry
|
|
44
|
+
* @param targetPlane - The plane to draw on
|
|
45
|
+
*/
|
|
46
|
+
(geometry: ISceneObject, radius: number, deleteSource: boolean, targetPlane: PlaneLike | ISceneObject): ISlot;
|
|
47
|
+
}
|
|
48
|
+
declare const _default: SlotFunction;
|
|
49
|
+
export default _default;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { isPoint2DLike } from "../../math/point.js";
|
|
2
|
+
import { Move } from "../../features/2d/move.js";
|
|
3
|
+
import { Slot } from "../../features/2d/slot.js";
|
|
4
|
+
import { SlotFromEdge } from "../../features/2d/slot-from-edge.js";
|
|
5
|
+
import { normalizePoint2D } from "../../helpers/normalize.js";
|
|
6
|
+
import { registerBuilder } from "../../index.js";
|
|
7
|
+
import { SceneObject } from "../../common/scene-object.js";
|
|
8
|
+
import { isPlaneLike } from "../../math/plane.js";
|
|
9
|
+
import { resolvePlane } from "../../helpers/resolve.js";
|
|
10
|
+
function build(context) {
|
|
11
|
+
return function slot() {
|
|
12
|
+
// SlotFromEdge path: first arg is a SceneObject (geometry)
|
|
13
|
+
if (arguments[0] instanceof SceneObject) {
|
|
14
|
+
const geometry = arguments[0];
|
|
15
|
+
const radius = arguments[1];
|
|
16
|
+
let deleteSource = true;
|
|
17
|
+
let planeObj = null;
|
|
18
|
+
let argIdx = 2;
|
|
19
|
+
// Check if there's a deleteSource boolean before a potential plane
|
|
20
|
+
if (argIdx < arguments.length && typeof arguments[argIdx] === 'boolean') {
|
|
21
|
+
deleteSource = arguments[argIdx];
|
|
22
|
+
argIdx++;
|
|
23
|
+
}
|
|
24
|
+
// Check if there's a plane arg remaining
|
|
25
|
+
if (argIdx < arguments.length) {
|
|
26
|
+
const planeArg = arguments[argIdx];
|
|
27
|
+
if (isPlaneLike(planeArg) || planeArg instanceof SceneObject) {
|
|
28
|
+
planeObj = resolvePlane(planeArg, context);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
const slotFromEdge = new SlotFromEdge(geometry, radius, deleteSource, planeObj);
|
|
32
|
+
context.addSceneObject(slotFromEdge);
|
|
33
|
+
return slotFromEdge;
|
|
34
|
+
}
|
|
35
|
+
let planeObj = null;
|
|
36
|
+
let argCount = arguments.length;
|
|
37
|
+
// Detect plane as last argument
|
|
38
|
+
if (argCount > 0) {
|
|
39
|
+
const lastArg = arguments[argCount - 1];
|
|
40
|
+
if (isPlaneLike(lastArg) || (lastArg instanceof SceneObject && !isPoint2DLike(lastArg))) {
|
|
41
|
+
planeObj = resolvePlane(lastArg, context);
|
|
42
|
+
argCount--;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
// slot(distance, radius)
|
|
46
|
+
if (argCount === 2 && typeof arguments[0] === 'number') {
|
|
47
|
+
const distance = arguments[0];
|
|
48
|
+
const radius = arguments[1];
|
|
49
|
+
const s = new Slot(distance, radius, planeObj);
|
|
50
|
+
context.addSceneObject(s);
|
|
51
|
+
return s;
|
|
52
|
+
}
|
|
53
|
+
// slot(start, distance, radius)
|
|
54
|
+
if (argCount === 3) {
|
|
55
|
+
const start = normalizePoint2D(arguments[0]);
|
|
56
|
+
const distance = arguments[1];
|
|
57
|
+
const radius = arguments[2];
|
|
58
|
+
const s = new Slot(distance, radius, planeObj);
|
|
59
|
+
context.addSceneObjects([new Move(start), s]);
|
|
60
|
+
return s;
|
|
61
|
+
}
|
|
62
|
+
throw new Error("Invalid arguments for slot()");
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
export default registerBuilder(build);
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Point2DLike } from "../../math/point.js";
|
|
2
|
+
import { QualifiedSceneObject } from "../../features/2d/constraints/qualified-geometry.js";
|
|
3
|
+
import { IGeometry, ISceneObject, ITangentArcTwoObjects } from "../interfaces.js";
|
|
4
|
+
interface TArcFunction {
|
|
5
|
+
/**
|
|
6
|
+
* Draws a tangent arc with a given radius and end angle.
|
|
7
|
+
* @param radius - The arc radius (defaults to 100)
|
|
8
|
+
* @param endAngle - The sweep angle in degrees (defaults to 90)
|
|
9
|
+
*/
|
|
10
|
+
(radius?: number, endAngle?: number): IGeometry;
|
|
11
|
+
/**
|
|
12
|
+
* Draws a tangent arc with a given radius, angle, and start tangent direction.
|
|
13
|
+
* @param radius - The arc radius
|
|
14
|
+
* @param angle - The sweep angle in degrees
|
|
15
|
+
* @param tangent - The start tangent direction
|
|
16
|
+
*/
|
|
17
|
+
(radius: number, angle: number, tangent: Point2DLike): IGeometry;
|
|
18
|
+
/**
|
|
19
|
+
* Draws a tangent arc to a given end point.
|
|
20
|
+
* @param endPoint - The end point of the arc
|
|
21
|
+
*/
|
|
22
|
+
(endPoint: Point2DLike): IGeometry;
|
|
23
|
+
/**
|
|
24
|
+
* Draws a tangent arc to a given end point with an explicit end tangent.
|
|
25
|
+
* @param endPoint - The end point of the arc
|
|
26
|
+
* @param tangent - The end tangent direction
|
|
27
|
+
*/
|
|
28
|
+
(endPoint: Point2DLike, tangent: Point2DLike): IGeometry;
|
|
29
|
+
/**
|
|
30
|
+
* Draws a tangent arc from a start point to an end point with a tangent.
|
|
31
|
+
* @param startPoint - The start point of the arc
|
|
32
|
+
* @param endPoint - The end point of the arc
|
|
33
|
+
* @param tangent - The end tangent direction
|
|
34
|
+
*/
|
|
35
|
+
(startPoint: Point2DLike, endPoint: Point2DLike, tangent: Point2DLike): IGeometry;
|
|
36
|
+
/**
|
|
37
|
+
* Draws a tangent arc between two objects with a given radius.
|
|
38
|
+
* @param c1 - The first constraint object or point
|
|
39
|
+
* @param c2 - The second constraint object or point
|
|
40
|
+
* @param radius - The arc radius
|
|
41
|
+
* @param mustTouch - Whether the arc must touch both objects
|
|
42
|
+
*/
|
|
43
|
+
(c1: ISceneObject | QualifiedSceneObject | Point2DLike, c2: ISceneObject | QualifiedSceneObject | Point2DLike, radius: number, mustTouch?: boolean): ITangentArcTwoObjects;
|
|
44
|
+
}
|
|
45
|
+
declare const _default: TArcFunction;
|
|
46
|
+
export default _default;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { isPoint2DLike } from "../../math/point.js";
|
|
2
|
+
import { TangentArc } from "../../features/2d/tarc.js";
|
|
3
|
+
import { TangentArcToPoint } from "../../features/2d/tarc-to-point.js";
|
|
4
|
+
import { TangentArcToPointTangent } from "../../features/2d/tarc-to-point-tangent.js";
|
|
5
|
+
import { TangentArcWithTangent } from "../../features/2d/tarc-with-tangent.js";
|
|
6
|
+
import { Move } from "../../features/2d/move.js";
|
|
7
|
+
import { normalizePoint2D } from "../../helpers/normalize.js";
|
|
8
|
+
import { registerBuilder } from "../../index.js";
|
|
9
|
+
import { QualifiedSceneObject } from "../../features/2d/constraints/qualified-geometry.js";
|
|
10
|
+
import { TangentArcTwoObjects } from "../../features/2d/tarc-constrained.js";
|
|
11
|
+
function build(context) {
|
|
12
|
+
return function tarc() {
|
|
13
|
+
// tarc(c1, c2, radius): fillet arc tangent to two circles/points
|
|
14
|
+
if ((arguments.length === 3 || arguments.length === 4) && typeof arguments[2] === 'number') {
|
|
15
|
+
const o1 = isPoint2DLike(arguments[0]) ? normalizePoint2D(arguments[0]) : arguments[0];
|
|
16
|
+
const o2 = isPoint2DLike(arguments[1]) ? normalizePoint2D(arguments[1]) : arguments[1];
|
|
17
|
+
const c1 = QualifiedSceneObject.from(o1);
|
|
18
|
+
const c2 = QualifiedSceneObject.from(o2);
|
|
19
|
+
const radius = arguments[2];
|
|
20
|
+
const mustTouch = typeof arguments[3] === 'boolean' ? arguments[3] : false;
|
|
21
|
+
const arc = new TangentArcTwoObjects(c1, c2, radius, mustTouch);
|
|
22
|
+
context.addSceneObject(arc);
|
|
23
|
+
return arc;
|
|
24
|
+
}
|
|
25
|
+
if (arguments.length > 0 && isPoint2DLike(arguments[0])) {
|
|
26
|
+
// 3 Point2DLike args: tArc(startPoint, endPoint, tangent)
|
|
27
|
+
if (arguments.length > 2 && isPoint2DLike(arguments[1]) && isPoint2DLike(arguments[2])) {
|
|
28
|
+
const startPoint = normalizePoint2D(arguments[0]);
|
|
29
|
+
const endPoint = normalizePoint2D(arguments[1]);
|
|
30
|
+
const tangent = normalizePoint2D(arguments[2]);
|
|
31
|
+
const arc = new TangentArcToPointTangent(endPoint, tangent);
|
|
32
|
+
context.addSceneObjects([new Move(startPoint), arc]);
|
|
33
|
+
return arc;
|
|
34
|
+
}
|
|
35
|
+
const endPoint = normalizePoint2D(arguments[0]);
|
|
36
|
+
// 2 Point2DLike args: tArc(endPoint, tangent)
|
|
37
|
+
if (arguments.length > 1 && isPoint2DLike(arguments[1])) {
|
|
38
|
+
const tangent = normalizePoint2D(arguments[1]);
|
|
39
|
+
const arc = new TangentArcToPointTangent(endPoint, tangent);
|
|
40
|
+
context.addSceneObject(arc);
|
|
41
|
+
return arc;
|
|
42
|
+
}
|
|
43
|
+
const arc = new TangentArcToPoint(endPoint);
|
|
44
|
+
context.addSceneObject(arc);
|
|
45
|
+
return arc;
|
|
46
|
+
}
|
|
47
|
+
const radius = arguments[0] || 100;
|
|
48
|
+
const endAngle = arguments[1] || 90;
|
|
49
|
+
// tArc(radius, angle, tangent): explicit start tangent instead of reading from previous sibling
|
|
50
|
+
if (arguments.length === 3 && isPoint2DLike(arguments[2])) {
|
|
51
|
+
const tangent = normalizePoint2D(arguments[2]);
|
|
52
|
+
const arc = new TangentArcWithTangent(radius, endAngle, tangent);
|
|
53
|
+
context.addSceneObject(arc);
|
|
54
|
+
return arc;
|
|
55
|
+
}
|
|
56
|
+
const arc = new TangentArc(radius, endAngle);
|
|
57
|
+
context.addSceneObject(arc);
|
|
58
|
+
return arc;
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
export default registerBuilder(build);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { QualifiedSceneObject } from "../../features/2d/constraints/qualified-geometry.js";
|
|
2
|
+
import { Point2DLike } from "../../math/point.js";
|
|
3
|
+
import { IGeometry, ISceneObject } from "../interfaces.js";
|
|
4
|
+
interface TCircleFunction {
|
|
5
|
+
/**
|
|
6
|
+
* Draws a circle tangent to two objects with the given diameter.
|
|
7
|
+
* @param c1 - The first constraint object or point
|
|
8
|
+
* @param c2 - The second constraint object or point
|
|
9
|
+
* @param diameter - The circle diameter
|
|
10
|
+
* @param mustTouch - Whether the circle must touch both objects
|
|
11
|
+
*/
|
|
12
|
+
(c1: ISceneObject | QualifiedSceneObject | Point2DLike, c2: ISceneObject | QualifiedSceneObject | Point2DLike, diameter: number, mustTouch?: boolean): IGeometry;
|
|
13
|
+
}
|
|
14
|
+
declare const _default: TCircleFunction;
|
|
15
|
+
export default _default;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { QualifiedSceneObject } from "../../features/2d/constraints/qualified-geometry.js";
|
|
2
|
+
import { TwoObjectsTangentCircle } from "../../features/2d/tcircle-constrained.js";
|
|
3
|
+
import { normalizePoint2D } from "../../helpers/normalize.js";
|
|
4
|
+
import { registerBuilder } from "../../index.js";
|
|
5
|
+
import { isPoint2DLike } from "../../math/point.js";
|
|
6
|
+
function build(context) {
|
|
7
|
+
return function tCircle() {
|
|
8
|
+
if ((arguments.length === 3 || arguments.length === 4) && typeof arguments[2] === 'number') {
|
|
9
|
+
const o1 = isPoint2DLike(arguments[0]) ? normalizePoint2D(arguments[0]) : arguments[0];
|
|
10
|
+
const o2 = isPoint2DLike(arguments[1]) ? normalizePoint2D(arguments[1]) : arguments[1];
|
|
11
|
+
const c1 = QualifiedSceneObject.from(o1);
|
|
12
|
+
const c2 = QualifiedSceneObject.from(o2);
|
|
13
|
+
const diameter = arguments[2];
|
|
14
|
+
const mustTouch = typeof arguments[3] === 'boolean' ? arguments[3] : false;
|
|
15
|
+
const tangentCircle = new TwoObjectsTangentCircle(c1, c2, diameter, mustTouch);
|
|
16
|
+
context.addSceneObject(tangentCircle);
|
|
17
|
+
return tangentCircle;
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
throw new Error('Invalid arguments for tCircle: expected (c1, c2, diameter) or (c1, c2, c3)');
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
export default registerBuilder(build);
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { QualifiedSceneObject } from "../../features/2d/constraints/qualified-geometry.js";
|
|
2
|
+
import { IGeometry, ISceneObject, ITwoObjectsTangentLine } from "../interfaces.js";
|
|
3
|
+
interface TLineFunction {
|
|
4
|
+
/**
|
|
5
|
+
* Draws a line tangent to the previous geometry with the given distance.
|
|
6
|
+
* @param distance - The tangent line length
|
|
7
|
+
*/
|
|
8
|
+
(distance: number): IGeometry;
|
|
9
|
+
/**
|
|
10
|
+
* Draws a line tangent to two objects.
|
|
11
|
+
* @param c1 - The first constraint object
|
|
12
|
+
* @param c2 - The second constraint object
|
|
13
|
+
* @param mustTouch - Whether the line must touch both objects
|
|
14
|
+
*/
|
|
15
|
+
(c1: ISceneObject | QualifiedSceneObject, c2: ISceneObject | QualifiedSceneObject, mustTouch?: boolean): ITwoObjectsTangentLine;
|
|
16
|
+
/**
|
|
17
|
+
* Draws a line tangent to one object.
|
|
18
|
+
* @param c1 - The constraint object
|
|
19
|
+
* @param mustTouch - Whether the line must touch the object
|
|
20
|
+
*/
|
|
21
|
+
(c1: ISceneObject | QualifiedSceneObject, mustTouch?: boolean): IGeometry;
|
|
22
|
+
}
|
|
23
|
+
declare const _default: TLineFunction;
|
|
24
|
+
export default _default;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { QualifiedSceneObject } from "../../features/2d/constraints/qualified-geometry.js";
|
|
2
|
+
import { OneObjectTangentLine, TwoObjectsTangentLine } from "../../features/2d/tline-constrained.js";
|
|
3
|
+
import { TangentLine } from "../../features/2d/tline.js";
|
|
4
|
+
import { registerBuilder } from "../../index.js";
|
|
5
|
+
function build(context) {
|
|
6
|
+
return function line() {
|
|
7
|
+
if (arguments.length === 1 && typeof arguments[0] === 'number') {
|
|
8
|
+
const distance = arguments[0];
|
|
9
|
+
const hline = new TangentLine(distance);
|
|
10
|
+
context.addSceneObject(hline);
|
|
11
|
+
return hline;
|
|
12
|
+
}
|
|
13
|
+
else if (arguments.length === 1 || (arguments.length === 2 && typeof arguments[1] === 'boolean')) {
|
|
14
|
+
const mustTouch = typeof arguments[1] === 'boolean' ? arguments[1] : false;
|
|
15
|
+
const constrainedLine = new OneObjectTangentLine(QualifiedSceneObject.from(arguments[0]), mustTouch);
|
|
16
|
+
context.addSceneObject(constrainedLine);
|
|
17
|
+
return constrainedLine;
|
|
18
|
+
}
|
|
19
|
+
else if (arguments.length >= 2) {
|
|
20
|
+
const mustTouch = typeof arguments[2] === 'boolean' ? arguments[2] : false;
|
|
21
|
+
const constrainedLine = new TwoObjectsTangentLine(QualifiedSceneObject.from(arguments[0]), QualifiedSceneObject.from(arguments[1]), mustTouch);
|
|
22
|
+
context.addSceneObject(constrainedLine);
|
|
23
|
+
return constrainedLine;
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
throw new Error('Invalid number of arguments for line function');
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
export default registerBuilder(build);
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Point2DLike } from "../../math/point.js";
|
|
2
|
+
import { PlaneLike } from "../../math/plane.js";
|
|
3
|
+
import { IGeometry, ISceneObject } from "../interfaces.js";
|
|
4
|
+
interface VLineFunction {
|
|
5
|
+
/**
|
|
6
|
+
* Draws a vertical line of the given distance.
|
|
7
|
+
* @param distance - The line length
|
|
8
|
+
* @param centered - Whether to center the line on the current position
|
|
9
|
+
*/
|
|
10
|
+
(distance: number, centered?: boolean): IGeometry;
|
|
11
|
+
/**
|
|
12
|
+
* Draws a vertical line from a start point.
|
|
13
|
+
* @param start - The start point
|
|
14
|
+
* @param distance - The line length
|
|
15
|
+
* @param centered - Whether to center the line on the start point
|
|
16
|
+
*/
|
|
17
|
+
(start: Point2DLike, distance: number, centered?: boolean): IGeometry;
|
|
18
|
+
/**
|
|
19
|
+
* Draws a vertical line on a specific plane.
|
|
20
|
+
* @param distance - The line length
|
|
21
|
+
* @param targetPlane - The plane to draw on
|
|
22
|
+
*/
|
|
23
|
+
(distance: number, targetPlane: PlaneLike | ISceneObject): IGeometry;
|
|
24
|
+
/**
|
|
25
|
+
* Draws a vertical line with centering on a specific plane.
|
|
26
|
+
* @param distance - The line length
|
|
27
|
+
* @param centered - Whether to center the line on the current position
|
|
28
|
+
* @param targetPlane - The plane to draw on
|
|
29
|
+
*/
|
|
30
|
+
(distance: number, centered: boolean, targetPlane: PlaneLike | ISceneObject): IGeometry;
|
|
31
|
+
}
|
|
32
|
+
declare const _default: VLineFunction;
|
|
33
|
+
export default _default;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { isPoint2DLike } from "../../math/point.js";
|
|
2
|
+
import { Move } from "../../features/2d/move.js";
|
|
3
|
+
import { VerticalLine } from "../../features/2d/vline.js";
|
|
4
|
+
import { normalizePoint2D } from "../../helpers/normalize.js";
|
|
5
|
+
import { registerBuilder } from "../../index.js";
|
|
6
|
+
import { isPlaneLike } from "../../math/plane.js";
|
|
7
|
+
import { SceneObject } from "../../common/scene-object.js";
|
|
8
|
+
import { resolvePlane } from "../../helpers/resolve.js";
|
|
9
|
+
function build(context) {
|
|
10
|
+
return function line() {
|
|
11
|
+
let planeObj = null;
|
|
12
|
+
let argCount = arguments.length;
|
|
13
|
+
// Detect plane as last argument
|
|
14
|
+
if (argCount > 0) {
|
|
15
|
+
const lastArg = arguments[argCount - 1];
|
|
16
|
+
if (isPlaneLike(lastArg) || (lastArg instanceof SceneObject && !isPoint2DLike(lastArg))) {
|
|
17
|
+
planeObj = resolvePlane(lastArg, context);
|
|
18
|
+
argCount--;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
if (typeof arguments[0] !== 'number') {
|
|
22
|
+
// vline(start, distance) or vline(start, distance, centered)
|
|
23
|
+
const start = normalizePoint2D(arguments[0]);
|
|
24
|
+
const distance = arguments[1];
|
|
25
|
+
const centered = argCount >= 3 ? arguments[2] : false;
|
|
26
|
+
const vline = new VerticalLine(distance, centered, planeObj);
|
|
27
|
+
context.addSceneObjects([new Move(start), vline]);
|
|
28
|
+
return vline;
|
|
29
|
+
}
|
|
30
|
+
const distance = arguments[0];
|
|
31
|
+
const centered = argCount >= 2 ? arguments[1] : false;
|
|
32
|
+
const vline = new VerticalLine(distance, centered, planeObj);
|
|
33
|
+
context.addSceneObject(vline);
|
|
34
|
+
return vline;
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
export default registerBuilder(build);
|