@faicad/faijs 0.16.1 → 0.18.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 +20 -2
- 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 +66 -29
- 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 +104 -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 +276 -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 +12 -3
- package/dist/api/chamfer.d.ts.map +1 -1
- package/dist/api/chamfer.js +54 -20
- 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 +44 -14
- 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 +22 -10
- 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 +20 -6
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/index.js +30 -13
- 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/profile.d.ts +89 -0
- package/dist/api/profile.d.ts.map +1 -0
- package/dist/api/profile.js +194 -0
- package/dist/api/profile.js.map +1 -0
- package/dist/api/replicate.d.ts +28 -1
- package/dist/api/replicate.d.ts.map +1 -1
- package/dist/api/replicate.js +34 -23
- 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 +729 -477
- 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 +35 -2
- 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 +64 -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 +782 -218
- package/dist/brepkit-kernel/brepkitKernel.js.map +1 -1
- package/dist/brepkit-kernel/multi-version-test.d.ts +40 -0
- package/dist/brepkit-kernel/multi-version-test.d.ts.map +1 -0
- package/dist/brepkit-kernel/multi-version-test.js +89 -0
- package/dist/brepkit-kernel/multi-version-test.js.map +1 -0
- 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 +29 -1
- package/dist/lang/symbol-table.generated.d.ts.map +1 -1
- package/dist/lang/symbol-table.generated.js +30 -2
- 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,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Self-hosted compat-op implementations — boolean / section
|
|
3
|
+
* (core-decouple Phase 3, §5.4).
|
|
4
|
+
*
|
|
5
|
+
* @platform occt
|
|
6
|
+
*
|
|
7
|
+
* Brep-shaped implementation for `section`. Semantics mirror vendored
|
|
8
|
+
* `topology/booleanFns.ts` `section` (NULL_SHAPE_INPUT guard, plane resolution
|
|
9
|
+
* from PlaneInput, kernel section via a planar tool, compound result) using the
|
|
10
|
+
* L1 `sectionByPlane` (occt-wasm `BRepAlgoAPI_Section` + edge/wire downcast).
|
|
11
|
+
*/
|
|
12
|
+
import type { BrepHandle } from '../../brep/engine/types.js';
|
|
13
|
+
import { type Result } from '../../result/result.js';
|
|
14
|
+
/**
|
|
15
|
+
* Section a shape with a plane (vendored `section(shape, plane, options?)`).
|
|
16
|
+
*
|
|
17
|
+
* The plane is resolved from `PlaneInput` (named plane or explicit Plane); the
|
|
18
|
+
* L1 `sectionByPlane` builds the planar tool, runs `BRepAlgoAPI_Section`, and
|
|
19
|
+
* downcasts the result compound to edge/wire handles, which are re-combined
|
|
20
|
+
* into a compound to match the vendored product shape. `options` (approximation
|
|
21
|
+
* / planeSize) is accepted for signature compatibility; the occt native
|
|
22
|
+
* section uses its default approximation.
|
|
23
|
+
*
|
|
24
|
+
* @param args - Resolved arguments (shape, plane).
|
|
25
|
+
* @returns The section result compound as a `BrepHandle`.
|
|
26
|
+
*/
|
|
27
|
+
export declare function sectionBrep(...args: unknown[]): Result<BrepHandle>;
|
|
28
|
+
/**
|
|
29
|
+
* Fuse (union) two shapes into one.
|
|
30
|
+
* @param args - Resolved arguments (a, b).
|
|
31
|
+
* @returns The fused shape as a `BrepHandle`.
|
|
32
|
+
*/
|
|
33
|
+
export declare function fuseBrep(...args: unknown[]): Result<BrepHandle>;
|
|
34
|
+
/**
|
|
35
|
+
* Split a shape with one or more tool shapes.
|
|
36
|
+
* @param args - Resolved arguments (shape, tools).
|
|
37
|
+
* @returns The split result as a `BrepHandle`.
|
|
38
|
+
*/
|
|
39
|
+
export declare function splitBrep(...args: unknown[]): Result<BrepHandle>;
|
|
40
|
+
//# sourceMappingURL=booleanFns.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"booleanFns.d.ts","sourceRoot":"","sources":["../../../src/api/brep-mirror/booleanFns.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AAGzD,OAAO,EAAW,KAAK,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAU1D;;;;;;;;;;;;GAYG;AACH,wBAAgB,WAAW,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC,UAAU,CAAC,CAiClE;AASD;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC,UAAU,CAAC,CAW/D;AAQD;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC,UAAU,CAAC,CAoBhE"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Self-hosted compat-op implementations — boolean / section
|
|
3
|
+
* (core-decouple Phase 3, §5.4).
|
|
4
|
+
*
|
|
5
|
+
* @platform occt
|
|
6
|
+
*
|
|
7
|
+
* Brep-shaped implementation for `section`. Semantics mirror vendored
|
|
8
|
+
* `topology/booleanFns.ts` `section` (NULL_SHAPE_INPUT guard, plane resolution
|
|
9
|
+
* from PlaneInput, kernel section via a planar tool, compound result) using the
|
|
10
|
+
* L1 `sectionByPlane` (occt-wasm `BRepAlgoAPI_Section` + edge/wire downcast).
|
|
11
|
+
*/
|
|
12
|
+
import { getBrepApi } from '../../brep/handle-bridge.js';
|
|
13
|
+
import { getOcctKernel } from '../../occt-kernel/occtKernel.js';
|
|
14
|
+
import { ok, err } from '../../result/result.js';
|
|
15
|
+
import { kernelError } from '../../result/errors.js';
|
|
16
|
+
import { resolveArgs } from '../internal/dual-form-args.js';
|
|
17
|
+
import { resolvePlane } from '../brepjs-compat/planeOps.js';
|
|
18
|
+
import { brepHandleOf } from './brepHelpers.js';
|
|
19
|
+
const SECTION_PARAMS = { name: 'section', params: ['shape', 'plane'], formClass: 'A' };
|
|
20
|
+
/**
|
|
21
|
+
* Section a shape with a plane (vendored `section(shape, plane, options?)`).
|
|
22
|
+
*
|
|
23
|
+
* The plane is resolved from `PlaneInput` (named plane or explicit Plane); the
|
|
24
|
+
* L1 `sectionByPlane` builds the planar tool, runs `BRepAlgoAPI_Section`, and
|
|
25
|
+
* downcasts the result compound to edge/wire handles, which are re-combined
|
|
26
|
+
* into a compound to match the vendored product shape. `options` (approximation
|
|
27
|
+
* / planeSize) is accepted for signature compatibility; the occt native
|
|
28
|
+
* section uses its default approximation.
|
|
29
|
+
*
|
|
30
|
+
* @param args - Resolved arguments (shape, plane).
|
|
31
|
+
* @returns The section result compound as a `BrepHandle`.
|
|
32
|
+
*/
|
|
33
|
+
export function sectionBrep(...args) {
|
|
34
|
+
const [shape, plane] = resolveArgs(args, SECTION_PARAMS);
|
|
35
|
+
const kernel = getBrepApi();
|
|
36
|
+
const h = brepHandleOf(shape);
|
|
37
|
+
// NOTE: 2026-09-26 brepkit 降级——移除 getOcctKernel().IsNull 平台耦合。
|
|
38
|
+
// 空/坏句柄由下游 sectionByPlane 内核抛错并被下方 try/catch 捕获为 SECTION_FAILED
|
|
39
|
+
// (occt 的 sectionByPlane 对空结果本就返回 [],行为等价;brepkit 对坏句柄抛
|
|
40
|
+
// "invalid solid handle",诚实报错而非崩溃)。
|
|
41
|
+
const resolved = resolvePlane(plane);
|
|
42
|
+
if (!resolved.ok)
|
|
43
|
+
return resolved;
|
|
44
|
+
const p = resolved.value;
|
|
45
|
+
try {
|
|
46
|
+
const parts = kernel.sectionByPlane(h, { x: p.origin[0], y: p.origin[1], z: p.origin[2] }, { x: p.zDir[0], y: p.zDir[1], z: p.zDir[2] });
|
|
47
|
+
// 语义差异(如实登记):occt sectionByPlane 返回 edge/wire 句柄组(1D 剖面线);
|
|
48
|
+
// brepkit sectionByPlane 返回 face 句柄组(2D 剖面面)。两侧都包成 compound 产物,
|
|
49
|
+
// 下游 meshShape/wireframe 已按已知集合分发(brepkit makeCompound 对非 solid 子句柄走
|
|
50
|
+
// 虚拟 compound 路径)。
|
|
51
|
+
return ok(kernel.makeCompound(parts));
|
|
52
|
+
}
|
|
53
|
+
catch (e) {
|
|
54
|
+
return err(kernelError('SECTION_FAILED', `Section with plane failed: ${e instanceof Error ? e.message : String(e)}`, e, { operation: 'section' }, 'The cutting plane may not intersect the shape. Verify plane position relative to shape bounds.'));
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
// ---------------------------------------------------------------------------
|
|
58
|
+
// fuse — union two shapes (vendored topology/booleanFns.ts#fuse)
|
|
59
|
+
// ---------------------------------------------------------------------------
|
|
60
|
+
const FUSE_PARAMS = { name: 'fuse', params: ['a', 'b', 'options'], formClass: 'A' };
|
|
61
|
+
/**
|
|
62
|
+
* Fuse (union) two shapes into one.
|
|
63
|
+
* @param args - Resolved arguments (a, b).
|
|
64
|
+
* @returns The fused shape as a `BrepHandle`.
|
|
65
|
+
*/
|
|
66
|
+
export function fuseBrep(...args) {
|
|
67
|
+
const [a, b] = resolveArgs(args, FUSE_PARAMS);
|
|
68
|
+
const kernel = getBrepApi();
|
|
69
|
+
const ha = brepHandleOf(a);
|
|
70
|
+
const hb = brepHandleOf(b);
|
|
71
|
+
try {
|
|
72
|
+
return ok(kernel.fuse(ha, hb));
|
|
73
|
+
}
|
|
74
|
+
catch (e) {
|
|
75
|
+
const raw = e instanceof Error ? e.message : String(e);
|
|
76
|
+
return err(kernelError('FUSE_FAILED', `fuse failed: ${raw}`, e));
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
// ---------------------------------------------------------------------------
|
|
80
|
+
// split — split a shape with tool(s) (vendored topology/api.ts#split → booleanFns.split)
|
|
81
|
+
// ---------------------------------------------------------------------------
|
|
82
|
+
const SPLIT_PARAMS = { name: 'split', params: ['shape', 'tools'], formClass: 'A' };
|
|
83
|
+
/**
|
|
84
|
+
* Split a shape with one or more tool shapes.
|
|
85
|
+
* @param args - Resolved arguments (shape, tools).
|
|
86
|
+
* @returns The split result as a `BrepHandle`.
|
|
87
|
+
*/
|
|
88
|
+
export function splitBrep(...args) {
|
|
89
|
+
const [shape, toolsRaw] = resolveArgs(args, SPLIT_PARAMS);
|
|
90
|
+
const h = brepHandleOf(shape);
|
|
91
|
+
const tools = (toolsRaw ?? []);
|
|
92
|
+
if (tools.length === 0)
|
|
93
|
+
return ok(h);
|
|
94
|
+
const toolHandles = tools.map((t) => brepHandleOf(t));
|
|
95
|
+
try {
|
|
96
|
+
const result = getOcctKernel().split(h, toolHandles);
|
|
97
|
+
return ok(result);
|
|
98
|
+
}
|
|
99
|
+
catch (e) {
|
|
100
|
+
const raw = e instanceof Error ? e.message : String(e);
|
|
101
|
+
return err(kernelError('SPLIT_FAILED', `Split operation failed on ${tools.length} tool(s): ${raw}`, e, { operation: 'split', toolCount: tools.length }));
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
//# sourceMappingURL=booleanFns.js.map
|
|
@@ -0,0 +1 @@
|
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AG,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 } 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 // NOTE: 2026-09-26 brepkit 降级——移除 getOcctKernel().IsNull 平台耦合。\n // 空/坏句柄由下游 sectionByPlane 内核抛错并被下方 try/catch 捕获为 SECTION_FAILED\n // (occt 的 sectionByPlane 对空结果本就返回 [],行为等价;brepkit 对坏句柄抛\n // \"invalid solid handle\",诚实报错而非崩溃)。\n const resolved = resolvePlane(plane as PlaneInput)\n if (!resolved.ok) return resolved\n const p = resolved.value\n try {\n const parts = 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 // 语义差异(如实登记):occt sectionByPlane 返回 edge/wire 句柄组(1D 剖面线);\n // brepkit sectionByPlane 返回 face 句柄组(2D 剖面面)。两侧都包成 compound 产物,\n // 下游 meshShape/wireframe 已按已知集合分发(brepkit makeCompound 对非 solid 子句柄走\n // 虚拟 compound 路径)。\n return ok(kernel.makeCompound(parts))\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;A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§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"}
|