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,33 @@
|
|
|
1
|
+
import type { GccEnt_Position, gp_Circ, gp_Circ2d, gp_Lin, gp_Lin2d, gp_Pln, gp_Pnt, gp_Pnt2d, Handle_Geom_Curve } from "occjs-wrapper";
|
|
2
|
+
import { ConstraintQualifier } from "../../features/2d/constraints/qualified-geometry.js";
|
|
3
|
+
import { Point2D } from "../../math/point.js";
|
|
4
|
+
import { Edge } from "../../common/edge.js";
|
|
5
|
+
import { Shape } from "../../common/shape.js";
|
|
6
|
+
import { Plane } from "../../math/plane.js";
|
|
7
|
+
export declare function get2dGeometry<T extends gp_Circ | gp_Lin | gp_Pnt>(plane: gp_Pln, geometry: T): gp_Lin2d | gp_Circ2d | gp_Pnt2d;
|
|
8
|
+
export declare function get2dCurve(plane: gp_Pln, curve: Handle_Geom_Curve): import("occjs-wrapper").Handle_Geom2d_Curve;
|
|
9
|
+
export declare function getQualifier(qualifier: ConstraintQualifier): GccEnt_Position;
|
|
10
|
+
export declare function getQualifiedCurve(plane: gp_Pln, curve: Handle_Geom_Curve, qualifier: ConstraintQualifier): import("occjs-wrapper").Geom2dGcc_QualifiedCurve;
|
|
11
|
+
export declare function getQualifiedGeometry(plane: gp_Pln, geometry: gp_Circ | gp_Lin, qualifier: ConstraintQualifier): import("occjs-wrapper").GccEnt_QualifiedCirc | import("occjs-wrapper").GccEnt_QualifiedLin;
|
|
12
|
+
export declare function calculateTangent(solutions: {
|
|
13
|
+
center: gp_Pnt2d;
|
|
14
|
+
radius: number;
|
|
15
|
+
tangentPoint1: gp_Pnt2d;
|
|
16
|
+
tangentPoint2: gp_Pnt2d;
|
|
17
|
+
}[]): Point2D | null;
|
|
18
|
+
export declare function toCircleEdges(solutions: {
|
|
19
|
+
center: gp_Pnt2d;
|
|
20
|
+
radius: number;
|
|
21
|
+
tangentPoint1: gp_Pnt2d;
|
|
22
|
+
tangentPoint2: gp_Pnt2d;
|
|
23
|
+
}[], plane: Plane): Edge[];
|
|
24
|
+
export declare function toArcEdges(solutions: {
|
|
25
|
+
center: gp_Pnt2d;
|
|
26
|
+
radius: number;
|
|
27
|
+
tangentPoint1: gp_Pnt2d;
|
|
28
|
+
tangentPoint2: gp_Pnt2d;
|
|
29
|
+
}[], plane: Plane): Edge[];
|
|
30
|
+
export declare function filterSolutionsByFiniteExtent<T extends {
|
|
31
|
+
tangentPoint1: gp_Pnt2d;
|
|
32
|
+
tangentPoint2: gp_Pnt2d;
|
|
33
|
+
}>(solutions: T[], shape1: Shape, shape2: Shape, plane: Plane): T[];
|
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
import { getOC } from "../init.js";
|
|
2
|
+
import { Point2D } from "../../math/point.js";
|
|
3
|
+
import { Edge } from "../../common/edge.js";
|
|
4
|
+
import { Convert } from "../convert.js";
|
|
5
|
+
import { Geometry } from "../geometry.js";
|
|
6
|
+
export function get2dGeometry(plane, geometry) {
|
|
7
|
+
const oc = getOC();
|
|
8
|
+
return oc.ProjLib.Project(plane, geometry);
|
|
9
|
+
}
|
|
10
|
+
export function get2dCurve(plane, curve) {
|
|
11
|
+
const oc = getOC();
|
|
12
|
+
return oc.GeomAPI.To2d(curve, plane);
|
|
13
|
+
}
|
|
14
|
+
export function getQualifier(qualifier) {
|
|
15
|
+
const oc = getOC();
|
|
16
|
+
switch (qualifier) {
|
|
17
|
+
case 'unqualified':
|
|
18
|
+
return oc.GccEnt_Position.GccEnt_unqualified;
|
|
19
|
+
case 'enclosed':
|
|
20
|
+
return oc.GccEnt_Position.GccEnt_enclosed;
|
|
21
|
+
case 'enclosing':
|
|
22
|
+
return oc.GccEnt_Position.GccEnt_enclosing;
|
|
23
|
+
case 'outside':
|
|
24
|
+
return oc.GccEnt_Position.GccEnt_outside;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
export function getQualifiedCurve(plane, curve, qualifier) {
|
|
28
|
+
const oc = getOC();
|
|
29
|
+
const curve2dHandle = get2dCurve(plane, curve);
|
|
30
|
+
const handle = new oc.Geom2dAdaptor_Curve(curve2dHandle);
|
|
31
|
+
return new oc.Geom2dGcc_QualifiedCurve(handle, getQualifier(qualifier));
|
|
32
|
+
}
|
|
33
|
+
export function getQualifiedGeometry(plane, geometry, qualifier) {
|
|
34
|
+
const oc = getOC();
|
|
35
|
+
const geom = get2dGeometry(plane, geometry);
|
|
36
|
+
if (geom instanceof oc.gp_Circ2d) {
|
|
37
|
+
return new oc.GccEnt_QualifiedCirc(geom, getQualifier(qualifier));
|
|
38
|
+
}
|
|
39
|
+
else if (geom instanceof oc.gp_Lin2d) {
|
|
40
|
+
return new oc.GccEnt_QualifiedLin(geom, getQualifier(qualifier));
|
|
41
|
+
}
|
|
42
|
+
throw new Error('Unsupported geometry type');
|
|
43
|
+
}
|
|
44
|
+
export function calculateTangent(solutions) {
|
|
45
|
+
if (solutions.length === 0) {
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
const lastSolution = solutions[solutions.length - 1];
|
|
49
|
+
const cx = lastSolution.center.X();
|
|
50
|
+
const cy = lastSolution.center.Y();
|
|
51
|
+
const radius = lastSolution.radius;
|
|
52
|
+
let angle1 = Math.atan2(lastSolution.tangentPoint1.Y() - cy, lastSolution.tangentPoint1.X() - cx);
|
|
53
|
+
let angle2 = Math.atan2(lastSolution.tangentPoint2.Y() - cy, lastSolution.tangentPoint2.X() - cx);
|
|
54
|
+
const dist1 = Math.hypot(lastSolution.tangentPoint1.X() - cx, lastSolution.tangentPoint1.Y() - cy);
|
|
55
|
+
const dist2 = Math.hypot(lastSolution.tangentPoint2.X() - cx, lastSolution.tangentPoint2.Y() - cy);
|
|
56
|
+
if (dist1 < radius * 0.9) {
|
|
57
|
+
angle1 += Math.PI;
|
|
58
|
+
}
|
|
59
|
+
if (dist2 < radius * 0.9) {
|
|
60
|
+
angle2 += Math.PI;
|
|
61
|
+
}
|
|
62
|
+
let diff = angle2 - angle1;
|
|
63
|
+
if (diff > Math.PI) {
|
|
64
|
+
diff -= 2 * Math.PI;
|
|
65
|
+
}
|
|
66
|
+
if (diff < -Math.PI) {
|
|
67
|
+
diff += 2 * Math.PI;
|
|
68
|
+
}
|
|
69
|
+
// Determine whether the actual arc takes the short or long path, using the
|
|
70
|
+
// same heuristic as toArcEdges: pick the arc whose midpoint is closest to
|
|
71
|
+
// the midpoint of the original (raw) tangent points on the input geometries.
|
|
72
|
+
const rawMidX = (lastSolution.tangentPoint1.X() + lastSolution.tangentPoint2.X()) / 2;
|
|
73
|
+
const rawMidY = (lastSolution.tangentPoint1.Y() + lastSolution.tangentPoint2.Y()) / 2;
|
|
74
|
+
const midAngleShort = angle1 + diff / 2;
|
|
75
|
+
const midAngleLong = midAngleShort + Math.PI;
|
|
76
|
+
const shortMidX = cx + radius * Math.cos(midAngleShort);
|
|
77
|
+
const shortMidY = cy + radius * Math.sin(midAngleShort);
|
|
78
|
+
const longMidX = cx + radius * Math.cos(midAngleLong);
|
|
79
|
+
const longMidY = cy + radius * Math.sin(midAngleLong);
|
|
80
|
+
const distShort = Math.hypot(shortMidX - rawMidX, shortMidY - rawMidY);
|
|
81
|
+
const distLong = Math.hypot(longMidX - rawMidX, longMidY - rawMidY);
|
|
82
|
+
// If the long arc is chosen, the traversal direction is opposite to what
|
|
83
|
+
// the short-arc diff implies, so flip the sign.
|
|
84
|
+
const sign = (distShort <= distLong ? diff : -diff) > 0 ? 1 : -1;
|
|
85
|
+
return new Point2D(sign * (-Math.sin(angle2)), sign * Math.cos(angle2));
|
|
86
|
+
}
|
|
87
|
+
export function toCircleEdges(solutions, plane) {
|
|
88
|
+
return solutions.map(solution => {
|
|
89
|
+
const center2d = Convert.toPoint2D(solution.center);
|
|
90
|
+
const worldCenter = plane.localToWorld(center2d);
|
|
91
|
+
const circle = Geometry.makeCircle(worldCenter, solution.radius, plane.normal);
|
|
92
|
+
return Geometry.makeEdgeFromCircle(circle);
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
export function toArcEdges(solutions, plane) {
|
|
96
|
+
return solutions.map(solution => {
|
|
97
|
+
const pnt1 = Convert.toPoint2D(solution.tangentPoint1);
|
|
98
|
+
const pnt2 = Convert.toPoint2D(solution.tangentPoint2);
|
|
99
|
+
const center = Convert.toPoint2D(solution.center);
|
|
100
|
+
const radius = solution.radius;
|
|
101
|
+
let angle1 = Math.atan2(pnt1.y - center.y, pnt1.x - center.x);
|
|
102
|
+
let angle2 = Math.atan2(pnt2.y - center.y, pnt2.x - center.x);
|
|
103
|
+
// Solver tangent points lie on the input geometries, not on the solution
|
|
104
|
+
// circle. When a tangent point falls inside the solution circle (internal
|
|
105
|
+
// tangency), its direction from the center is opposite to the actual
|
|
106
|
+
// tangent point on the solution circle — correct by flipping the angle.
|
|
107
|
+
if (pnt1.distanceTo(center) < radius * 0.9) {
|
|
108
|
+
angle1 += Math.PI;
|
|
109
|
+
}
|
|
110
|
+
if (pnt2.distanceTo(center) < radius * 0.9) {
|
|
111
|
+
angle2 += Math.PI;
|
|
112
|
+
}
|
|
113
|
+
const worldPnt1 = plane.localToWorld(new Point2D(center.x + radius * Math.cos(angle1), center.y + radius * Math.sin(angle1)));
|
|
114
|
+
const worldPnt2 = plane.localToWorld(new Point2D(center.x + radius * Math.cos(angle2), center.y + radius * Math.sin(angle2)));
|
|
115
|
+
let diff = angle2 - angle1;
|
|
116
|
+
if (diff > Math.PI) {
|
|
117
|
+
diff -= 2 * Math.PI;
|
|
118
|
+
}
|
|
119
|
+
if (diff < -Math.PI) {
|
|
120
|
+
diff += 2 * Math.PI;
|
|
121
|
+
}
|
|
122
|
+
const midAngleShort = angle1 + diff / 2;
|
|
123
|
+
const midAngleLong = midAngleShort + Math.PI;
|
|
124
|
+
// Pick the arc whose midpoint is closest to the midpoint of the original
|
|
125
|
+
// tangent points (on the input geometries), so the arc bridges between them.
|
|
126
|
+
const rawMidX = (pnt1.x + pnt2.x) / 2;
|
|
127
|
+
const rawMidY = (pnt1.y + pnt2.y) / 2;
|
|
128
|
+
const shortMidX = center.x + radius * Math.cos(midAngleShort);
|
|
129
|
+
const shortMidY = center.y + radius * Math.sin(midAngleShort);
|
|
130
|
+
const longMidX = center.x + radius * Math.cos(midAngleLong);
|
|
131
|
+
const longMidY = center.y + radius * Math.sin(midAngleLong);
|
|
132
|
+
const distShort = Math.hypot(shortMidX - rawMidX, shortMidY - rawMidY);
|
|
133
|
+
const distLong = Math.hypot(longMidX - rawMidX, longMidY - rawMidY);
|
|
134
|
+
const midAngle = distShort <= distLong ? midAngleShort : midAngleLong;
|
|
135
|
+
const worldMid = plane.localToWorld(new Point2D(center.x + radius * Math.cos(midAngle), center.y + radius * Math.sin(midAngle)));
|
|
136
|
+
const arc = Geometry.makeArcThreePoints(worldPnt1, worldMid, worldPnt2);
|
|
137
|
+
return Geometry.makeEdgeFromCurve(arc);
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
export function filterSolutionsByFiniteExtent(solutions, shape1, shape2, plane) {
|
|
141
|
+
const edges = getFiniteEdgeExtents([shape1, shape2], plane);
|
|
142
|
+
if (edges.length === 0) {
|
|
143
|
+
return solutions;
|
|
144
|
+
}
|
|
145
|
+
return solutions.filter(solution => {
|
|
146
|
+
const tp1 = new Point2D(solution.tangentPoint1.X(), solution.tangentPoint1.Y());
|
|
147
|
+
const tp2 = new Point2D(solution.tangentPoint2.X(), solution.tangentPoint2.Y());
|
|
148
|
+
return isWithinFiniteEdges(tp1, edges) && isWithinFiniteEdges(tp2, edges);
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
function getFiniteEdgeExtents(shapes, plane) {
|
|
152
|
+
const oc = getOC();
|
|
153
|
+
const result = [];
|
|
154
|
+
for (const shape of shapes) {
|
|
155
|
+
if (!(shape instanceof Edge)) {
|
|
156
|
+
continue;
|
|
157
|
+
}
|
|
158
|
+
const adaptor = new oc.BRepAdaptor_Curve(shape.getShape());
|
|
159
|
+
const curveType = adaptor.GetType();
|
|
160
|
+
if (curveType === oc.GeomAbs_CurveType.GeomAbs_Line) {
|
|
161
|
+
adaptor.delete();
|
|
162
|
+
const start = plane.worldToLocal(shape.getFirstVertex().toPoint());
|
|
163
|
+
const end = plane.worldToLocal(shape.getLastVertex().toPoint());
|
|
164
|
+
const dx = end.x - start.x;
|
|
165
|
+
const dy = end.y - start.y;
|
|
166
|
+
const len2 = dx * dx + dy * dy;
|
|
167
|
+
if (len2 < oc.Precision.SquareConfusion()) {
|
|
168
|
+
continue;
|
|
169
|
+
}
|
|
170
|
+
result.push({ type: 'line', start, end, dx, dy, len2, len: Math.sqrt(len2) });
|
|
171
|
+
}
|
|
172
|
+
else if (curveType === oc.GeomAbs_CurveType.GeomAbs_Circle) {
|
|
173
|
+
if (shape.isClosed()) {
|
|
174
|
+
adaptor.delete();
|
|
175
|
+
continue; // Full circle, no filtering needed
|
|
176
|
+
}
|
|
177
|
+
const circle = adaptor.Circle();
|
|
178
|
+
const centerGp = circle.Location();
|
|
179
|
+
const center = plane.worldToLocal(Convert.toPoint(centerGp));
|
|
180
|
+
const radius = circle.Radius();
|
|
181
|
+
// Evaluate at midpoint parameter to determine arc direction
|
|
182
|
+
const firstParam = adaptor.FirstParameter();
|
|
183
|
+
const lastParam = adaptor.LastParameter();
|
|
184
|
+
const midParam = (firstParam + lastParam) / 2;
|
|
185
|
+
const midGp = adaptor.Value(midParam);
|
|
186
|
+
const mid = plane.worldToLocal(Convert.toPoint(midGp));
|
|
187
|
+
adaptor.delete();
|
|
188
|
+
const start = plane.worldToLocal(shape.getFirstVertex().toPoint());
|
|
189
|
+
const end = plane.worldToLocal(shape.getLastVertex().toPoint());
|
|
190
|
+
result.push({
|
|
191
|
+
type: 'arc',
|
|
192
|
+
center,
|
|
193
|
+
radius,
|
|
194
|
+
startAngle: Math.atan2(start.y - center.y, start.x - center.x),
|
|
195
|
+
midAngle: Math.atan2(mid.y - center.y, mid.x - center.x),
|
|
196
|
+
endAngle: Math.atan2(end.y - center.y, end.x - center.x),
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
else {
|
|
200
|
+
adaptor.delete();
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
return result;
|
|
204
|
+
}
|
|
205
|
+
// Returns false if the point lies on a curve's infinite extension but outside
|
|
206
|
+
// its finite extent. Points not on any edge's geometry pass through.
|
|
207
|
+
function isWithinFiniteEdges(point, edges) {
|
|
208
|
+
const oc = getOC();
|
|
209
|
+
for (const edge of edges) {
|
|
210
|
+
if (edge.type === 'line') {
|
|
211
|
+
const perpDist = Math.abs((point.x - edge.start.x) * (-edge.dy / edge.len) +
|
|
212
|
+
(point.y - edge.start.y) * (edge.dx / edge.len));
|
|
213
|
+
if (perpDist > oc.Precision.Approximation()) {
|
|
214
|
+
continue; // Point is not on this line's geometry
|
|
215
|
+
}
|
|
216
|
+
const t = ((point.x - edge.start.x) * edge.dx + (point.y - edge.start.y) * edge.dy) / edge.len2;
|
|
217
|
+
if (t < -oc.Precision.PConfusion() || t > 1 + oc.Precision.PConfusion()) {
|
|
218
|
+
return false;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
else if (edge.type === 'arc') {
|
|
222
|
+
const dist = Math.hypot(point.x - edge.center.x, point.y - edge.center.y);
|
|
223
|
+
if (Math.abs(dist - edge.radius) > oc.Precision.Confusion()) {
|
|
224
|
+
continue; // Point is not on this circle's geometry
|
|
225
|
+
}
|
|
226
|
+
const angle = Math.atan2(point.y - edge.center.y, point.x - edge.center.x);
|
|
227
|
+
if (!isAngleOnArc(angle, edge.startAngle, edge.midAngle, edge.endAngle)) {
|
|
228
|
+
return false;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
return true;
|
|
233
|
+
}
|
|
234
|
+
function isAngleOnArc(angle, startAngle, midAngle, endAngle) {
|
|
235
|
+
const oc = getOC();
|
|
236
|
+
function normAngle(a) {
|
|
237
|
+
let r = a % (2 * Math.PI);
|
|
238
|
+
if (r < 0) {
|
|
239
|
+
r += 2 * Math.PI;
|
|
240
|
+
}
|
|
241
|
+
return r;
|
|
242
|
+
}
|
|
243
|
+
const normMid = normAngle(midAngle - startAngle);
|
|
244
|
+
const normEnd = normAngle(endAngle - startAngle);
|
|
245
|
+
const normPoint = normAngle(angle - startAngle);
|
|
246
|
+
// The arc sweeps from 0 (start) through normMid to normEnd.
|
|
247
|
+
// Total sweep = startToMid + midToEnd (both measured CCW).
|
|
248
|
+
const startToMid = normMid;
|
|
249
|
+
const midToEnd = normAngle(endAngle - midAngle);
|
|
250
|
+
const totalSweep = startToMid + midToEnd;
|
|
251
|
+
return normPoint <= totalSweep + oc.Precision.Angular();
|
|
252
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ConstraintSolver } from "./constraint-solver.js";
|
|
2
|
+
import { QualifiedShape } from "../../features/2d/constraints/qualified-geometry.js";
|
|
3
|
+
import { Edge } from "../../common/edge.js";
|
|
4
|
+
import { Plane } from "../../math/plane.js";
|
|
5
|
+
import { Shape } from "../../common/shape.js";
|
|
6
|
+
import { GeometricConstraintSolver } from "./geometric/geometric-constraint-solver.js";
|
|
7
|
+
import { CurveConstraintSolver } from "./curve/curve-constraint-solver.js";
|
|
8
|
+
import { Point2D } from "../../math/point.js";
|
|
9
|
+
export declare class ConstraintSolverAdaptor extends ConstraintSolver {
|
|
10
|
+
private geometricSolver;
|
|
11
|
+
private curveSolver;
|
|
12
|
+
private mustTouch;
|
|
13
|
+
constructor(geometricSolver: GeometricConstraintSolver, curveSolver: CurveConstraintSolver, mustTouch: boolean);
|
|
14
|
+
getTangentLines(plane: Plane, shape1: QualifiedShape, shape2: QualifiedShape): Edge[];
|
|
15
|
+
getTangentCircles(plane: Plane, shape1: QualifiedShape, shape2: QualifiedShape, radius: number): Edge[];
|
|
16
|
+
getTangentArcs(plane: Plane, shape1: QualifiedShape, shape2: QualifiedShape, radius: number): {
|
|
17
|
+
edges: Edge[];
|
|
18
|
+
endTangent: Point2D | null;
|
|
19
|
+
};
|
|
20
|
+
isCurve(shape: Shape): boolean;
|
|
21
|
+
private getShapeGeometry;
|
|
22
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { ConstraintSolver } from "./constraint-solver.js";
|
|
2
|
+
import { getOC } from "../init.js";
|
|
3
|
+
import { Vertex } from "../../common/vertex.js";
|
|
4
|
+
export class ConstraintSolverAdaptor extends ConstraintSolver {
|
|
5
|
+
geometricSolver;
|
|
6
|
+
curveSolver;
|
|
7
|
+
mustTouch;
|
|
8
|
+
constructor(geometricSolver, curveSolver, mustTouch) {
|
|
9
|
+
super();
|
|
10
|
+
this.geometricSolver = geometricSolver;
|
|
11
|
+
this.curveSolver = curveSolver;
|
|
12
|
+
this.mustTouch = mustTouch;
|
|
13
|
+
}
|
|
14
|
+
getTangentLines(plane, shape1, shape2) {
|
|
15
|
+
console.log('Determining which solver to use for tangent lines', shape1, shape2);
|
|
16
|
+
if (this.isCurve(shape1.shape) || this.isCurve(shape2.shape)) {
|
|
17
|
+
console.log('Using curve solver for tangent shapes');
|
|
18
|
+
return this.curveSolver.getTangentLines(plane, shape1, shape2, this.mustTouch);
|
|
19
|
+
}
|
|
20
|
+
console.log('Using geometric solver for tangent shapes');
|
|
21
|
+
return this.geometricSolver.getTangentLines(plane, shape1, shape2, this.mustTouch);
|
|
22
|
+
}
|
|
23
|
+
getTangentCircles(plane, shape1, shape2, radius) {
|
|
24
|
+
if (this.isCurve(shape1.shape) || this.isCurve(shape2.shape)) {
|
|
25
|
+
console.log('Using curve solver for tangent circles');
|
|
26
|
+
return this.curveSolver.getTangentCircles(plane, shape1, shape2, radius, this.mustTouch);
|
|
27
|
+
}
|
|
28
|
+
console.log('Using geometric solver for tangent circles');
|
|
29
|
+
return this.geometricSolver.getTangentCircles(plane, shape1, shape2, radius, this.mustTouch);
|
|
30
|
+
}
|
|
31
|
+
getTangentArcs(plane, shape1, shape2, radius) {
|
|
32
|
+
if (this.isCurve(shape1.shape) || this.isCurve(shape2.shape)) {
|
|
33
|
+
console.log('Using curve solver for tangent arcs');
|
|
34
|
+
return this.curveSolver.getTangentArcs(plane, shape1, shape2, radius, this.mustTouch);
|
|
35
|
+
}
|
|
36
|
+
console.log('Using geometric solver for tangent circles');
|
|
37
|
+
return this.geometricSolver.getTangentArcs(plane, shape1, shape2, radius, this.mustTouch);
|
|
38
|
+
}
|
|
39
|
+
isCurve(shape) {
|
|
40
|
+
return !(shape instanceof Vertex) && this.getShapeGeometry(shape) === 'curve';
|
|
41
|
+
}
|
|
42
|
+
getShapeGeometry(shape) {
|
|
43
|
+
const oc = getOC();
|
|
44
|
+
const adaptor = new oc.BRepAdaptor_Curve(shape.getShape());
|
|
45
|
+
const type = adaptor.GetType();
|
|
46
|
+
if (type === oc.GeomAbs_CurveType.GeomAbs_Line) {
|
|
47
|
+
adaptor.delete();
|
|
48
|
+
return 'line';
|
|
49
|
+
}
|
|
50
|
+
else if (type === oc.GeomAbs_CurveType.GeomAbs_Circle) {
|
|
51
|
+
if (adaptor.IsClosed()) {
|
|
52
|
+
console.log('Shape is a closed circle');
|
|
53
|
+
adaptor.delete();
|
|
54
|
+
return 'circle';
|
|
55
|
+
}
|
|
56
|
+
adaptor.delete();
|
|
57
|
+
return 'curve';
|
|
58
|
+
}
|
|
59
|
+
adaptor.delete();
|
|
60
|
+
throw new Error('Unsupported shape type for tangent line solver');
|
|
61
|
+
}
|
|
62
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Edge } from "../../common/edge.js";
|
|
2
|
+
import { QualifiedShape } from "../../features/2d/constraints/qualified-geometry.js";
|
|
3
|
+
import { Plane } from "../../math/plane.js";
|
|
4
|
+
import { Point2D } from "../../math/point.js";
|
|
5
|
+
export interface TangentLineSolver {
|
|
6
|
+
getTangentLines(plane: Plane, shape1: QualifiedShape, shape2: QualifiedShape, mustTouch?: boolean): Edge[];
|
|
7
|
+
}
|
|
8
|
+
export interface TangentCircleSolver {
|
|
9
|
+
getTangentCircles(plane: Plane, shape1: QualifiedShape, shape2: QualifiedShape, radius: number, mustTouch?: boolean): Edge[];
|
|
10
|
+
}
|
|
11
|
+
export declare abstract class ConstraintSolver implements TangentLineSolver, TangentCircleSolver {
|
|
12
|
+
abstract getTangentLines(plane: Plane, shape1: QualifiedShape, shape2: QualifiedShape, mustTouch?: boolean): Edge[];
|
|
13
|
+
abstract getTangentCircles(plane: Plane, shape1: QualifiedShape, shape2: QualifiedShape, radius: number, mustTouch?: boolean): Edge[];
|
|
14
|
+
abstract getTangentArcs(plane: Plane, shape1: QualifiedShape, shape2: QualifiedShape, radius: number, mustTouch?: boolean): {
|
|
15
|
+
edges: Edge[];
|
|
16
|
+
endTangent: Point2D;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ConstraintSolverAdaptor } from "./constraint-solver-adaptor.js";
|
|
2
|
+
import { CurveConstraintSolver } from "./curve/curve-constraint-solver.js";
|
|
3
|
+
import { GeometricConstraintSolver } from "./geometric/geometric-constraint-solver.js";
|
|
4
|
+
export function createConstraintSolver(mustTouch) {
|
|
5
|
+
return new ConstraintSolverAdaptor(new GeometricConstraintSolver(), new CurveConstraintSolver(), mustTouch);
|
|
6
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Edge } from "../../../common/edge.js";
|
|
2
|
+
import { QualifiedShape } from "../../../features/2d/constraints/qualified-geometry.js";
|
|
3
|
+
import { Plane } from "../../../math/plane.js";
|
|
4
|
+
import { Point2D } from "../../../math/point.js";
|
|
5
|
+
import { ConstraintSolver } from "../constraint-solver.js";
|
|
6
|
+
export declare class CurveConstraintSolver extends ConstraintSolver {
|
|
7
|
+
getTangentCircles(plane: Plane, shape1: QualifiedShape, shape2: QualifiedShape, radius: number, mustTouch: boolean): Edge[];
|
|
8
|
+
getTangentLines(plane: Plane, shape1: QualifiedShape, shape2: QualifiedShape, mustTouch: boolean): Edge[];
|
|
9
|
+
getTangentArcs(plane: Plane, shape1: QualifiedShape, shape2: QualifiedShape, radius: number, mustTouch: boolean): {
|
|
10
|
+
edges: Edge[];
|
|
11
|
+
endTangent: Point2D | null;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ConstraintSolver } from "../constraint-solver.js";
|
|
2
|
+
import { CurveTangentCircleSolver } from "./tangent-circle-solver.js";
|
|
3
|
+
import { CurveTangentLineSolver } from "./tangent-line-solver.js";
|
|
4
|
+
export class CurveConstraintSolver extends ConstraintSolver {
|
|
5
|
+
getTangentCircles(plane, shape1, shape2, radius, mustTouch) {
|
|
6
|
+
const solver = new CurveTangentCircleSolver();
|
|
7
|
+
console.log('Getting tangent circles');
|
|
8
|
+
return solver.getTangentCircles(plane, shape1, shape2, radius, mustTouch);
|
|
9
|
+
}
|
|
10
|
+
getTangentLines(plane, shape1, shape2, mustTouch) {
|
|
11
|
+
const solver = new CurveTangentLineSolver();
|
|
12
|
+
return solver.getTangentLines(plane, shape1, shape2, mustTouch);
|
|
13
|
+
}
|
|
14
|
+
getTangentArcs(plane, shape1, shape2, radius, mustTouch) {
|
|
15
|
+
const solver = new CurveTangentCircleSolver();
|
|
16
|
+
return solver.getTangentArcs(plane, shape1, shape2, radius, mustTouch);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Edge } from "../../../common/edge.js";
|
|
2
|
+
import { QualifiedShape } from "../../../features/2d/constraints/qualified-geometry.js";
|
|
3
|
+
import { Plane } from "../../../math/plane.js";
|
|
4
|
+
import { TangentCircleSolver } from "../constraint-solver.js";
|
|
5
|
+
import { Point2D } from "../../../math/point.js";
|
|
6
|
+
export declare class CurveTangentCircleSolver implements TangentCircleSolver {
|
|
7
|
+
getTangentCircles(plane: Plane, shape1: QualifiedShape, shape2: QualifiedShape, radius: number, mustTouch: boolean): Edge[];
|
|
8
|
+
getTangentArcs(plane: Plane, shape1: QualifiedShape, shape2: QualifiedShape, radius: number, mustTouch: boolean): {
|
|
9
|
+
edges: Edge[];
|
|
10
|
+
endTangent: Point2D | null;
|
|
11
|
+
};
|
|
12
|
+
private getCurveCurveTangent;
|
|
13
|
+
private getCurvePointTangent;
|
|
14
|
+
private getSolutions;
|
|
15
|
+
private getCurve;
|
|
16
|
+
}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { Vertex } from "../../../common/vertex.js";
|
|
2
|
+
import { calculateTangent, filterSolutionsByFiniteExtent, getQualifiedCurve, toArcEdges, toCircleEdges } from "../constraint-helpers.js";
|
|
3
|
+
import { Convert } from "../../convert.js";
|
|
4
|
+
import { getOC } from "../../init.js";
|
|
5
|
+
export class CurveTangentCircleSolver {
|
|
6
|
+
getTangentCircles(plane, shape1, shape2, radius, mustTouch) {
|
|
7
|
+
const isVertex1 = shape1.shape instanceof Vertex;
|
|
8
|
+
const isVertex2 = shape2.shape instanceof Vertex;
|
|
9
|
+
if (isVertex1 || isVertex2) {
|
|
10
|
+
const vertex = isVertex1 ? shape1 : shape2;
|
|
11
|
+
const other = isVertex1 ? shape2 : shape1;
|
|
12
|
+
let solutions = this.getCurvePointTangent(plane, vertex.shape, other, radius);
|
|
13
|
+
if (mustTouch) {
|
|
14
|
+
solutions = filterSolutionsByFiniteExtent(solutions, shape1.shape, shape2.shape, plane);
|
|
15
|
+
}
|
|
16
|
+
return toCircleEdges(solutions, plane);
|
|
17
|
+
}
|
|
18
|
+
let solutions = this.getCurveCurveTangent(plane, shape1, shape2, radius);
|
|
19
|
+
if (mustTouch) {
|
|
20
|
+
solutions = filterSolutionsByFiniteExtent(solutions, shape1.shape, shape2.shape, plane);
|
|
21
|
+
}
|
|
22
|
+
return toCircleEdges(solutions, plane);
|
|
23
|
+
}
|
|
24
|
+
getTangentArcs(plane, shape1, shape2, radius, mustTouch) {
|
|
25
|
+
const isVertex1 = shape1.shape instanceof Vertex;
|
|
26
|
+
const isVertex2 = shape2.shape instanceof Vertex;
|
|
27
|
+
if (isVertex1 || isVertex2) {
|
|
28
|
+
const vertex = isVertex1 ? shape1 : shape2;
|
|
29
|
+
const other = isVertex1 ? shape2 : shape1;
|
|
30
|
+
let solutions = this.getCurvePointTangent(plane, vertex.shape, other, radius);
|
|
31
|
+
if (mustTouch) {
|
|
32
|
+
solutions = filterSolutionsByFiniteExtent(solutions, shape1.shape, shape2.shape, plane);
|
|
33
|
+
}
|
|
34
|
+
const edges = toArcEdges(solutions, plane);
|
|
35
|
+
const endTangent = calculateTangent(solutions);
|
|
36
|
+
return {
|
|
37
|
+
edges,
|
|
38
|
+
endTangent
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
let solutions = this.getCurveCurveTangent(plane, shape1, shape2, radius);
|
|
42
|
+
if (mustTouch) {
|
|
43
|
+
solutions = filterSolutionsByFiniteExtent(solutions, shape1.shape, shape2.shape, plane);
|
|
44
|
+
}
|
|
45
|
+
const edges = toArcEdges(solutions, plane);
|
|
46
|
+
const endTangent = calculateTangent(solutions);
|
|
47
|
+
return {
|
|
48
|
+
edges,
|
|
49
|
+
endTangent
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
getCurveCurveTangent(plane, lineShape1, lineShape2, radius) {
|
|
53
|
+
const oc = getOC();
|
|
54
|
+
const tolerance = oc.Precision.Angular();
|
|
55
|
+
const [pln, disposePln] = Convert.toGpPln(plane);
|
|
56
|
+
const curve1 = this.getCurve(lineShape1.shape);
|
|
57
|
+
const curve2 = this.getCurve(lineShape2.shape);
|
|
58
|
+
const qualifiedCurve1 = getQualifiedCurve(pln, curve1, lineShape1.qualifier);
|
|
59
|
+
const qualifiedCurve2 = getQualifiedCurve(pln, curve2, lineShape2.qualifier);
|
|
60
|
+
const solver = new oc.Geom2dGcc_Circ2d2TanRad(qualifiedCurve1, qualifiedCurve2, radius, tolerance);
|
|
61
|
+
const solutions = this.getSolutions(solver, plane);
|
|
62
|
+
disposePln();
|
|
63
|
+
return solutions;
|
|
64
|
+
}
|
|
65
|
+
getCurvePointTangent(plane, vertex, lineShape, radius) {
|
|
66
|
+
const oc = getOC();
|
|
67
|
+
const tolerance = oc.Precision.Angular();
|
|
68
|
+
const [pln, disposePln] = Convert.toGpPln(plane);
|
|
69
|
+
const [pnt, disposePnt] = Convert.toGpPnt2d(vertex.toPoint2D());
|
|
70
|
+
const geom2dPnt = new oc.Geom2d_CartesianPoint(pnt);
|
|
71
|
+
const handle = new oc.Handle_Geom2d_Point(geom2dPnt);
|
|
72
|
+
disposePnt();
|
|
73
|
+
const curve = this.getCurve(lineShape.shape);
|
|
74
|
+
const qualifiedCurve = getQualifiedCurve(pln, curve, lineShape.qualifier);
|
|
75
|
+
const solver = new oc.Geom2dGcc_Circ2d2TanRad(qualifiedCurve, handle, radius, tolerance);
|
|
76
|
+
const solutions = this.getSolutions(solver, plane);
|
|
77
|
+
disposePln();
|
|
78
|
+
handle.delete();
|
|
79
|
+
return solutions;
|
|
80
|
+
}
|
|
81
|
+
getSolutions(solver, plane) {
|
|
82
|
+
const oc = getOC();
|
|
83
|
+
const result = [];
|
|
84
|
+
if (solver.IsDone()) {
|
|
85
|
+
for (let i = 1; i <= solver.NbSolutions(); i++) {
|
|
86
|
+
const circ2d = solver.ThisSolution(i);
|
|
87
|
+
const radius = circ2d.Radius();
|
|
88
|
+
const center = circ2d.Location();
|
|
89
|
+
const pnt1 = new oc.gp_Pnt2d();
|
|
90
|
+
const pnt2 = new oc.gp_Pnt2d();
|
|
91
|
+
solver.Tangency1(i, 0, 0, pnt1);
|
|
92
|
+
solver.Tangency2(i, 0, 0, pnt2);
|
|
93
|
+
result.push({
|
|
94
|
+
center,
|
|
95
|
+
radius,
|
|
96
|
+
tangentPoint1: pnt1,
|
|
97
|
+
tangentPoint2: pnt2
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
return result;
|
|
102
|
+
}
|
|
103
|
+
getCurve(shape) {
|
|
104
|
+
const oc = getOC();
|
|
105
|
+
const adaptor = new oc.BRepAdaptor_Curve(shape.getShape());
|
|
106
|
+
const curve = adaptor.Curve();
|
|
107
|
+
const handle = curve.Curve();
|
|
108
|
+
curve.delete();
|
|
109
|
+
adaptor.delete();
|
|
110
|
+
return handle;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Edge } from "../../../common/edge.js";
|
|
2
|
+
import { Shape } from "../../../common/shape.js";
|
|
3
|
+
import { ConstraintQualifier } from "../../../features/2d/constraints/qualified-geometry.js";
|
|
4
|
+
import { Plane } from "../../../math/plane.js";
|
|
5
|
+
import { TangentLineSolver } from "../constraint-solver.js";
|
|
6
|
+
export declare class CurveTangentLineSolver implements TangentLineSolver {
|
|
7
|
+
getTangentLines(plane: Plane, shape1: {
|
|
8
|
+
shape: Shape;
|
|
9
|
+
qualifier: ConstraintQualifier;
|
|
10
|
+
}, shape2: {
|
|
11
|
+
shape: Shape;
|
|
12
|
+
qualifier: ConstraintQualifier;
|
|
13
|
+
}, mustTouch: boolean): Edge[];
|
|
14
|
+
private getPointCurveTangent;
|
|
15
|
+
private getCurveCurveTangent;
|
|
16
|
+
private getSolutions;
|
|
17
|
+
private solutionsToEdges;
|
|
18
|
+
private getCurve;
|
|
19
|
+
}
|