@faicad/faijs 0.16.1 → 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":"sweepFns.d.ts","sourceRoot":"","sources":["../../../src/api/brep-mirror/sweepFns.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AAEzD,OAAO,EAAW,KAAK,MAAM,EAAE,MAAM,qBAAqB,CAAA;AA8B1D;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC,UAAU,CAAC,CAclE;AAMD;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC,UAAU,CAAC,CAqBlE;AAMD;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC,UAAU,CAAC,CA8BhE;AAMD;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC,UAAU,CAAC,CA6BzE;AAMD;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC,UAAU,CAAC,CAqDvE"}
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Self-hosted compat-op implementations — extrude/revolve/sweep family
|
|
3
|
+
* (core-decouple Phase 3, §5.4; G3).
|
|
4
|
+
*
|
|
5
|
+
* @platform occt
|
|
6
|
+
*
|
|
7
|
+
* Semantics mirror vendored `operations/{api,extrudeFns,sweepFns}.ts`:
|
|
8
|
+
* - `extrudeBrep` — height: number → [0,0,h]; Vec3 → as-is. EXTRUDE_ZERO_VECTOR guard.
|
|
9
|
+
* - `revolveBrep` — options { at, axis, angle(radians, default 2π) }; REVOLUTION_NOT_3D.
|
|
10
|
+
* - `sweepBrep` — config.mode 'simple' → simplePipe; default → sweepPipeShell(frenet).
|
|
11
|
+
* shellMode / law / auxiliarySpine / support / correction configs are not
|
|
12
|
+
* supported after selfhosting (cad 面取手写 api/sweep.ts,shell 元组不暴露 §2.4①).
|
|
13
|
+
* - `complexExtrudeBrep` / `twistExtrudeBrep` — linear / helix spine built on
|
|
14
|
+
* occt-wasm makeLineEdge+makeWire / makeHelixWire, then sweepPipeShell.
|
|
15
|
+
* ExtrusionProfile scaling law is not supported (vendored buildLawFromProfile
|
|
16
|
+
* has no L1 equivalent); non-undefined profile → LAW_UNSUPPORTED error.
|
|
17
|
+
*/
|
|
18
|
+
import { getBrepApi } from '../../brep/handle-bridge.js';
|
|
19
|
+
import { ok, err } from '../../result/result.js';
|
|
20
|
+
import { kernelError, validationError } from '../../result/errors.js';
|
|
21
|
+
import { resolveArgs } from '../internal/dual-form-args.js';
|
|
22
|
+
import { brepHandleOf } from './brepHelpers.js';
|
|
23
|
+
import { getOcctKernel } from '../../occt-kernel/occtKernel.js';
|
|
24
|
+
const EXTRUDE_PARAMS = { name: 'extrude', params: ['face', 'height'], formClass: 'A' };
|
|
25
|
+
const REVOLVE_PARAMS = { name: 'revolve', params: ['face', 'options'], formClass: 'A' };
|
|
26
|
+
const SWEEP_PARAMS = { name: 'sweep', params: ['wire', 'spine', 'config', 'shellMode'], formClass: 'A' };
|
|
27
|
+
const COMPLEX_EXTRUDE_PARAMS = { name: 'complexExtrude', params: ['wire', 'center', 'normal', 'profile'], formClass: 'A' };
|
|
28
|
+
const TWIST_EXTRUDE_PARAMS = { name: 'twistExtrude', params: ['wire', 'angleDegrees', 'center', 'normal', 'profile'], formClass: 'A' };
|
|
29
|
+
function vecLength(v) {
|
|
30
|
+
return Math.hypot(v[0], v[1], v[2]);
|
|
31
|
+
}
|
|
32
|
+
/** 构造直线 spine wire(vendored makeSpineWire)。 */
|
|
33
|
+
function makeSpineWire(kernel, start, end) {
|
|
34
|
+
const e = kernel.makeLineEdge({ x: start[0], y: start[1], z: start[2] }, { x: end[0], y: end[1], z: end[2] });
|
|
35
|
+
const w = kernel.makeWire([e]);
|
|
36
|
+
kernel.release(e);
|
|
37
|
+
return w;
|
|
38
|
+
}
|
|
39
|
+
// ---------------------------------------------------------------------------
|
|
40
|
+
// extrude — face 沿向量/高度拉伸(vendored api.js#extrude + extrudeFns.ts#extrude)
|
|
41
|
+
// ---------------------------------------------------------------------------
|
|
42
|
+
/**
|
|
43
|
+
* Extrude a face along a vector/height (vendored api.js#extrude + extrudeFns.ts#extrude).
|
|
44
|
+
*
|
|
45
|
+
* @param args - Resolved arguments (face, height or extrusion vector).
|
|
46
|
+
* @returns The extruded solid as a `BrepHandle`.
|
|
47
|
+
*/
|
|
48
|
+
export function extrudeBrep(...args) {
|
|
49
|
+
const [face, height] = resolveArgs(args, EXTRUDE_PARAMS);
|
|
50
|
+
const kernel = getBrepApi();
|
|
51
|
+
const f = brepHandleOf(face);
|
|
52
|
+
const vec = typeof height === 'number' ? [0, 0, height] : height;
|
|
53
|
+
if (vecLength(vec) < 1e-10) {
|
|
54
|
+
return err(validationError('EXTRUDE_ZERO_VECTOR', 'extrude: extrusion vector has zero length'));
|
|
55
|
+
}
|
|
56
|
+
try {
|
|
57
|
+
return ok(kernel.extrude(f, vec[0], vec[1], vec[2]));
|
|
58
|
+
}
|
|
59
|
+
catch (e) {
|
|
60
|
+
const raw = e instanceof Error ? e.message : String(e);
|
|
61
|
+
return err(kernelError('EXTRUDE_FAILED', `Extrusion operation failed: ${raw}`, e));
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
// ---------------------------------------------------------------------------
|
|
65
|
+
// revolve — face 绕轴旋转(vendored api.js#revolve;angle 单位弧度,默认 2π)
|
|
66
|
+
// ---------------------------------------------------------------------------
|
|
67
|
+
/**
|
|
68
|
+
* Revolve a face around an axis (vendored api.js#revolve; angle in radians, default 2π).
|
|
69
|
+
*
|
|
70
|
+
* @param args - Resolved arguments (face, revolve options).
|
|
71
|
+
* @returns The revolved solid as a `BrepHandle`.
|
|
72
|
+
*/
|
|
73
|
+
export function revolveBrep(...args) {
|
|
74
|
+
const [face, options] = resolveArgs(args, REVOLVE_PARAMS);
|
|
75
|
+
const kernel = getBrepApi();
|
|
76
|
+
const f = brepHandleOf(face);
|
|
77
|
+
const { at = [0, 0, 0], axis = [0, 0, 1], angle = 2 * Math.PI } = (options ?? {});
|
|
78
|
+
try {
|
|
79
|
+
const h = kernel.revolveVec(f, { x: at[0], y: at[1], z: at[2] }, { x: axis[0], y: axis[1], z: axis[2] }, (angle * 180) / Math.PI);
|
|
80
|
+
return ok(h);
|
|
81
|
+
}
|
|
82
|
+
catch (e) {
|
|
83
|
+
const raw = e instanceof Error ? e.message : String(e);
|
|
84
|
+
return err(kernelError('REVOLVE_FAILED', `Revolution operation failed: ${raw}`, e));
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
// ---------------------------------------------------------------------------
|
|
88
|
+
// sweep — 截面沿脊柱扫掠(vendored sweepFns.ts#sweep)
|
|
89
|
+
// ---------------------------------------------------------------------------
|
|
90
|
+
/**
|
|
91
|
+
* Sweep a profile along a spine (vendored sweepFns.ts#sweep).
|
|
92
|
+
*
|
|
93
|
+
* @param args - Resolved arguments (wire, spine, config, shellMode).
|
|
94
|
+
* @returns The swept solid as a `BrepHandle`.
|
|
95
|
+
*/
|
|
96
|
+
export function sweepBrep(...args) {
|
|
97
|
+
const [wire, spine, config, shellMode] = resolveArgs(args, SWEEP_PARAMS);
|
|
98
|
+
const w = brepHandleOf(wire);
|
|
99
|
+
const sp = brepHandleOf(spine);
|
|
100
|
+
const cfg = (config ?? {});
|
|
101
|
+
if (shellMode === true) {
|
|
102
|
+
return err(validationError('SWEEP_SHELL_MODE_UNSUPPORTED', 'sweep shellMode is not supported after selfhosting (cad 面不暴露壳元组 §2.4①)'));
|
|
103
|
+
}
|
|
104
|
+
if (cfg.transitionMode !== undefined && cfg.transitionMode !== 'right') {
|
|
105
|
+
return err(validationError('SWEEP_TRANSITION_UNSUPPORTED', `sweep transitionMode '${cfg.transitionMode}' is not supported after selfhosting (only 'right' default)`));
|
|
106
|
+
}
|
|
107
|
+
try {
|
|
108
|
+
if (cfg.mode === 'simple') {
|
|
109
|
+
return ok(getOcctKernel().simplePipe(w, sp));
|
|
110
|
+
}
|
|
111
|
+
return ok(getOcctKernel().sweepPipeShell(w, sp, cfg.frenet === true, false));
|
|
112
|
+
}
|
|
113
|
+
catch (e) {
|
|
114
|
+
const raw = e instanceof Error ? e.message : String(e);
|
|
115
|
+
return err(kernelError('SWEEP_FAILED', `Sweep operation failed: ${raw}`, e));
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
// ---------------------------------------------------------------------------
|
|
119
|
+
// complexExtrude — wire 沿 normal 挤出(vendored sweepFns.ts#complexExtrude)
|
|
120
|
+
// ---------------------------------------------------------------------------
|
|
121
|
+
/**
|
|
122
|
+
* Extrude a wire along a normal (vendored sweepFns.ts#complexExtrude).
|
|
123
|
+
*
|
|
124
|
+
* @param args - Resolved arguments (wire, center, normal, profile).
|
|
125
|
+
* @returns The extruded solid as a `BrepHandle`.
|
|
126
|
+
*/
|
|
127
|
+
export function complexExtrudeBrep(...args) {
|
|
128
|
+
const [wire, center, normal, profile] = resolveArgs(args, COMPLEX_EXTRUDE_PARAMS);
|
|
129
|
+
const kernel = getBrepApi();
|
|
130
|
+
const w = brepHandleOf(wire);
|
|
131
|
+
const c = (center ?? [0, 0, 0]);
|
|
132
|
+
const n = (normal ?? [0, 0, 0]);
|
|
133
|
+
if (vecLength(n) < 1e-10) {
|
|
134
|
+
return err(validationError('ZERO_LENGTH_EXTRUSION', 'Extrusion vector cannot have zero length'));
|
|
135
|
+
}
|
|
136
|
+
if (profile !== undefined && profile !== null) {
|
|
137
|
+
return err(validationError('COMPLEX_EXTRUDE_LAW_UNSUPPORTED', 'complexExtrude ExtrusionProfile scaling law is not supported after selfhosting'));
|
|
138
|
+
}
|
|
139
|
+
const endPoint = [c[0] + n[0], c[1] + n[1], c[2] + n[2]];
|
|
140
|
+
const spine = makeSpineWire(kernel, c, endPoint);
|
|
141
|
+
try {
|
|
142
|
+
const h = getOcctKernel().sweepPipeShell(w, spine, false, false);
|
|
143
|
+
return ok(h);
|
|
144
|
+
}
|
|
145
|
+
catch (e) {
|
|
146
|
+
const raw = e instanceof Error ? e.message : String(e);
|
|
147
|
+
return err(kernelError('SWEEP_FAILED', `complexExtrude sweep failed: ${raw}`, e));
|
|
148
|
+
}
|
|
149
|
+
finally {
|
|
150
|
+
kernel.release(spine);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
// ---------------------------------------------------------------------------
|
|
154
|
+
// twistExtrude — wire 沿螺旋挤出(vendored sweepFns.ts#twistExtrude)
|
|
155
|
+
// ---------------------------------------------------------------------------
|
|
156
|
+
/**
|
|
157
|
+
* Extrude a wire along a helical path (vendored sweepFns.ts#twistExtrude).
|
|
158
|
+
*
|
|
159
|
+
* @param args - Resolved arguments (wire, angleDegrees, center, normal, profile).
|
|
160
|
+
* @returns The twisted extrusion as a `BrepHandle`.
|
|
161
|
+
*/
|
|
162
|
+
export function twistExtrudeBrep(...args) {
|
|
163
|
+
const [wire, angleDegrees, center, normal, profile] = resolveArgs(args, TWIST_EXTRUDE_PARAMS);
|
|
164
|
+
const kernel = getBrepApi();
|
|
165
|
+
const w = brepHandleOf(wire);
|
|
166
|
+
const angle = Number(angleDegrees);
|
|
167
|
+
const c = (center ?? [0, 0, 0]);
|
|
168
|
+
const n = (normal ?? [0, 0, 0]);
|
|
169
|
+
if (Math.abs(angle) < 1e-10) {
|
|
170
|
+
return err(validationError('ZERO_TWIST_ANGLE', 'Twist angle cannot be zero'));
|
|
171
|
+
}
|
|
172
|
+
if (angle < 0) {
|
|
173
|
+
return err(validationError('TWIST_NEGATIVE_ANGLE_UNSUPPORTED', 'twistExtrude negative angle (left-handed helix) is not supported after selfhosting (occt-wasm makeHelixWire has no handedness param)'));
|
|
174
|
+
}
|
|
175
|
+
if (vecLength(n) < 1e-10) {
|
|
176
|
+
return err(validationError('ZERO_LENGTH_EXTRUSION', 'Extrusion vector cannot have zero length'));
|
|
177
|
+
}
|
|
178
|
+
if (profile !== undefined && profile !== null) {
|
|
179
|
+
return err(validationError('TWIST_EXTRUDE_LAW_UNSUPPORTED', 'twistExtrude ExtrusionProfile scaling law is not supported after selfhosting'));
|
|
180
|
+
}
|
|
181
|
+
const extrusionLength = vecLength(n);
|
|
182
|
+
const pitch = (360.0 / Math.abs(angle)) * extrusionLength;
|
|
183
|
+
// vendored 语义:主 spine=直线、auxiliary=helix,sweepPipeShell 传对象参数
|
|
184
|
+
// (occt-wasm 运行时接受 auxiliary 键;d.ts 窄签名用 as never 绕过)
|
|
185
|
+
const endPointTwist = [c[0] + n[0], c[1] + n[1], c[2] + n[2]];
|
|
186
|
+
const spine = makeSpineWire(kernel, c, endPointTwist);
|
|
187
|
+
const axisDir = vecLength(n) > 1e-12 ? [n[0] / vecLength(n), n[1] / vecLength(n), n[2] / vecLength(n)] : [0, 0, 1];
|
|
188
|
+
try {
|
|
189
|
+
const helix = getOcctKernel().makeHelixWire({ x: c[0], y: c[1], z: c[2] }, { x: axisDir[0], y: axisDir[1], z: axisDir[2] }, pitch, extrusionLength, 1);
|
|
190
|
+
const h = getOcctKernel().sweepPipeShell(w, spine, { auxiliary: helix });
|
|
191
|
+
getOcctKernel().release(helix);
|
|
192
|
+
kernel.release(spine);
|
|
193
|
+
return ok(h);
|
|
194
|
+
}
|
|
195
|
+
catch (e) {
|
|
196
|
+
const raw = e instanceof Error ? e.message : String(e);
|
|
197
|
+
return err(kernelError('SWEEP_FAILED', `twistExtrude sweep failed: ${raw}`, e));
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
//# sourceMappingURL=sweepFns.js.map
|
|
@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AA;QACrB,OAAO,EAAE,CAAC,CAAC,CAAC,CAAA;IACd,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,cAAc,EAAE,8BAA8B,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC,CAAA;IACjF,CAAC;AACH,CAAC","sourcesContent":["/**\n * Self-hosted compat-op implementations — extrude/revolve/sweep family\n * (core-decouple Phase 3, §5.4; G3).\n *\n * @platform occt\n *\n * Semantics mirror vendored `operations/{api,extrudeFns,sweepFns}.ts`:\n * - `extrudeBrep` — height: number → [0,0,h]; Vec3 → as-is. EXTRUDE_ZERO_VECTOR guard.\n * - `revolveBrep` — options { at, axis, angle(radians, default 2π) }; REVOLUTION_NOT_3D.\n * - `sweepBrep` — config.mode 'simple' → simplePipe; default → sweepPipeShell(frenet).\n * shellMode / law / auxiliarySpine / support / correction configs are not\n * supported after selfhosting (cad 面取手写 api/sweep.ts,shell 元组不暴露 §2.4①).\n * - `complexExtrudeBrep` / `twistExtrudeBrep` — linear / helix spine built on\n * occt-wasm makeLineEdge+makeWire / makeHelixWire, then sweepPipeShell.\n * ExtrusionProfile scaling law is not supported (vendored buildLawFromProfile\n * has no L1 equivalent); non-undefined profile → LAW_UNSUPPORTED error.\n */\n\nimport type { BrepHandle } from '../../brep/engine/types'\nimport { getBrepApi } from '../../brep/handle-bridge'\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 { Vec3 } from '../brepjs-compat/types'\nimport { brepHandleOf } from './brepHelpers'\nimport { getOcctKernel } from '../../occt-kernel/occtKernel'\n\nconst EXTRUDE_PARAMS = { name: 'extrude', params: ['face', 'height'], formClass: 'A' as FormClass }\nconst REVOLVE_PARAMS = { name: 'revolve', params: ['face', 'options'], formClass: 'A' as FormClass }\nconst SWEEP_PARAMS = { name: 'sweep', params: ['wire', 'spine', 'config', 'shellMode'], formClass: 'A' as FormClass }\nconst COMPLEX_EXTRUDE_PARAMS = { name: 'complexExtrude', params: ['wire', 'center', 'normal', 'profile'], formClass: 'A' as FormClass }\nconst TWIST_EXTRUDE_PARAMS = { name: 'twistExtrude', params: ['wire', 'angleDegrees', 'center', 'normal', 'profile'], formClass: 'A' as FormClass }\n\nfunction vecLength(v: readonly number[]): number {\n return Math.hypot(v[0], v[1], v[2])\n}\n\n/** 构造直线 spine wire(vendored makeSpineWire)。 */\nfunction makeSpineWire(kernel: ReturnType<typeof getBrepApi>, start: Vec3, end: Vec3): BrepHandle {\n const e = kernel.makeLineEdge({ x: start[0], y: start[1], z: start[2] }, { x: end[0], y: end[1], z: end[2] })\n const w = kernel.makeWire([e])\n kernel.release(e)\n return w\n}\n\n// ---------------------------------------------------------------------------\n// extrude — face 沿向量/高度拉伸(vendored api.js#extrude + extrudeFns.ts#extrude)\n// ---------------------------------------------------------------------------\n\n/**\n * Extrude a face along a vector/height (vendored api.js#extrude + extrudeFns.ts#extrude).\n *\n * @param args - Resolved arguments (face, height or extrusion vector).\n * @returns The extruded solid as a `BrepHandle`.\n */\nexport function extrudeBrep(...args: unknown[]): Result<BrepHandle> {\n const [face, height] = resolveArgs(args, EXTRUDE_PARAMS)\n const kernel = getBrepApi()\n const f = brepHandleOf(face)\n const vec: Vec3 = typeof height === 'number' ? [0, 0, height] : (height as Vec3)\n if (vecLength(vec) < 1e-10) {\n return err(validationError('EXTRUDE_ZERO_VECTOR', 'extrude: extrusion vector has zero length'))\n }\n try {\n return ok(kernel.extrude(f, vec[0], vec[1], vec[2]))\n } catch (e) {\n const raw = e instanceof Error ? e.message : String(e)\n return err(kernelError('EXTRUDE_FAILED', `Extrusion operation failed: ${raw}`, e))\n }\n}\n\n// ---------------------------------------------------------------------------\n// revolve — face 绕轴旋转(vendored api.js#revolve;angle 单位弧度,默认 2π)\n// ---------------------------------------------------------------------------\n\n/**\n * Revolve a face around an axis (vendored api.js#revolve; angle in radians, default 2π).\n *\n * @param args - Resolved arguments (face, revolve options).\n * @returns The revolved solid as a `BrepHandle`.\n */\nexport function revolveBrep(...args: unknown[]): Result<BrepHandle> {\n const [face, options] = resolveArgs(args, REVOLVE_PARAMS)\n const kernel = getBrepApi()\n const f = brepHandleOf(face)\n const { at = [0, 0, 0], axis = [0, 0, 1], angle = 2 * Math.PI } = (options ?? {}) as {\n at?: Vec3\n axis?: Vec3\n angle?: number\n }\n try {\n const h = kernel.revolveVec(\n f,\n { x: at[0], y: at[1], z: at[2] },\n { x: axis[0], y: axis[1], z: axis[2] },\n (angle * 180) / Math.PI,\n )\n return ok(h)\n } catch (e) {\n const raw = e instanceof Error ? e.message : String(e)\n return err(kernelError('REVOLVE_FAILED', `Revolution operation failed: ${raw}`, e))\n }\n}\n\n// ---------------------------------------------------------------------------\n// sweep — 截面沿脊柱扫掠(vendored sweepFns.ts#sweep)\n// ---------------------------------------------------------------------------\n\n/**\n * Sweep a profile along a spine (vendored sweepFns.ts#sweep).\n *\n * @param args - Resolved arguments (wire, spine, config, shellMode).\n * @returns The swept solid as a `BrepHandle`.\n */\nexport function sweepBrep(...args: unknown[]): Result<BrepHandle> {\n const [wire, spine, config, shellMode] = resolveArgs(args, SWEEP_PARAMS)\n const w = brepHandleOf(wire)\n const sp = brepHandleOf(spine)\n const cfg = (config ?? {}) as { mode?: string; frenet?: boolean; transitionMode?: string }\n if (shellMode === true) {\n return err(\n validationError(\n 'SWEEP_SHELL_MODE_UNSUPPORTED',\n 'sweep shellMode is not supported after selfhosting (cad 面不暴露壳元组 §2.4①)',\n ),\n )\n }\n if (cfg.transitionMode !== undefined && cfg.transitionMode !== 'right') {\n return err(\n validationError(\n 'SWEEP_TRANSITION_UNSUPPORTED',\n `sweep transitionMode '${cfg.transitionMode}' is not supported after selfhosting (only 'right' default)`,\n ),\n )\n }\n try {\n if (cfg.mode === 'simple') {\n return ok(getOcctKernel().simplePipe(w as never, sp as never) as unknown as BrepHandle)\n }\n return ok(getOcctKernel().sweepPipeShell(w as never, sp as never, cfg.frenet === true, false) as unknown as BrepHandle)\n } catch (e) {\n const raw = e instanceof Error ? e.message : String(e)\n return err(kernelError('SWEEP_FAILED', `Sweep operation failed: ${raw}`, e))\n }\n}\n\n// ---------------------------------------------------------------------------\n// complexExtrude — wire 沿 normal 挤出(vendored sweepFns.ts#complexExtrude)\n// ---------------------------------------------------------------------------\n\n/**\n * Extrude a wire along a normal (vendored sweepFns.ts#complexExtrude).\n *\n * @param args - Resolved arguments (wire, center, normal, profile).\n * @returns The extruded solid as a `BrepHandle`.\n */\nexport function complexExtrudeBrep(...args: unknown[]): Result<BrepHandle> {\n const [wire, center, normal, profile] = resolveArgs(args, COMPLEX_EXTRUDE_PARAMS)\n const kernel = getBrepApi()\n const w = brepHandleOf(wire)\n const c = (center ?? [0, 0, 0]) as Vec3\n const n = (normal ?? [0, 0, 0]) as Vec3\n\n if (vecLength(n) < 1e-10) {\n return err(validationError('ZERO_LENGTH_EXTRUSION', 'Extrusion vector cannot have zero length'))\n }\n if (profile !== undefined && profile !== null) {\n return err(\n validationError(\n 'COMPLEX_EXTRUDE_LAW_UNSUPPORTED',\n 'complexExtrude ExtrusionProfile scaling law is not supported after selfhosting',\n ),\n )\n }\n const endPoint: Vec3 = [c[0] + n[0], c[1] + n[1], c[2] + n[2]]\n const spine = makeSpineWire(kernel, c, endPoint)\n try {\n const h = getOcctKernel().sweepPipeShell(w as never, spine as never, false, false) as unknown as BrepHandle\n return ok(h)\n } catch (e) {\n const raw = e instanceof Error ? e.message : String(e)\n return err(kernelError('SWEEP_FAILED', `complexExtrude sweep failed: ${raw}`, e))\n } finally {\n kernel.release(spine)\n }\n}\n\n// ---------------------------------------------------------------------------\n// twistExtrude — wire 沿螺旋挤出(vendored sweepFns.ts#twistExtrude)\n// ---------------------------------------------------------------------------\n\n/**\n * Extrude a wire along a helical path (vendored sweepFns.ts#twistExtrude).\n *\n * @param args - Resolved arguments (wire, angleDegrees, center, normal, profile).\n * @returns The twisted extrusion as a `BrepHandle`.\n */\nexport function twistExtrudeBrep(...args: unknown[]): Result<BrepHandle> {\n const [wire, angleDegrees, center, normal, profile] = resolveArgs(args, TWIST_EXTRUDE_PARAMS)\n const kernel = getBrepApi()\n const w = brepHandleOf(wire)\n const angle = Number(angleDegrees)\n const c = (center ?? [0, 0, 0]) as Vec3\n const n = (normal ?? [0, 0, 0]) as Vec3\n\n if (Math.abs(angle) < 1e-10) {\n return err(validationError('ZERO_TWIST_ANGLE', 'Twist angle cannot be zero'))\n }\n if (angle < 0) {\n return err(\n validationError(\n 'TWIST_NEGATIVE_ANGLE_UNSUPPORTED',\n 'twistExtrude negative angle (left-handed helix) is not supported after selfhosting (occt-wasm makeHelixWire has no handedness param)',\n ),\n )\n }\n if (vecLength(n) < 1e-10) {\n return err(validationError('ZERO_LENGTH_EXTRUSION', 'Extrusion vector cannot have zero length'))\n }\n if (profile !== undefined && profile !== null) {\n return err(\n validationError(\n 'TWIST_EXTRUDE_LAW_UNSUPPORTED',\n 'twistExtrude ExtrusionProfile scaling law is not supported after selfhosting',\n ),\n )\n }\n const extrusionLength = vecLength(n)\n const pitch = (360.0 / Math.abs(angle)) * extrusionLength\n // vendored 语义:主 spine=直线、auxiliary=helix,sweepPipeShell 传对象参数\n // (occt-wasm 运行时接受 auxiliary 键;d.ts 窄签名用 as never 绕过)\n const endPointTwist: Vec3 = [c[0] + n[0], c[1] + n[1], c[2] + n[2]]\n const spine = makeSpineWire(kernel, c, endPointTwist)\n const axisDir = vecLength(n) > 1e-12 ? [n[0] / vecLength(n), n[1] / vecLength(n), n[2] / vecLength(n)] : [0, 0, 1]\n try {\n const helix = getOcctKernel().makeHelixWire(\n { x: c[0], y: c[1], z: c[2] },\n { x: axisDir[0], y: axisDir[1], z: axisDir[2] },\n pitch,\n extrusionLength,\n 1,\n )\n const h = getOcctKernel().sweepPipeShell(w as never, spine as never, { auxiliary: helix } as never) as unknown as BrepHandle\n getOcctKernel().release(helix as never)\n kernel.release(spine)\n return ok(h)\n } catch (e) {\n const raw = e instanceof Error ? e.message : String(e)\n return err(kernelError('SWEEP_FAILED', `twistExtrude sweep failed: ${raw}`, e))\n }\n}\n"]}
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Functional thread operation — builds a helical screw thread.
|
|
3
3
|
*
|
|
4
|
+
* @platform occt — 本文件 import occt-kernel:螺纹用 `loft`
|
|
5
|
+
* (BRepOffsetAPI_ThruSections)构造,loft 是 occt-only(L1 无,engine-method-map
|
|
6
|
+
* `loft` → occt-only)。守卫①要求平台 import 自证身份;调用方 op(screw)声明
|
|
7
|
+
* `engines: ['occt']`(D11)。
|
|
8
|
+
*
|
|
4
9
|
* 适配自 brepjs `src/operations/threadFns.ts`。
|
|
5
10
|
* 保留文件名和核心算法,适配本项目的 occt-wasm API。
|
|
6
11
|
*
|
|
@@ -65,4 +70,14 @@ export interface ThreadOptions {
|
|
|
65
70
|
* ```
|
|
66
71
|
*/
|
|
67
72
|
export declare function threadBrep(kernel: BrepEngineApi, options: ThreadOptions): BrepHandle;
|
|
73
|
+
import { type Result } from '../../result/result.js';
|
|
74
|
+
/**
|
|
75
|
+
* compat-op wrapper: thread(options) → Result<BrepHandle>.
|
|
76
|
+
* Converges on core threadBrep (§5.4: vendored compat op and core version merged into one).
|
|
77
|
+
* threadBrep internal validation throws are caught as Result err (codes THREAD_INVALID_ARGS / THREAD_FAILED).
|
|
78
|
+
*
|
|
79
|
+
* @param args - Resolved arguments (thread options).
|
|
80
|
+
* @returns The generated thread solid as a `BrepHandle`.
|
|
81
|
+
*/
|
|
82
|
+
export declare function threadBrepOp(...args: unknown[]): Result<BrepHandle>;
|
|
68
83
|
//# sourceMappingURL=threadFns.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"threadFns.d.ts","sourceRoot":"","sources":["../../../src/api/brep-mirror/threadFns.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"threadFns.d.ts","sourceRoot":"","sources":["../../../src/api/brep-mirror/threadFns.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AACzD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAA;AAIjE,4BAA4B;AAC5B,MAAM,WAAW,aAAa;IAC5B,iCAAiC;IACjC,MAAM,EAAE,MAAM,CAAA;IACd,iBAAiB;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,mCAAmC;IACnC,MAAM,EAAE,MAAM,CAAA;IACd,mDAAmD;IACnD,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,8BAA8B;IAC9B,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,6BAA6B;IAC7B,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,sBAAsB;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,8BAA8B;IAC9B,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,UAAU,CACxB,MAAM,EAAE,aAAa,EACrB,OAAO,EAAE,aAAa,GACrB,UAAU,CA8EZ;AAWD,OAAO,EAAW,KAAK,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAK1D;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC,UAAU,CAAC,CAanE"}
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Functional thread operation — builds a helical screw thread.
|
|
3
3
|
*
|
|
4
|
+
* @platform occt — 本文件 import occt-kernel:螺纹用 `loft`
|
|
5
|
+
* (BRepOffsetAPI_ThruSections)构造,loft 是 occt-only(L1 无,engine-method-map
|
|
6
|
+
* `loft` → occt-only)。守卫①要求平台 import 自证身份;调用方 op(screw)声明
|
|
7
|
+
* `engines: ['occt']`(D11)。
|
|
8
|
+
*
|
|
4
9
|
* 适配自 brepjs `src/operations/threadFns.ts`。
|
|
5
10
|
* 保留文件名和核心算法,适配本项目的 occt-wasm API。
|
|
6
11
|
*
|
|
@@ -14,6 +19,8 @@
|
|
|
14
19
|
* - brepjs 用 DisposalScope 管理中间句柄 → 本项目手动 kernel.release
|
|
15
20
|
* - brepjs 用 Result 类型 → 本项目抛出异常
|
|
16
21
|
*/
|
|
22
|
+
import { getOcctKernel } from '../../occt-kernel/occtKernel.js';
|
|
23
|
+
import { getBrepApi } from '../../brep/handle-bridge.js';
|
|
17
24
|
/**
|
|
18
25
|
* 通过 loft 旋转齿截面构建螺旋螺纹 ridge。
|
|
19
26
|
*
|
|
@@ -91,8 +98,9 @@ export function threadBrep(kernel, options) {
|
|
|
91
98
|
const wire = kernel.makeWire(edges);
|
|
92
99
|
sections.push(wire);
|
|
93
100
|
}
|
|
94
|
-
// Loft
|
|
95
|
-
|
|
101
|
+
// Loft(occt-only 平台面,D3)。BrepHandle(branded number)与 occt-wasm
|
|
102
|
+
// ShapeHandle 运行时同构,品牌转换只发生在平台边界。
|
|
103
|
+
const thread = getOcctKernel().loft(sections, true, true);
|
|
96
104
|
// 释放中间句柄
|
|
97
105
|
for (const w of sections)
|
|
98
106
|
kernel.release(w);
|
|
@@ -100,4 +108,31 @@ export function threadBrep(kernel, options) {
|
|
|
100
108
|
kernel.release(e);
|
|
101
109
|
return thread;
|
|
102
110
|
}
|
|
111
|
+
import { resolveArgs } from '../internal/dual-form-args.js';
|
|
112
|
+
import { ok, err } from '../../result/result.js';
|
|
113
|
+
import { validationError, kernelError } from '../../result/errors.js';
|
|
114
|
+
const THREAD_PARAMS = { name: 'thread', params: ['options'], formClass: 'B1' };
|
|
115
|
+
/**
|
|
116
|
+
* compat-op wrapper: thread(options) → Result<BrepHandle>.
|
|
117
|
+
* Converges on core threadBrep (§5.4: vendored compat op and core version merged into one).
|
|
118
|
+
* threadBrep internal validation throws are caught as Result err (codes THREAD_INVALID_ARGS / THREAD_FAILED).
|
|
119
|
+
*
|
|
120
|
+
* @param args - Resolved arguments (thread options).
|
|
121
|
+
* @returns The generated thread solid as a `BrepHandle`.
|
|
122
|
+
*/
|
|
123
|
+
export function threadBrepOp(...args) {
|
|
124
|
+
const [options] = resolveArgs(args, THREAD_PARAMS);
|
|
125
|
+
const kernel = getBrepApi();
|
|
126
|
+
try {
|
|
127
|
+
const h = threadBrep(kernel, options);
|
|
128
|
+
return ok(h);
|
|
129
|
+
}
|
|
130
|
+
catch (e) {
|
|
131
|
+
const raw = e instanceof Error ? e.message : String(e);
|
|
132
|
+
if (raw.startsWith('[threadBrep]')) {
|
|
133
|
+
return err(validationError('THREAD_INVALID_ARGS', raw));
|
|
134
|
+
}
|
|
135
|
+
return err(kernelError('THREAD_FAILED', `Thread generation failed: ${raw}`, e));
|
|
136
|
+
}
|
|
137
|
+
}
|
|
103
138
|
//# sourceMappingURL=threadFns.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"threadFns.js","sourceRoot":"","sources":["../../../src/api/brep-mirror/threadFns.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AA+BH;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,UAAU,UAAU,CACxB,MAAqB,EACrB,OAAsB;IAEtB,MAAM,EACJ,MAAM,EACN,KAAK,EACL,MAAM,EACN,KAAK,GAAG,GAAG,GAAG,KAAK,EACnB,cAAc,GAAG,IAAI,GAAG,KAAK,EAC7B,KAAK,GAAG,CAAC,EACT,eAAe,GAAG,EAAE,EACpB,QAAQ,GAAG,KAAK,EAChB,MAAM,GAAG,KAAK,GACf,GAAG,OAAO,CAAA;IAEX,OAAO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EAAE,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,CAAA;QAE/C,MAAM;QACN,MAAM,KAAK,GAAiB,EAAE,CAAA;QAC9B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YACxC,MAAM,IAAI,GAAG,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAA;YAC/E,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;YAChB,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAC9B,CAAC;QAED,UAAU;QACV,MAAM,IAAI,GAAG,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAA;QACnC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IACrB,CAAC;IAED,OAAO;IACP,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;IAEhD,SAAS;IACT,KAAK,MAAM,CAAC,IAAI,QAAQ;QAAE,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;IAC3C,KAAK,MAAM,CAAC,IAAI,iBAAiB;QAAE,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;IAEpD,OAAO,MAAM,CAAA;AACf,CAAC","sourcesContent":["/**\n * Functional thread operation — builds a helical screw thread.\n *\n * 适配自 brepjs `src/operations/threadFns.ts`。\n * 保留文件名和核心算法,适配本项目的 occt-wasm API。\n *\n * occt-wasm 的 `BRepOffsetAPI_MakePipeShell` (sweep) 无法可靠地沿螺旋线扫掠截面,\n * 因此螺纹用 loft(`BRepOffsetAPI_ThruSections`)穿过一系列旋转的齿截面构造。\n * 结果是螺旋螺纹的 *ridge* — 外螺纹 fuse 到螺杆,内螺纹 cut 从孔中减去。\n *\n * 与 brepjs 的差异:\n * - brepjs 用 BlueprintSketcher + line() + wire() 构造截面 → 本项目直接用 kernel.makeLineEdge + kernel.makeWire\n * - brepjs 用 loft() 函数 → 本项目直接用 kernel.loft(wires, isSolid, ruled)\n * - brepjs 用 DisposalScope 管理中间句柄 → 本项目手动 kernel.release\n * - brepjs 用 Result 类型 → 本项目抛出异常\n */\n\nimport type { BrepHandle } from '../../brep/engine/types'\nimport type { BrepEngineApi } from '../../brep/engine/primitives'\n\n/** 螺纹配置参数。单位 mm,角度由螺距推导。 */\nexport interface ThreadOptions {\n /** 核心半径(外螺纹)或名义孔半径(内螺纹),在螺纹根部 */\n radius: number\n /** 每圈轴向距离(螺距) */\n pitch: number\n /** 螺纹总长(沿轴)。圈数 = height / pitch */\n height: number\n /** 径向螺纹高度(齿顶 - 齿根)。默认 0.6 * pitch(≈ISO 60° V 型) */\n depth?: number\n /** 齿根处轴向半宽。默认 0.42 * pitch */\n toothHalfWidth?: number\n /**\n * flat 顶宽,给出梯形齿而非尖 V 型。\n * 0(默认)= 尖 V(ISO/UN);正值 = 梯形齿(Acme/square)。\n * 必须 < toothHalfWidth。\n */\n crest?: number\n /** 每圈截面数 — 越高越平滑但越慢。默认 20 */\n sectionsPerTurn?: number\n /** 左旋。默认 false(右旋) */\n lefthand?: boolean\n /** 齿尖朝向轴心(内螺纹用 cut 从孔中减去时) */\n inward?: boolean\n}\n\n/**\n * 通过 loft 旋转齿截面构建螺旋螺纹 ridge。\n *\n * @param kernel OCCT 内核\n * @param options 螺纹配置\n * @returns 螺纹 ridge solid(BrepHandle)\n *\n * @example 外螺纹(Ø12 螺杆,2.5mm 螺距):\n * ```ts\n * const ridge = threadBrep(kernel, { radius: 6, pitch: 2.5, height: 7.5 })\n * const rod = kernel.makeCylinder(6.15, 7.5)\n * const result = kernel.fuse(rod, ridge)\n * kernel.release(rod)\n * kernel.release(ridge)\n * ```\n *\n * @example 内螺纹(攻丝 Ø6 孔):\n * ```ts\n * const ridge = threadBrep(kernel, { radius: 3, pitch: 1, height: 6, inward: true })\n * const result = kernel.cut(boredBlock, ridge)\n * kernel.release(ridge)\n * ```\n */\nexport function threadBrep(\n kernel: BrepEngineApi,\n options: ThreadOptions,\n): BrepHandle {\n const {\n radius,\n pitch,\n height,\n depth = 0.6 * pitch,\n toothHalfWidth = 0.42 * pitch,\n crest = 0,\n sectionsPerTurn = 12,\n lefthand = false,\n inward = false,\n } = options\n\n // 参数校验\n if (!(radius > 0)) throw new Error('[threadBrep] radius must be > 0')\n if (!(pitch > 0)) throw new Error('[threadBrep] pitch must be > 0')\n if (!(height > 0)) throw new Error('[threadBrep] height must be > 0')\n if (!(depth > 0)) throw new Error('[threadBrep] depth must be > 0')\n if (crest < 0 || crest >= toothHalfWidth) {\n throw new Error('[threadBrep] crest must be >= 0 and < toothHalfWidth')\n }\n if (sectionsPerTurn < 3) {\n throw new Error('[threadBrep] sectionsPerTurn must be >= 3')\n }\n\n const turns = height / pitch\n const nSec = Math.max(2, Math.round(turns * sectionsPerTurn))\n const sign = lefthand ? -1 : 1\n const apexU = inward ? -depth : depth // 齿顶:外螺纹朝外,内螺纹朝内\n const baseU = inward ? 0.3 : -0.3 // 齿根:略微嵌入配合实体以保证布尔干净\n const a = toothHalfWidth\n\n // 构建截面序列\n const sections: BrepHandle[] = []\n const intermediateEdges: BrepHandle[] = []\n\n for (let i = 0; i <= nSec; i++) {\n const th = (sign * i * 2 * Math.PI) / sectionsPerTurn\n const z = (pitch * Math.abs(th)) / (2 * Math.PI)\n const cx = radius * Math.cos(th)\n const cy = radius * Math.sin(th)\n const rx = Math.cos(th)\n const ry = Math.sin(th)\n\n // 点生成函数:u = 径向偏移,v = 轴向偏移\n const pt = (u: number, v: number) => ({\n x: cx + u * rx,\n y: cy + u * ry,\n z: z + v,\n })\n\n // V 型齿(crest=0)通过单个顶点闭合;梯形齿(crest>0)给出平顶\n const profile = crest > 0\n ? [pt(baseU, -a), pt(apexU, -crest), pt(apexU, crest), pt(baseU, a)]\n : [pt(baseU, -a), pt(apexU, 0), pt(baseU, a)]\n\n // 构建边\n const edges: BrepHandle[] = []\n for (let k = 0; k < profile.length; k++) {\n const edge = kernel.makeLineEdge(profile[k], profile[(k + 1) % profile.length])\n edges.push(edge)\n intermediateEdges.push(edge)\n }\n\n // 构建 wire\n const wire = kernel.makeWire(edges)\n sections.push(wire)\n }\n\n // Loft\n const thread = kernel.loft(sections, true, true)\n\n // 释放中间句柄\n for (const w of sections) kernel.release(w)\n for (const e of intermediateEdges) kernel.release(e)\n\n return thread\n}\n"]}
|
|
1
|
+
{"version":3,"file":"threadFns.js","sourceRoot":"","sources":["../../../src/api/brep-mirror/threadFns.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAIH,OAAO,EAAE,aAAa,EAAoB,MAAM,8BAA8B,CAAA;AAC9E,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AA4BrD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,UAAU,UAAU,CACxB,MAAqB,EACrB,OAAsB;IAEtB,MAAM,EACJ,MAAM,EACN,KAAK,EACL,MAAM,EACN,KAAK,GAAG,GAAG,GAAG,KAAK,EACnB,cAAc,GAAG,IAAI,GAAG,KAAK,EAC7B,KAAK,GAAG,CAAC,EACT,eAAe,GAAG,EAAE,EACpB,QAAQ,GAAG,KAAK,EAChB,MAAM,GAAG,KAAK,GACf,GAAG,OAAO,CAAA;IAEX,OAAO;IACP,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAA;IACrE,IAAI,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAA;IACnE,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAA;IACrE,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tD,OAAO,EAAE,CAAC,CAAC,CAAC,CAAA;IACd,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,IAAI,GAAG,CAAC,UAAU,CAAC,cAAc,CAAC,EAAE,CAAC;YACnC,OAAO,GAAG,CAAC,eAAe,CAAC,qBAAqB,EAAE,GAAG,CAAC,CAAC,CAAA;QACzD,CAAC;QACD,OAAO,GAAG,CAAC,WAAW,CAAC,eAAe,EAAE,6BAA6B,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC,CAAA;IACjF,CAAC;AACH,CAAC","sourcesContent":["/**\n * Functional thread operation — builds a helical screw thread.\n *\n * @platform occt — 本文件 import occt-kernel:螺纹用 `loft`\n * (BRepOffsetAPI_ThruSections)构造,loft 是 occt-only(L1 无,engine-method-map\n * `loft` → occt-only)。守卫①要求平台 import 自证身份;调用方 op(screw)声明\n * `engines: ['occt']`(D11)。\n *\n * 适配自 brepjs `src/operations/threadFns.ts`。\n * 保留文件名和核心算法,适配本项目的 occt-wasm API。\n *\n * occt-wasm 的 `BRepOffsetAPI_MakePipeShell` (sweep) 无法可靠地沿螺旋线扫掠截面,\n * 因此螺纹用 loft(`BRepOffsetAPI_ThruSections`)穿过一系列旋转的齿截面构造。\n * 结果是螺旋螺纹的 *ridge* — 外螺纹 fuse 到螺杆,内螺纹 cut 从孔中减去。\n *\n * 与 brepjs 的差异:\n * - brepjs 用 BlueprintSketcher + line() + wire() 构造截面 → 本项目直接用 kernel.makeLineEdge + kernel.makeWire\n * - brepjs 用 loft() 函数 → 本项目直接用 kernel.loft(wires, isSolid, ruled)\n * - brepjs 用 DisposalScope 管理中间句柄 → 本项目手动 kernel.release\n * - brepjs 用 Result 类型 → 本项目抛出异常\n */\n\nimport type { BrepHandle } from '../../brep/engine/types'\nimport type { BrepEngineApi } from '../../brep/engine/primitives'\nimport { getOcctKernel, type ShapeHandle } from '../../occt-kernel/occtKernel'\nimport { getBrepApi } from '../../brep/handle-bridge'\n\n/** 螺纹配置参数。单位 mm,角度由螺距推导。 */\nexport interface ThreadOptions {\n /** 核心半径(外螺纹)或名义孔半径(内螺纹),在螺纹根部 */\n radius: number\n /** 每圈轴向距离(螺距) */\n pitch: number\n /** 螺纹总长(沿轴)。圈数 = height / pitch */\n height: number\n /** 径向螺纹高度(齿顶 - 齿根)。默认 0.6 * pitch(≈ISO 60° V 型) */\n depth?: number\n /** 齿根处轴向半宽。默认 0.42 * pitch */\n toothHalfWidth?: number\n /**\n * flat 顶宽,给出梯形齿而非尖 V 型。\n * 0(默认)= 尖 V(ISO/UN);正值 = 梯形齿(Acme/square)。\n * 必须 < toothHalfWidth。\n */\n crest?: number\n /** 每圈截面数 — 越高越平滑但越慢。默认 20 */\n sectionsPerTurn?: number\n /** 左旋。默认 false(右旋) */\n lefthand?: boolean\n /** 齿尖朝向轴心(内螺纹用 cut 从孔中减去时) */\n inward?: boolean\n}\n\n/**\n * 通过 loft 旋转齿截面构建螺旋螺纹 ridge。\n *\n * @param kernel OCCT 内核\n * @param options 螺纹配置\n * @returns 螺纹 ridge solid(BrepHandle)\n *\n * @example 外螺纹(Ø12 螺杆,2.5mm 螺距):\n * ```ts\n * const ridge = threadBrep(kernel, { radius: 6, pitch: 2.5, height: 7.5 })\n * const rod = kernel.makeCylinder(6.15, 7.5)\n * const result = kernel.fuse(rod, ridge)\n * kernel.release(rod)\n * kernel.release(ridge)\n * ```\n *\n * @example 内螺纹(攻丝 Ø6 孔):\n * ```ts\n * const ridge = threadBrep(kernel, { radius: 3, pitch: 1, height: 6, inward: true })\n * const result = kernel.cut(boredBlock, ridge)\n * kernel.release(ridge)\n * ```\n */\nexport function threadBrep(\n kernel: BrepEngineApi,\n options: ThreadOptions,\n): BrepHandle {\n const {\n radius,\n pitch,\n height,\n depth = 0.6 * pitch,\n toothHalfWidth = 0.42 * pitch,\n crest = 0,\n sectionsPerTurn = 12,\n lefthand = false,\n inward = false,\n } = options\n\n // 参数校验\n if (!(radius > 0)) throw new Error('[threadBrep] radius must be > 0')\n if (!(pitch > 0)) throw new Error('[threadBrep] pitch must be > 0')\n if (!(height > 0)) throw new Error('[threadBrep] height must be > 0')\n if (!(depth > 0)) throw new Error('[threadBrep] depth must be > 0')\n if (crest < 0 || crest >= toothHalfWidth) {\n throw new Error('[threadBrep] crest must be >= 0 and < toothHalfWidth')\n }\n if (sectionsPerTurn < 3) {\n throw new Error('[threadBrep] sectionsPerTurn must be >= 3')\n }\n\n const turns = height / pitch\n const nSec = Math.max(2, Math.round(turns * sectionsPerTurn))\n const sign = lefthand ? -1 : 1\n const apexU = inward ? -depth : depth // 齿顶:外螺纹朝外,内螺纹朝内\n const baseU = inward ? 0.3 : -0.3 // 齿根:略微嵌入配合实体以保证布尔干净\n const a = toothHalfWidth\n\n // 构建截面序列\n const sections: BrepHandle[] = []\n const intermediateEdges: BrepHandle[] = []\n\n for (let i = 0; i <= nSec; i++) {\n const th = (sign * i * 2 * Math.PI) / sectionsPerTurn\n const z = (pitch * Math.abs(th)) / (2 * Math.PI)\n const cx = radius * Math.cos(th)\n const cy = radius * Math.sin(th)\n const rx = Math.cos(th)\n const ry = Math.sin(th)\n\n // 点生成函数:u = 径向偏移,v = 轴向偏移\n const pt = (u: number, v: number) => ({\n x: cx + u * rx,\n y: cy + u * ry,\n z: z + v,\n })\n\n // V 型齿(crest=0)通过单个顶点闭合;梯形齿(crest>0)给出平顶\n const profile = crest > 0\n ? [pt(baseU, -a), pt(apexU, -crest), pt(apexU, crest), pt(baseU, a)]\n : [pt(baseU, -a), pt(apexU, 0), pt(baseU, a)]\n\n // 构建边\n const edges: BrepHandle[] = []\n for (let k = 0; k < profile.length; k++) {\n const edge = kernel.makeLineEdge(profile[k], profile[(k + 1) % profile.length])\n edges.push(edge)\n intermediateEdges.push(edge)\n }\n\n // 构建 wire\n const wire = kernel.makeWire(edges)\n sections.push(wire)\n }\n\n // Loft(occt-only 平台面,D3)。BrepHandle(branded number)与 occt-wasm\n // ShapeHandle 运行时同构,品牌转换只发生在平台边界。\n const thread = getOcctKernel().loft(sections as unknown as ShapeHandle[], true, true)\n\n // 释放中间句柄\n for (const w of sections) kernel.release(w)\n for (const e of intermediateEdges) kernel.release(e)\n\n return thread as unknown as BrepHandle\n}\n\n\n/**\n * compat-op 包装:thread(options) → Result<BrepHandle>。\n * 收敛以 core threadBrep 为准(§5.4:vendored compat op 与 core 版两份收敛为一处)。\n * threadBrep 内部校验抛异常 → 捕获为 Result err(错误码 THREAD_INVALID_ARGS / THREAD_FAILED)。\n */\n\nimport type { FormClass } from '../internal/dual-form-args'\nimport { resolveArgs } from '../internal/dual-form-args'\nimport { ok, err, type Result } from '../../result/result'\nimport { validationError, kernelError } from '../../result/errors'\n\nconst THREAD_PARAMS = { name: 'thread', params: ['options'], formClass: 'B1' as FormClass }\n\n/**\n * compat-op wrapper: thread(options) → Result<BrepHandle>.\n * Converges on core threadBrep (§5.4: vendored compat op and core version merged into one).\n * threadBrep internal validation throws are caught as Result err (codes THREAD_INVALID_ARGS / THREAD_FAILED).\n *\n * @param args - Resolved arguments (thread options).\n * @returns The generated thread solid as a `BrepHandle`.\n */\nexport function threadBrepOp(...args: unknown[]): Result<BrepHandle> {\n const [options] = resolveArgs(args, THREAD_PARAMS)\n const kernel = getBrepApi()\n try {\n const h = threadBrep(kernel, options as ThreadOptions)\n return ok(h)\n } catch (e) {\n const raw = e instanceof Error ? e.message : String(e)\n if (raw.startsWith('[threadBrep]')) {\n return err(validationError('THREAD_INVALID_ARGS', raw))\n }\n return err(kernelError('THREAD_FAILED', `Thread generation failed: ${raw}`, e))\n }\n}\n"]}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Self-hosted compat-op implementations — topology transform family
|
|
3
|
+
* (core-decouple Phase 3, §5.4).
|
|
4
|
+
*
|
|
5
|
+
* @platform occt
|
|
6
|
+
*
|
|
7
|
+
* Each export is a "brep-shaped" implementation consumed by the generated
|
|
8
|
+
* compat-op projection (defineOp + D11 arg normalization). Inputs are the
|
|
9
|
+
* normalized positional arguments of the op's params table; shapes arrive as
|
|
10
|
+
* faijs Shapes (or raw handles) and results are returned as BREP handles
|
|
11
|
+
* (wrapped by `wrapBrepOne` → `fromHandle`).
|
|
12
|
+
*
|
|
13
|
+
* Semantics mirror the vendored brepjs fns (`topology/transformFns.ts`,
|
|
14
|
+
* `topology/shapeFns.ts`) with the brepjs object model (castResultShape,
|
|
15
|
+
* metadata propagation, evolution tracking) dropped: occt-wasm handles only.
|
|
16
|
+
*/
|
|
17
|
+
import type { BrepHandle } from '../../brep/engine/types.js';
|
|
18
|
+
import { type Result } from '../../result/result.js';
|
|
19
|
+
/**
|
|
20
|
+
* Apply a 4×4 affine matrix (OpenSCAD `multmatrix` equivalent).
|
|
21
|
+
*
|
|
22
|
+
* The vendored fn splits orthogonal (evolution-tracked) and non-orthogonal
|
|
23
|
+
* (`gp_GTrsf`) paths; the core path uses the single L1 `generalTransform`
|
|
24
|
+
* (occt-wasm `gp_GTrsf`, geometrically equivalent for both classes) since
|
|
25
|
+
* `applyMatrix` carries identity naming and needs no face evolution.
|
|
26
|
+
*
|
|
27
|
+
* @param args - Resolved arguments (shape, matrix).
|
|
28
|
+
* @returns The transformed shape as a `BrepHandle`.
|
|
29
|
+
*/
|
|
30
|
+
export declare function applyMatrixBrep(...args: unknown[]): Result<BrepHandle>;
|
|
31
|
+
/**
|
|
32
|
+
* Deep-copy a shape (`kernel.copyShape`).
|
|
33
|
+
*
|
|
34
|
+
* @param args - Resolved arguments (shape).
|
|
35
|
+
* @returns The cloned shape as a `BrepHandle`.
|
|
36
|
+
*/
|
|
37
|
+
export declare function cloneBrep(...args: unknown[]): Result<BrepHandle>;
|
|
38
|
+
/**
|
|
39
|
+
* Placement-only rigid move (translate/rotate) via the kernel's cheap location
|
|
40
|
+
* re-tag. Ops apply first-to-last (rotate then translate).
|
|
41
|
+
*
|
|
42
|
+
* @param args - Resolved arguments (shape, placement).
|
|
43
|
+
* @returns The relocated shape as a `BrepHandle`.
|
|
44
|
+
*/
|
|
45
|
+
export declare function locateBrep(...args: unknown[]): Result<BrepHandle>;
|
|
46
|
+
/**
|
|
47
|
+
* Mirror across a plane defined by `options.at` (origin) and `options.normal`.
|
|
48
|
+
*
|
|
49
|
+
* @param args - Resolved arguments (shape, mirror options).
|
|
50
|
+
* @returns The mirrored shape as a `BrepHandle`.
|
|
51
|
+
*/
|
|
52
|
+
export declare function mirrorBrep(...args: unknown[]): Result<BrepHandle>;
|
|
53
|
+
/**
|
|
54
|
+
* Rotate the shape around an axis (vendored topology/api.js#rotate + transformFns.ts#rotate).
|
|
55
|
+
*
|
|
56
|
+
* @param args - Resolved arguments (shape, angle in degrees, axis options).
|
|
57
|
+
* @returns The rotated shape as a `BrepHandle`.
|
|
58
|
+
*/
|
|
59
|
+
export declare function rotateBrep(...args: unknown[]): Result<BrepHandle>;
|
|
60
|
+
/**
|
|
61
|
+
* Shell — hollow the shape by removing faces (vendored topology/api.js#shell + modifierFns.ts#shell).
|
|
62
|
+
*
|
|
63
|
+
* @param args - Resolved arguments (shape, faces, thickness, options).
|
|
64
|
+
* @returns The shelled (hollowed) shape as a `BrepHandle`.
|
|
65
|
+
*/
|
|
66
|
+
export declare function shellBrep(...args: unknown[]): Result<BrepHandle>;
|
|
67
|
+
/**
|
|
68
|
+
* Offset all faces of the shape (vendored topology/api.js#offset + modifierFns.ts#offset).
|
|
69
|
+
*
|
|
70
|
+
* @param args - Resolved arguments (shape, distance, options).
|
|
71
|
+
* @returns The offset shape as a `BrepHandle`.
|
|
72
|
+
*/
|
|
73
|
+
export declare function offsetBrep(...args: unknown[]): Result<BrepHandle>;
|
|
74
|
+
//# sourceMappingURL=topologyFns.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"topologyFns.d.ts","sourceRoot":"","sources":["../../../src/api/brep-mirror/topologyFns.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AAEzD,OAAO,EAAW,KAAK,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAoD1D;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC,UAAU,CAAC,CAgDtE;AAQD;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC,UAAU,CAAC,CAchE;AAmBD;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC,UAAU,CAAC,CAoBjE;AAQD;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC,UAAU,CAAC,CAiBjE;AAQD;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC,UAAU,CAAC,CAgCjE;AAOD;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC,UAAU,CAAC,CAmBhE;AAOD;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC,UAAU,CAAC,CAejE"}
|