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,81 @@
|
|
|
1
|
+
import { getOC } from "./init.js";
|
|
2
|
+
import { Explorer } from "./explorer.js";
|
|
3
|
+
export class FaceProps {
|
|
4
|
+
static getProperties(face) {
|
|
5
|
+
const oc = getOC();
|
|
6
|
+
const ocFace = oc.TopoDS.Face(face);
|
|
7
|
+
const adaptor = new oc.BRepAdaptor_Surface(ocFace, true);
|
|
8
|
+
const type = adaptor.GetType();
|
|
9
|
+
if (type === oc.GeomAbs_SurfaceType.GeomAbs_Plane) {
|
|
10
|
+
adaptor.delete();
|
|
11
|
+
// Check if it's a circular face (plane with a single closed circular edge)
|
|
12
|
+
const edges = Explorer.findShapes(ocFace, oc.TopAbs_ShapeEnum.TopAbs_EDGE);
|
|
13
|
+
let isCircle = false;
|
|
14
|
+
let circleRadius = 0;
|
|
15
|
+
if (edges.length >= 1) {
|
|
16
|
+
let allCircular = true;
|
|
17
|
+
let closedCircleFound = false;
|
|
18
|
+
for (const e of edges) {
|
|
19
|
+
const curveAdaptor = new oc.BRepAdaptor_Curve(oc.TopoDS.Edge(e));
|
|
20
|
+
const curveType = curveAdaptor.GetType();
|
|
21
|
+
if (curveType !== oc.GeomAbs_CurveType.GeomAbs_Circle) {
|
|
22
|
+
allCircular = false;
|
|
23
|
+
curveAdaptor.delete();
|
|
24
|
+
break;
|
|
25
|
+
}
|
|
26
|
+
if (curveAdaptor.IsClosed()) {
|
|
27
|
+
const circle = curveAdaptor.Circle();
|
|
28
|
+
circleRadius = circle.Radius();
|
|
29
|
+
circle.delete();
|
|
30
|
+
closedCircleFound = true;
|
|
31
|
+
}
|
|
32
|
+
curveAdaptor.delete();
|
|
33
|
+
}
|
|
34
|
+
isCircle = allCircular && closedCircleFound;
|
|
35
|
+
}
|
|
36
|
+
if (isCircle) {
|
|
37
|
+
return { surfaceType: 'circle', radius: circleRadius };
|
|
38
|
+
}
|
|
39
|
+
const surfaceProps = new oc.GProp_GProps();
|
|
40
|
+
oc.BRepGProp.SurfaceProperties(ocFace, surfaceProps, false, false);
|
|
41
|
+
const areaMm2 = surfaceProps.Mass();
|
|
42
|
+
surfaceProps.delete();
|
|
43
|
+
return { surfaceType: 'plane', areaMm2 };
|
|
44
|
+
}
|
|
45
|
+
if (type === oc.GeomAbs_SurfaceType.GeomAbs_Cylinder) {
|
|
46
|
+
const cylinder = adaptor.Cylinder();
|
|
47
|
+
const radius = cylinder.Radius();
|
|
48
|
+
cylinder.delete();
|
|
49
|
+
adaptor.delete();
|
|
50
|
+
return { surfaceType: 'cylinder', radius };
|
|
51
|
+
}
|
|
52
|
+
if (type === oc.GeomAbs_SurfaceType.GeomAbs_Sphere) {
|
|
53
|
+
const sphere = adaptor.Sphere();
|
|
54
|
+
const radius = sphere.Radius();
|
|
55
|
+
sphere.delete();
|
|
56
|
+
adaptor.delete();
|
|
57
|
+
return { surfaceType: 'sphere', radius };
|
|
58
|
+
}
|
|
59
|
+
if (type === oc.GeomAbs_SurfaceType.GeomAbs_Torus) {
|
|
60
|
+
const torus = adaptor.Torus();
|
|
61
|
+
const majorRadius = torus.MajorRadius();
|
|
62
|
+
const minorRadius = torus.MinorRadius();
|
|
63
|
+
torus.delete();
|
|
64
|
+
adaptor.delete();
|
|
65
|
+
return { surfaceType: 'torus', majorRadius, minorRadius };
|
|
66
|
+
}
|
|
67
|
+
if (type === oc.GeomAbs_SurfaceType.GeomAbs_Cone) {
|
|
68
|
+
const cone = adaptor.Cone();
|
|
69
|
+
const halfAngleDeg = cone.SemiAngle() * (180 / Math.PI);
|
|
70
|
+
cone.delete();
|
|
71
|
+
adaptor.delete();
|
|
72
|
+
return { surfaceType: 'cone', halfAngleDeg };
|
|
73
|
+
}
|
|
74
|
+
adaptor.delete();
|
|
75
|
+
const surfaceProps = new oc.GProp_GProps();
|
|
76
|
+
oc.BRepGProp.SurfaceProperties(ocFace, surfaceProps, false, false);
|
|
77
|
+
const areaMm2 = surfaceProps.Mass();
|
|
78
|
+
surfaceProps.delete();
|
|
79
|
+
return { surfaceType: 'other', areaMm2 };
|
|
80
|
+
}
|
|
81
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { gp_Pln, gp_Cylinder, TopoDS_Shape } from "occjs-wrapper";
|
|
2
|
+
import { Vector3d } from "../math/vector3d.js";
|
|
3
|
+
import { Plane } from "../math/plane.js";
|
|
4
|
+
import { Shape } from "../common/shape.js";
|
|
5
|
+
import { Face } from "../common/face.js";
|
|
6
|
+
export declare class FaceQuery {
|
|
7
|
+
static isCircleFace(face: Shape, diameter?: number): boolean;
|
|
8
|
+
static isConeFace(face: Shape): boolean;
|
|
9
|
+
static isCylinderFace(face: Shape, diameter?: number): boolean;
|
|
10
|
+
static isCylinderCurveFace(face: Shape, diameter?: number): boolean;
|
|
11
|
+
static isFaceOnPlane(face: Shape, plane: Plane): boolean;
|
|
12
|
+
static isFaceParallelToPlane(face: Shape, plane: Plane): boolean;
|
|
13
|
+
static isPlanarFace(face: Shape): boolean;
|
|
14
|
+
static getSurfaceType(face: Shape): string;
|
|
15
|
+
static getSurfacePlane(face: Shape): Plane;
|
|
16
|
+
static areFacePlanesParallel(face1: Shape, face2: Shape): boolean;
|
|
17
|
+
static getSignedPlaneDistance(startFace: Shape, targetFace: Shape): number;
|
|
18
|
+
static findFarthestCornerDistanceFromFace(targetFace: Shape, sourceFace: Shape): number;
|
|
19
|
+
static makeInfinitePlanarFace(face: Shape, offset?: number, offsetDirection?: Vector3d): Face;
|
|
20
|
+
static makeInfiniteCylindricalFace(face: Shape, offset?: number): Face;
|
|
21
|
+
static isCircleFaceRaw(face: TopoDS_Shape, diameter?: number): boolean;
|
|
22
|
+
static isConeFaceRaw(face: TopoDS_Shape): boolean;
|
|
23
|
+
static isCylinderFaceRaw(face: TopoDS_Shape, diameter?: number): boolean;
|
|
24
|
+
static isCylinderCurveFaceRaw(face: TopoDS_Shape, diameter?: number): boolean;
|
|
25
|
+
static isFaceOnPlaneRaw(face: TopoDS_Shape, plane: gp_Pln): boolean;
|
|
26
|
+
static isFaceParallelToPlaneRaw(face: TopoDS_Shape, plane: gp_Pln): boolean;
|
|
27
|
+
static isPlanarFaceRaw(face: TopoDS_Shape): boolean;
|
|
28
|
+
static getSurfaceTypeRaw(face: TopoDS_Shape): string;
|
|
29
|
+
static getSurfaceAdaptorPlaneRaw(face: TopoDS_Shape): gp_Pln;
|
|
30
|
+
static getSurfaceAdaptorCylinderRaw(face: TopoDS_Shape): gp_Cylinder;
|
|
31
|
+
static findFarthestCornerDistanceRaw(face: TopoDS_Shape, plane: gp_Pln): number;
|
|
32
|
+
static arePlanesParallelRaw(plane1: gp_Pln, plane2: gp_Pln): boolean;
|
|
33
|
+
static findFaceByDistance(faces: Face[], plane: Plane, mode: 'first' | 'last'): Face | null;
|
|
34
|
+
static getSignedPlaneDistanceRaw(startPlane: gp_Pln, targetPlane: gp_Pln): number;
|
|
35
|
+
}
|
|
@@ -0,0 +1,341 @@
|
|
|
1
|
+
import { getOC } from "./init.js";
|
|
2
|
+
import { Explorer } from "./explorer.js";
|
|
3
|
+
import { FaceOps } from "./face-ops.js";
|
|
4
|
+
import { Convert } from "./convert.js";
|
|
5
|
+
import { Face } from "../common/face.js";
|
|
6
|
+
export class FaceQuery {
|
|
7
|
+
// Wrapper methods (public API for external callers)
|
|
8
|
+
static isCircleFace(face, diameter) {
|
|
9
|
+
return FaceQuery.isCircleFaceRaw(face.getShape(), diameter);
|
|
10
|
+
}
|
|
11
|
+
static isConeFace(face) {
|
|
12
|
+
return FaceQuery.isConeFaceRaw(face.getShape());
|
|
13
|
+
}
|
|
14
|
+
static isCylinderFace(face, diameter) {
|
|
15
|
+
return FaceQuery.isCylinderFaceRaw(face.getShape(), diameter);
|
|
16
|
+
}
|
|
17
|
+
static isCylinderCurveFace(face, diameter) {
|
|
18
|
+
return FaceQuery.isCylinderCurveFaceRaw(face.getShape(), diameter);
|
|
19
|
+
}
|
|
20
|
+
static isFaceOnPlane(face, plane) {
|
|
21
|
+
const [gpPln, dispose] = Convert.toGpPln(plane);
|
|
22
|
+
const result = FaceQuery.isFaceOnPlaneRaw(face.getShape(), gpPln);
|
|
23
|
+
dispose();
|
|
24
|
+
return result;
|
|
25
|
+
}
|
|
26
|
+
static isFaceParallelToPlane(face, plane) {
|
|
27
|
+
const [gpPln, dispose] = Convert.toGpPln(plane);
|
|
28
|
+
const result = FaceQuery.isFaceParallelToPlaneRaw(face.getShape(), gpPln);
|
|
29
|
+
dispose();
|
|
30
|
+
return result;
|
|
31
|
+
}
|
|
32
|
+
static isPlanarFace(face) {
|
|
33
|
+
return FaceQuery.isPlanarFaceRaw(face.getShape());
|
|
34
|
+
}
|
|
35
|
+
static getSurfaceType(face) {
|
|
36
|
+
return FaceQuery.getSurfaceTypeRaw(face.getShape());
|
|
37
|
+
}
|
|
38
|
+
static getSurfacePlane(face) {
|
|
39
|
+
const gpPln = FaceQuery.getSurfaceAdaptorPlaneRaw(face.getShape());
|
|
40
|
+
const result = Convert.toPlane(gpPln);
|
|
41
|
+
gpPln.delete();
|
|
42
|
+
return result;
|
|
43
|
+
}
|
|
44
|
+
static areFacePlanesParallel(face1, face2) {
|
|
45
|
+
const plane1 = FaceQuery.getSurfaceAdaptorPlaneRaw(face1.getShape());
|
|
46
|
+
const plane2 = FaceQuery.getSurfaceAdaptorPlaneRaw(face2.getShape());
|
|
47
|
+
const result = FaceQuery.arePlanesParallelRaw(plane1, plane2);
|
|
48
|
+
plane1.delete();
|
|
49
|
+
plane2.delete();
|
|
50
|
+
return result;
|
|
51
|
+
}
|
|
52
|
+
static getSignedPlaneDistance(startFace, targetFace) {
|
|
53
|
+
const startPlane = FaceQuery.getSurfaceAdaptorPlaneRaw(startFace.getShape());
|
|
54
|
+
const targetPlane = FaceQuery.getSurfaceAdaptorPlaneRaw(targetFace.getShape());
|
|
55
|
+
const result = FaceQuery.getSignedPlaneDistanceRaw(startPlane, targetPlane);
|
|
56
|
+
startPlane.delete();
|
|
57
|
+
targetPlane.delete();
|
|
58
|
+
return result;
|
|
59
|
+
}
|
|
60
|
+
static findFarthestCornerDistanceFromFace(targetFace, sourceFace) {
|
|
61
|
+
const sourcePlane = FaceQuery.getSurfaceAdaptorPlaneRaw(sourceFace.getShape());
|
|
62
|
+
const result = FaceQuery.findFarthestCornerDistanceRaw(targetFace.getShape(), sourcePlane);
|
|
63
|
+
sourcePlane.delete();
|
|
64
|
+
return result;
|
|
65
|
+
}
|
|
66
|
+
static makeInfinitePlanarFace(face, offset, offsetDirection) {
|
|
67
|
+
const gpPln = FaceQuery.getSurfaceAdaptorPlaneRaw(face.getShape());
|
|
68
|
+
if (offset && offsetDirection) {
|
|
69
|
+
const [vec, disposeVec] = Convert.toGpVec(offsetDirection);
|
|
70
|
+
vec.Multiply(offset);
|
|
71
|
+
gpPln.Translate(vec);
|
|
72
|
+
disposeVec();
|
|
73
|
+
}
|
|
74
|
+
const rawFace = FaceOps.makeFaceFromPlane(gpPln);
|
|
75
|
+
gpPln.delete();
|
|
76
|
+
return Face.fromTopoDSFace(rawFace);
|
|
77
|
+
}
|
|
78
|
+
static makeInfiniteCylindricalFace(face, offset) {
|
|
79
|
+
const oc = getOC();
|
|
80
|
+
const cylinder = FaceQuery.getSurfaceAdaptorCylinderRaw(face.getShape());
|
|
81
|
+
const cylMaker = new oc.gce_MakeCylinder(cylinder, offset || 0);
|
|
82
|
+
const rawFace = FaceOps.makeFaceFromCylinder(cylMaker.Value());
|
|
83
|
+
cylinder.delete();
|
|
84
|
+
cylMaker.delete();
|
|
85
|
+
return Face.fromTopoDSFace(rawFace);
|
|
86
|
+
}
|
|
87
|
+
// Raw methods (for oc-internal and common/ use)
|
|
88
|
+
static isCircleFaceRaw(face, diameter) {
|
|
89
|
+
const oc = getOC();
|
|
90
|
+
const ocFace = oc.TopoDS.Face(face);
|
|
91
|
+
const faceAdaptor = new oc.BRepAdaptor_Surface(ocFace, true);
|
|
92
|
+
const type = faceAdaptor.GetType();
|
|
93
|
+
if (type !== oc.GeomAbs_SurfaceType.GeomAbs_Plane) {
|
|
94
|
+
faceAdaptor.delete();
|
|
95
|
+
return false;
|
|
96
|
+
}
|
|
97
|
+
faceAdaptor.delete();
|
|
98
|
+
const edges = Explorer.findShapes(ocFace, oc.TopAbs_ShapeEnum.TopAbs_EDGE);
|
|
99
|
+
for (const e of edges) {
|
|
100
|
+
const edge = oc.TopoDS.Edge(e);
|
|
101
|
+
const curveAdaptor = new oc.BRepAdaptor_Curve(edge);
|
|
102
|
+
const curveType = curveAdaptor.GetType();
|
|
103
|
+
if (curveType !== oc.GeomAbs_CurveType.GeomAbs_Circle) {
|
|
104
|
+
curveAdaptor.delete();
|
|
105
|
+
return false;
|
|
106
|
+
}
|
|
107
|
+
if (curveAdaptor.IsClosed()) {
|
|
108
|
+
if (diameter === undefined) {
|
|
109
|
+
curveAdaptor.delete();
|
|
110
|
+
return true;
|
|
111
|
+
}
|
|
112
|
+
const circle = curveAdaptor.Circle();
|
|
113
|
+
const r = circle.Radius();
|
|
114
|
+
circle.delete();
|
|
115
|
+
curveAdaptor.delete();
|
|
116
|
+
return Math.abs(r - diameter / 2) <= oc.Precision.Confusion();
|
|
117
|
+
}
|
|
118
|
+
curveAdaptor.delete();
|
|
119
|
+
}
|
|
120
|
+
return false;
|
|
121
|
+
}
|
|
122
|
+
static isConeFaceRaw(face) {
|
|
123
|
+
const oc = getOC();
|
|
124
|
+
const ocFace = oc.TopoDS.Face(face);
|
|
125
|
+
const faceAdaptor = new oc.BRepAdaptor_Surface(ocFace, true);
|
|
126
|
+
const type = faceAdaptor.GetType();
|
|
127
|
+
faceAdaptor.delete();
|
|
128
|
+
return type === oc.GeomAbs_SurfaceType.GeomAbs_Cone;
|
|
129
|
+
}
|
|
130
|
+
static isCylinderFaceRaw(face, diameter) {
|
|
131
|
+
const oc = getOC();
|
|
132
|
+
const ocFace = oc.TopoDS.Face(face);
|
|
133
|
+
const faceAdaptor = new oc.BRepAdaptor_Surface(ocFace, true);
|
|
134
|
+
const type = faceAdaptor.GetType();
|
|
135
|
+
faceAdaptor.delete();
|
|
136
|
+
if (type !== oc.GeomAbs_SurfaceType.GeomAbs_Cylinder) {
|
|
137
|
+
return false;
|
|
138
|
+
}
|
|
139
|
+
const edges = Explorer.findShapes(ocFace, oc.TopAbs_ShapeEnum.TopAbs_EDGE);
|
|
140
|
+
for (const edge of edges) {
|
|
141
|
+
const curveAdaptor = new oc.BRepAdaptor_Curve(oc.TopoDS.Edge(edge));
|
|
142
|
+
const curveType = curveAdaptor.GetType();
|
|
143
|
+
if (curveAdaptor.IsClosed() && curveType === oc.GeomAbs_CurveType.GeomAbs_Circle) {
|
|
144
|
+
if (diameter === undefined) {
|
|
145
|
+
curveAdaptor.delete();
|
|
146
|
+
return true;
|
|
147
|
+
}
|
|
148
|
+
const circle = curveAdaptor.Circle();
|
|
149
|
+
const r = circle.Radius();
|
|
150
|
+
circle.delete();
|
|
151
|
+
curveAdaptor.delete();
|
|
152
|
+
return Math.abs(r - diameter / 2) <= oc.Precision.Confusion();
|
|
153
|
+
}
|
|
154
|
+
curveAdaptor.delete();
|
|
155
|
+
}
|
|
156
|
+
return false;
|
|
157
|
+
}
|
|
158
|
+
static isCylinderCurveFaceRaw(face, diameter) {
|
|
159
|
+
const oc = getOC();
|
|
160
|
+
const ocFace = oc.TopoDS.Face(face);
|
|
161
|
+
const faceAdaptor = new oc.BRepAdaptor_Surface(ocFace, true);
|
|
162
|
+
const type = faceAdaptor.GetType();
|
|
163
|
+
faceAdaptor.delete();
|
|
164
|
+
if (type !== oc.GeomAbs_SurfaceType.GeomAbs_Cylinder) {
|
|
165
|
+
return false;
|
|
166
|
+
}
|
|
167
|
+
const edges = Explorer.findShapes(ocFace, oc.TopAbs_ShapeEnum.TopAbs_EDGE);
|
|
168
|
+
for (const edge of edges) {
|
|
169
|
+
const curveAdaptor = new oc.BRepAdaptor_Curve(oc.TopoDS.Edge(edge));
|
|
170
|
+
const curveType = curveAdaptor.GetType();
|
|
171
|
+
if (curveType === oc.GeomAbs_CurveType.GeomAbs_Circle && !curveAdaptor.IsClosed()) {
|
|
172
|
+
if (diameter === undefined) {
|
|
173
|
+
curveAdaptor.delete();
|
|
174
|
+
return true;
|
|
175
|
+
}
|
|
176
|
+
const circle = curveAdaptor.Circle();
|
|
177
|
+
const r = circle.Radius();
|
|
178
|
+
circle.delete();
|
|
179
|
+
curveAdaptor.delete();
|
|
180
|
+
return Math.abs(r - diameter / 2) <= oc.Precision.Confusion();
|
|
181
|
+
}
|
|
182
|
+
curveAdaptor.delete();
|
|
183
|
+
}
|
|
184
|
+
return false;
|
|
185
|
+
}
|
|
186
|
+
static isFaceOnPlaneRaw(face, plane) {
|
|
187
|
+
const oc = getOC();
|
|
188
|
+
return FaceOps.faceOnPlane(oc.TopoDS.Face(face), plane);
|
|
189
|
+
}
|
|
190
|
+
static isFaceParallelToPlaneRaw(face, plane) {
|
|
191
|
+
const oc = getOC();
|
|
192
|
+
const ocFace = oc.TopoDS.Face(face);
|
|
193
|
+
const faceAdaptor = new oc.BRepAdaptor_Surface(ocFace, true);
|
|
194
|
+
const facePlane = faceAdaptor.Plane();
|
|
195
|
+
const faceAxis = facePlane.Axis();
|
|
196
|
+
const targetAxis = plane.Axis();
|
|
197
|
+
const faceNormal = faceAxis.Direction();
|
|
198
|
+
const targetNormal = targetAxis.Direction();
|
|
199
|
+
const result = faceNormal.IsParallel(targetNormal, oc.Precision.Angular());
|
|
200
|
+
faceNormal.delete();
|
|
201
|
+
targetNormal.delete();
|
|
202
|
+
faceAxis.delete();
|
|
203
|
+
targetAxis.delete();
|
|
204
|
+
facePlane.delete();
|
|
205
|
+
faceAdaptor.delete();
|
|
206
|
+
return result;
|
|
207
|
+
}
|
|
208
|
+
static isPlanarFaceRaw(face) {
|
|
209
|
+
const oc = getOC();
|
|
210
|
+
const ocFace = oc.TopoDS.Face(face);
|
|
211
|
+
const adaptor = new oc.BRepAdaptor_Surface(ocFace, true);
|
|
212
|
+
const result = adaptor.GetType() === oc.GeomAbs_SurfaceType.GeomAbs_Plane;
|
|
213
|
+
adaptor.delete();
|
|
214
|
+
return result;
|
|
215
|
+
}
|
|
216
|
+
static getSurfaceTypeRaw(face) {
|
|
217
|
+
const oc = getOC();
|
|
218
|
+
const ocFace = oc.TopoDS.Face(face);
|
|
219
|
+
const adaptor = new oc.BRepAdaptor_Surface(ocFace, true);
|
|
220
|
+
const type = adaptor.GetType();
|
|
221
|
+
adaptor.delete();
|
|
222
|
+
if (type === oc.GeomAbs_SurfaceType.GeomAbs_Plane)
|
|
223
|
+
return "plane";
|
|
224
|
+
if (type === oc.GeomAbs_SurfaceType.GeomAbs_Cylinder)
|
|
225
|
+
return "cylinder";
|
|
226
|
+
if (type === oc.GeomAbs_SurfaceType.GeomAbs_Cone)
|
|
227
|
+
return "cone";
|
|
228
|
+
if (type === oc.GeomAbs_SurfaceType.GeomAbs_Sphere)
|
|
229
|
+
return "sphere";
|
|
230
|
+
if (type === oc.GeomAbs_SurfaceType.GeomAbs_Torus)
|
|
231
|
+
return "torus";
|
|
232
|
+
return "other";
|
|
233
|
+
}
|
|
234
|
+
static getSurfaceAdaptorPlaneRaw(face) {
|
|
235
|
+
const oc = getOC();
|
|
236
|
+
const ocFace = oc.TopoDS.Face(face);
|
|
237
|
+
const adaptor = new oc.BRepAdaptor_Surface(ocFace, true);
|
|
238
|
+
const plane = adaptor.Plane();
|
|
239
|
+
adaptor.delete();
|
|
240
|
+
return plane;
|
|
241
|
+
}
|
|
242
|
+
static getSurfaceAdaptorCylinderRaw(face) {
|
|
243
|
+
const oc = getOC();
|
|
244
|
+
const ocFace = oc.TopoDS.Face(face);
|
|
245
|
+
const adaptor = new oc.BRepAdaptor_Surface(ocFace, true);
|
|
246
|
+
const cylinder = adaptor.Cylinder();
|
|
247
|
+
adaptor.delete();
|
|
248
|
+
return cylinder;
|
|
249
|
+
}
|
|
250
|
+
static findFarthestCornerDistanceRaw(face, plane) {
|
|
251
|
+
const oc = getOC();
|
|
252
|
+
const bbox = new oc.Bnd_Box();
|
|
253
|
+
oc.BRepBndLib.Add(face, bbox, true);
|
|
254
|
+
const minPnt = bbox.CornerMin();
|
|
255
|
+
const maxPnt = bbox.CornerMax();
|
|
256
|
+
bbox.delete();
|
|
257
|
+
const corners = [
|
|
258
|
+
new oc.gp_Pnt(minPnt.X(), minPnt.Y(), minPnt.Z()),
|
|
259
|
+
new oc.gp_Pnt(maxPnt.X(), minPnt.Y(), minPnt.Z()),
|
|
260
|
+
new oc.gp_Pnt(minPnt.X(), maxPnt.Y(), minPnt.Z()),
|
|
261
|
+
new oc.gp_Pnt(minPnt.X(), minPnt.Y(), maxPnt.Z()),
|
|
262
|
+
new oc.gp_Pnt(maxPnt.X(), maxPnt.Y(), minPnt.Z()),
|
|
263
|
+
new oc.gp_Pnt(maxPnt.X(), minPnt.Y(), maxPnt.Z()),
|
|
264
|
+
new oc.gp_Pnt(minPnt.X(), maxPnt.Y(), maxPnt.Z()),
|
|
265
|
+
new oc.gp_Pnt(maxPnt.X(), maxPnt.Y(), maxPnt.Z())
|
|
266
|
+
];
|
|
267
|
+
const planeAxis = plane.Axis();
|
|
268
|
+
const planePoint = planeAxis.Location();
|
|
269
|
+
const planeNormal = planeAxis.Direction();
|
|
270
|
+
let maxDistance = 0;
|
|
271
|
+
for (const corner of corners) {
|
|
272
|
+
const vectorToPoint = new oc.gp_Vec(planePoint, corner);
|
|
273
|
+
const distance = vectorToPoint.Dot(new oc.gp_Vec(planeNormal));
|
|
274
|
+
if (!maxDistance || Math.abs(distance) > Math.abs(maxDistance)) {
|
|
275
|
+
maxDistance = distance;
|
|
276
|
+
}
|
|
277
|
+
vectorToPoint.delete();
|
|
278
|
+
corner.delete();
|
|
279
|
+
}
|
|
280
|
+
planeAxis.delete();
|
|
281
|
+
planePoint.delete();
|
|
282
|
+
planeNormal.delete();
|
|
283
|
+
return maxDistance;
|
|
284
|
+
}
|
|
285
|
+
static arePlanesParallelRaw(plane1, plane2) {
|
|
286
|
+
const oc = getOC();
|
|
287
|
+
const dir1 = plane1.Axis().Direction();
|
|
288
|
+
const dir2 = plane2.Axis().Direction();
|
|
289
|
+
const result = dir1.IsParallel(dir2, oc.Precision.Angular());
|
|
290
|
+
dir1.delete();
|
|
291
|
+
dir2.delete();
|
|
292
|
+
return result;
|
|
293
|
+
}
|
|
294
|
+
static findFaceByDistance(faces, plane, mode) {
|
|
295
|
+
const oc = getOC();
|
|
296
|
+
const tolerance = oc.Precision.Confusion();
|
|
297
|
+
let bestFace = null;
|
|
298
|
+
let bestDistance = mode === 'first' ? Infinity : -Infinity;
|
|
299
|
+
for (const face of faces) {
|
|
300
|
+
const distance = plane.distanceToPoint(face.center());
|
|
301
|
+
if (distance < tolerance) {
|
|
302
|
+
continue;
|
|
303
|
+
}
|
|
304
|
+
if (mode === 'first' ? distance < bestDistance : distance > bestDistance) {
|
|
305
|
+
bestDistance = distance;
|
|
306
|
+
bestFace = face;
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
return bestFace;
|
|
310
|
+
}
|
|
311
|
+
static getSignedPlaneDistanceRaw(startPlane, targetPlane) {
|
|
312
|
+
const startPlanePosition = startPlane.Location();
|
|
313
|
+
const targetPlanePosition = targetPlane.Location();
|
|
314
|
+
let normalizedStart = Convert.toVector3dFromGpPnt(startPlanePosition);
|
|
315
|
+
if (normalizedStart.length() === 0) {
|
|
316
|
+
const normal = startPlane.Axis().Direction();
|
|
317
|
+
normalizedStart = Convert.toVector3dFromGpDir(normal).normalize();
|
|
318
|
+
normal.delete();
|
|
319
|
+
}
|
|
320
|
+
else {
|
|
321
|
+
normalizedStart = normalizedStart.normalize();
|
|
322
|
+
}
|
|
323
|
+
let normalizedTarget = Convert.toVector3dFromGpPnt(targetPlanePosition);
|
|
324
|
+
if (normalizedTarget.length() === 0) {
|
|
325
|
+
const normal = targetPlane.Axis().Direction();
|
|
326
|
+
normalizedTarget = Convert.toVector3dFromGpDir(normal).normalize();
|
|
327
|
+
normal.delete();
|
|
328
|
+
}
|
|
329
|
+
else {
|
|
330
|
+
normalizedTarget = normalizedTarget.normalize();
|
|
331
|
+
}
|
|
332
|
+
const dot = normalizedStart.dot(normalizedTarget);
|
|
333
|
+
let distance = startPlane.Distance(targetPlane);
|
|
334
|
+
if (dot < 0) {
|
|
335
|
+
distance = -distance;
|
|
336
|
+
}
|
|
337
|
+
startPlanePosition.delete();
|
|
338
|
+
targetPlanePosition.delete();
|
|
339
|
+
return distance;
|
|
340
|
+
}
|
|
341
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { gp_Pln, TopoDS_Wire } from "occjs-wrapper";
|
|
2
|
+
import { Shape } from "../common/shape.js";
|
|
3
|
+
import { Edge } from "../common/edge.js";
|
|
4
|
+
import { Face } from "../common/face.js";
|
|
5
|
+
import { Wire } from "../common/wire.js";
|
|
6
|
+
import { Plane } from "../math/plane.js";
|
|
7
|
+
export declare class FilletOps {
|
|
8
|
+
static makeFillet(solid: Shape, edges: Edge[], radius: number): Shape;
|
|
9
|
+
static makeChamfer(solid: Shape, edges: Edge[], distance: number): Shape;
|
|
10
|
+
static makeChamferTwoDistances(solid: Shape, edges: Edge[], distance1: number, distance2: number, faces: Face[], isAngle?: boolean): Shape;
|
|
11
|
+
static fillet2d(shape: Wire | Edge, plane: Plane, radius: number): Wire;
|
|
12
|
+
static fillet2dRaw(wire: TopoDS_Wire, plane: gp_Pln, radius: number): TopoDS_Wire;
|
|
13
|
+
}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { getOC } from "./init.js";
|
|
2
|
+
import { Convert } from "./convert.js";
|
|
3
|
+
import { Wire } from "../common/wire.js";
|
|
4
|
+
import { ShapeFactory } from "../common/shape-factory.js";
|
|
5
|
+
import { WireOps } from "./wire-ops.js";
|
|
6
|
+
import { rad } from "../helpers/math-helpers.js";
|
|
7
|
+
export class FilletOps {
|
|
8
|
+
static makeFillet(solid, edges, radius) {
|
|
9
|
+
const oc = getOC();
|
|
10
|
+
const maker = new oc.BRepFilletAPI_MakeFillet(solid.getShape(), oc.ChFi3d_FilletShape.ChFi3d_Rational);
|
|
11
|
+
for (const edge of edges) {
|
|
12
|
+
maker.Add(radius, oc.TopoDS.Edge(edge.getShape()));
|
|
13
|
+
}
|
|
14
|
+
const progress = new oc.Message_ProgressRange();
|
|
15
|
+
maker.Build(progress);
|
|
16
|
+
progress.delete();
|
|
17
|
+
if (!maker.IsDone()) {
|
|
18
|
+
maker.delete();
|
|
19
|
+
throw new Error("Failed to create fillet.");
|
|
20
|
+
}
|
|
21
|
+
const result = maker.Shape();
|
|
22
|
+
maker.delete();
|
|
23
|
+
return ShapeFactory.fromShape(result);
|
|
24
|
+
}
|
|
25
|
+
static makeChamfer(solid, edges, distance) {
|
|
26
|
+
const oc = getOC();
|
|
27
|
+
const maker = new oc.BRepFilletAPI_MakeChamfer(solid.getShape());
|
|
28
|
+
for (const edge of edges) {
|
|
29
|
+
maker.Add(distance, oc.TopoDS.Edge(edge.getShape()));
|
|
30
|
+
}
|
|
31
|
+
const progress = new oc.Message_ProgressRange();
|
|
32
|
+
maker.Build(progress);
|
|
33
|
+
progress.delete();
|
|
34
|
+
if (!maker.IsDone()) {
|
|
35
|
+
maker.delete();
|
|
36
|
+
throw new Error("Failed to create chamfer.");
|
|
37
|
+
}
|
|
38
|
+
const result = maker.Shape();
|
|
39
|
+
maker.delete();
|
|
40
|
+
return ShapeFactory.fromShape(result);
|
|
41
|
+
}
|
|
42
|
+
static makeChamferTwoDistances(solid, edges, distance1, distance2, faces, isAngle = false) {
|
|
43
|
+
const oc = getOC();
|
|
44
|
+
const maker = new oc.BRepFilletAPI_MakeChamfer(solid.getShape());
|
|
45
|
+
for (let i = 0; i < edges.length; i++) {
|
|
46
|
+
const face = faces[i];
|
|
47
|
+
if (!face) {
|
|
48
|
+
throw new Error("Chamfer: Failed to find common face for chamfer.");
|
|
49
|
+
}
|
|
50
|
+
if (isAngle) {
|
|
51
|
+
maker.AddDA(distance1, rad(distance2), oc.TopoDS.Edge(edges[i].getShape()), oc.TopoDS.Face(face.getShape()));
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
maker.Add(distance1, distance2, oc.TopoDS.Edge(edges[i].getShape()), oc.TopoDS.Face(face.getShape()));
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
const progress = new oc.Message_ProgressRange();
|
|
58
|
+
maker.Build(progress);
|
|
59
|
+
progress.delete();
|
|
60
|
+
if (!maker.IsDone()) {
|
|
61
|
+
maker.delete();
|
|
62
|
+
throw new Error("Failed to create chamfer.");
|
|
63
|
+
}
|
|
64
|
+
const result = maker.Shape();
|
|
65
|
+
maker.delete();
|
|
66
|
+
return ShapeFactory.fromShape(result);
|
|
67
|
+
}
|
|
68
|
+
static fillet2d(shape, plane, radius) {
|
|
69
|
+
const wire = shape instanceof Wire ? shape : WireOps.makeWireFromEdges([shape]);
|
|
70
|
+
const [pln, disposePln] = Convert.toGpPln(plane);
|
|
71
|
+
const result = FilletOps.fillet2dRaw(wire.getShape(), pln, radius);
|
|
72
|
+
disposePln();
|
|
73
|
+
return Wire.fromTopoDSWire(result);
|
|
74
|
+
}
|
|
75
|
+
static fillet2dRaw(wire, plane, radius) {
|
|
76
|
+
const oc = getOC();
|
|
77
|
+
let currentWire = wire;
|
|
78
|
+
let cornerIndex = 0;
|
|
79
|
+
const isClosed = wire.Closed();
|
|
80
|
+
try {
|
|
81
|
+
while (true) {
|
|
82
|
+
const edges = [];
|
|
83
|
+
const explorer = new oc.BRepTools_WireExplorer(currentWire);
|
|
84
|
+
while (explorer.More()) {
|
|
85
|
+
edges.push(oc.TopoDS.Edge(explorer.Current()));
|
|
86
|
+
explorer.Next();
|
|
87
|
+
}
|
|
88
|
+
explorer.delete();
|
|
89
|
+
const maxCorners = isClosed ? edges.length : edges.length - 1;
|
|
90
|
+
if (cornerIndex >= maxCorners) {
|
|
91
|
+
edges.forEach(e => e.delete());
|
|
92
|
+
break;
|
|
93
|
+
}
|
|
94
|
+
const edge1 = edges[cornerIndex];
|
|
95
|
+
const edge2 = edges[(cornerIndex + 1) % edges.length];
|
|
96
|
+
const sharedVertex = oc.TopExp.LastVertex(edge1, false);
|
|
97
|
+
const sharedPoint = oc.BRep_Tool.Pnt(sharedVertex);
|
|
98
|
+
sharedVertex.delete();
|
|
99
|
+
const pairWireBuilder = new oc.BRepBuilderAPI_MakeWire(edge1, edge2);
|
|
100
|
+
const pairWire = pairWireBuilder.Wire();
|
|
101
|
+
const filletAPI = new oc.ChFi2d_FilletAPI(pairWire, plane);
|
|
102
|
+
const success = filletAPI.Perform(radius);
|
|
103
|
+
if (!success) {
|
|
104
|
+
filletAPI.delete();
|
|
105
|
+
pairWire.delete();
|
|
106
|
+
pairWireBuilder.delete();
|
|
107
|
+
edges.forEach(e => e.delete());
|
|
108
|
+
cornerIndex++;
|
|
109
|
+
continue;
|
|
110
|
+
}
|
|
111
|
+
const modEdge1 = new oc.TopoDS_Edge();
|
|
112
|
+
const modEdge2 = new oc.TopoDS_Edge();
|
|
113
|
+
const filletEdge = filletAPI.Result(sharedPoint, modEdge1, modEdge2, -1);
|
|
114
|
+
sharedPoint.delete();
|
|
115
|
+
filletAPI.delete();
|
|
116
|
+
pairWire.delete();
|
|
117
|
+
pairWireBuilder.delete();
|
|
118
|
+
const newWireBuilder = new oc.BRepBuilderAPI_MakeWire();
|
|
119
|
+
const nextIndex = (cornerIndex + 1) % edges.length;
|
|
120
|
+
for (let i = 0; i < edges.length; i++) {
|
|
121
|
+
if (i === cornerIndex) {
|
|
122
|
+
newWireBuilder.Add(modEdge1);
|
|
123
|
+
newWireBuilder.Add(filletEdge);
|
|
124
|
+
}
|
|
125
|
+
else if (i === nextIndex) {
|
|
126
|
+
newWireBuilder.Add(modEdge2);
|
|
127
|
+
}
|
|
128
|
+
else {
|
|
129
|
+
newWireBuilder.Add(edges[i]);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
const prevWire = currentWire;
|
|
133
|
+
currentWire = newWireBuilder.Wire();
|
|
134
|
+
newWireBuilder.delete();
|
|
135
|
+
if (prevWire !== wire) {
|
|
136
|
+
prevWire.delete();
|
|
137
|
+
}
|
|
138
|
+
modEdge1.delete();
|
|
139
|
+
modEdge2.delete();
|
|
140
|
+
filletEdge.delete();
|
|
141
|
+
edges.forEach(e => e.delete());
|
|
142
|
+
cornerIndex += 2;
|
|
143
|
+
}
|
|
144
|
+
return currentWire;
|
|
145
|
+
}
|
|
146
|
+
catch (e) {
|
|
147
|
+
if (currentWire !== wire) {
|
|
148
|
+
currentWire.delete();
|
|
149
|
+
}
|
|
150
|
+
throw e;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { Geom_BezierCurve, Geom_Circle, Geom_TrimmedCurve, TopoDS_Edge } from "occjs-wrapper";
|
|
2
|
+
import { Point, Point2D } from "../math/point.js";
|
|
3
|
+
import { Vector3d } from "../math/vector3d.js";
|
|
4
|
+
import { Edge } from "../common/edge.js";
|
|
5
|
+
export declare class Geometry {
|
|
6
|
+
static makeSegment(p1: Point, p2: Point): Geom_TrimmedCurve;
|
|
7
|
+
static makeArcThreePoints(start: Point, end: Point, p3: Point): Geom_TrimmedCurve;
|
|
8
|
+
static makeArc(center: Point, radius: number, normal: Vector3d, start: Point, end: Point): Geom_TrimmedCurve;
|
|
9
|
+
static makeArcFromAngle(center: Point, radius: number, normal: Vector3d, start: Point, angle: number): Geom_TrimmedCurve;
|
|
10
|
+
static makeArcFromTangent(start: Point, end: Point, tangent: Vector3d): Geom_TrimmedCurve;
|
|
11
|
+
static makeCircle(center: Point, radius: number, normal: Vector3d): Geom_Circle;
|
|
12
|
+
static makeBezierCurve(poles: Point[]): Geom_BezierCurve;
|
|
13
|
+
static makeEdgeFromBezier(curve: Geom_BezierCurve): Edge;
|
|
14
|
+
static makeEdge(geometry: Geom_TrimmedCurve): Edge;
|
|
15
|
+
static makeEdgeFromCurve(curve: Geom_TrimmedCurve): Edge;
|
|
16
|
+
static makeEdgeFromCircle(circle: Geom_Circle): Edge;
|
|
17
|
+
static makeEdgeRaw(geometry: Geom_TrimmedCurve): TopoDS_Edge;
|
|
18
|
+
static makeEdgeFromCurveRaw(curve: Geom_TrimmedCurve): TopoDS_Edge;
|
|
19
|
+
static makeEdgeFromCircleRaw(circle: Geom_Circle): TopoDS_Edge;
|
|
20
|
+
static getPointOnCircle(center: Point2D, radius: number, angle: number): Point2D;
|
|
21
|
+
static getCircleCenter(point: Point2D, radius: number, angle: number): Point2D;
|
|
22
|
+
}
|