brepjs 12.8.2 → 12.10.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/dist/2d/blueprints/{approximations.d.ts → blueprintApproximations.d.ts} +1 -1
- package/dist/2d/blueprints/blueprintApproximations.d.ts.map +1 -0
- package/dist/2d/blueprints/{customCorners.d.ts → blueprintCustomCorners.d.ts} +1 -1
- package/dist/2d/blueprints/blueprintCustomCorners.d.ts.map +1 -0
- package/dist/2d/blueprints/blueprintFns.d.ts +17 -3
- package/dist/2d/blueprints/blueprintFns.d.ts.map +1 -1
- package/dist/2d/blueprints/{offset.d.ts → blueprintOffset.d.ts} +1 -1
- package/dist/2d/blueprints/blueprintOffset.d.ts.map +1 -0
- package/dist/2d/blueprints/index.d.ts +4 -4
- package/dist/2d/blueprints/index.d.ts.map +1 -1
- package/dist/2d/lib/Curve2D.d.ts +1 -1
- package/dist/2d/lib/Curve2D.d.ts.map +1 -1
- package/dist/2d/lib/svgPath.d.ts.map +1 -1
- package/dist/2d/lib/vectorOperations.d.ts +4 -1
- package/dist/2d/lib/vectorOperations.d.ts.map +1 -1
- package/dist/2d-CzEysb7A.js +108 -0
- package/dist/2d-DCxS_sb_.cjs +107 -0
- package/dist/2d.cjs +24 -88
- package/dist/2d.d.ts +1 -1
- package/dist/2d.js +34 -99
- package/dist/{Blueprint-CQ28WJhz.cjs → Blueprint-BoC0DsDm.cjs} +15 -45
- package/dist/{Blueprint-DbVaf6k7.js → Blueprint-CQNRtmYG.js} +33 -63
- package/dist/{boolean2D-y3E92F0u.js → boolean2D-DXAt4GAK.js} +132 -62
- package/dist/{boolean2D-0blbVtJ8.cjs → boolean2D-N9Pgumgg.cjs} +112 -42
- package/dist/{booleanFns-BCTjYZAg.js → booleanFns-BXV7Oh0h.js} +53 -50
- package/dist/{booleanFns-gmsX3Cv2.cjs → booleanFns-CxArUj_q.cjs} +43 -40
- package/dist/brepjs.cjs +448 -379
- package/dist/brepjs.js +1634 -1563
- package/dist/core/dimensionTypes.d.ts +52 -0
- package/dist/core/dimensionTypes.d.ts.map +1 -0
- package/dist/core/disposal.d.ts +18 -0
- package/dist/core/disposal.d.ts.map +1 -1
- package/dist/core/errors.d.ts +7 -8
- package/dist/core/errors.d.ts.map +1 -1
- package/dist/core/kernelErrorTranslation.d.ts +15 -0
- package/dist/core/kernelErrorTranslation.d.ts.map +1 -0
- package/dist/core/planeOps.d.ts +14 -0
- package/dist/core/planeOps.d.ts.map +1 -1
- package/dist/core/result.d.ts +4 -0
- package/dist/core/result.d.ts.map +1 -1
- package/dist/core/shapeTypes.d.ts +14 -146
- package/dist/core/shapeTypes.d.ts.map +1 -1
- package/dist/core/{definitionMaps.d.ts → typeDiscriminants.d.ts} +5 -1
- package/dist/core/typeDiscriminants.d.ts.map +1 -0
- package/dist/core/validityTypes.d.ts +100 -0
- package/dist/core/validityTypes.d.ts.map +1 -0
- package/dist/core.cjs +52 -11
- package/dist/core.d.ts +1 -1
- package/dist/core.d.ts.map +1 -1
- package/dist/core.js +119 -76
- package/dist/{curveFns-BZngcnQ1.cjs → curveFns-CWZRuXQ3.cjs} +2 -2
- package/dist/{curveFns-mROFhiuG.js → curveFns-OmbtFSG8.js} +14 -14
- package/dist/{drawFns-Bwakrq7w.js → drawFns-8S0ULGRj.js} +146 -118
- package/dist/{drawFns-CjRc1NfQ.cjs → drawFns-voV2wEp8.cjs} +153 -125
- package/dist/{faceFns-B8GnxjdY.js → faceFns-Bn2seBfp.js} +16 -24
- package/dist/{faceFns-DB1Fc5gy.cjs → faceFns-CmIrjdt1.cjs} +2 -10
- package/dist/{helpers-X0juxnwj.js → helpers-CEn618MW.js} +89 -21
- package/dist/{helpers-C8NoT0Wu.cjs → helpers-mipaxDTy.cjs} +77 -9
- package/dist/index.d.ts +20 -19
- package/dist/index.d.ts.map +1 -1
- package/dist/io/gltfImportFns.d.ts +18 -0
- package/dist/io/gltfImportFns.d.ts.map +1 -0
- package/dist/io/ioUtils.d.ts +16 -0
- package/dist/io/ioUtils.d.ts.map +1 -0
- package/dist/io/objImportFns.d.ts.map +1 -1
- package/dist/io/threemfImportFns.d.ts.map +1 -1
- package/dist/io.cjs +4 -4
- package/dist/io.js +4 -4
- package/dist/kernel/brepkit/booleanOps.d.ts +23 -0
- package/dist/kernel/brepkit/booleanOps.d.ts.map +1 -0
- package/dist/kernel/brepkit/constructionOps.d.ts +51 -0
- package/dist/kernel/brepkit/constructionOps.d.ts.map +1 -0
- package/dist/kernel/brepkit/evolutionOps.d.ts +31 -0
- package/dist/kernel/brepkit/evolutionOps.d.ts.map +1 -0
- package/dist/kernel/brepkit/geometryOps.d.ts +56 -0
- package/dist/kernel/brepkit/geometryOps.d.ts.map +1 -0
- package/dist/kernel/brepkit/helpers.d.ts +84 -0
- package/dist/kernel/brepkit/helpers.d.ts.map +1 -0
- package/dist/kernel/brepkit/internalOps.d.ts +28 -0
- package/dist/kernel/brepkit/internalOps.d.ts.map +1 -0
- package/dist/kernel/brepkit/ioOps.d.ts +43 -0
- package/dist/kernel/brepkit/ioOps.d.ts.map +1 -0
- package/dist/kernel/brepkit/measureOps.d.ts +30 -0
- package/dist/kernel/brepkit/measureOps.d.ts.map +1 -0
- package/dist/kernel/brepkit/meshOps.d.ts +7 -0
- package/dist/kernel/brepkit/meshOps.d.ts.map +1 -0
- package/dist/kernel/brepkit/modifierOps.d.ts +15 -0
- package/dist/kernel/brepkit/modifierOps.d.ts.map +1 -0
- package/dist/kernel/brepkit/repairOps.d.ts +14 -0
- package/dist/kernel/brepkit/repairOps.d.ts.map +1 -0
- package/dist/kernel/brepkit/sweepOps.d.ts +27 -0
- package/dist/kernel/brepkit/sweepOps.d.ts.map +1 -0
- package/dist/kernel/brepkit/topologyOps.d.ts +16 -0
- package/dist/kernel/brepkit/topologyOps.d.ts.map +1 -0
- package/dist/kernel/brepkit/transformOps.d.ts +14 -0
- package/dist/kernel/brepkit/transformOps.d.ts.map +1 -0
- package/dist/kernel/brepkitAdapter.d.ts +1 -1
- package/dist/kernel/brepkitAdapter.d.ts.map +1 -1
- package/dist/kernel/brepkitWasmTypes.d.ts +8 -0
- package/dist/kernel/brepkitWasmTypes.d.ts.map +1 -1
- package/dist/kernel/defaultAdapter.d.ts.map +1 -1
- package/dist/kernel/extendedConstructorOps.d.ts +9 -1
- package/dist/kernel/extendedConstructorOps.d.ts.map +1 -1
- package/dist/kernel/index.d.ts +1 -0
- package/dist/kernel/index.d.ts.map +1 -1
- package/dist/kernel/interfaces/boolean-ops.d.ts +25 -0
- package/dist/kernel/interfaces/boolean-ops.d.ts.map +1 -0
- package/dist/kernel/interfaces/builder-ops.d.ts +57 -0
- package/dist/kernel/interfaces/builder-ops.d.ts.map +1 -0
- package/dist/kernel/interfaces/core.d.ts +30 -0
- package/dist/kernel/interfaces/core.d.ts.map +1 -0
- package/dist/kernel/interfaces/curve-ops.d.ts +41 -0
- package/dist/kernel/interfaces/curve-ops.d.ts.map +1 -0
- package/dist/kernel/interfaces/evolution-ops.d.ts +19 -0
- package/dist/kernel/interfaces/evolution-ops.d.ts.map +1 -0
- package/dist/kernel/interfaces/index.d.ts +37 -0
- package/dist/kernel/interfaces/index.d.ts.map +1 -0
- package/dist/kernel/interfaces/io-ops.d.ts +66 -0
- package/dist/kernel/interfaces/io-ops.d.ts.map +1 -0
- package/dist/kernel/interfaces/measure-ops.d.ts +35 -0
- package/dist/kernel/interfaces/measure-ops.d.ts.map +1 -0
- package/dist/kernel/interfaces/mesh-ops.d.ts +21 -0
- package/dist/kernel/interfaces/mesh-ops.d.ts.map +1 -0
- package/dist/kernel/interfaces/modifier-ops.d.ts +22 -0
- package/dist/kernel/interfaces/modifier-ops.d.ts.map +1 -0
- package/dist/kernel/interfaces/primitive-ops.d.ts +13 -0
- package/dist/kernel/interfaces/primitive-ops.d.ts.map +1 -0
- package/dist/kernel/interfaces/repair-ops.d.ts +36 -0
- package/dist/kernel/interfaces/repair-ops.d.ts.map +1 -0
- package/dist/kernel/interfaces/surface-ops.d.ts +50 -0
- package/dist/kernel/interfaces/surface-ops.d.ts.map +1 -0
- package/dist/kernel/interfaces/sweep-ops.d.ts +49 -0
- package/dist/kernel/interfaces/sweep-ops.d.ts.map +1 -0
- package/dist/kernel/interfaces/topology-ops.d.ts +30 -0
- package/dist/kernel/interfaces/topology-ops.d.ts.map +1 -0
- package/dist/kernel/interfaces/transform-ops.d.ts +35 -0
- package/dist/kernel/interfaces/transform-ops.d.ts.map +1 -0
- package/dist/kernel/modifierOps.d.ts +2 -2
- package/dist/kernel/modifierOps.d.ts.map +1 -1
- package/dist/kernel/types.d.ts +2 -446
- package/dist/kernel/types.d.ts.map +1 -1
- package/dist/measurement/measureCache.d.ts +11 -9
- package/dist/measurement/measureCache.d.ts.map +1 -1
- package/dist/measurement/measureFns.d.ts +24 -71
- package/dist/measurement/measureFns.d.ts.map +1 -1
- package/dist/measurement/measureTypes.d.ts +30 -0
- package/dist/measurement/measureTypes.d.ts.map +1 -0
- package/dist/{measurement-D8EJ694A.js → measurement-fJWDEpz0.js} +53 -34
- package/dist/measurement-ph-kanQ7.cjs +154 -0
- package/dist/measurement.cjs +2 -1
- package/dist/measurement.d.ts +1 -1
- package/dist/measurement.d.ts.map +1 -1
- package/dist/measurement.js +4 -3
- package/dist/{meshFns-BnV0ZR8w.cjs → meshFns-B9p4EVV8.cjs} +4 -4
- package/dist/{meshFns-nQjK38EC.js → meshFns-D0qIoxm-.js} +3 -3
- package/dist/operations/compoundOpsFns.d.ts +38 -0
- package/dist/operations/compoundOpsFns.d.ts.map +1 -0
- package/dist/operations/convexHullFns.d.ts +21 -0
- package/dist/operations/convexHullFns.d.ts.map +1 -0
- package/dist/operations/extrudeFns.d.ts +2 -93
- package/dist/operations/extrudeFns.d.ts.map +1 -1
- package/dist/operations/guidedSweepFns.d.ts +3 -22
- package/dist/operations/guidedSweepFns.d.ts.map +1 -1
- package/dist/operations/multiSweepFns.d.ts +3 -29
- package/dist/operations/multiSweepFns.d.ts.map +1 -1
- package/dist/operations/roofFns.d.ts +2 -2
- package/dist/operations/roofFns.d.ts.map +1 -1
- package/dist/operations/straightSkeleton.d.ts.map +1 -1
- package/dist/operations/sweepFns.d.ts +121 -0
- package/dist/operations/sweepFns.d.ts.map +1 -0
- package/dist/{operations-BfbkK6DU.js → operations-DX_qy_TB.js} +29 -177
- package/dist/{operations-CYpmLSC4.cjs → operations-Ds4xoyxR.cjs} +6 -154
- package/dist/operations.cjs +6 -10
- package/dist/operations.d.ts +0 -2
- package/dist/operations.d.ts.map +1 -1
- package/dist/operations.js +26 -30
- package/dist/originTrackingFns-BOCAMfd0.js +137 -0
- package/dist/originTrackingFns-SPU7ly3_.cjs +136 -0
- package/dist/query/edgeFinder.d.ts +4 -14
- package/dist/query/edgeFinder.d.ts.map +1 -1
- package/dist/query/faceFinder.d.ts +4 -14
- package/dist/query/faceFinder.d.ts.map +1 -1
- package/dist/query/finderCore.d.ts +6 -0
- package/dist/query/finderCore.d.ts.map +1 -1
- package/dist/query/shapeFinders.d.ts +32 -0
- package/dist/query/shapeFinders.d.ts.map +1 -0
- package/dist/query/wireFinder.d.ts +4 -9
- package/dist/query/wireFinder.d.ts.map +1 -1
- package/dist/query.cjs +54 -32
- package/dist/query.js +56 -34
- package/dist/{result-BaSD1fqR.js → result-CoDaWsvc.js} +48 -90
- package/dist/{result-fAX0OZzI.cjs → result-DULetAht.cjs} +17 -59
- package/dist/result.cjs +1 -1
- package/dist/result.js +23 -23
- package/dist/shapeFns-BZ6zk7nd.js +34 -0
- package/dist/shapeFns-bRkrwI8R.cjs +33 -0
- package/dist/{shapeTypes-7xEam9Ri.cjs → shapeTypes-T0n6mRmt.cjs} +170 -137
- package/dist/{shapeTypes-CpSaBLDv.js → shapeTypes-dhhm-T5A.js} +205 -172
- package/dist/sketching/CompoundSketch.d.ts +4 -4
- package/dist/sketching/CompoundSketch.d.ts.map +1 -1
- package/dist/sketching/Sketch.d.ts +3 -3
- package/dist/sketching/Sketch.d.ts.map +1 -1
- package/dist/sketching/Sketcher.d.ts.map +1 -1
- package/dist/sketching/Sketches.d.ts +1 -1
- package/dist/sketching/Sketches.d.ts.map +1 -1
- package/dist/sketching/draw.d.ts +1 -20
- package/dist/sketching/draw.d.ts.map +1 -1
- package/dist/sketching/draw3d.d.ts +22 -0
- package/dist/sketching/draw3d.d.ts.map +1 -0
- package/dist/sketching/sketchFns.d.ts +3 -3
- package/dist/sketching/sketchFns.d.ts.map +1 -1
- package/dist/sketching/sketchLib.d.ts +2 -2
- package/dist/sketching/sketchLib.d.ts.map +1 -1
- package/dist/sketching.cjs +2 -2
- package/dist/sketching.d.ts +2 -1
- package/dist/sketching.d.ts.map +1 -1
- package/dist/sketching.js +2 -2
- package/dist/{solidBuilders-994_MQwB.cjs → solidBuilders-BEAoLYvr.cjs} +3 -3
- package/dist/{solidBuilders-DmwhTCCd.js → solidBuilders-tVmD3R7Z.js} +12 -12
- package/dist/{surfaceBuilders-5VA34a3_.cjs → surfaceBuilders-DYS8AMSS.cjs} +3 -3
- package/dist/{surfaceBuilders-nQdJ56fe.js → surfaceBuilders-Dl0ATFbO.js} +15 -15
- package/dist/sweepFns-BKnQs59A.js +215 -0
- package/dist/sweepFns-COqeYIUp.cjs +214 -0
- package/dist/text/textBlueprints.d.ts +4 -3
- package/dist/text/textBlueprints.d.ts.map +1 -1
- package/dist/topology/booleanFns.d.ts.map +1 -1
- package/dist/topology/cast.d.ts +1 -5
- package/dist/topology/cast.d.ts.map +1 -1
- package/dist/topology/compoundOpsFns.d.ts +3 -35
- package/dist/topology/compoundOpsFns.d.ts.map +1 -1
- package/dist/topology/curveFns.d.ts +1 -1
- package/dist/topology/curveFns.d.ts.map +1 -1
- package/dist/topology/index.d.ts +2 -3
- package/dist/topology/index.d.ts.map +1 -1
- package/dist/topology/{colorFns.d.ts → metadata/colorFns.d.ts} +2 -2
- package/dist/topology/metadata/colorFns.d.ts.map +1 -0
- package/dist/topology/{faceTagFns.d.ts → metadata/faceTagFns.d.ts} +2 -2
- package/dist/topology/metadata/faceTagFns.d.ts.map +1 -0
- package/dist/topology/metadata/metadataPropagation.d.ts +30 -0
- package/dist/topology/metadata/metadataPropagation.d.ts.map +1 -0
- package/dist/topology/metadata/originTrackingFns.d.ts +23 -0
- package/dist/topology/metadata/originTrackingFns.d.ts.map +1 -0
- package/dist/topology/modifierFns.d.ts.map +1 -1
- package/dist/topology/shapeFns.d.ts +6 -120
- package/dist/topology/shapeFns.d.ts.map +1 -1
- package/dist/topology/topologyQueryFns.d.ts +67 -0
- package/dist/topology/topologyQueryFns.d.ts.map +1 -0
- package/dist/topology/transformFns.d.ts +49 -0
- package/dist/topology/transformFns.d.ts.map +1 -0
- package/dist/topology/wrapperFns.d.ts.map +1 -1
- package/dist/{topology-C7x98OVn.js → topology-C1oUQXZS.js} +235 -50
- package/dist/{topology-ANwCzGL8.cjs → topology-xyDYbkHW.cjs} +205 -20
- package/dist/topology.cjs +18 -17
- package/dist/topology.js +97 -96
- package/dist/topologyQueryFns-0IptTUCo.cjs +118 -0
- package/dist/topologyQueryFns-Dj4Xd5kx.js +119 -0
- package/dist/{types-CWDdqcrq.js → types-CcKqsmd0.js} +2 -2
- package/dist/utils/precisionRound.d.ts +4 -0
- package/dist/utils/precisionRound.d.ts.map +1 -1
- package/dist/utils/vec2d.d.ts +5 -0
- package/dist/utils/vec2d.d.ts.map +1 -1
- package/dist/{vecOps-ZDdZWbwT.js → vecOps-LTN--A58.js} +15 -15
- package/dist/{vectors-Bx8wkNui.js → vectors-B8juLsQB.js} +15 -7
- package/dist/{vectors-D_IiZx0q.cjs → vectors-I_0zdD3O.cjs} +9 -1
- package/dist/vectors.cjs +1 -1
- package/dist/vectors.js +23 -23
- package/package.json +9 -9
- package/dist/2d/blueprints/approximations.d.ts.map +0 -1
- package/dist/2d/blueprints/customCorners.d.ts.map +0 -1
- package/dist/2d/blueprints/offset.d.ts.map +0 -1
- package/dist/core/definitionMaps.d.ts.map +0 -1
- package/dist/core/geometryHelpers.d.ts +0 -30
- package/dist/core/geometryHelpers.d.ts.map +0 -1
- package/dist/core/memory.d.ts +0 -6
- package/dist/core/memory.d.ts.map +0 -1
- package/dist/core/typeErrors.d.ts +0 -17
- package/dist/core/typeErrors.d.ts.map +0 -1
- package/dist/cornerFinder-Ckz-mPHE.js +0 -59
- package/dist/cornerFinder-ZmOyOOsh.cjs +0 -58
- package/dist/loft-Bhw-FMoL.js +0 -228
- package/dist/loft-hp3pc1M7.cjs +0 -227
- package/dist/measurement-BoNTUBAp.cjs +0 -135
- package/dist/operations/extrude.d.ts +0 -72
- package/dist/operations/extrude.d.ts.map +0 -1
- package/dist/operations/loft.d.ts +0 -33
- package/dist/operations/loft.d.ts.map +0 -1
- package/dist/shapeFns-C2SnNvdH.cjs +0 -468
- package/dist/shapeFns-FDuKkrDR.js +0 -469
- package/dist/topology/colorFns.d.ts.map +0 -1
- package/dist/topology/faceTagFns.d.ts.map +0 -1
- package/dist/utils/round2.d.ts +0 -3
- package/dist/utils/round2.d.ts.map +0 -1
- package/dist/utils/round5.d.ts +0 -3
- package/dist/utils/round5.d.ts.map +0 -1
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Vec3 } from '../core/types.js';
|
|
2
|
+
import { Solid } from '../core/shapeTypes.js';
|
|
3
|
+
import { Result } from '../core/result.js';
|
|
4
|
+
/**
|
|
5
|
+
* Compute the 3D convex hull of a point cloud.
|
|
6
|
+
*
|
|
7
|
+
* Returns the tightest convex solid enclosing all given points.
|
|
8
|
+
* At least 4 non-coplanar points are required to form a solid.
|
|
9
|
+
*
|
|
10
|
+
* @param points - Array of 3D coordinates.
|
|
11
|
+
* @returns `Result<Solid>` — the convex hull solid, or an error.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* const solid = unwrap(convexHull([
|
|
16
|
+
* [0, 0, 0], [10, 0, 0], [0, 10, 0], [0, 0, 10],
|
|
17
|
+
* ]));
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export declare function convexHull(points: ReadonlyArray<Vec3>): Result<Solid>;
|
|
21
|
+
//# sourceMappingURL=convexHullFns.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convexHullFns.d.ts","sourceRoot":"","sources":["../../src/operations/convexHullFns.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAEnD,OAAO,EAAE,KAAK,MAAM,EAAW,MAAM,mBAAmB,CAAC;AAIzD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,aAAa,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,CAoCrE"}
|
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
import { Vec3 } from '../core/types.js';
|
|
2
|
-
import { Dimension, OrientedFace,
|
|
2
|
+
import { Dimension, OrientedFace, Shape3D, ValidSolid } from '../core/shapeTypes.js';
|
|
3
3
|
import { Result } from '../core/result.js';
|
|
4
|
-
import { ExtrusionProfile, SweepOptions } from './extrudeUtils.js';
|
|
5
|
-
/**
|
|
6
|
-
* Functional extrusion operations using Vec3 tuples and branded shape types.
|
|
7
|
-
* Immutable: all functions return new shapes without disposing inputs.
|
|
8
|
-
*/
|
|
9
|
-
type KernelType = any;
|
|
10
4
|
export type { ExtrusionProfile, SweepOptions } from './extrudeUtils.js';
|
|
11
5
|
/**
|
|
12
6
|
* Extrude a face along a vector to produce a solid.
|
|
@@ -14,14 +8,6 @@ export type { ExtrusionProfile, SweepOptions } from './extrudeUtils.js';
|
|
|
14
8
|
* @param face - The planar face to extrude.
|
|
15
9
|
* @param extrusionVec - Direction and magnitude of the extrusion as `[x, y, z]`.
|
|
16
10
|
* @returns `Result` containing the extruded solid, or an error if validation or operation fails.
|
|
17
|
-
*
|
|
18
|
-
* @example
|
|
19
|
-
* ```ts
|
|
20
|
-
* const result = extrude(squareFace, [0, 0, 10]);
|
|
21
|
-
* if (isOk(result)) console.log('Extruded:', result.value);
|
|
22
|
-
* ```
|
|
23
|
-
*
|
|
24
|
-
* @see {@link extrude!basicFaceExtrusion | basicFaceExtrusion} for the OOP API equivalent.
|
|
25
11
|
*/
|
|
26
12
|
export declare function extrude(face: OrientedFace<Dimension>, extrusionVec: Vec3): Result<ValidSolid>;
|
|
27
13
|
/**
|
|
@@ -32,84 +18,7 @@ export declare function extrude(face: OrientedFace<Dimension>, extrusionVec: Vec
|
|
|
32
18
|
* @param direction - Direction vector of the rotation axis. Defaults to Z-up.
|
|
33
19
|
* @param angle - Rotation angle in degrees (0-360). Defaults to a full revolution.
|
|
34
20
|
* @returns `Result` containing the revolved 3D shape, or an error if the result is not 3D.
|
|
35
|
-
*
|
|
36
|
-
* @see {@link extrude!revolution | revolution} for the OOP API equivalent.
|
|
37
21
|
*/
|
|
38
22
|
export declare function revolve(face: OrientedFace<Dimension>, center?: Vec3, direction?: Vec3, angle?: number): Result<Shape3D>;
|
|
39
|
-
|
|
40
|
-
* Sweep a wire profile along a spine wire to create a 3D shape.
|
|
41
|
-
*
|
|
42
|
-
* Supports Frenet framing, auxiliary spine twist, scaling laws, contact
|
|
43
|
-
* detection, and configurable corner transition modes.
|
|
44
|
-
*
|
|
45
|
-
* @param wire - The profile wire to sweep.
|
|
46
|
-
* @param spine - The path wire to sweep along.
|
|
47
|
-
* @param config - Sweep configuration (frenet, transition mode, scaling law, etc.).
|
|
48
|
-
* @param shellMode - When `true`, return `[shell, startWire, endWire]` instead of a solid.
|
|
49
|
-
* @returns `Result` containing either a solid or a `[Shape3D, Wire, Wire]` tuple in shell mode.
|
|
50
|
-
*
|
|
51
|
-
* @remarks
|
|
52
|
-
* In WASM, `BRepOffsetAPI_MakePipeShell` supports only a single `Add_1` call per builder.
|
|
53
|
-
* Multi-profile sweeps will silently ignore additional profiles.
|
|
54
|
-
*
|
|
55
|
-
* @see {@link extrude!genericSweep | genericSweep} for the OOP API equivalent.
|
|
56
|
-
*/
|
|
57
|
-
export declare function sweep(wire: Wire<Dimension>, spine: Wire<Dimension>, config?: SweepOptions, shellMode?: boolean): Result<Shape3D | [Shape3D, Wire, Wire]>;
|
|
58
|
-
/**
|
|
59
|
-
* Extrude a wire along a normal constrained to a support surface.
|
|
60
|
-
*
|
|
61
|
-
* Constructs a linear spine from `center` to `center + normal` and sweeps
|
|
62
|
-
* the profile wire along it, constrained by the support surface geometry.
|
|
63
|
-
*
|
|
64
|
-
* @param wire - The profile wire to sweep.
|
|
65
|
-
* @param center - Start point of the extrusion spine.
|
|
66
|
-
* @param normal - Direction and length of the extrusion.
|
|
67
|
-
* @param support - kernel support surface that constrains the sweep.
|
|
68
|
-
* @returns `Result` containing the swept 3D shape.
|
|
69
|
-
*
|
|
70
|
-
* @see {@link extrude!supportExtrude | supportExtrude (OOP)} for the class-based equivalent.
|
|
71
|
-
*/
|
|
72
|
-
export declare function supportExtrude(wire: Wire<Dimension>, center: Vec3, normal: Vec3, support: KernelType): Result<Shape3D>;
|
|
73
|
-
/**
|
|
74
|
-
* Extrude a wire along a normal with optional profile scaling.
|
|
75
|
-
*
|
|
76
|
-
* Builds a linear spine from `center` to `center + normal` and sweeps the
|
|
77
|
-
* profile wire. When `profileShape` is provided, a scaling law (s-curve or
|
|
78
|
-
* linear) modulates the cross-section size along the path.
|
|
79
|
-
*
|
|
80
|
-
* @param wire - The profile wire to sweep.
|
|
81
|
-
* @param center - Start point of the extrusion spine.
|
|
82
|
-
* @param normal - Direction and length of the extrusion. Must be non-zero.
|
|
83
|
-
* @param profileShape - Optional scaling profile applied along the extrusion.
|
|
84
|
-
* @param shellMode - When `true`, return `[shell, startWire, endWire]` instead of a solid.
|
|
85
|
-
* @returns `Result` containing the extruded shape or a shell tuple.
|
|
86
|
-
*
|
|
87
|
-
* @example
|
|
88
|
-
* ```ts
|
|
89
|
-
* const tapered = complexExtrude(wire, [0,0,0], [0,0,50], {
|
|
90
|
-
* profile: 'linear', endFactor: 0.5
|
|
91
|
-
* });
|
|
92
|
-
* ```
|
|
93
|
-
*
|
|
94
|
-
* @see {@link extrude!complexExtrude | complexExtrude (OOP)} for the class-based equivalent.
|
|
95
|
-
*/
|
|
96
|
-
export declare function complexExtrude(wire: Wire<Dimension>, center: Vec3, normal: Vec3, profileShape?: ExtrusionProfile, shellMode?: boolean): Result<Shape3D | [Shape3D, Wire, Wire]>;
|
|
97
|
-
/**
|
|
98
|
-
* Extrude a wire along a normal with helical twist and optional profile scaling.
|
|
99
|
-
*
|
|
100
|
-
* Constructs a helical auxiliary spine that rotates the profile by
|
|
101
|
-
* `angleDegrees` over the extrusion length. Combines twist with optional
|
|
102
|
-
* s-curve or linear scaling when `profileShape` is provided.
|
|
103
|
-
*
|
|
104
|
-
* @param wire - The profile wire to sweep.
|
|
105
|
-
* @param angleDegrees - Total twist rotation in degrees. Must be non-zero.
|
|
106
|
-
* @param center - Start point of the extrusion spine.
|
|
107
|
-
* @param normal - Direction and length of the extrusion. Must be non-zero.
|
|
108
|
-
* @param profileShape - Optional scaling profile applied along the extrusion.
|
|
109
|
-
* @param shellMode - When `true`, return `[shell, startWire, endWire]` instead of a solid.
|
|
110
|
-
* @returns `Result` containing the twisted extruded shape or a shell tuple.
|
|
111
|
-
*
|
|
112
|
-
* @see {@link extrude!twistExtrude | twistExtrude (OOP)} for the class-based equivalent.
|
|
113
|
-
*/
|
|
114
|
-
export declare function twistExtrude(wire: Wire<Dimension>, angleDegrees: number, center: Vec3, normal: Vec3, profileShape?: ExtrusionProfile, shellMode?: boolean): Result<Shape3D | [Shape3D, Wire, Wire]>;
|
|
23
|
+
export { sweep, supportExtrude, complexExtrude, twistExtrude } from './sweepFns.js';
|
|
115
24
|
//# sourceMappingURL=extrudeFns.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extrudeFns.d.ts","sourceRoot":"","sources":["../../src/operations/extrudeFns.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"extrudeFns.d.ts","sourceRoot":"","sources":["../../src/operations/extrudeFns.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAE7C,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAE1F,OAAO,EAAE,KAAK,MAAM,EAAW,MAAM,mBAAmB,CAAC;AAGzD,YAAY,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAMxE;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,YAAY,CAAC,SAAS,CAAC,EAAE,YAAY,EAAE,IAAI,GAAG,MAAM,CAAC,UAAU,CAAC,CAwB7F;AAED;;;;;;;;GAQG;AACH,wBAAgB,OAAO,CACrB,IAAI,EAAE,YAAY,CAAC,SAAS,CAAC,EAC7B,MAAM,GAAE,IAAgB,EACxB,SAAS,GAAE,IAAgB,EAC3B,KAAK,SAAM,GACV,MAAM,CAAC,OAAO,CAAC,CAajB;AAMD,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -1,25 +1,6 @@
|
|
|
1
|
-
import { Dimension, Wire, Solid, Shell } from '../core/shapeTypes.js';
|
|
2
|
-
import { Result } from '../core/result.js';
|
|
3
|
-
/** Options for guide curve sweep. */
|
|
4
|
-
export interface GuidedSweepOptions {
|
|
5
|
-
/** Transition mode at spine vertices. Defaults to 'transformed'. */
|
|
6
|
-
transition?: 'transformed' | 'round' | 'right';
|
|
7
|
-
/** Produce a solid (true) or shell (false). Defaults to true. */
|
|
8
|
-
solid?: boolean;
|
|
9
|
-
/** Builder tolerance. When set, passed to SetTolerance. */
|
|
10
|
-
tolerance?: number;
|
|
11
|
-
}
|
|
12
1
|
/**
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* The first guide wire is used as an auxiliary spine via `SetMode_5`, which
|
|
16
|
-
* controls how the profile orientation evolves along the path.
|
|
17
|
-
*
|
|
18
|
-
* @param profile - The cross-section wire to sweep.
|
|
19
|
-
* @param spine - The path wire to sweep along.
|
|
20
|
-
* @param guides - Guide wires controlling profile evolution. First guide is used as auxiliary spine.
|
|
21
|
-
* @param options - Sweep configuration.
|
|
22
|
-
* @returns Result containing the swept Solid or Shell.
|
|
2
|
+
* Re-exports from `./sweepFns.js` for backward compatibility.
|
|
3
|
+
* Guided sweep has been consolidated into sweepFns.
|
|
23
4
|
*/
|
|
24
|
-
export
|
|
5
|
+
export { guidedSweep, type GuidedSweepOptions } from './sweepFns.js';
|
|
25
6
|
//# sourceMappingURL=guidedSweepFns.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"guidedSweepFns.d.ts","sourceRoot":"","sources":["../../src/operations/guidedSweepFns.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"guidedSweepFns.d.ts","sourceRoot":"","sources":["../../src/operations/guidedSweepFns.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,WAAW,EAAE,KAAK,kBAAkB,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -1,32 +1,6 @@
|
|
|
1
|
-
import { Dimension, Wire, Solid, Shell } from '../core/shapeTypes.js';
|
|
2
|
-
import { Result } from '../core/result.js';
|
|
3
|
-
/** Configuration for a single sweep section (profile wire + optional location). */
|
|
4
|
-
export interface SweepSectionConfig {
|
|
5
|
-
/** The profile wire for this section. */
|
|
6
|
-
wire: Wire<Dimension>;
|
|
7
|
-
/** Location along the spine as a parameter in [0.0, 1.0]. Auto-distributed if omitted. */
|
|
8
|
-
location?: number;
|
|
9
|
-
}
|
|
10
|
-
/** Options for the multi-section sweep operation. */
|
|
11
|
-
export interface MultiSweepOptions {
|
|
12
|
-
/** Produce a solid (true) or shell (false). Defaults to true. */
|
|
13
|
-
solid?: boolean;
|
|
14
|
-
/** Use ruled (straight) interpolation between sections. Defaults to false. */
|
|
15
|
-
ruled?: boolean;
|
|
16
|
-
/** Tolerance for the loft builder. Defaults to 1e-6. */
|
|
17
|
-
tolerance?: number;
|
|
18
|
-
}
|
|
19
1
|
/**
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
* Each section wire is positioned at a point along the spine (either at an
|
|
23
|
-
* explicit `location` parameter or auto-distributed evenly). The profiles
|
|
24
|
-
* are then lofted using `BRepOffsetAPI_ThruSections`.
|
|
25
|
-
*
|
|
26
|
-
* @param sections - At least 2 section configs with profile wires.
|
|
27
|
-
* @param spine - The path wire to sweep along.
|
|
28
|
-
* @param options - Sweep configuration.
|
|
29
|
-
* @returns Result containing the swept Solid or Shell.
|
|
2
|
+
* Re-exports from `./sweepFns.js` for backward compatibility.
|
|
3
|
+
* Multi-section sweep has been consolidated into sweepFns.
|
|
30
4
|
*/
|
|
31
|
-
export
|
|
5
|
+
export { multiSectionSweep, type SweepSectionConfig, type MultiSweepOptions } from './sweepFns.js';
|
|
32
6
|
//# sourceMappingURL=multiSweepFns.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"multiSweepFns.d.ts","sourceRoot":"","sources":["../../src/operations/multiSweepFns.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"multiSweepFns.d.ts","sourceRoot":"","sources":["../../src/operations/multiSweepFns.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,iBAAiB,EAAE,KAAK,kBAAkB,EAAE,KAAK,iBAAiB,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ClosedWire, Dimension, Solid } from '../core/shapeTypes.js';
|
|
2
2
|
import { Result } from '../core/result.js';
|
|
3
3
|
export interface RoofOptions {
|
|
4
4
|
/** Roof slope angle in degrees (default: 45). */
|
|
@@ -12,5 +12,5 @@ export interface RoofOptions {
|
|
|
12
12
|
* @param options - Optional angle (degrees) for the roof slope
|
|
13
13
|
* @returns A Result containing the roof Solid, or an error
|
|
14
14
|
*/
|
|
15
|
-
export declare function roof(w:
|
|
15
|
+
export declare function roof(w: ClosedWire<Dimension>, options?: RoofOptions): Result<Solid>;
|
|
16
16
|
//# sourceMappingURL=roofFns.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"roofFns.d.ts","sourceRoot":"","sources":["../../src/operations/roofFns.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"roofFns.d.ts","sourceRoot":"","sources":["../../src/operations/roofFns.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,KAAK,EAAQ,MAAM,uBAAuB,CAAC;AAEhF,OAAO,EAAE,KAAK,MAAM,EAAW,MAAM,mBAAmB,CAAC;AAWzD,MAAM,WAAW,WAAW;IAC1B,iDAAiD;IACjD,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;CACzB;AA+HD;;;;;;;GAOG;AACH,wBAAgB,IAAI,CAAC,CAAC,EAAE,UAAU,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,MAAM,CAAC,KAAK,CAAC,CAoGnF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"straightSkeleton.d.ts","sourceRoot":"","sources":["../../src/operations/straightSkeleton.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,QAAQ,EAAE,SAAS,EAAE,CAAC;IAC/B,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,CAAC;CAC5B;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,KAAK,EAAE,YAAY,EAAE,CAAC;IAC/B,QAAQ,CAAC,KAAK,EAAE,YAAY,EAAE,CAAC;CAChC;
|
|
1
|
+
{"version":3,"file":"straightSkeleton.d.ts","sourceRoot":"","sources":["../../src/operations/straightSkeleton.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,QAAQ,EAAE,SAAS,EAAE,CAAC;IAC/B,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,CAAC;CAC5B;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,KAAK,EAAE,YAAY,EAAE,CAAC;IAC/B,QAAQ,CAAC,KAAK,EAAE,YAAY,EAAE,CAAC;CAChC;AAsQD;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,SAAS,EAAE,GAAG,gBAAgB,CAyO9E"}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { Vec3 } from '../core/types.js';
|
|
2
|
+
import { ClosedWire, Dimension, Wire, Shell, Solid, Shape3D } from '../core/shapeTypes.js';
|
|
3
|
+
import { Result } from '../core/result.js';
|
|
4
|
+
import { ExtrusionProfile, SweepOptions } from './extrudeUtils.js';
|
|
5
|
+
/**
|
|
6
|
+
* Sweep operations — generic sweep, support extrude, complex extrude,
|
|
7
|
+
* twist extrude, multi-section sweep, and guided sweep.
|
|
8
|
+
*
|
|
9
|
+
* Consolidated from extrudeFns, multiSweepFns, and guidedSweepFns.
|
|
10
|
+
*/
|
|
11
|
+
type KernelType = any;
|
|
12
|
+
export type { ExtrusionProfile, SweepOptions } from './extrudeUtils.js';
|
|
13
|
+
/** Configuration for a single sweep section (profile wire + optional location). */
|
|
14
|
+
export interface SweepSectionConfig {
|
|
15
|
+
/** The profile wire for this section. */
|
|
16
|
+
wire: Wire<Dimension>;
|
|
17
|
+
/** Location along the spine as a parameter in [0.0, 1.0]. Auto-distributed if omitted. */
|
|
18
|
+
location?: number;
|
|
19
|
+
}
|
|
20
|
+
/** Options for the multi-section sweep operation. */
|
|
21
|
+
export interface MultiSweepOptions {
|
|
22
|
+
/** Produce a solid (true) or shell (false). Defaults to true. */
|
|
23
|
+
solid?: boolean;
|
|
24
|
+
/** Use ruled (straight) interpolation between sections. Defaults to false. */
|
|
25
|
+
ruled?: boolean;
|
|
26
|
+
/** Tolerance for the loft builder. Defaults to 1e-6. */
|
|
27
|
+
tolerance?: number;
|
|
28
|
+
}
|
|
29
|
+
/** Options for guide curve sweep. */
|
|
30
|
+
export interface GuidedSweepOptions {
|
|
31
|
+
/** Transition mode at spine vertices. Defaults to 'transformed'. */
|
|
32
|
+
transition?: 'transformed' | 'round' | 'right';
|
|
33
|
+
/** Produce a solid (true) or shell (false). Defaults to true. */
|
|
34
|
+
solid?: boolean;
|
|
35
|
+
/** Builder tolerance. When set, passed to SetTolerance. */
|
|
36
|
+
tolerance?: number;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Sweep a wire profile along a spine wire to create a 3D shape.
|
|
40
|
+
*
|
|
41
|
+
* Supports Frenet framing, auxiliary spine twist, scaling laws, contact
|
|
42
|
+
* detection, and configurable corner transition modes.
|
|
43
|
+
*
|
|
44
|
+
* @param wire - The profile wire to sweep (must be closed for solid output).
|
|
45
|
+
* @param spine - The path wire to sweep along.
|
|
46
|
+
* @param config - Sweep configuration (frenet, transition mode, scaling law, etc.).
|
|
47
|
+
* @param shellMode - When `true`, return `[shell, startWire, endWire]` instead of a solid.
|
|
48
|
+
* @returns `Result` containing either a solid or a `[Shape3D, Wire, Wire]` tuple in shell mode.
|
|
49
|
+
*/
|
|
50
|
+
export declare function sweep(wire: ClosedWire<Dimension>, spine: Wire<Dimension>, config?: SweepOptions, shellMode?: boolean): Result<Shape3D | [Shape3D, Wire, Wire]>;
|
|
51
|
+
/**
|
|
52
|
+
* Extrude a wire along a normal constrained to a support surface.
|
|
53
|
+
*
|
|
54
|
+
* Constructs a linear spine from `center` to `center + normal` and sweeps
|
|
55
|
+
* the profile wire along it, constrained by the support surface geometry.
|
|
56
|
+
*
|
|
57
|
+
* @param wire - The profile wire to sweep (must be closed).
|
|
58
|
+
* @param center - Start point of the extrusion spine.
|
|
59
|
+
* @param normal - Direction and length of the extrusion.
|
|
60
|
+
* @param support - kernel support surface that constrains the sweep.
|
|
61
|
+
* @returns `Result` containing the swept 3D shape.
|
|
62
|
+
*/
|
|
63
|
+
export declare function supportExtrude(wire: ClosedWire<Dimension>, center: Vec3, normal: Vec3, support: KernelType): Result<Shape3D>;
|
|
64
|
+
/**
|
|
65
|
+
* Extrude a wire along a normal with optional profile scaling.
|
|
66
|
+
*
|
|
67
|
+
* Builds a linear spine from `center` to `center + normal` and sweeps the
|
|
68
|
+
* profile wire. When `profileShape` is provided, a scaling law (s-curve or
|
|
69
|
+
* linear) modulates the cross-section size along the path.
|
|
70
|
+
*
|
|
71
|
+
* @param wire - The profile wire to sweep (must be closed).
|
|
72
|
+
* @param center - Start point of the extrusion spine.
|
|
73
|
+
* @param normal - Direction and length of the extrusion. Must be non-zero.
|
|
74
|
+
* @param profileShape - Optional scaling profile applied along the extrusion.
|
|
75
|
+
* @param shellMode - When `true`, return `[shell, startWire, endWire]` instead of a solid.
|
|
76
|
+
* @returns `Result` containing the extruded shape or a shell tuple.
|
|
77
|
+
*/
|
|
78
|
+
export declare function complexExtrude(wire: ClosedWire<Dimension>, center: Vec3, normal: Vec3, profileShape?: ExtrusionProfile, shellMode?: boolean): Result<Shape3D | [Shape3D, Wire, Wire]>;
|
|
79
|
+
/**
|
|
80
|
+
* Extrude a wire along a normal with helical twist and optional profile scaling.
|
|
81
|
+
*
|
|
82
|
+
* Constructs a helical auxiliary spine that rotates the profile by
|
|
83
|
+
* `angleDegrees` over the extrusion length. Combines twist with optional
|
|
84
|
+
* s-curve or linear scaling when `profileShape` is provided.
|
|
85
|
+
*
|
|
86
|
+
* @param wire - The profile wire to sweep (must be closed).
|
|
87
|
+
* @param angleDegrees - Total twist rotation in degrees. Must be non-zero.
|
|
88
|
+
* @param center - Start point of the extrusion spine.
|
|
89
|
+
* @param normal - Direction and length of the extrusion. Must be non-zero.
|
|
90
|
+
* @param profileShape - Optional scaling profile applied along the extrusion.
|
|
91
|
+
* @param shellMode - When `true`, return `[shell, startWire, endWire]` instead of a solid.
|
|
92
|
+
* @returns `Result` containing the twisted extruded shape or a shell tuple.
|
|
93
|
+
*/
|
|
94
|
+
export declare function twistExtrude(wire: ClosedWire<Dimension>, angleDegrees: number, center: Vec3, normal: Vec3, profileShape?: ExtrusionProfile, shellMode?: boolean): Result<Shape3D | [Shape3D, Wire, Wire]>;
|
|
95
|
+
/**
|
|
96
|
+
* Sweep multiple profile sections along a spine wire.
|
|
97
|
+
*
|
|
98
|
+
* Each section wire is positioned at a point along the spine (either at an
|
|
99
|
+
* explicit `location` parameter or auto-distributed evenly). The profiles
|
|
100
|
+
* are then lofted using `BRepOffsetAPI_ThruSections`.
|
|
101
|
+
*
|
|
102
|
+
* @param sections - At least 2 section configs with profile wires.
|
|
103
|
+
* @param spine - The path wire to sweep along.
|
|
104
|
+
* @param options - Sweep configuration.
|
|
105
|
+
* @returns Result containing the swept Solid or Shell.
|
|
106
|
+
*/
|
|
107
|
+
export declare function multiSectionSweep(sections: ReadonlyArray<SweepSectionConfig>, spine: Wire<Dimension>, options?: MultiSweepOptions): Result<Solid | Shell>;
|
|
108
|
+
/**
|
|
109
|
+
* Sweep a profile wire along a spine, using guide wires to control shape evolution.
|
|
110
|
+
*
|
|
111
|
+
* The first guide wire is used as an auxiliary spine via `SetMode_5`, which
|
|
112
|
+
* controls how the profile orientation evolves along the path.
|
|
113
|
+
*
|
|
114
|
+
* @param profile - The cross-section wire to sweep.
|
|
115
|
+
* @param spine - The path wire to sweep along.
|
|
116
|
+
* @param guides - Guide wires controlling profile evolution. First guide is used as auxiliary spine.
|
|
117
|
+
* @param options - Sweep configuration.
|
|
118
|
+
* @returns Result containing the swept Solid or Shell.
|
|
119
|
+
*/
|
|
120
|
+
export declare function guidedSweep(profile: Wire<Dimension>, spine: Wire<Dimension>, guides: ReadonlyArray<Wire<Dimension>>, options?: GuidedSweepOptions): Result<Solid | Shell>;
|
|
121
|
+
//# sourceMappingURL=sweepFns.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sweepFns.d.ts","sourceRoot":"","sources":["../../src/operations/sweepFns.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
1
|
+
import { e as err, i as ioError, o as ok, v as validationError, f as computationError } from "./result-CoDaWsvc.js";
|
|
2
|
+
import { i as vecIsZero, c as vecNormalize } from "./vecOps-LTN--A58.js";
|
|
3
|
+
import { g as fuseAll } from "./booleanFns-BXV7Oh0h.js";
|
|
4
|
+
import { g as getKernel, w as createKernelHandle, c as castShape } from "./shapeTypes-dhhm-T5A.js";
|
|
5
|
+
import { t as toBREP } from "./shapeFns-BZ6zk7nd.js";
|
|
6
|
+
import { e as fromBREP } from "./faceFns-Bn2seBfp.js";
|
|
7
|
+
import "./sweepFns-BKnQs59A.js";
|
|
8
8
|
function uuidv() {
|
|
9
9
|
return (String([1e7]) + String(-1e3) + String(-4e3) + String(-8e3) + String(-1e11)).replace(
|
|
10
10
|
/[018]/g,
|
|
@@ -31,148 +31,6 @@ function createAssembly(shapes = []) {
|
|
|
31
31
|
const doc = getKernel().createXCAFDocument(parts);
|
|
32
32
|
return createKernelHandle(doc);
|
|
33
33
|
}
|
|
34
|
-
function makeSpineWire(start, end) {
|
|
35
|
-
const kernel = getKernel();
|
|
36
|
-
const edge = kernel.makeLineEdge([...start], [...end]);
|
|
37
|
-
const wire = kernel.makeWire([edge]);
|
|
38
|
-
return castShape(wire);
|
|
39
|
-
}
|
|
40
|
-
function makeHelixWire(pitch, height, radius, center, dir, _lefthand = false) {
|
|
41
|
-
const kernel = getKernel();
|
|
42
|
-
return castShape(kernel.makeHelixWire(pitch, height, radius, [...center], [...dir]));
|
|
43
|
-
}
|
|
44
|
-
function extrude(face, extrusionVec) {
|
|
45
|
-
if (getKernel().isNull(face.wrapped)) {
|
|
46
|
-
return err(validationError(BrepErrorCode.NULL_SHAPE_INPUT, "extrude: face is a null shape"));
|
|
47
|
-
}
|
|
48
|
-
if (vecLength(extrusionVec) === 0) {
|
|
49
|
-
return err(validationError("EXTRUDE_ZERO_VECTOR", "extrude: extrusion vector has zero length"));
|
|
50
|
-
}
|
|
51
|
-
try {
|
|
52
|
-
const kernel = getKernel();
|
|
53
|
-
const len = vecLength(extrusionVec);
|
|
54
|
-
const dir = vecNormalize(extrusionVec);
|
|
55
|
-
const shape = kernel.extrude(face.wrapped, [...dir], len);
|
|
56
|
-
const downcastShape = kernel.downcast(shape, "solid");
|
|
57
|
-
const solid = createSolid(downcastShape);
|
|
58
|
-
return ok(solid);
|
|
59
|
-
} catch (e) {
|
|
60
|
-
return err(
|
|
61
|
-
kernelError("EXTRUDE_FAILED", "Extrusion operation failed", e, {
|
|
62
|
-
operation: "extrude",
|
|
63
|
-
vectorLength: vecLength(extrusionVec)
|
|
64
|
-
})
|
|
65
|
-
);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
function revolve(face, center = [0, 0, 0], direction = [0, 0, 1], angle = 360) {
|
|
69
|
-
if (getKernel().isNull(face.wrapped)) {
|
|
70
|
-
return err(validationError(BrepErrorCode.NULL_SHAPE_INPUT, "revolve: face is a null shape"));
|
|
71
|
-
}
|
|
72
|
-
const kernel = getKernel();
|
|
73
|
-
const shape = kernel.revolveVec(face.wrapped, [...center], [...direction], angle);
|
|
74
|
-
const result = castShape(shape);
|
|
75
|
-
if (!isShape3D(result)) {
|
|
76
|
-
return err(typeCastError("REVOLUTION_NOT_3D", "Revolution did not produce a 3D shape"));
|
|
77
|
-
}
|
|
78
|
-
return ok(result);
|
|
79
|
-
}
|
|
80
|
-
function sweep(wire, spine, config = {}, shellMode = false) {
|
|
81
|
-
if (config.mode === "simple" && !shellMode) {
|
|
82
|
-
const kernel2 = getKernel();
|
|
83
|
-
const resultOc = kernel2.simplePipe(wire.wrapped, spine.wrapped);
|
|
84
|
-
const shape2 = castShape(resultOc);
|
|
85
|
-
if (!isShape3D(shape2)) {
|
|
86
|
-
return err(typeCastError("SWEEP_NOT_3D", "Simple pipe did not produce a 3D shape"));
|
|
87
|
-
}
|
|
88
|
-
return ok(shape2);
|
|
89
|
-
}
|
|
90
|
-
const {
|
|
91
|
-
frenet = false,
|
|
92
|
-
auxiliarySpine,
|
|
93
|
-
law = null,
|
|
94
|
-
transitionMode = "right",
|
|
95
|
-
withContact,
|
|
96
|
-
support,
|
|
97
|
-
forceProfileSpineOthogonality,
|
|
98
|
-
tolerance,
|
|
99
|
-
boundTolerance,
|
|
100
|
-
angularTolerance,
|
|
101
|
-
maxDegree,
|
|
102
|
-
maxSegments
|
|
103
|
-
} = config;
|
|
104
|
-
const kernel = getKernel();
|
|
105
|
-
const withCorrection = transitionMode === "round" ? true : !!forceProfileSpineOthogonality;
|
|
106
|
-
const result = kernel.sweepPipeShell(wire.wrapped, spine.wrapped, {
|
|
107
|
-
transitionMode,
|
|
108
|
-
contact: !!withContact,
|
|
109
|
-
correction: withCorrection,
|
|
110
|
-
frenet,
|
|
111
|
-
shellMode,
|
|
112
|
-
...auxiliarySpine?.wrapped ? { auxiliary: auxiliarySpine.wrapped } : {},
|
|
113
|
-
...law !== null ? { law } : {},
|
|
114
|
-
...support !== null ? { support } : {},
|
|
115
|
-
tolerance,
|
|
116
|
-
boundTolerance,
|
|
117
|
-
angularTolerance,
|
|
118
|
-
maxDegree,
|
|
119
|
-
maxSegments
|
|
120
|
-
});
|
|
121
|
-
if (shellMode && typeof result === "object" && "firstShape" in result) {
|
|
122
|
-
const shape2 = castShape(result.shape);
|
|
123
|
-
if (!isShape3D(shape2)) {
|
|
124
|
-
return err(typeCastError("SWEEP_NOT_3D", "Sweep did not produce a 3D shape"));
|
|
125
|
-
}
|
|
126
|
-
const startWire = castShape(result.firstShape);
|
|
127
|
-
const endWire = castShape(result.lastShape);
|
|
128
|
-
if (!isWire(startWire)) {
|
|
129
|
-
return err(typeCastError("SWEEP_START_NOT_WIRE", "Sweep did not produce a start Wire"));
|
|
130
|
-
}
|
|
131
|
-
if (!isWire(endWire)) {
|
|
132
|
-
return err(typeCastError("SWEEP_END_NOT_WIRE", "Sweep did not produce an end Wire"));
|
|
133
|
-
}
|
|
134
|
-
return ok([shape2, startWire, endWire]);
|
|
135
|
-
}
|
|
136
|
-
const shape = castShape(result);
|
|
137
|
-
if (!isShape3D(shape)) {
|
|
138
|
-
return err(typeCastError("SWEEP_NOT_3D", "Sweep did not produce a 3D shape"));
|
|
139
|
-
}
|
|
140
|
-
return ok(shape);
|
|
141
|
-
}
|
|
142
|
-
function supportExtrude(wire, center, normal, support) {
|
|
143
|
-
const endPoint = vecAdd(center, normal);
|
|
144
|
-
const spine = makeSpineWire(center, endPoint);
|
|
145
|
-
return sweep(wire, spine, { support });
|
|
146
|
-
}
|
|
147
|
-
function complexExtrude(wire, center, normal, profileShape, shellMode = false) {
|
|
148
|
-
const extrusionLength = vecLength(normal);
|
|
149
|
-
if (extrusionLength === 0) {
|
|
150
|
-
return err(
|
|
151
|
-
validationError("ZERO_LENGTH_EXTRUSION", "Extrusion vector cannot have zero length")
|
|
152
|
-
);
|
|
153
|
-
}
|
|
154
|
-
const endPoint = vecAdd(center, normal);
|
|
155
|
-
const spine = makeSpineWire(center, endPoint);
|
|
156
|
-
const law = profileShape ? unwrap(buildLawFromProfile(extrusionLength, profileShape)) : null;
|
|
157
|
-
return sweep(wire, spine, { law }, shellMode);
|
|
158
|
-
}
|
|
159
|
-
function twistExtrude(wire, angleDegrees, center, normal, profileShape, shellMode = false) {
|
|
160
|
-
if (angleDegrees === 0) {
|
|
161
|
-
return err(validationError("ZERO_TWIST_ANGLE", "Twist angle cannot be zero"));
|
|
162
|
-
}
|
|
163
|
-
const extrusionLength = vecLength(normal);
|
|
164
|
-
if (extrusionLength === 0) {
|
|
165
|
-
return err(
|
|
166
|
-
validationError("ZERO_LENGTH_EXTRUSION", "Extrusion vector cannot have zero length")
|
|
167
|
-
);
|
|
168
|
-
}
|
|
169
|
-
const endPoint = vecAdd(center, normal);
|
|
170
|
-
const spine = makeSpineWire(center, endPoint);
|
|
171
|
-
const pitch = 360 / angleDegrees * extrusionLength;
|
|
172
|
-
const auxiliarySpine = makeHelixWire(pitch, extrusionLength, 1, center, normal);
|
|
173
|
-
const law = profileShape ? unwrap(buildLawFromProfile(extrusionLength, profileShape)) : null;
|
|
174
|
-
return sweep(wire, spine, { auxiliarySpine, law }, shellMode);
|
|
175
|
-
}
|
|
176
34
|
function exportAssemblySTEP(shapes = [], { unit, modelUnit } = {}) {
|
|
177
35
|
const parseHex = (hex) => {
|
|
178
36
|
let h = hex;
|
|
@@ -529,38 +387,32 @@ function deserializeHistory(data) {
|
|
|
529
387
|
return ok({ steps: data.steps, shapes });
|
|
530
388
|
}
|
|
531
389
|
export {
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
stepsFrom as C,
|
|
535
|
-
supportExtrude as D,
|
|
536
|
-
twistExtrude as E,
|
|
537
|
-
undoLast as F,
|
|
538
|
-
updateNode as G,
|
|
539
|
-
gridPattern as H,
|
|
390
|
+
updateNode as A,
|
|
391
|
+
gridPattern as B,
|
|
540
392
|
addChild as a,
|
|
541
393
|
addStep as b,
|
|
542
394
|
circularPattern as c,
|
|
543
395
|
collectShapes as d,
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
396
|
+
countNodes as e,
|
|
397
|
+
createAssembly as f,
|
|
398
|
+
createAssemblyNode as g,
|
|
399
|
+
createHistory as h,
|
|
400
|
+
createRegistry as i,
|
|
401
|
+
deserializeHistory as j,
|
|
402
|
+
exportAssemblySTEP as k,
|
|
551
403
|
linearPattern as l,
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
404
|
+
findNode as m,
|
|
405
|
+
findStep as n,
|
|
406
|
+
getShape as o,
|
|
407
|
+
modifyStep as p,
|
|
408
|
+
registerShape as q,
|
|
409
|
+
registerOperation as r,
|
|
410
|
+
removeChild as s,
|
|
411
|
+
replayFrom as t,
|
|
412
|
+
replayHistory as u,
|
|
413
|
+
serializeHistory as v,
|
|
562
414
|
walkAssembly as w,
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
415
|
+
stepCount as x,
|
|
416
|
+
stepsFrom as y,
|
|
417
|
+
undoLast as z
|
|
566
418
|
};
|