@faicad/faijs 0.16.0 → 0.17.0
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 +4 -5
- package/NOTICE +5 -6
- package/dist/api/api-namespace.d.ts.map +1 -1
- package/dist/api/api-namespace.js +19 -1
- package/dist/api/api-namespace.js.map +1 -1
- package/dist/api/assembly/entities.d.ts +1 -1
- package/dist/api/assembly/entities.d.ts.map +1 -1
- package/dist/api/assembly/entities.js.map +1 -1
- package/dist/api/assembly/joints.d.ts +2 -2
- package/dist/api/assembly/joints.d.ts.map +1 -1
- package/dist/api/assembly/joints.js +2 -2
- package/dist/api/assembly/joints.js.map +1 -1
- package/dist/api/assembly/lower.d.ts +1 -1
- package/dist/api/assembly/lower.d.ts.map +1 -1
- package/dist/api/assembly/lower.js.map +1 -1
- package/dist/api/assembly/pose.d.ts +3 -3
- package/dist/api/assembly/pose.d.ts.map +1 -1
- package/dist/api/assembly/pose.js +1 -1
- package/dist/api/assembly/pose.js.map +1 -1
- package/dist/api/assembly/preview.d.ts +1 -1
- package/dist/api/assembly/preview.d.ts.map +1 -1
- package/dist/api/assembly/preview.js +1 -1
- package/dist/api/assembly/preview.js.map +1 -1
- package/dist/api/assembly/solve.d.ts.map +1 -1
- package/dist/api/assembly/solve.js +3 -3
- package/dist/api/assembly/solve.js.map +1 -1
- package/dist/api/assembly/solvers/assembly-tree.d.ts +98 -0
- package/dist/api/assembly/solvers/assembly-tree.d.ts.map +1 -0
- package/dist/api/assembly/solvers/assembly-tree.js +130 -0
- package/dist/api/assembly/solvers/assembly-tree.js.map +1 -0
- package/dist/api/assembly/solvers/chain-solver.d.ts +27 -0
- package/dist/api/assembly/solvers/chain-solver.d.ts.map +1 -0
- package/dist/api/assembly/solvers/chain-solver.js +330 -0
- package/dist/api/assembly/solvers/chain-solver.js.map +1 -0
- package/dist/api/assembly/solvers/global-solver.js +2 -2
- package/dist/api/assembly/solvers/global-solver.js.map +1 -1
- package/dist/api/assembly/solvers/joints-kinematics.d.ts +308 -0
- package/dist/api/assembly/solvers/joints-kinematics.d.ts.map +1 -0
- package/dist/api/assembly/solvers/joints-kinematics.js +643 -0
- package/dist/api/assembly/solvers/joints-kinematics.js.map +1 -0
- package/dist/api/assembly/solvers/quat.d.ts +35 -0
- package/dist/api/assembly/solvers/quat.d.ts.map +1 -0
- package/dist/api/assembly/solvers/quat.js +84 -0
- package/dist/api/assembly/solvers/quat.js.map +1 -0
- package/dist/api/assembly/solvers/types.d.ts +33 -0
- package/dist/api/assembly/solvers/types.d.ts.map +1 -1
- package/dist/api/assembly/solvers/types.js.map +1 -1
- package/dist/api/boolean.d.ts.map +1 -1
- package/dist/api/boolean.js +3 -4
- package/dist/api/boolean.js.map +1 -1
- package/dist/api/brep-mirror/booleanFns.d.ts +40 -0
- package/dist/api/brep-mirror/booleanFns.d.ts.map +1 -0
- package/dist/api/brep-mirror/booleanFns.js +99 -0
- package/dist/api/brep-mirror/booleanFns.js.map +1 -0
- package/dist/api/brep-mirror/brepHelpers.d.ts +55 -0
- package/dist/api/brep-mirror/brepHelpers.d.ts.map +1 -0
- package/dist/api/brep-mirror/brepHelpers.js +131 -0
- package/dist/api/brep-mirror/brepHelpers.js.map +1 -0
- package/dist/api/brep-mirror/compoundFns.d.ts +47 -0
- package/dist/api/brep-mirror/compoundFns.d.ts.map +1 -0
- package/dist/api/brep-mirror/compoundFns.js +300 -0
- package/dist/api/brep-mirror/compoundFns.js.map +1 -0
- package/dist/api/brep-mirror/healingFns.d.ts +78 -0
- package/dist/api/brep-mirror/healingFns.d.ts.map +1 -0
- package/dist/api/brep-mirror/healingFns.js +294 -0
- package/dist/api/brep-mirror/healingFns.js.map +1 -0
- package/dist/api/brep-mirror/hullFns.d.ts +20 -0
- package/dist/api/brep-mirror/hullFns.d.ts.map +1 -0
- package/dist/api/brep-mirror/hullFns.js +46 -0
- package/dist/api/brep-mirror/hullFns.js.map +1 -0
- package/dist/api/brep-mirror/patternFns.d.ts +43 -0
- package/dist/api/brep-mirror/patternFns.d.ts.map +1 -0
- package/dist/api/brep-mirror/patternFns.js +178 -0
- package/dist/api/brep-mirror/patternFns.js.map +1 -0
- package/dist/api/brep-mirror/primitiveFns.d.ts +42 -0
- package/dist/api/brep-mirror/primitiveFns.d.ts.map +1 -0
- package/dist/api/brep-mirror/primitiveFns.js +104 -0
- package/dist/api/brep-mirror/primitiveFns.js.map +1 -0
- package/dist/api/brep-mirror/roofFns.d.ts +24 -0
- package/dist/api/brep-mirror/roofFns.d.ts.map +1 -0
- package/dist/api/brep-mirror/roofFns.js +229 -0
- package/dist/api/brep-mirror/roofFns.js.map +1 -0
- package/dist/api/brep-mirror/straightSkeleton.d.ts +36 -0
- package/dist/api/brep-mirror/straightSkeleton.d.ts.map +1 -0
- package/dist/api/brep-mirror/straightSkeleton.js +443 -0
- package/dist/api/brep-mirror/straightSkeleton.js.map +1 -0
- package/dist/api/brep-mirror/sweepFns.d.ts +55 -0
- package/dist/api/brep-mirror/sweepFns.d.ts.map +1 -0
- package/dist/api/brep-mirror/sweepFns.js +200 -0
- package/dist/api/brep-mirror/sweepFns.js.map +1 -0
- package/dist/api/brep-mirror/threadFns.d.ts +15 -0
- package/dist/api/brep-mirror/threadFns.d.ts.map +1 -1
- package/dist/api/brep-mirror/threadFns.js +37 -2
- package/dist/api/brep-mirror/threadFns.js.map +1 -1
- package/dist/api/brep-mirror/topologyFns.d.ts +74 -0
- package/dist/api/brep-mirror/topologyFns.d.ts.map +1 -0
- package/dist/api/brep-mirror/topologyFns.js +273 -0
- package/dist/api/brep-mirror/topologyFns.js.map +1 -0
- package/dist/api/brep-topology.d.ts +190 -0
- package/dist/api/brep-topology.d.ts.map +1 -0
- package/dist/api/brep-topology.js +337 -0
- package/dist/api/brep-topology.js.map +1 -0
- package/dist/api/brepjs-compat/constants.d.ts +11 -0
- package/dist/api/brepjs-compat/constants.d.ts.map +1 -0
- package/dist/api/brepjs-compat/constants.js +11 -0
- package/dist/api/brepjs-compat/constants.js.map +1 -0
- package/dist/api/brepjs-compat/index.d.ts +19 -232
- package/dist/api/brepjs-compat/index.d.ts.map +1 -1
- package/dist/api/brepjs-compat/index.js +19 -286
- package/dist/api/brepjs-compat/index.js.map +1 -1
- package/dist/api/brepjs-compat/planeOps.d.ts +98 -0
- package/dist/api/brepjs-compat/planeOps.d.ts.map +1 -0
- package/dist/api/brepjs-compat/planeOps.js +170 -0
- package/dist/api/brepjs-compat/planeOps.js.map +1 -0
- package/dist/api/brepjs-compat/planeTypes.d.ts +24 -0
- package/dist/api/brepjs-compat/planeTypes.d.ts.map +1 -0
- package/dist/api/brepjs-compat/planeTypes.js +8 -0
- package/dist/api/brepjs-compat/planeTypes.js.map +1 -0
- package/dist/api/brepjs-compat/types.d.ts +64 -0
- package/dist/api/brepjs-compat/types.d.ts.map +1 -0
- package/dist/api/brepjs-compat/types.js +48 -0
- package/dist/api/brepjs-compat/types.js.map +1 -0
- package/dist/api/brepjs-compat/vecOps.d.ts +124 -0
- package/dist/api/brepjs-compat/vecOps.d.ts.map +1 -0
- package/dist/api/brepjs-compat/vecOps.js +202 -0
- package/dist/api/brepjs-compat/vecOps.js.map +1 -0
- package/dist/api/chamfer.d.ts +5 -0
- package/dist/api/chamfer.d.ts.map +1 -1
- package/dist/api/chamfer.js +13 -8
- package/dist/api/chamfer.js.map +1 -1
- package/dist/api/compound-geom.d.ts.map +1 -1
- package/dist/api/compound-geom.js +8 -2
- package/dist/api/compound-geom.js.map +1 -1
- package/dist/api/draft.d.ts +69 -0
- package/dist/api/draft.d.ts.map +1 -0
- package/dist/api/draft.js +109 -0
- package/dist/api/draft.js.map +1 -0
- package/dist/api/edge-ref.d.ts.map +1 -1
- package/dist/api/edge-ref.js +2 -2
- package/dist/api/edge-ref.js.map +1 -1
- package/dist/api/engrave.d.ts.map +1 -1
- package/dist/api/engrave.js +2 -3
- package/dist/api/engrave.js.map +1 -1
- package/dist/api/extrude.d.ts.map +1 -1
- package/dist/api/extrude.js +28 -13
- package/dist/api/extrude.js.map +1 -1
- package/dist/api/face-ref.d.ts.map +1 -1
- package/dist/api/face-ref.js +2 -2
- package/dist/api/face-ref.js.map +1 -1
- package/dist/api/feature-repair.d.ts +137 -0
- package/dist/api/feature-repair.d.ts.map +1 -0
- package/dist/api/feature-repair.js +221 -0
- package/dist/api/feature-repair.js.map +1 -0
- package/dist/api/fillet-variable.d.ts +35 -0
- package/dist/api/fillet-variable.d.ts.map +1 -0
- package/dist/api/fillet-variable.js +71 -0
- package/dist/api/fillet-variable.js.map +1 -0
- package/dist/api/fillet.d.ts +3 -0
- package/dist/api/fillet.d.ts.map +1 -1
- package/dist/api/fillet.js +7 -4
- package/dist/api/fillet.js.map +1 -1
- package/dist/api/generated/2d.d.ts +1 -13
- package/dist/api/generated/2d.d.ts.map +1 -1
- package/dist/api/generated/2d.js +6 -1
- package/dist/api/generated/2d.js.map +1 -1
- package/dist/api/generated/brepjs/index.d.ts +298 -298
- package/dist/api/generated/brepjs/index.d.ts.map +1 -1
- package/dist/api/generated/brepjs/index.js +183 -183
- package/dist/api/generated/brepjs/index.js.map +1 -1
- package/dist/api/generated/core.d.ts +3 -123
- package/dist/api/generated/core.d.ts.map +1 -1
- package/dist/api/generated/core.js +2 -81
- package/dist/api/generated/core.js.map +1 -1
- package/dist/api/generated/gear.d.ts +1 -15
- package/dist/api/generated/gear.d.ts.map +1 -1
- package/dist/api/generated/gear.js +6 -3
- package/dist/api/generated/gear.js.map +1 -1
- package/dist/api/generated/io.d.ts +1 -13
- package/dist/api/generated/io.d.ts.map +1 -1
- package/dist/api/generated/io.js +6 -1
- package/dist/api/generated/io.js.map +1 -1
- package/dist/api/generated/kernel.d.ts +1 -39
- package/dist/api/generated/kernel.d.ts.map +1 -1
- package/dist/api/generated/kernel.js +6 -4
- package/dist/api/generated/kernel.js.map +1 -1
- package/dist/api/generated/measurement.d.ts +53 -97
- package/dist/api/generated/measurement.d.ts.map +1 -1
- package/dist/api/generated/measurement.js +48 -143
- package/dist/api/generated/measurement.js.map +1 -1
- package/dist/api/generated/ns.d.ts +1 -10
- package/dist/api/generated/ns.d.ts.map +1 -1
- package/dist/api/generated/ns.js +2 -10
- package/dist/api/generated/ns.js.map +1 -1
- package/dist/api/generated/operations.d.ts +65 -110
- package/dist/api/generated/operations.d.ts.map +1 -1
- package/dist/api/generated/operations.js +132 -80
- package/dist/api/generated/operations.js.map +1 -1
- package/dist/api/generated/projection.d.ts +1 -8
- package/dist/api/generated/projection.d.ts.map +1 -1
- package/dist/api/generated/projection.js +6 -4
- package/dist/api/generated/projection.js.map +1 -1
- package/dist/api/generated/query.d.ts +1 -9
- package/dist/api/generated/query.d.ts.map +1 -1
- package/dist/api/generated/query.js +6 -1
- package/dist/api/generated/query.js.map +1 -1
- package/dist/api/generated/script-face-manifest.d.ts +2 -0
- package/dist/api/generated/script-face-manifest.d.ts.map +1 -1
- package/dist/api/generated/script-face-manifest.js +34 -22
- package/dist/api/generated/script-face-manifest.js.map +1 -1
- package/dist/api/generated/script-face.d.ts +52 -27
- package/dist/api/generated/script-face.d.ts.map +1 -1
- package/dist/api/generated/script-face.js +18 -4
- package/dist/api/generated/script-face.js.map +1 -1
- package/dist/api/generated/sketching.d.ts +4 -7
- package/dist/api/generated/sketching.d.ts.map +1 -1
- package/dist/api/generated/sketching.js +10 -8
- package/dist/api/generated/sketching.js.map +1 -1
- package/dist/api/generated/text.d.ts +1 -6
- package/dist/api/generated/text.d.ts.map +1 -1
- package/dist/api/generated/text.js +6 -3
- package/dist/api/generated/text.js.map +1 -1
- package/dist/api/generated/topology.d.ts +77 -175
- package/dist/api/generated/topology.d.ts.map +1 -1
- package/dist/api/generated/topology.js +172 -131
- package/dist/api/generated/topology.js.map +1 -1
- package/dist/api/geom.d.ts.map +1 -1
- package/dist/api/geom.js +2 -2
- package/dist/api/geom.js.map +1 -1
- package/dist/api/helix.d.ts +51 -0
- package/dist/api/helix.d.ts.map +1 -0
- package/dist/api/helix.js +63 -0
- package/dist/api/helix.js.map +1 -0
- package/dist/api/import-step.d.ts.map +1 -1
- package/dist/api/import-step.js +6 -2
- package/dist/api/import-step.js.map +1 -1
- package/dist/api/index.d.ts +18 -5
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/index.js +29 -12
- package/dist/api/index.js.map +1 -1
- package/dist/api/internal/compat-op.d.ts +10 -0
- package/dist/api/internal/compat-op.d.ts.map +1 -1
- package/dist/api/internal/compat-op.js +9 -3
- package/dist/api/internal/compat-op.js.map +1 -1
- package/dist/api/internal/compat-projection.d.ts +4 -4
- package/dist/api/internal/compat-projection.js +7 -7
- package/dist/api/internal/compat-projection.js.map +1 -1
- package/dist/api/internal/l3-bridge.d.ts +75 -42
- package/dist/api/internal/l3-bridge.d.ts.map +1 -1
- package/dist/api/internal/l3-bridge.js +105 -50
- package/dist/api/internal/l3-bridge.js.map +1 -1
- package/dist/api/internal/profile-wire.d.ts +31 -0
- package/dist/api/internal/profile-wire.d.ts.map +1 -0
- package/dist/api/internal/profile-wire.js +37 -0
- package/dist/api/internal/profile-wire.js.map +1 -0
- package/dist/api/internal/replica-role-table.js +2 -2
- package/dist/api/internal/replica-role-table.js.map +1 -1
- package/dist/api/loft.d.ts +66 -0
- package/dist/api/loft.d.ts.map +1 -0
- package/dist/api/loft.js +111 -0
- package/dist/api/loft.js.map +1 -0
- package/dist/api/measurement/index.d.ts +51 -0
- package/dist/api/measurement/index.d.ts.map +1 -0
- package/dist/api/measurement/index.js +71 -0
- package/dist/api/measurement/index.js.map +1 -0
- package/dist/api/occt-kernel-bridge.d.ts +5 -8
- package/dist/api/occt-kernel-bridge.d.ts.map +1 -1
- package/dist/api/occt-kernel-bridge.js +18 -14
- package/dist/api/occt-kernel-bridge.js.map +1 -1
- package/dist/api/pattern.d.ts.map +1 -1
- package/dist/api/pattern.js +3 -4
- package/dist/api/pattern.js.map +1 -1
- package/dist/api/place.d.ts.map +1 -1
- package/dist/api/place.js +2 -4
- package/dist/api/place.js.map +1 -1
- package/dist/api/primitives.d.ts.map +1 -1
- package/dist/api/primitives.js +3 -4
- package/dist/api/primitives.js.map +1 -1
- package/dist/api/replicate.d.ts +28 -1
- package/dist/api/replicate.d.ts.map +1 -1
- package/dist/api/replicate.js +29 -19
- package/dist/api/replicate.js.map +1 -1
- package/dist/api/result.d.ts +6 -11
- package/dist/api/result.d.ts.map +1 -1
- package/dist/api/result.js +6 -11
- package/dist/api/result.js.map +1 -1
- package/dist/api/revolve.d.ts.map +1 -1
- package/dist/api/revolve.js +15 -14
- package/dist/api/revolve.js.map +1 -1
- package/dist/api/screw.d.ts +3 -0
- package/dist/api/screw.d.ts.map +1 -1
- package/dist/api/screw.js +9 -4
- package/dist/api/screw.js.map +1 -1
- package/dist/api/sdf.d.ts +1 -1
- package/dist/api/section-by-plane.d.ts +42 -0
- package/dist/api/section-by-plane.d.ts.map +1 -0
- package/dist/api/section-by-plane.js +61 -0
- package/dist/api/section-by-plane.js.map +1 -0
- package/dist/api/shell.d.ts +45 -0
- package/dist/api/shell.d.ts.map +1 -0
- package/dist/api/shell.js +73 -0
- package/dist/api/shell.js.map +1 -0
- package/dist/api/sketch.d.ts +8 -1
- package/dist/api/sketch.d.ts.map +1 -1
- package/dist/api/sketch.js +12 -7
- package/dist/api/sketch.js.map +1 -1
- package/dist/api/split-by-plane.d.ts +41 -0
- package/dist/api/split-by-plane.d.ts.map +1 -0
- package/dist/api/split-by-plane.js +60 -0
- package/dist/api/split-by-plane.js.map +1 -0
- package/dist/api/split.d.ts +6 -1
- package/dist/api/split.d.ts.map +1 -1
- package/dist/api/split.js +23 -9
- package/dist/api/split.js.map +1 -1
- package/dist/api/surface/arg-spec.d.ts +22 -0
- package/dist/api/surface/arg-spec.d.ts.map +1 -1
- package/dist/api/surface/arg-spec.js +723 -476
- package/dist/api/surface/arg-spec.js.map +1 -1
- package/dist/api/sweep.d.ts +55 -0
- package/dist/api/sweep.d.ts.map +1 -0
- package/dist/api/sweep.js +86 -0
- package/dist/api/sweep.js.map +1 -0
- package/dist/api/thicken.d.ts +36 -0
- package/dist/api/thicken.d.ts.map +1 -0
- package/dist/api/thicken.js +55 -0
- package/dist/api/thicken.js.map +1 -0
- package/dist/api/transform.d.ts +8 -0
- package/dist/api/transform.d.ts.map +1 -1
- package/dist/api/transform.js +15 -4
- package/dist/api/transform.js.map +1 -1
- package/dist/api/view/cameraFns.d.ts +48 -0
- package/dist/api/view/cameraFns.d.ts.map +1 -0
- package/dist/api/view/cameraFns.js +75 -0
- package/dist/api/view/cameraFns.js.map +1 -0
- package/dist/api/view/projectionPlanes.d.ts +25 -0
- package/dist/api/view/projectionPlanes.d.ts.map +1 -0
- package/dist/api/view/projectionPlanes.js +30 -0
- package/dist/api/view/projectionPlanes.js.map +1 -0
- package/dist/api/view/view-camera.d.ts +2 -2
- package/dist/api/view/view-camera.d.ts.map +1 -1
- package/dist/api/view/view-camera.js +3 -3
- package/dist/api/view/view-camera.js.map +1 -1
- package/dist/api/view/view-projection.d.ts +9 -6
- package/dist/api/view/view-projection.d.ts.map +1 -1
- package/dist/api/view/view-projection.js +132 -65
- package/dist/api/view/view-projection.js.map +1 -1
- package/dist/api/wire.d.ts +45 -0
- package/dist/api/wire.d.ts.map +1 -0
- package/dist/api/wire.js +96 -0
- package/dist/api/wire.js.map +1 -0
- package/dist/boolean/creased-normals.d.ts +50 -0
- package/dist/boolean/creased-normals.d.ts.map +1 -0
- package/dist/boolean/creased-normals.js +114 -0
- package/dist/boolean/creased-normals.js.map +1 -0
- package/dist/boolean/deriveNormals.d.ts +4 -1
- package/dist/boolean/deriveNormals.d.ts.map +1 -1
- package/dist/boolean/deriveNormals.js +5 -2
- package/dist/boolean/deriveNormals.js.map +1 -1
- package/dist/brep/brep-ops.d.ts +6 -0
- package/dist/brep/brep-ops.d.ts.map +1 -1
- package/dist/brep/brep-ops.js +11 -2
- package/dist/brep/brep-ops.js.map +1 -1
- package/dist/brep/brep-topology.d.ts +4 -0
- package/dist/brep/brep-topology.d.ts.map +1 -1
- package/dist/brep/brep-topology.js +4 -0
- package/dist/brep/brep-topology.js.map +1 -1
- package/dist/brep/engine/adapters/brep-mock.d.ts.map +1 -1
- package/dist/brep/engine/adapters/brep-mock.js +79 -59
- package/dist/brep/engine/adapters/brep-mock.js.map +1 -1
- package/dist/brep/engine/adapters/brepkit.d.ts.map +1 -1
- package/dist/brep/engine/adapters/brepkit.js +7 -1
- package/dist/brep/engine/adapters/brepkit.js.map +1 -1
- package/dist/brep/engine/adapters/occt.d.ts +15 -7
- package/dist/brep/engine/adapters/occt.d.ts.map +1 -1
- package/dist/brep/engine/adapters/occt.js +52 -167
- package/dist/brep/engine/adapters/occt.js.map +1 -1
- package/dist/brep/engine/primitives.d.ts +93 -130
- package/dist/brep/engine/primitives.d.ts.map +1 -1
- package/dist/brep/engine/primitives.js +9 -7
- package/dist/brep/engine/primitives.js.map +1 -1
- package/dist/brep/engine/types.d.ts +14 -1
- package/dist/brep/engine/types.d.ts.map +1 -1
- package/dist/brep/engine/types.js +11 -1
- package/dist/brep/engine/types.js.map +1 -1
- package/dist/brep/export/step.d.ts +3 -0
- package/dist/brep/export/step.d.ts.map +1 -1
- package/dist/brep/export/step.js +7 -1
- package/dist/brep/export/step.js.map +1 -1
- package/dist/brep/face-evolution.d.ts +8 -0
- package/dist/brep/face-evolution.d.ts.map +1 -1
- package/dist/brep/face-evolution.js +15 -3
- package/dist/brep/face-evolution.js.map +1 -1
- package/dist/brep/handle-bridge.d.ts +20 -2
- package/dist/brep/handle-bridge.d.ts.map +1 -1
- package/dist/brep/handle-bridge.js +25 -2
- package/dist/brep/handle-bridge.js.map +1 -1
- package/dist/brepkit-kernel/brepkitKernel.d.ts +25 -5
- package/dist/brepkit-kernel/brepkitKernel.d.ts.map +1 -1
- package/dist/brepkit-kernel/brepkitKernel.js +336 -144
- package/dist/brepkit-kernel/brepkitKernel.js.map +1 -1
- package/dist/cad-runtime/admit-compat-lib.d.ts +6 -1
- package/dist/cad-runtime/admit-compat-lib.d.ts.map +1 -1
- package/dist/cad-runtime/admit-compat-lib.js +5 -1
- package/dist/cad-runtime/admit-compat-lib.js.map +1 -1
- package/dist/cad-runtime/backend-dispatch.d.ts +9 -3
- package/dist/cad-runtime/backend-dispatch.d.ts.map +1 -1
- package/dist/cad-runtime/backend-dispatch.js +32 -2
- package/dist/cad-runtime/backend-dispatch.js.map +1 -1
- package/dist/cad-runtime/direct-executor.d.ts.map +1 -1
- package/dist/cad-runtime/direct-executor.js +8 -2
- package/dist/cad-runtime/direct-executor.js.map +1 -1
- package/dist/cad-runtime/runtime.d.ts +3 -0
- package/dist/cad-runtime/runtime.d.ts.map +1 -1
- package/dist/cad-runtime/runtime.js +3 -1
- package/dist/cad-runtime/runtime.js.map +1 -1
- package/dist/define-op.d.ts +18 -2
- package/dist/define-op.d.ts.map +1 -1
- package/dist/define-op.js +29 -1
- package/dist/define-op.js.map +1 -1
- package/dist/env-agnostic.d.ts +3 -0
- package/dist/env-agnostic.d.ts.map +1 -1
- package/dist/env-agnostic.js +7 -0
- package/dist/env-agnostic.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -4
- package/dist/index.js.map +1 -1
- package/dist/lang/symbol-table.generated.d.ts +28 -0
- package/dist/lang/symbol-table.generated.d.ts.map +1 -1
- package/dist/lang/symbol-table.generated.js +29 -1
- package/dist/lang/symbol-table.generated.js.map +1 -1
- package/dist/occt-kernel/highLevelApi.d.ts.map +1 -1
- package/dist/occt-kernel/highLevelApi.js +6 -3
- package/dist/occt-kernel/highLevelApi.js.map +1 -1
- package/dist/occt-kernel/hullGeometry.d.ts +31 -0
- package/dist/occt-kernel/hullGeometry.d.ts.map +1 -0
- package/dist/occt-kernel/hullGeometry.js +319 -0
- package/dist/occt-kernel/hullGeometry.js.map +1 -0
- package/dist/occt-kernel/hullOps.d.ts +24 -0
- package/dist/occt-kernel/hullOps.d.ts.map +1 -0
- package/dist/occt-kernel/hullOps.js +52 -0
- package/dist/occt-kernel/hullOps.js.map +1 -0
- package/dist/occt-kernel/occt-primitives.d.ts +14 -0
- package/dist/occt-kernel/occt-primitives.d.ts.map +1 -0
- package/dist/occt-kernel/occt-primitives.js +351 -0
- package/dist/occt-kernel/occt-primitives.js.map +1 -0
- package/dist/occt-kernel/occtKernel.d.ts +14 -6
- package/dist/occt-kernel/occtKernel.d.ts.map +1 -1
- package/dist/occt-kernel/occtKernel.js +11 -3
- package/dist/occt-kernel/occtKernel.js.map +1 -1
- package/dist/occt-kernel/topologyExt.js +2 -2
- package/dist/occt-kernel/topologyExt.js.map +1 -1
- package/dist/primitives/brep-primitives.d.ts +4 -0
- package/dist/primitives/brep-primitives.d.ts.map +1 -1
- package/dist/primitives/brep-primitives.js +4 -0
- package/dist/primitives/brep-primitives.js.map +1 -1
- package/dist/result/bug.d.ts +22 -0
- package/dist/result/bug.d.ts.map +1 -0
- package/dist/result/bug.js +28 -0
- package/dist/result/bug.js.map +1 -0
- package/dist/result/errors.d.ts +270 -0
- package/dist/result/errors.d.ts.map +1 -0
- package/dist/result/errors.js +317 -0
- package/dist/result/errors.js.map +1 -0
- package/dist/result/kernelErrorTranslation.d.ts +21 -0
- package/dist/result/kernelErrorTranslation.d.ts.map +1 -0
- package/dist/result/kernelErrorTranslation.js +102 -0
- package/dist/result/kernelErrorTranslation.js.map +1 -0
- package/dist/result/result.d.ts +213 -0
- package/dist/result/result.d.ts.map +1 -0
- package/dist/result/result.js +336 -0
- package/dist/result/result.js.map +1 -0
- package/dist/result/vec3.d.ts +12 -0
- package/dist/result/vec3.d.ts.map +1 -0
- package/dist/result/vec3.js +14 -0
- package/dist/result/vec3.js.map +1 -0
- package/dist/runtime-state.d.ts +9 -0
- package/dist/runtime-state.d.ts.map +1 -1
- package/dist/runtime-state.js.map +1 -1
- package/dist/sdk.d.ts +3 -1
- package/dist/sdk.d.ts.map +1 -1
- package/dist/sdk.js +2 -1
- package/dist/sdk.js.map +1 -1
- package/dist/shape.d.ts +43 -1
- package/dist/shape.d.ts.map +1 -1
- package/dist/shape.js +57 -1
- package/dist/shape.js.map +1 -1
- package/dist/topology/naming/geom-hint.js +1 -1
- package/dist/topology/naming/geom-hint.js.map +1 -1
- package/dist/topology/naming/score.js +1 -1
- package/dist/topology/naming/score.js.map +1 -1
- package/package.json +6 -16
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"booleanFns.js","sourceRoot":"","sources":["../../../src/api/brep-mirror/booleanFns.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAA;AAC5D,OAAO,EAAE,EAAE,EAAE,GAAG,EAAe,MAAM,qBAAqB,CAAA;AAC1D,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAElE,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAExD,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAE5C,MAAM,cAAc,GAAG,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,EAAE,SAAS,EAAE,GAAgB,EAAE,CAAA;AAEnG;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,WAAW,CAAC,GAAG,IAAe;IAC5C,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,WAAW,CAAC,IAAI,EAAE,cAAc,CAAC,CAAA;IACxD,MAAM,MAAM,GAAG,UAAU,EAAE,CAAA;IAC3B,MAAM,CAAC,GAAG,YAAY,CAAC,KAAK,CAAC,CAAA;IAC7B,IAAI,aAAa,EAAE,CAAC,MAAM,CAAC,CAAU,CAAC,EAAE,CAAC;QACvC,OAAO,GAAG,CAAC,eAAe,CAAC,kBAAkB,EAAE,gCAAgC,CAAC,CAAC,CAAA;IACnF,CAAC;IACD,MAAM,QAAQ,GAAG,YAAY,CAAC,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;IACrD,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,aAAa,EAAE,CAAC,KAAK,CAAC,CAAU,EAAE,WAAoB,CAAC,CAAA;QACtE,OAAO,EAAE,CAAC,MAA+B,CAAC,CAAA;IAC5C,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,MAAM,GAAG,GAAG,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;QACtD,OAAO,GAAG,CACR,WAAW,CACT,cAAc,EACd,6BAA6B,KAAK,CAAC,MAAM,aAAa,GAAG,EAAE,EAC3D,CAAC,EACD,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,KAAK,CAAC,MAAM,EAAE,CAChD,CACF,CAAA;IACH,CAAC;AACH,CAAC","sourcesContent":["/**\n * Self-hosted compat-op implementations — boolean / section\n * (core-decouple Phase 3, §5.4).\n *\n * @platform occt\n *\n * Brep-shaped implementation for `section`. Semantics mirror vendored\n * `topology/booleanFns.ts` `section` (NULL_SHAPE_INPUT guard, plane resolution\n * from PlaneInput, kernel section via a planar tool, compound result) using the\n * L1 `sectionByPlane` (occt-wasm `BRepAlgoAPI_Section` + edge/wire downcast).\n */\n\nimport type { BrepHandle } from '../../brep/engine/types'\nimport { getBrepApi } from '../../brep/handle-bridge'\nimport { getOcctKernel } from '../../occt-kernel/occtKernel'\nimport { ok, err, type Result } from '../../result/result'\nimport { kernelError, validationError } from '../../result/errors'\nimport type { FormClass } from '../internal/dual-form-args'\nimport { resolveArgs } from '../internal/dual-form-args'\nimport type { PlaneInput } from '../brepjs-compat/planeTypes'\nimport { resolvePlane } from '../brepjs-compat/planeOps'\nimport { brepHandleOf } from './brepHelpers'\n\nconst SECTION_PARAMS = { name: 'section', params: ['shape', 'plane'], formClass: 'A' as FormClass }\n\n/**\n * Section a shape with a plane (vendored `section(shape, plane, options?)`).\n *\n * The plane is resolved from `PlaneInput` (named plane or explicit Plane); the\n * L1 `sectionByPlane` builds the planar tool, runs `BRepAlgoAPI_Section`, and\n * downcasts the result compound to edge/wire handles, which are re-combined\n * into a compound to match the vendored product shape. `options` (approximation\n * / planeSize) is accepted for signature compatibility; the occt native\n * section uses its default approximation.\n *\n * @param args - Resolved arguments (shape, plane).\n * @returns The section result compound as a `BrepHandle`.\n */\nexport function sectionBrep(...args: unknown[]): Result<BrepHandle> {\n const [shape, plane] = resolveArgs(args, SECTION_PARAMS)\n const kernel = getBrepApi()\n const h = brepHandleOf(shape)\n if (getOcctKernel().isNull(h as never)) {\n return err(validationError('NULL_SHAPE_INPUT', 'section: shape is a null shape'))\n }\n const resolved = resolvePlane(plane as PlaneInput)\n if (!resolved.ok) return resolved\n const p = resolved.value\n try {\n const edges = kernel.sectionByPlane(\n h,\n { x: p.origin[0], y: p.origin[1], z: p.origin[2] },\n { x: p.zDir[0], y: p.zDir[1], z: p.zDir[2] },\n )\n return ok(kernel.makeCompound(edges))\n } catch (e) {\n return err(\n kernelError(\n 'SECTION_FAILED',\n `Section with plane failed: ${e instanceof Error ? e.message : String(e)}`,\n e,\n { operation: 'section' },\n 'The cutting plane may not intersect the shape. Verify plane position relative to shape bounds.',\n ),\n )\n }\n}\n\n\n// ---------------------------------------------------------------------------\n// fuse — union two shapes (vendored topology/booleanFns.ts#fuse)\n// ---------------------------------------------------------------------------\n\nconst FUSE_PARAMS = { name: 'fuse', params: ['a', 'b', 'options'], formClass: 'A' as FormClass }\n\n/**\n * Fuse (union) two shapes into one.\n * @param args - Resolved arguments (a, b).\n * @returns The fused shape as a `BrepHandle`.\n */\nexport function fuseBrep(...args: unknown[]): Result<BrepHandle> {\n const [a, b] = resolveArgs(args, FUSE_PARAMS)\n const kernel = getBrepApi()\n const ha = brepHandleOf(a)\n const hb = brepHandleOf(b)\n try {\n return ok(kernel.fuse(ha, hb))\n } catch (e) {\n const raw = e instanceof Error ? e.message : String(e)\n return err(kernelError('FUSE_FAILED', `fuse failed: ${raw}`, e))\n }\n}\n\n// ---------------------------------------------------------------------------\n// split — split a shape with tool(s) (vendored topology/api.ts#split → booleanFns.split)\n// ---------------------------------------------------------------------------\n\nconst SPLIT_PARAMS = { name: 'split', params: ['shape', 'tools'], formClass: 'A' as FormClass }\n\n/**\n * Split a shape with one or more tool shapes.\n * @param args - Resolved arguments (shape, tools).\n * @returns The split result as a `BrepHandle`.\n */\nexport function splitBrep(...args: unknown[]): Result<BrepHandle> {\n const [shape, toolsRaw] = resolveArgs(args, SPLIT_PARAMS)\n const h = brepHandleOf(shape)\n const tools = (toolsRaw ?? []) as unknown[]\n if (tools.length === 0) return ok(h)\n const toolHandles = tools.map((t) => brepHandleOf(t))\n try {\n const result = getOcctKernel().split(h as never, toolHandles as never)\n return ok(result as unknown as BrepHandle)\n } catch (e) {\n const raw = e instanceof Error ? e.message : String(e)\n return err(\n kernelError(\n 'SPLIT_FAILED',\n `Split operation failed on ${tools.length} tool(s): ${raw}`,\n e,\n { operation: 'split', toolCount: tools.length },\n ),\n )\n }\n}\n"]}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* brep-mirror helpers — shared utilities for self-hosted compat-op implementations
|
|
3
|
+
* (core-decouple Phase 3, §5.4).
|
|
4
|
+
*
|
|
5
|
+
* @module
|
|
6
|
+
*/
|
|
7
|
+
import type { BrepHandle } from '../../brep/engine/types.js';
|
|
8
|
+
/**
|
|
9
|
+
* Extract a core BREP handle from an op argument.
|
|
10
|
+
*
|
|
11
|
+
* Accepts (in order of preference):
|
|
12
|
+
* - a raw branded number (BrepHandle),
|
|
13
|
+
* - a brepjs-style kernel handle object `{ id }`,
|
|
14
|
+
* - a brepjs-style shape wrapper `{ wrapped }`,
|
|
15
|
+
* - a faijs Shape whose brep slot carries the handle.
|
|
16
|
+
*
|
|
17
|
+
* @param v - the op argument (positional, post D11 normalization).
|
|
18
|
+
* @returns the numeric BREP handle.
|
|
19
|
+
* @throws when no handle can be extracted (E_BREP_INPUT).
|
|
20
|
+
*/
|
|
21
|
+
export declare function brepHandleOf(v: unknown): BrepHandle;
|
|
22
|
+
/** Identity 3×4 row-major affine matrix (12 elements). */
|
|
23
|
+
export declare const IDENTITY_3X4: readonly number[];
|
|
24
|
+
/**
|
|
25
|
+
* Compose two 3×4 row-major affine matrices: `a` applied first, then `b`
|
|
26
|
+
* (column-vector convention: p' = b·(a·p)).
|
|
27
|
+
*
|
|
28
|
+
* @param a - first matrix (12 elements).
|
|
29
|
+
* @param b - second matrix (12 elements).
|
|
30
|
+
* @returns the composed 12-element matrix.
|
|
31
|
+
*/
|
|
32
|
+
export declare function composeAffine(a: readonly number[], b: readonly number[]): number[];
|
|
33
|
+
/**
|
|
34
|
+
* 3×4 translation matrix for a vector.
|
|
35
|
+
* @param v - Translation vector.
|
|
36
|
+
* @returns The 3×4 translation matrix.
|
|
37
|
+
*/
|
|
38
|
+
export declare function translationMatrix(v: readonly [number, number, number]): number[];
|
|
39
|
+
/**
|
|
40
|
+
* 3×4 rotation matrix rotating `angleDeg` degrees around the axis (unit-ized)
|
|
41
|
+
* passing through `center`. Rodrigues formula, column-vector convention.
|
|
42
|
+
*
|
|
43
|
+
* @param axis - Rotation axis (unit-ized internally).
|
|
44
|
+
* @param center - Point the rotation passes through.
|
|
45
|
+
* @param angleDeg - Rotation angle in degrees.
|
|
46
|
+
* @returns The 3×4 rotation matrix.
|
|
47
|
+
*/
|
|
48
|
+
export declare function rotationMatrix(axis: readonly [number, number, number], center: readonly [number, number, number], angleDeg: number): number[];
|
|
49
|
+
/**
|
|
50
|
+
* 3×4 matrix rotating the +Z axis onto `axis` (unit-ized), origin-centered.
|
|
51
|
+
* @param axis - Target axis direction.
|
|
52
|
+
* @returns The 3×4 rotation matrix.
|
|
53
|
+
*/
|
|
54
|
+
export declare function rotationZTo(axis: readonly [number, number, number]): number[];
|
|
55
|
+
//# sourceMappingURL=brepHelpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"brepHelpers.d.ts","sourceRoot":"","sources":["../../../src/api/brep-mirror/brepHelpers.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AAGzD;;;;;;;;;;;;GAYG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAAE,OAAO,GAAG,UAAU,CAUnD;AAED,0DAA0D;AAC1D,eAAO,MAAM,YAAY,EAAE,SAAS,MAAM,EAAyC,CAAA;AAEnF;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAAE,SAAS,MAAM,EAAE,EAAE,CAAC,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,EAAE,CAWlF;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,EAAE,CAEhF;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAC5B,IAAI,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EACvC,MAAM,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EACzC,QAAQ,EAAE,MAAM,GACf,MAAM,EAAE,CA4BV;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,EAAE,CAsB7E"}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* brep-mirror helpers — shared utilities for self-hosted compat-op implementations
|
|
3
|
+
* (core-decouple Phase 3, §5.4).
|
|
4
|
+
*
|
|
5
|
+
* @module
|
|
6
|
+
*/
|
|
7
|
+
import { brepOf } from '../../shape.js';
|
|
8
|
+
/**
|
|
9
|
+
* Extract a core BREP handle from an op argument.
|
|
10
|
+
*
|
|
11
|
+
* Accepts (in order of preference):
|
|
12
|
+
* - a raw branded number (BrepHandle),
|
|
13
|
+
* - a brepjs-style kernel handle object `{ id }`,
|
|
14
|
+
* - a brepjs-style shape wrapper `{ wrapped }`,
|
|
15
|
+
* - a faijs Shape whose brep slot carries the handle.
|
|
16
|
+
*
|
|
17
|
+
* @param v - the op argument (positional, post D11 normalization).
|
|
18
|
+
* @returns the numeric BREP handle.
|
|
19
|
+
* @throws when no handle can be extracted (E_BREP_INPUT).
|
|
20
|
+
*/
|
|
21
|
+
export function brepHandleOf(v) {
|
|
22
|
+
if (typeof v === 'number')
|
|
23
|
+
return v;
|
|
24
|
+
if (v !== null && typeof v === 'object') {
|
|
25
|
+
const rec = v;
|
|
26
|
+
if (typeof rec.id === 'number')
|
|
27
|
+
return rec.id;
|
|
28
|
+
if ('wrapped' in rec)
|
|
29
|
+
return brepHandleOf(rec.wrapped);
|
|
30
|
+
const solid = brepOf(v);
|
|
31
|
+
if (typeof solid === 'number')
|
|
32
|
+
return solid;
|
|
33
|
+
}
|
|
34
|
+
throw new Error('[brep-mirror] E_BREP_INPUT: argument carries no BREP handle');
|
|
35
|
+
}
|
|
36
|
+
/** Identity 3×4 row-major affine matrix (12 elements). */
|
|
37
|
+
export const IDENTITY_3X4 = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0];
|
|
38
|
+
/**
|
|
39
|
+
* Compose two 3×4 row-major affine matrices: `a` applied first, then `b`
|
|
40
|
+
* (column-vector convention: p' = b·(a·p)).
|
|
41
|
+
*
|
|
42
|
+
* @param a - first matrix (12 elements).
|
|
43
|
+
* @param b - second matrix (12 elements).
|
|
44
|
+
* @returns the composed 12-element matrix.
|
|
45
|
+
*/
|
|
46
|
+
export function composeAffine(a, b) {
|
|
47
|
+
const out = new Array(12);
|
|
48
|
+
for (let r = 0; r < 3; r++) {
|
|
49
|
+
const a0 = a[r * 4], a1 = a[r * 4 + 1], a2 = a[r * 4 + 2], a3 = a[r * 4 + 3];
|
|
50
|
+
for (let c = 0; c < 3; c++)
|
|
51
|
+
out[r * 4 + c] = a0 * b[c] + a1 * b[4 + c] + a2 * b[8 + c];
|
|
52
|
+
out[r * 4 + 3] = a0 * b[3] + a1 * b[7] + a2 * b[11] + a3;
|
|
53
|
+
}
|
|
54
|
+
return out;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* 3×4 translation matrix for a vector.
|
|
58
|
+
* @param v - Translation vector.
|
|
59
|
+
* @returns The 3×4 translation matrix.
|
|
60
|
+
*/
|
|
61
|
+
export function translationMatrix(v) {
|
|
62
|
+
return [1, 0, 0, v[0], 0, 1, 0, v[1], 0, 0, 1, v[2]];
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* 3×4 rotation matrix rotating `angleDeg` degrees around the axis (unit-ized)
|
|
66
|
+
* passing through `center`. Rodrigues formula, column-vector convention.
|
|
67
|
+
*
|
|
68
|
+
* @param axis - Rotation axis (unit-ized internally).
|
|
69
|
+
* @param center - Point the rotation passes through.
|
|
70
|
+
* @param angleDeg - Rotation angle in degrees.
|
|
71
|
+
* @returns The 3×4 rotation matrix.
|
|
72
|
+
*/
|
|
73
|
+
export function rotationMatrix(axis, center, angleDeg) {
|
|
74
|
+
let [ux, uy, uz] = axis;
|
|
75
|
+
const len = Math.hypot(ux, uy, uz);
|
|
76
|
+
if (len < 1e-12)
|
|
77
|
+
throw new Error('[brep-mirror] rotation: zero-length axis');
|
|
78
|
+
ux /= len;
|
|
79
|
+
uy /= len;
|
|
80
|
+
uz /= len;
|
|
81
|
+
const th = (angleDeg * Math.PI) / 180;
|
|
82
|
+
const c = Math.cos(th);
|
|
83
|
+
const s = Math.sin(th);
|
|
84
|
+
const t = 1 - c;
|
|
85
|
+
const [cx, cy, cz] = center;
|
|
86
|
+
const r00 = t * ux * ux + c;
|
|
87
|
+
const r01 = t * ux * uy - s * uz;
|
|
88
|
+
const r02 = t * ux * uz + s * uy;
|
|
89
|
+
const r10 = t * ux * uy + s * uz;
|
|
90
|
+
const r11 = t * uy * uy + c;
|
|
91
|
+
const r12 = t * uy * uz - s * ux;
|
|
92
|
+
const r20 = t * ux * uz - s * uy;
|
|
93
|
+
const r21 = t * uy * uz + s * ux;
|
|
94
|
+
const r22 = t * uz * uz + c;
|
|
95
|
+
return [
|
|
96
|
+
r00, r01, r02, cx - r00 * cx - r01 * cy - r02 * cz,
|
|
97
|
+
r10, r11, r12, cy - r10 * cx - r11 * cy - r12 * cz,
|
|
98
|
+
r20, r21, r22, cz - r20 * cx - r21 * cy - r22 * cz,
|
|
99
|
+
];
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* 3×4 matrix rotating the +Z axis onto `axis` (unit-ized), origin-centered.
|
|
103
|
+
* @param axis - Target axis direction.
|
|
104
|
+
* @returns The 3×4 rotation matrix.
|
|
105
|
+
*/
|
|
106
|
+
export function rotationZTo(axis) {
|
|
107
|
+
const [x, y, z] = axis;
|
|
108
|
+
const len = Math.hypot(x, y, z);
|
|
109
|
+
if (len < 1e-12)
|
|
110
|
+
throw new Error('[brep-mirror] rotationZTo: zero-length axis');
|
|
111
|
+
const nx = x / len;
|
|
112
|
+
const ny = y / len;
|
|
113
|
+
const nz = z / len;
|
|
114
|
+
if (Math.abs(nz - 1) < 1e-9)
|
|
115
|
+
return [...IDENTITY_3X4];
|
|
116
|
+
// Rodrigues rotation from [0,0,1] to [nx,ny,nz].
|
|
117
|
+
const cross = [-ny, nx, 0]; // [0,0,1] × axis
|
|
118
|
+
const crossLen = Math.hypot(...cross);
|
|
119
|
+
const kx = cross[0] / crossLen;
|
|
120
|
+
const ky = cross[1] / crossLen;
|
|
121
|
+
const kz = cross[2] / crossLen;
|
|
122
|
+
const cosA = nz;
|
|
123
|
+
const sinA = Math.hypot(nx, ny);
|
|
124
|
+
const t = 1 - cosA;
|
|
125
|
+
return [
|
|
126
|
+
t * kx * kx + cosA, t * kx * ky - sinA * kz, t * kx * kz + sinA * ky, 0,
|
|
127
|
+
t * kx * ky + sinA * kz, t * ky * ky + cosA, t * ky * kz - sinA * kx, 0,
|
|
128
|
+
t * kx * kz - sinA * ky, t * ky * kz + sinA * kx, t * kz * kz + cosA, 0,
|
|
129
|
+
];
|
|
130
|
+
}
|
|
131
|
+
//# sourceMappingURL=brepHelpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"brepHelpers.js","sourceRoot":"","sources":["../../../src/api/brep-mirror/brepHelpers.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAEpC;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,YAAY,CAAC,CAAU;IACrC,IAAI,OAAO,CAAC,KAAK,QAAQ;QAAE,OAAO,CAAe,CAAA;IACjD,IAAI,CAAC,KAAK,IAAI,IAAI,OAAO,CAAC,KAAK,QAAQ,EAAE,CAAC;QACxC,MAAM,GAAG,GAAG,CAA4B,CAAA;QACxC,IAAI,OAAO,GAAG,CAAC,EAAE,KAAK,QAAQ;YAAE,OAAO,GAAG,CAAC,EAAgB,CAAA;QAC3D,IAAI,SAAS,IAAI,GAAG;YAAE,OAAO,YAAY,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;QACtD,MAAM,KAAK,GAAG,MAAM,CAAC,CAAU,CAAC,CAAA;QAChC,IAAI,OAAO,KAAK,KAAK,QAAQ;YAAE,OAAO,KAAmB,CAAA;IAC3D,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,6DAA6D,CAAC,CAAA;AAChF,CAAC;AAED,0DAA0D;AAC1D,MAAM,CAAC,MAAM,YAAY,GAAsB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAA;AAEnF;;;;;;;GAOG;AACH,MAAM,UAAU,aAAa,CAAC,CAAoB,EAAE,CAAoB;IACtE,MAAM,GAAG,GAAG,IAAI,KAAK,CAAS,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AE,CAAC,CAAC,CAAA,CAAC,iBAAiB;IAC5C,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,CAAA;IACrC,MAAM,EAAE,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAA;IAC9B,MAAM,EAAE,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAA;IAC9B,MAAM,EAAE,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAA;IAC9B,MAAM,IAAI,GAAG,EAAE,CAAA;IACf,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,EAAE,EAAE,CAAC,CAAA;IAC/B,MAAM,CAAC,GAAG,CAAC,GAAG,IAAI,CAAA;IAClB,OAAO;QACL,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,GAAG,EAAE,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,GAAG,EAAE,EAAE,CAAC;QACvE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,GAAG,EAAE,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,GAAG,EAAE,EAAE,CAAC;QACvE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,GAAG,EAAE,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,GAAG,EAAE,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,CAAC;KACxE,CAAA;AACH,CAAC","sourcesContent":["/**\n * brep-mirror helpers — shared utilities for self-hosted compat-op implementations\n * (core-decouple Phase 3, §5.4).\n *\n * @module\n */\n\nimport type { BrepHandle } from '../../brep/engine/types'\nimport { brepOf } from '../../shape'\n\n/**\n * Extract a core BREP handle from an op argument.\n *\n * Accepts (in order of preference):\n * - a raw branded number (BrepHandle),\n * - a brepjs-style kernel handle object `{ id }`,\n * - a brepjs-style shape wrapper `{ wrapped }`,\n * - a faijs Shape whose brep slot carries the handle.\n *\n * @param v - the op argument (positional, post D11 normalization).\n * @returns the numeric BREP handle.\n * @throws when no handle can be extracted (E_BREP_INPUT).\n */\nexport function brepHandleOf(v: unknown): BrepHandle {\n if (typeof v === 'number') return v as BrepHandle\n if (v !== null && typeof v === 'object') {\n const rec = v as Record<string, unknown>\n if (typeof rec.id === 'number') return rec.id as BrepHandle\n if ('wrapped' in rec) return brepHandleOf(rec.wrapped)\n const solid = brepOf(v as never)\n if (typeof solid === 'number') return solid as BrepHandle\n }\n throw new Error('[brep-mirror] E_BREP_INPUT: argument carries no BREP handle')\n}\n\n/** Identity 3×4 row-major affine matrix (12 elements). */\nexport const IDENTITY_3X4: readonly number[] = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0]\n\n/**\n * Compose two 3×4 row-major affine matrices: `a` applied first, then `b`\n * (column-vector convention: p' = b·(a·p)).\n *\n * @param a - first matrix (12 elements).\n * @param b - second matrix (12 elements).\n * @returns the composed 12-element matrix.\n */\nexport function composeAffine(a: readonly number[], b: readonly number[]): number[] {\n const out = new Array<number>(12)\n for (let r = 0; r < 3; r++) {\n const a0 = a[r * 4],\n a1 = a[r * 4 + 1],\n a2 = a[r * 4 + 2],\n a3 = a[r * 4 + 3]\n for (let c = 0; c < 3; c++) out[r * 4 + c] = a0 * b[c] + a1 * b[4 + c] + a2 * b[8 + c]\n out[r * 4 + 3] = a0 * b[3] + a1 * b[7] + a2 * b[11] + a3\n }\n return out\n}\n\n/**\n * 3×4 translation matrix for a vector.\n * @param v - Translation vector.\n * @returns The 3×4 translation matrix.\n */\nexport function translationMatrix(v: readonly [number, number, number]): number[] {\n return [1, 0, 0, v[0], 0, 1, 0, v[1], 0, 0, 1, v[2]]\n}\n\n/**\n * 3×4 rotation matrix rotating `angleDeg` degrees around the axis (unit-ized)\n * passing through `center`. Rodrigues formula, column-vector convention.\n *\n * @param axis - Rotation axis (unit-ized internally).\n * @param center - Point the rotation passes through.\n * @param angleDeg - Rotation angle in degrees.\n * @returns The 3×4 rotation matrix.\n */\nexport function rotationMatrix(\n axis: readonly [number, number, number],\n center: readonly [number, number, number],\n angleDeg: number,\n): number[] {\n let [ux, uy, uz] = axis\n const len = Math.hypot(ux, uy, uz)\n if (len < 1e-12) throw new Error('[brep-mirror] rotation: zero-length axis')\n ux /= len\n uy /= len\n uz /= len\n const th = (angleDeg * Math.PI) / 180\n const c = Math.cos(th)\n const s = Math.sin(th)\n const t = 1 - c\n const [cx, cy, cz] = center\n\n const r00 = t * ux * ux + c\n const r01 = t * ux * uy - s * uz\n const r02 = t * ux * uz + s * uy\n const r10 = t * ux * uy + s * uz\n const r11 = t * uy * uy + c\n const r12 = t * uy * uz - s * ux\n const r20 = t * ux * uz - s * uy\n const r21 = t * uy * uz + s * ux\n const r22 = t * uz * uz + c\n\n return [\n r00, r01, r02, cx - r00 * cx - r01 * cy - r02 * cz,\n r10, r11, r12, cy - r10 * cx - r11 * cy - r12 * cz,\n r20, r21, r22, cz - r20 * cx - r21 * cy - r22 * cz,\n ]\n}\n\n/**\n * 3×4 matrix rotating the +Z axis onto `axis` (unit-ized), origin-centered.\n * @param axis - Target axis direction.\n * @returns The 3×4 rotation matrix.\n */\nexport function rotationZTo(axis: readonly [number, number, number]): number[] {\n const [x, y, z] = axis\n const len = Math.hypot(x, y, z)\n if (len < 1e-12) throw new Error('[brep-mirror] rotationZTo: zero-length axis')\n const nx = x / len\n const ny = y / len\n const nz = z / len\n if (Math.abs(nz - 1) < 1e-9) return [...IDENTITY_3X4]\n // Rodrigues rotation from [0,0,1] to [nx,ny,nz].\n const cross = [-ny, nx, 0] // [0,0,1] × axis\n const crossLen = Math.hypot(...cross)\n const kx = cross[0] / crossLen\n const ky = cross[1] / crossLen\n const kz = cross[2] / crossLen\n const cosA = nz\n const sinA = Math.hypot(nx, ny)\n const t = 1 - cosA\n return [\n t * kx * kx + cosA, t * kx * ky - sinA * kz, t * kx * kz + sinA * ky, 0,\n t * kx * ky + sinA * kz, t * ky * ky + cosA, t * ky * kz - sinA * kx, 0,\n t * kx * kz - sinA * ky, t * ky * kz + sinA * kx, t * kz * kz + cosA, 0,\n ]\n}\n"]}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Self-hosted compat-op implementations — compound feature family
|
|
3
|
+
* (core-decouple Phase 3, §5.4; drill / pocket / boss / mirrorJoin).
|
|
4
|
+
*
|
|
5
|
+
* @platform occt
|
|
6
|
+
*
|
|
7
|
+
* Semantics mirror vendored `operations/compoundOpsFns.ts` with the brepjs
|
|
8
|
+
* object model dropped:
|
|
9
|
+
* - `options.face` supports an omitted default (highest-Z face) or an already
|
|
10
|
+
* constructed brepjs Face (`{ wrapped }`); FinderFn (brepjs finder DSL) is
|
|
11
|
+
* not supported after selfhosting.
|
|
12
|
+
* - `options.profile` must be an already constructed brepjs Wire (`{ wrapped }`);
|
|
13
|
+
* DrawingLike (sketchOnPlane) is not supported (sketch DSL is the brepjs
|
|
14
|
+
* compat surface, not a core data type).
|
|
15
|
+
* Intermediates (tool/profile face/positioned face) are released after use.
|
|
16
|
+
*/
|
|
17
|
+
import type { BrepHandle } from '../../brep/engine/types.js';
|
|
18
|
+
import { type Result } from '../../result/result.js';
|
|
19
|
+
/**
|
|
20
|
+
* Drill — cut a cylinder through the shape.
|
|
21
|
+
*
|
|
22
|
+
* @param args - Resolved arguments (shape, drill options).
|
|
23
|
+
* @returns The drilled shape as a `BrepHandle`.
|
|
24
|
+
*/
|
|
25
|
+
export declare function drillBrep(...args: unknown[]): Result<BrepHandle>;
|
|
26
|
+
/**
|
|
27
|
+
* Pocket — extrude a profile inward and cut it from the shape.
|
|
28
|
+
*
|
|
29
|
+
* @param args - Resolved arguments (shape, pocket options).
|
|
30
|
+
* @returns The pocketed shape as a `BrepHandle`.
|
|
31
|
+
*/
|
|
32
|
+
export declare function pocketBrep(...args: unknown[]): Result<BrepHandle>;
|
|
33
|
+
/**
|
|
34
|
+
* Boss — extrude a profile outward and fuse it onto the shape.
|
|
35
|
+
*
|
|
36
|
+
* @param args - Resolved arguments (shape, boss options).
|
|
37
|
+
* @returns The shape with the boss fused as a `BrepHandle`.
|
|
38
|
+
*/
|
|
39
|
+
export declare function bossBrep(...args: unknown[]): Result<BrepHandle>;
|
|
40
|
+
/**
|
|
41
|
+
* Mirror the shape across a plane and fuse the mirrored copy to the original.
|
|
42
|
+
*
|
|
43
|
+
* @param args - Resolved arguments (shape, mirror options).
|
|
44
|
+
* @returns The shape joined with its mirror as a `BrepHandle`.
|
|
45
|
+
*/
|
|
46
|
+
export declare function mirrorJoinBrep(...args: unknown[]): Result<BrepHandle>;
|
|
47
|
+
//# sourceMappingURL=compoundFns.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compoundFns.d.ts","sourceRoot":"","sources":["../../../src/api/brep-mirror/compoundFns.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AAEzD,OAAO,EAAkB,KAAK,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAkHjE;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC,UAAU,CAAC,CA4DhE;AAMD;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC,UAAU,CAAC,CAmCjE;AAMD;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC,UAAU,CAAC,CAmC/D;AAMD;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC,UAAU,CAAC,CAwBrE"}
|
|
@@ -0,0 +1,300 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Self-hosted compat-op implementations — compound feature family
|
|
3
|
+
* (core-decouple Phase 3, §5.4; drill / pocket / boss / mirrorJoin).
|
|
4
|
+
*
|
|
5
|
+
* @platform occt
|
|
6
|
+
*
|
|
7
|
+
* Semantics mirror vendored `operations/compoundOpsFns.ts` with the brepjs
|
|
8
|
+
* object model dropped:
|
|
9
|
+
* - `options.face` supports an omitted default (highest-Z face) or an already
|
|
10
|
+
* constructed brepjs Face (`{ wrapped }`); FinderFn (brepjs finder DSL) is
|
|
11
|
+
* not supported after selfhosting.
|
|
12
|
+
* - `options.profile` must be an already constructed brepjs Wire (`{ wrapped }`);
|
|
13
|
+
* DrawingLike (sketchOnPlane) is not supported (sketch DSL is the brepjs
|
|
14
|
+
* compat surface, not a core data type).
|
|
15
|
+
* Intermediates (tool/profile face/positioned face) are released after use.
|
|
16
|
+
*/
|
|
17
|
+
import { getBrepApi } from '../../brep/handle-bridge.js';
|
|
18
|
+
import { ok, err, isErr } from '../../result/result.js';
|
|
19
|
+
import { kernelError, validationError } from '../../result/errors.js';
|
|
20
|
+
import { resolveArgs } from '../internal/dual-form-args.js';
|
|
21
|
+
import { brepHandleOf, composeAffine, rotationZTo, translationMatrix } from './brepHelpers.js';
|
|
22
|
+
const DRILL_PARAMS = { name: 'drill', params: ['shape', 'options'], formClass: 'A' };
|
|
23
|
+
const POCKET_PARAMS = { name: 'pocket', params: ['shape', 'options'], formClass: 'A' };
|
|
24
|
+
const BOSS_PARAMS = { name: 'boss', params: ['shape', 'options'], formClass: 'A' };
|
|
25
|
+
const MIRROR_JOIN_PARAMS = { name: 'mirrorJoin', params: ['shape', 'options'], formClass: 'A' };
|
|
26
|
+
// ---------------------------------------------------------------------------
|
|
27
|
+
// Vec helpers (vendored vecOps)
|
|
28
|
+
// ---------------------------------------------------------------------------
|
|
29
|
+
function vecIsZero(v) {
|
|
30
|
+
return v[0] === 0 && v[1] === 0 && v[2] === 0;
|
|
31
|
+
}
|
|
32
|
+
function vecNormalize(v) {
|
|
33
|
+
const len = Math.hypot(v[0], v[1], v[2]);
|
|
34
|
+
return [v[0] / len, v[1] / len, v[2] / len];
|
|
35
|
+
}
|
|
36
|
+
function vecScale(v, k) {
|
|
37
|
+
return [v[0] * k, v[1] * k, v[2] * k];
|
|
38
|
+
}
|
|
39
|
+
// ---------------------------------------------------------------------------
|
|
40
|
+
// Face/profile helpers
|
|
41
|
+
// ---------------------------------------------------------------------------
|
|
42
|
+
/** 构造位于 pos、沿 dir 轴的 cylinder(radius × height),返回句柄(调用方负责释放/消费)。 */
|
|
43
|
+
function cylinderAt(kernel, radius, height, pos, dir) {
|
|
44
|
+
const base = kernel.makeCylinder(radius, height);
|
|
45
|
+
const m = composeAffine(rotationZTo(dir), translationMatrix(pos));
|
|
46
|
+
const placed = kernel.located(base, m);
|
|
47
|
+
kernel.release(base);
|
|
48
|
+
return placed;
|
|
49
|
+
}
|
|
50
|
+
/** 解析目标面:省略 → 最高 Z 面(faceCenter 最大);Face({wrapped})→ 直取。 */
|
|
51
|
+
function resolveTargetFace(kernel, shape, faceSpec) {
|
|
52
|
+
if (faceSpec === undefined || faceSpec === null) {
|
|
53
|
+
const faces = kernel.getSubShapes(shape, 'face');
|
|
54
|
+
if (faces.length === 0) {
|
|
55
|
+
return err(validationError('COMPOUND_NO_FACES', 'compoundOps: shape has no faces'));
|
|
56
|
+
}
|
|
57
|
+
let best = faces[0];
|
|
58
|
+
let bestZ = kernel.surfaceCenterOfMass(best).z;
|
|
59
|
+
for (let i = 1; i < faces.length; i++) {
|
|
60
|
+
const z = kernel.surfaceCenterOfMass(faces[i]).z;
|
|
61
|
+
if (z > bestZ) {
|
|
62
|
+
best = faces[i];
|
|
63
|
+
bestZ = z;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return ok(best);
|
|
67
|
+
}
|
|
68
|
+
if (typeof faceSpec === 'object') {
|
|
69
|
+
try {
|
|
70
|
+
return ok(brepHandleOf(faceSpec));
|
|
71
|
+
}
|
|
72
|
+
catch {
|
|
73
|
+
return err(validationError('COMPOUND_FACE_NOT_FOUND', 'compoundOps: face spec must be a brepjs Face handle or omitted'));
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return err(validationError('COMPOUND_FACE_NOT_FOUND', 'compoundOps: face spec must be a brepjs Face handle or omitted'));
|
|
77
|
+
}
|
|
78
|
+
/** 面法向(uv 中心,vendored normalAt)。 */
|
|
79
|
+
function faceNormalAt(kernel, face) {
|
|
80
|
+
const b = kernel.uvBounds(face);
|
|
81
|
+
const u = 0.5 * (b.uMin + b.uMax);
|
|
82
|
+
const v = 0.5 * (b.vMin + b.vMax);
|
|
83
|
+
const n = kernel.surfaceNormal(face, u, v);
|
|
84
|
+
return [n.x, n.y, n.z];
|
|
85
|
+
}
|
|
86
|
+
/** 面质心(vendored faceCenter)。 */
|
|
87
|
+
function faceCenterAt(kernel, face) {
|
|
88
|
+
const c = kernel.surfaceCenterOfMass(face);
|
|
89
|
+
return [c.x, c.y, c.z];
|
|
90
|
+
}
|
|
91
|
+
/** profile(brepjs Wire)→ face handle。 */
|
|
92
|
+
function profileToFace(kernel, profile) {
|
|
93
|
+
try {
|
|
94
|
+
const wire = brepHandleOf(profile);
|
|
95
|
+
return ok(kernel.makeFace(wire));
|
|
96
|
+
}
|
|
97
|
+
catch (e) {
|
|
98
|
+
const raw = e instanceof Error ? e.message : String(e);
|
|
99
|
+
return err(validationError('COMPOUND_PROFILE_INVALID', `compoundOps: profile must be a brepjs Wire (${raw})`));
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
// ---------------------------------------------------------------------------
|
|
103
|
+
// drill — cut a cylinder through the shape
|
|
104
|
+
// ---------------------------------------------------------------------------
|
|
105
|
+
/**
|
|
106
|
+
* Drill — cut a cylinder through the shape.
|
|
107
|
+
*
|
|
108
|
+
* @param args - Resolved arguments (shape, drill options).
|
|
109
|
+
* @returns The drilled shape as a `BrepHandle`.
|
|
110
|
+
*/
|
|
111
|
+
export function drillBrep(...args) {
|
|
112
|
+
const [shape, options] = resolveArgs(args, DRILL_PARAMS);
|
|
113
|
+
const kernel = getBrepApi();
|
|
114
|
+
const s = brepHandleOf(shape);
|
|
115
|
+
const { at, radius, axis, depth } = options;
|
|
116
|
+
const ax = (axis ?? [0, 0, 1]);
|
|
117
|
+
if (radius <= 0)
|
|
118
|
+
return err(validationError('DRILL_INVALID_RADIUS', 'Drill radius must be positive'));
|
|
119
|
+
if (vecIsZero(ax))
|
|
120
|
+
return err(validationError('DRILL_ZERO_AXIS', 'Drill axis cannot be zero'));
|
|
121
|
+
const dir = vecNormalize([ax[0], ax[1], ax[2]]);
|
|
122
|
+
const pos = at.length === 2 ? [at[0], at[1], 0] : [at[0], at[1], at[2]];
|
|
123
|
+
let tool;
|
|
124
|
+
try {
|
|
125
|
+
if (depth !== undefined) {
|
|
126
|
+
tool = cylinderAt(kernel, radius, depth, pos, dir);
|
|
127
|
+
}
|
|
128
|
+
else {
|
|
129
|
+
// Through-all: project bounding box onto the drill axis, add overshoot.
|
|
130
|
+
const bb = kernel.getBoundingBox(s);
|
|
131
|
+
const corners = [
|
|
132
|
+
[bb.xmin, bb.ymin, bb.zmin],
|
|
133
|
+
[bb.xmax, bb.ymin, bb.zmin],
|
|
134
|
+
[bb.xmin, bb.ymax, bb.zmin],
|
|
135
|
+
[bb.xmax, bb.ymax, bb.zmin],
|
|
136
|
+
[bb.xmin, bb.ymin, bb.zmax],
|
|
137
|
+
[bb.xmax, bb.ymin, bb.zmax],
|
|
138
|
+
[bb.xmin, bb.ymax, bb.zmax],
|
|
139
|
+
[bb.xmax, bb.ymax, bb.zmax],
|
|
140
|
+
];
|
|
141
|
+
let tMin = Infinity;
|
|
142
|
+
let tMax = -Infinity;
|
|
143
|
+
for (const c of corners) {
|
|
144
|
+
const t = (c[0] - pos[0]) * dir[0] + (c[1] - pos[1]) * dir[1] + (c[2] - pos[2]) * dir[2];
|
|
145
|
+
if (t < tMin)
|
|
146
|
+
tMin = t;
|
|
147
|
+
if (t > tMax)
|
|
148
|
+
tMax = t;
|
|
149
|
+
}
|
|
150
|
+
const overshoot = 1;
|
|
151
|
+
tMin -= overshoot;
|
|
152
|
+
tMax += overshoot;
|
|
153
|
+
const d = tMax - tMin;
|
|
154
|
+
const startPos = [
|
|
155
|
+
pos[0] + dir[0] * tMin,
|
|
156
|
+
pos[1] + dir[1] * tMin,
|
|
157
|
+
pos[2] + dir[2] * tMin,
|
|
158
|
+
];
|
|
159
|
+
tool = cylinderAt(kernel, radius, d, startPos, dir);
|
|
160
|
+
}
|
|
161
|
+
return ok(kernel.cut(s, tool));
|
|
162
|
+
}
|
|
163
|
+
catch (e) {
|
|
164
|
+
const raw = e instanceof Error ? e.message : String(e);
|
|
165
|
+
return err(kernelError('DRILL_FAILED', `drill failed: ${raw}`, e));
|
|
166
|
+
}
|
|
167
|
+
finally {
|
|
168
|
+
if (tool !== undefined)
|
|
169
|
+
kernel.release(tool);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
// ---------------------------------------------------------------------------
|
|
173
|
+
// pocket — extrude a profile inward and cut
|
|
174
|
+
// ---------------------------------------------------------------------------
|
|
175
|
+
/**
|
|
176
|
+
* Pocket — extrude a profile inward and cut it from the shape.
|
|
177
|
+
*
|
|
178
|
+
* @param args - Resolved arguments (shape, pocket options).
|
|
179
|
+
* @returns The pocketed shape as a `BrepHandle`.
|
|
180
|
+
*/
|
|
181
|
+
export function pocketBrep(...args) {
|
|
182
|
+
const [shape, options] = resolveArgs(args, POCKET_PARAMS);
|
|
183
|
+
const kernel = getBrepApi();
|
|
184
|
+
const s = brepHandleOf(shape);
|
|
185
|
+
const { profile, depth } = options;
|
|
186
|
+
if (depth <= 0)
|
|
187
|
+
return err(validationError('POCKET_INVALID_DEPTH', 'Pocket depth must be positive'));
|
|
188
|
+
const faceRes = resolveTargetFace(kernel, s, options.face);
|
|
189
|
+
if (isErr(faceRes))
|
|
190
|
+
return faceRes;
|
|
191
|
+
const face = faceRes.value;
|
|
192
|
+
const normal = faceNormalAt(kernel, face);
|
|
193
|
+
const center = faceCenterAt(kernel, face);
|
|
194
|
+
const profRes = profileToFace(kernel, profile);
|
|
195
|
+
if (isErr(profRes))
|
|
196
|
+
return profRes;
|
|
197
|
+
const profFace = profRes.value;
|
|
198
|
+
let positioned;
|
|
199
|
+
let tool;
|
|
200
|
+
try {
|
|
201
|
+
positioned = kernel.translate(profFace, center[0], center[1], center[2]);
|
|
202
|
+
kernel.release(profFace);
|
|
203
|
+
const nn = vecNormalize([normal[0], normal[1], normal[2]]);
|
|
204
|
+
const extDir = vecScale(nn, -depth);
|
|
205
|
+
tool = kernel.extrude(positioned, extDir[0], extDir[1], extDir[2]);
|
|
206
|
+
kernel.release(positioned);
|
|
207
|
+
return ok(kernel.cut(s, tool));
|
|
208
|
+
}
|
|
209
|
+
catch (e) {
|
|
210
|
+
const raw = e instanceof Error ? e.message : String(e);
|
|
211
|
+
return err(kernelError('POCKET_FAILED', `pocket failed: ${raw}`, e));
|
|
212
|
+
}
|
|
213
|
+
finally {
|
|
214
|
+
if (tool !== undefined)
|
|
215
|
+
kernel.release(tool);
|
|
216
|
+
if (positioned !== undefined)
|
|
217
|
+
kernel.release(positioned);
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
// ---------------------------------------------------------------------------
|
|
221
|
+
// boss — extrude a profile outward and fuse
|
|
222
|
+
// ---------------------------------------------------------------------------
|
|
223
|
+
/**
|
|
224
|
+
* Boss — extrude a profile outward and fuse it onto the shape.
|
|
225
|
+
*
|
|
226
|
+
* @param args - Resolved arguments (shape, boss options).
|
|
227
|
+
* @returns The shape with the boss fused as a `BrepHandle`.
|
|
228
|
+
*/
|
|
229
|
+
export function bossBrep(...args) {
|
|
230
|
+
const [shape, options] = resolveArgs(args, BOSS_PARAMS);
|
|
231
|
+
const kernel = getBrepApi();
|
|
232
|
+
const s = brepHandleOf(shape);
|
|
233
|
+
const { profile, height } = options;
|
|
234
|
+
if (height <= 0)
|
|
235
|
+
return err(validationError('BOSS_INVALID_HEIGHT', 'Boss height must be positive'));
|
|
236
|
+
const faceRes = resolveTargetFace(kernel, s, options.face);
|
|
237
|
+
if (isErr(faceRes))
|
|
238
|
+
return faceRes;
|
|
239
|
+
const face = faceRes.value;
|
|
240
|
+
const normal = faceNormalAt(kernel, face);
|
|
241
|
+
const center = faceCenterAt(kernel, face);
|
|
242
|
+
const profRes = profileToFace(kernel, profile);
|
|
243
|
+
if (isErr(profRes))
|
|
244
|
+
return profRes;
|
|
245
|
+
const profFace = profRes.value;
|
|
246
|
+
let positioned;
|
|
247
|
+
let tool;
|
|
248
|
+
try {
|
|
249
|
+
positioned = kernel.translate(profFace, center[0], center[1], center[2]);
|
|
250
|
+
kernel.release(profFace);
|
|
251
|
+
const nn = vecNormalize([normal[0], normal[1], normal[2]]);
|
|
252
|
+
const extDir = vecScale(nn, height);
|
|
253
|
+
tool = kernel.extrude(positioned, extDir[0], extDir[1], extDir[2]);
|
|
254
|
+
kernel.release(positioned);
|
|
255
|
+
return ok(kernel.fuse(s, tool));
|
|
256
|
+
}
|
|
257
|
+
catch (e) {
|
|
258
|
+
const raw = e instanceof Error ? e.message : String(e);
|
|
259
|
+
return err(kernelError('BOSS_FAILED', `boss failed: ${raw}`, e));
|
|
260
|
+
}
|
|
261
|
+
finally {
|
|
262
|
+
if (tool !== undefined)
|
|
263
|
+
kernel.release(tool);
|
|
264
|
+
if (positioned !== undefined)
|
|
265
|
+
kernel.release(positioned);
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
// ---------------------------------------------------------------------------
|
|
269
|
+
// mirrorJoin — mirror and fuse in one step
|
|
270
|
+
// ---------------------------------------------------------------------------
|
|
271
|
+
/**
|
|
272
|
+
* Mirror the shape across a plane and fuse the mirrored copy to the original.
|
|
273
|
+
*
|
|
274
|
+
* @param args - Resolved arguments (shape, mirror options).
|
|
275
|
+
* @returns The shape joined with its mirror as a `BrepHandle`.
|
|
276
|
+
*/
|
|
277
|
+
export function mirrorJoinBrep(...args) {
|
|
278
|
+
const [shape, options] = resolveArgs(args, MIRROR_JOIN_PARAMS);
|
|
279
|
+
const kernel = getBrepApi();
|
|
280
|
+
const s = brepHandleOf(shape);
|
|
281
|
+
const { normal, at } = (options ?? {});
|
|
282
|
+
const n = (normal ?? [1, 0, 0]);
|
|
283
|
+
if (vecIsZero(n))
|
|
284
|
+
return err(validationError('MIRROR_ZERO_NORMAL', 'Mirror plane normal cannot be zero'));
|
|
285
|
+
const origin = (at ?? [0, 0, 0]);
|
|
286
|
+
let mirrored;
|
|
287
|
+
try {
|
|
288
|
+
mirrored = kernel.mirror(s, { x: origin[0], y: origin[1], z: origin[2] }, { x: n[0], y: n[1], z: n[2] });
|
|
289
|
+
return ok(kernel.fuse(s, mirrored));
|
|
290
|
+
}
|
|
291
|
+
catch (e) {
|
|
292
|
+
const raw = e instanceof Error ? e.message : String(e);
|
|
293
|
+
return err(kernelError('MIRROR_JOIN_FAILED', `mirrorJoin failed: ${raw}`, e));
|
|
294
|
+
}
|
|
295
|
+
finally {
|
|
296
|
+
if (mirrored !== undefined)
|
|
297
|
+
kernel.release(mirrored);
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
//# sourceMappingURL=compoundFns.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compoundFns.js","sourceRoot":"","sources":["../../../src/api/brep-mirror/compoundFns.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AACrD,OAAO,EAAE,EAAE,EAAE,GAAG,EAAE,KAAK,EAAe,MAAM,qBAAqB,CAAA;AACjE,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAElE,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAExD,OAAO,EAAE,YAAY,EAAE,aAA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D,OAAO,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAA;IACrC,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,MAAM,GAAG,GAAG,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;QACtD,OAAO,GAAG,CAAC,WAAW,CAAC,oBAAoB,EAAE,sBAAsB,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC,CAAA;IAC/E,CAAC;YAAS,CAAC;QACT,IAAI,QAAQ,KAAK,SAAS;YAAE,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAA;IACtD,CAAC;AACH,CAAC","sourcesContent":["/**\n * Self-hosted compat-op implementations — compound feature family\n * (core-decouple Phase 3, §5.4; drill / pocket / boss / mirrorJoin).\n *\n * @platform occt\n *\n * Semantics mirror vendored `operations/compoundOpsFns.ts` with the brepjs\n * object model dropped:\n * - `options.face` supports an omitted default (highest-Z face) or an already\n * constructed brepjs Face (`{ wrapped }`); FinderFn (brepjs finder DSL) is\n * not supported after selfhosting.\n * - `options.profile` must be an already constructed brepjs Wire (`{ wrapped }`);\n * DrawingLike (sketchOnPlane) is not supported (sketch DSL is the brepjs\n * compat surface, not a core data type).\n * Intermediates (tool/profile face/positioned face) are released after use.\n */\n\nimport type { BrepHandle } from '../../brep/engine/types'\nimport { getBrepApi } from '../../brep/handle-bridge'\nimport { ok, err, isErr, type Result } from '../../result/result'\nimport { kernelError, validationError } from '../../result/errors'\nimport type { FormClass } from '../internal/dual-form-args'\nimport { resolveArgs } from '../internal/dual-form-args'\nimport type { Vec3 } from '../brepjs-compat/types'\nimport { brepHandleOf, composeAffine, rotationZTo, translationMatrix } from './brepHelpers'\n\nconst DRILL_PARAMS = { name: 'drill', params: ['shape', 'options'], formClass: 'A' as FormClass }\nconst POCKET_PARAMS = { name: 'pocket', params: ['shape', 'options'], formClass: 'A' as FormClass }\nconst BOSS_PARAMS = { name: 'boss', params: ['shape', 'options'], formClass: 'A' as FormClass }\nconst MIRROR_JOIN_PARAMS = { name: 'mirrorJoin', params: ['shape', 'options'], formClass: 'A' as FormClass }\n\n// ---------------------------------------------------------------------------\n// Vec helpers (vendored vecOps)\n// ---------------------------------------------------------------------------\n\nfunction vecIsZero(v: readonly number[]): boolean {\n return v[0] === 0 && v[1] === 0 && v[2] === 0\n}\n\nfunction vecNormalize(v: readonly [number, number, number]): [number, number, number] {\n const len = Math.hypot(v[0], v[1], v[2])\n return [v[0] / len, v[1] / len, v[2] / len]\n}\n\nfunction vecScale(v: readonly [number, number, number], k: number): [number, number, number] {\n return [v[0] * k, v[1] * k, v[2] * k]\n}\n\n// ---------------------------------------------------------------------------\n// Face/profile helpers\n// ---------------------------------------------------------------------------\n\n/** 构造位于 pos、沿 dir 轴的 cylinder(radius × height),返回句柄(调用方负责释放/消费)。 */\nfunction cylinderAt(\n kernel: ReturnType<typeof getBrepApi>,\n radius: number,\n height: number,\n pos: [number, number, number],\n dir: [number, number, number],\n): BrepHandle {\n const base = kernel.makeCylinder(radius, height)\n const m = composeAffine(rotationZTo(dir), translationMatrix(pos))\n const placed = kernel.located(base, m as number[])\n kernel.release(base)\n return placed\n}\n\n/** 解析目标面:省略 → 最高 Z 面(faceCenter 最大);Face({wrapped})→ 直取。 */\nfunction resolveTargetFace(\n kernel: ReturnType<typeof getBrepApi>,\n shape: BrepHandle,\n faceSpec: unknown,\n): Result<BrepHandle> {\n if (faceSpec === undefined || faceSpec === null) {\n const faces = kernel.getSubShapes(shape, 'face')\n if (faces.length === 0) {\n return err(validationError('COMPOUND_NO_FACES', 'compoundOps: shape has no faces'))\n }\n let best = faces[0]\n let bestZ = kernel.surfaceCenterOfMass(best).z\n for (let i = 1; i < faces.length; i++) {\n const z = kernel.surfaceCenterOfMass(faces[i]).z\n if (z > bestZ) {\n best = faces[i]\n bestZ = z\n }\n }\n return ok(best)\n }\n if (typeof faceSpec === 'object') {\n try {\n return ok(brepHandleOf(faceSpec))\n } catch {\n return err(\n validationError('COMPOUND_FACE_NOT_FOUND', 'compoundOps: face spec must be a brepjs Face handle or omitted'),\n )\n }\n }\n return err(validationError('COMPOUND_FACE_NOT_FOUND', 'compoundOps: face spec must be a brepjs Face handle or omitted'))\n}\n\n/** 面法向(uv 中心,vendored normalAt)。 */\nfunction faceNormalAt(kernel: ReturnType<typeof getBrepApi>, face: BrepHandle): Vec3 {\n const b = kernel.uvBounds(face)\n const u = 0.5 * (b.uMin + b.uMax)\n const v = 0.5 * (b.vMin + b.vMax)\n const n = kernel.surfaceNormal(face, u, v)\n return [n.x, n.y, n.z]\n}\n\n/** 面质心(vendored faceCenter)。 */\nfunction faceCenterAt(kernel: ReturnType<typeof getBrepApi>, face: BrepHandle): Vec3 {\n const c = kernel.surfaceCenterOfMass(face)\n return [c.x, c.y, c.z]\n}\n\n/** profile(brepjs Wire)→ face handle。 */\nfunction profileToFace(kernel: ReturnType<typeof getBrepApi>, profile: unknown): Result<BrepHandle> {\n try {\n const wire = brepHandleOf(profile)\n return ok(kernel.makeFace(wire))\n } catch (e) {\n const raw = e instanceof Error ? e.message : String(e)\n return err(\n validationError('COMPOUND_PROFILE_INVALID', `compoundOps: profile must be a brepjs Wire (${raw})`),\n )\n }\n}\n\n// ---------------------------------------------------------------------------\n// drill — cut a cylinder through the shape\n// ---------------------------------------------------------------------------\n\n/**\n * Drill — cut a cylinder through the shape.\n *\n * @param args - Resolved arguments (shape, drill options).\n * @returns The drilled shape as a `BrepHandle`.\n */\nexport function drillBrep(...args: unknown[]): Result<BrepHandle> {\n const [shape, options] = resolveArgs(args, DRILL_PARAMS)\n const kernel = getBrepApi()\n const s = brepHandleOf(shape)\n const { at, radius, axis, depth } = options as {\n at: Vec3 | [number, number]\n radius: number\n axis?: Vec3\n depth?: number\n }\n const ax = (axis ?? [0, 0, 1]) as Vec3\n\n if (radius <= 0) return err(validationError('DRILL_INVALID_RADIUS', 'Drill radius must be positive'))\n if (vecIsZero(ax)) return err(validationError('DRILL_ZERO_AXIS', 'Drill axis cannot be zero'))\n\n const dir = vecNormalize([ax[0], ax[1], ax[2]])\n const pos: [number, number, number] = at.length === 2 ? [at[0], at[1], 0] : [at[0], at[1], at[2]]\n\n let tool: BrepHandle | undefined\n try {\n if (depth !== undefined) {\n tool = cylinderAt(kernel, radius, depth, pos, dir)\n } else {\n // Through-all: project bounding box onto the drill axis, add overshoot.\n const bb = kernel.getBoundingBox(s)\n const corners: [number, number, number][] = [\n [bb.xmin, bb.ymin, bb.zmin],\n [bb.xmax, bb.ymin, bb.zmin],\n [bb.xmin, bb.ymax, bb.zmin],\n [bb.xmax, bb.ymax, bb.zmin],\n [bb.xmin, bb.ymin, bb.zmax],\n [bb.xmax, bb.ymin, bb.zmax],\n [bb.xmin, bb.ymax, bb.zmax],\n [bb.xmax, bb.ymax, bb.zmax],\n ]\n let tMin = Infinity\n let tMax = -Infinity\n for (const c of corners) {\n const t = (c[0] - pos[0]) * dir[0] + (c[1] - pos[1]) * dir[1] + (c[2] - pos[2]) * dir[2]\n if (t < tMin) tMin = t\n if (t > tMax) tMax = t\n }\n const overshoot = 1\n tMin -= overshoot\n tMax += overshoot\n const d = tMax - tMin\n const startPos: [number, number, number] = [\n pos[0] + dir[0] * tMin,\n pos[1] + dir[1] * tMin,\n pos[2] + dir[2] * tMin,\n ]\n tool = cylinderAt(kernel, radius, d, startPos, dir)\n }\n return ok(kernel.cut(s, tool))\n } catch (e) {\n const raw = e instanceof Error ? e.message : String(e)\n return err(kernelError('DRILL_FAILED', `drill failed: ${raw}`, e))\n } finally {\n if (tool !== undefined) kernel.release(tool)\n }\n}\n\n// ---------------------------------------------------------------------------\n// pocket — extrude a profile inward and cut\n// ---------------------------------------------------------------------------\n\n/**\n * Pocket — extrude a profile inward and cut it from the shape.\n *\n * @param args - Resolved arguments (shape, pocket options).\n * @returns The pocketed shape as a `BrepHandle`.\n */\nexport function pocketBrep(...args: unknown[]): Result<BrepHandle> {\n const [shape, options] = resolveArgs(args, POCKET_PARAMS)\n const kernel = getBrepApi()\n const s = brepHandleOf(shape)\n const { profile, depth } = options as { profile: unknown; depth: number; face?: unknown }\n\n if (depth <= 0) return err(validationError('POCKET_INVALID_DEPTH', 'Pocket depth must be positive'))\n\n const faceRes = resolveTargetFace(kernel, s, (options as { face?: unknown }).face)\n if (isErr(faceRes)) return faceRes\n const face = faceRes.value\n const normal = faceNormalAt(kernel, face)\n const center = faceCenterAt(kernel, face)\n\n const profRes = profileToFace(kernel, profile)\n if (isErr(profRes)) return profRes\n const profFace = profRes.value\n\n let positioned: BrepHandle | undefined\n let tool: BrepHandle | undefined\n try {\n positioned = kernel.translate(profFace, center[0], center[1], center[2])\n kernel.release(profFace)\n const nn = vecNormalize([normal[0], normal[1], normal[2]])\n const extDir = vecScale(nn, -depth)\n tool = kernel.extrude(positioned, extDir[0], extDir[1], extDir[2])\n kernel.release(positioned)\n return ok(kernel.cut(s, tool))\n } catch (e) {\n const raw = e instanceof Error ? e.message : String(e)\n return err(kernelError('POCKET_FAILED', `pocket failed: ${raw}`, e))\n } finally {\n if (tool !== undefined) kernel.release(tool)\n if (positioned !== undefined) kernel.release(positioned)\n }\n}\n\n// ---------------------------------------------------------------------------\n// boss — extrude a profile outward and fuse\n// ---------------------------------------------------------------------------\n\n/**\n * Boss — extrude a profile outward and fuse it onto the shape.\n *\n * @param args - Resolved arguments (shape, boss options).\n * @returns The shape with the boss fused as a `BrepHandle`.\n */\nexport function bossBrep(...args: unknown[]): Result<BrepHandle> {\n const [shape, options] = resolveArgs(args, BOSS_PARAMS)\n const kernel = getBrepApi()\n const s = brepHandleOf(shape)\n const { profile, height } = options as { profile: unknown; height: number; face?: unknown }\n\n if (height <= 0) return err(validationError('BOSS_INVALID_HEIGHT', 'Boss height must be positive'))\n\n const faceRes = resolveTargetFace(kernel, s, (options as { face?: unknown }).face)\n if (isErr(faceRes)) return faceRes\n const face = faceRes.value\n const normal = faceNormalAt(kernel, face)\n const center = faceCenterAt(kernel, face)\n\n const profRes = profileToFace(kernel, profile)\n if (isErr(profRes)) return profRes\n const profFace = profRes.value\n\n let positioned: BrepHandle | undefined\n let tool: BrepHandle | undefined\n try {\n positioned = kernel.translate(profFace, center[0], center[1], center[2])\n kernel.release(profFace)\n const nn = vecNormalize([normal[0], normal[1], normal[2]])\n const extDir = vecScale(nn, height)\n tool = kernel.extrude(positioned, extDir[0], extDir[1], extDir[2])\n kernel.release(positioned)\n return ok(kernel.fuse(s, tool))\n } catch (e) {\n const raw = e instanceof Error ? e.message : String(e)\n return err(kernelError('BOSS_FAILED', `boss failed: ${raw}`, e))\n } finally {\n if (tool !== undefined) kernel.release(tool)\n if (positioned !== undefined) kernel.release(positioned)\n }\n}\n\n// ---------------------------------------------------------------------------\n// mirrorJoin — mirror and fuse in one step\n// ---------------------------------------------------------------------------\n\n/**\n * Mirror the shape across a plane and fuse the mirrored copy to the original.\n *\n * @param args - Resolved arguments (shape, mirror options).\n * @returns The shape joined with its mirror as a `BrepHandle`.\n */\nexport function mirrorJoinBrep(...args: unknown[]): Result<BrepHandle> {\n const [shape, options] = resolveArgs(args, MIRROR_JOIN_PARAMS)\n const kernel = getBrepApi()\n const s = brepHandleOf(shape)\n const { normal, at } = (options ?? {}) as { normal?: Vec3; at?: Vec3 }\n const n = (normal ?? [1, 0, 0]) as Vec3\n\n if (vecIsZero(n)) return err(validationError('MIRROR_ZERO_NORMAL', 'Mirror plane normal cannot be zero'))\n\n const origin = (at ?? [0, 0, 0]) as Vec3\n let mirrored: BrepHandle | undefined\n try {\n mirrored = kernel.mirror(\n s,\n { x: origin[0], y: origin[1], z: origin[2] },\n { x: n[0], y: n[1], z: n[2] },\n )\n return ok(kernel.fuse(s, mirrored))\n } catch (e) {\n const raw = e instanceof Error ? e.message : String(e)\n return err(kernelError('MIRROR_JOIN_FAILED', `mirrorJoin failed: ${raw}`, e))\n } finally {\n if (mirrored !== undefined) kernel.release(mirrored)\n }\n}\n"]}
|