brepjs 8.4.0 → 8.7.4
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.cjs +2 -2
- package/dist/2d.js +13 -13
- package/dist/{Blueprint-zgFe_5Qj.cjs → Blueprint-BcbOBF-9.cjs} +11 -99
- package/dist/{Blueprint-Bp45tnh0.js → Blueprint-Cmh8lKc4.js} +29 -117
- package/dist/{boolean2D-CfEbRMPF.cjs → boolean2D-CqacqjME.cjs} +24 -25
- package/dist/{boolean2D-DN6ETTCq.js → boolean2D-D94Axs3i.js} +23 -24
- package/dist/{booleanFns-C-M6qqvB.js → booleanFns-DdjtpcM6.js} +306 -12
- package/dist/{booleanFns-5dDG0jpA.cjs → booleanFns-NtKxkiXn.cjs} +299 -5
- package/dist/brepjs.cjs +1619 -71
- package/dist/brepjs.js +1880 -333
- package/dist/core/errors.d.ts +18 -0
- package/dist/core/errors.d.ts.map +1 -1
- package/dist/core.cjs +4 -4
- package/dist/core.js +4 -4
- package/dist/{cornerFinder-CC_MunIh.js → cornerFinder-BBOYfsXl.js} +1 -1
- package/dist/{cornerFinder-BQ-_VJx0.cjs → cornerFinder-Bqy8Lw2p.cjs} +1 -1
- package/dist/{curveFns-ZuQUBZvd.js → curveFns-B85Glnfo.js} +19 -17
- package/dist/{curveFns-VMxgfkqw.cjs → curveFns-BXCbASW-.cjs} +6 -4
- package/dist/{drawFns-BbhX1IUq.js → drawFns-B-gJ2WUc.js} +47 -21
- package/dist/{drawFns-CKaHgGSK.cjs → drawFns-CAmFEqd1.cjs} +63 -37
- package/dist/{errors-CSYOlCCR.js → errors-Coh_5_19.js} +26 -1
- package/dist/{errors-D13q2HCk.cjs → errors-eRQu29oc.cjs} +26 -1
- package/dist/{faceFns-CfJIbHY3.js → faceFns-CltrEfOo.js} +109 -12
- package/dist/{faceFns-es3GENII.cjs → faceFns-DcndPHWm.cjs} +103 -6
- package/dist/{helpers-C0q_FVxq.cjs → helpers-CC21GeAr.cjs} +8 -9
- package/dist/{helpers-CmVkMubc.js → helpers-SksQIreB.js} +16 -17
- package/dist/index.d.ts +18 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/io/dxfImportFns.d.ts +17 -0
- package/dist/io/dxfImportFns.d.ts.map +1 -0
- package/dist/io/objImportFns.d.ts +19 -0
- package/dist/io/objImportFns.d.ts.map +1 -0
- package/dist/io/threemfImportFns.d.ts +19 -0
- package/dist/io/threemfImportFns.d.ts.map +1 -0
- package/dist/io.cjs +5 -5
- package/dist/io.js +5 -5
- package/dist/kernel/hullOps.d.ts +1 -0
- package/dist/kernel/hullOps.d.ts.map +1 -1
- package/dist/kernel/occtAdapter.d.ts +5 -0
- package/dist/kernel/occtAdapter.d.ts.map +1 -1
- package/dist/kernel/solverAdapter.d.ts +39 -0
- package/dist/kernel/solverAdapter.d.ts.map +1 -0
- package/dist/kernel/types.d.ts +5 -0
- package/dist/kernel/types.d.ts.map +1 -1
- package/dist/{loft-B-UCPW9P.cjs → loft-BcyyvWCj.cjs} +28 -28
- package/dist/{loft-oJq2OD3A.js → loft-CJMPx1NQ.js} +16 -16
- package/dist/{measurement-Cf_SoIiR.js → measurement-ByOztLxb.js} +3 -3
- package/dist/{measurement-CYmT-C77.cjs → measurement-DU3ry-0Q.cjs} +3 -3
- package/dist/measurement.cjs +1 -1
- package/dist/measurement.js +1 -1
- package/dist/{meshFns-CqNwW0PO.js → meshFns-D2gLyLFt.js} +3 -3
- package/dist/{meshFns-DDC_2U81.cjs → meshFns-DawUwI3W.cjs} +3 -3
- package/dist/{occtBoundary-D_gjqgzo.js → occtBoundary-CWzWqBCm.js} +17 -5
- package/dist/{occtBoundary-CocN2VKx.cjs → occtBoundary-DH2VO-rq.cjs} +12 -0
- package/dist/operations/assemblyFns.d.ts +1 -0
- package/dist/operations/assemblyFns.d.ts.map +1 -1
- package/dist/operations/guidedSweepFns.d.ts +25 -0
- package/dist/operations/guidedSweepFns.d.ts.map +1 -0
- package/dist/operations/mateFns.d.ts +50 -0
- package/dist/operations/mateFns.d.ts.map +1 -0
- package/dist/operations/multiSweepFns.d.ts +32 -0
- package/dist/operations/multiSweepFns.d.ts.map +1 -0
- package/dist/operations/roofFns.d.ts +16 -0
- package/dist/operations/roofFns.d.ts.map +1 -0
- package/dist/operations/straightSkeleton.d.ts +28 -0
- package/dist/operations/straightSkeleton.d.ts.map +1 -0
- package/dist/{operations-BQeW_DSM.cjs → operations-CdELWxgv.cjs} +7 -7
- package/dist/{operations-6hdpuYmY.js → operations-DiXo_4t9.js} +15 -15
- package/dist/operations.cjs +2 -2
- package/dist/operations.js +13 -13
- package/dist/query.cjs +5 -5
- package/dist/query.js +7 -7
- package/dist/result.cjs +1 -1
- package/dist/result.js +1 -1
- package/dist/{shapeFns-B0zSdO9c.cjs → shapeFns-3RYtsUVY.cjs} +54 -21
- package/dist/{shapeFns-k1YHFwmB.js → shapeFns-4ioRrhih.js} +52 -19
- package/dist/{shapeTypes-BxVxLdiD.cjs → shapeTypes-CMjrTv36.cjs} +1 -1
- package/dist/{shapeTypes-c-_pgYCx.js → shapeTypes-D0vfRxWb.js} +13 -13
- package/dist/sketching.cjs +2 -2
- package/dist/sketching.js +2 -2
- package/dist/{curveBuilders-BREwqvuc.js → surfaceBuilders-B7Jxob8g.js} +106 -13
- package/dist/{curveBuilders-BkEJ-RVn.cjs → surfaceBuilders-Xx9DRRxs.cjs} +96 -3
- package/dist/text/textBlueprints.d.ts +38 -0
- package/dist/text/textBlueprints.d.ts.map +1 -1
- package/dist/topology/api.d.ts +5 -0
- package/dist/topology/api.d.ts.map +1 -1
- package/dist/topology/booleanFns.d.ts +10 -1
- package/dist/topology/booleanFns.d.ts.map +1 -1
- package/dist/topology/colorFns.d.ts +38 -0
- package/dist/topology/colorFns.d.ts.map +1 -0
- package/dist/topology/curveFns.d.ts +1 -1
- package/dist/topology/curveFns.d.ts.map +1 -1
- package/dist/topology/faceTagFns.d.ts +44 -0
- package/dist/topology/faceTagFns.d.ts.map +1 -0
- package/dist/topology/modifierFns.d.ts.map +1 -1
- package/dist/topology/polyhedronFns.d.ts +8 -0
- package/dist/topology/polyhedronFns.d.ts.map +1 -0
- package/dist/topology/shapeFns.d.ts +4 -0
- package/dist/topology/shapeFns.d.ts.map +1 -1
- package/dist/topology/surfaceBuilders.d.ts +7 -0
- package/dist/topology/surfaceBuilders.d.ts.map +1 -1
- package/dist/topology/surfaceFns.d.ts +38 -0
- package/dist/topology/surfaceFns.d.ts.map +1 -0
- package/dist/{topology-CycEc6Oe.cjs → topology-D-nGjCzV.cjs} +19 -20
- package/dist/{topology-tMKHJgw2.js → topology-DRP9zreU.js} +8 -9
- package/dist/topology.cjs +13 -14
- package/dist/topology.js +51 -52
- package/dist/{vectors-DE0XriuQ.js → vectors-CZV4ZrTz.js} +2 -2
- package/dist/{vectors-DVmHF4zt.cjs → vectors-DwFeX0Ja.cjs} +2 -2
- package/dist/vectors.cjs +2 -2
- package/dist/vectors.js +2 -2
- package/package.json +4 -3
- package/dist/cast-CPNOTNFm.cjs +0 -102
- package/dist/cast-Cerqtxtb.js +0 -103
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Constraint solver adapter — analytical solver for simple assembly mates.
|
|
3
|
+
*/
|
|
4
|
+
/** 3D vector (local alias to avoid cross-layer import). */
|
|
5
|
+
type Vec3 = readonly [number, number, number];
|
|
6
|
+
export interface SolverEntity {
|
|
7
|
+
type: 'plane' | 'axis' | 'point';
|
|
8
|
+
origin: Vec3;
|
|
9
|
+
normal?: Vec3;
|
|
10
|
+
direction?: Vec3;
|
|
11
|
+
}
|
|
12
|
+
export interface SolverConstraint {
|
|
13
|
+
type: 'coincident' | 'concentric' | 'distance' | 'angle' | 'fixed';
|
|
14
|
+
entityA?: {
|
|
15
|
+
node: string;
|
|
16
|
+
entity: SolverEntity;
|
|
17
|
+
};
|
|
18
|
+
entityB?: {
|
|
19
|
+
node: string;
|
|
20
|
+
entity: SolverEntity;
|
|
21
|
+
};
|
|
22
|
+
value?: number;
|
|
23
|
+
}
|
|
24
|
+
export interface SolverResult {
|
|
25
|
+
transforms: Map<string, {
|
|
26
|
+
position: Vec3;
|
|
27
|
+
rotation: [number, number, number, number];
|
|
28
|
+
}>;
|
|
29
|
+
dof: number;
|
|
30
|
+
converged: boolean;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Solve assembly constraints analytically.
|
|
34
|
+
*
|
|
35
|
+
* Handles: fixed, coincident planes, distance between planes, concentric axes.
|
|
36
|
+
*/
|
|
37
|
+
export declare function solveConstraints(nodes: string[], constraints: SolverConstraint[]): SolverResult;
|
|
38
|
+
export {};
|
|
39
|
+
//# sourceMappingURL=solverAdapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"solverAdapter.d.ts","sourceRoot":"","sources":["../../src/kernel/solverAdapter.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,2DAA2D;AAC3D,KAAK,IAAI,GAAG,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAE9C,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC;IACjC,MAAM,EAAE,IAAI,CAAC;IACb,MAAM,CAAC,EAAE,IAAI,CAAC;IACd,SAAS,CAAC,EAAE,IAAI,CAAC;CAClB;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,YAAY,GAAG,YAAY,GAAG,UAAU,GAAG,OAAO,GAAG,OAAO,CAAC;IACnE,OAAO,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,YAAY,CAAA;KAAE,CAAC;IACjD,OAAO,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,YAAY,CAAA;KAAE,CAAC;IACjD,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,YAAY;IAC3B,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE;QAAE,QAAQ,EAAE,IAAI,CAAC;QAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;KAAE,CAAC,CAAC;IACxF,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,OAAO,CAAC;CACpB;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,WAAW,EAAE,gBAAgB,EAAE,GAAG,YAAY,CA0D/F"}
|
package/dist/kernel/types.d.ts
CHANGED
|
@@ -58,6 +58,11 @@ export interface KernelAdapter {
|
|
|
58
58
|
y: number;
|
|
59
59
|
z: number;
|
|
60
60
|
}>, tolerance: number): OcShape;
|
|
61
|
+
buildSolidFromFaces(points: Array<{
|
|
62
|
+
x: number;
|
|
63
|
+
y: number;
|
|
64
|
+
z: number;
|
|
65
|
+
}>, faces: Array<readonly [number, number, number]>, tolerance: number): OcShape;
|
|
61
66
|
makeVertex(x: number, y: number, z: number): OcShape;
|
|
62
67
|
makeEdge(curve: OcType, start?: number, end?: number): OcShape;
|
|
63
68
|
makeWire(edges: OcShape[]): OcShape;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/kernel/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGvD,MAAM,MAAM,mBAAmB,GAAG,GAAG,CAAC;AAEtC,2EAA2E;AAC3E,MAAM,MAAM,OAAO,GAAG,YAAY,CAAC;AAGnC,MAAM,MAAM,MAAM,GAAG,GAAG,CAAC;AAEzB,MAAM,WAAW,cAAc;IAC7B,YAAY,CAAC,EAAE,MAAM,GAAG,YAAY,GAAG,UAAU,CAAC;IAClD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,QAAQ,GAAG,UAAU,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,GACnD,OAAO,CAAC;IACX,iBAAiB,CACf,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,EAClC,OAAO,CAAC,EAAE;QACR,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAAC;KAC7C,GACA,OAAO,CAAC;CACZ"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const occtBoundary = require("./occtBoundary-
|
|
2
|
+
const occtBoundary = require("./occtBoundary-DH2VO-rq.cjs");
|
|
3
3
|
const vecOps = require("./vecOps-CjRL1jau.cjs");
|
|
4
|
-
const
|
|
5
|
-
const errors = require("./errors-
|
|
6
|
-
const shapeTypes = require("./shapeTypes-
|
|
7
|
-
const
|
|
4
|
+
const faceFns = require("./faceFns-DcndPHWm.cjs");
|
|
5
|
+
const errors = require("./errors-eRQu29oc.cjs");
|
|
6
|
+
const shapeTypes = require("./shapeTypes-CMjrTv36.cjs");
|
|
7
|
+
const surfaceBuilders = require("./surfaceBuilders-Xx9DRRxs.cjs");
|
|
8
8
|
function buildLawFromProfile(extrusionLength, { profile, endFactor = 1 }) {
|
|
9
9
|
const oc = occtBoundary.getKernel().oc;
|
|
10
10
|
const r = shapeTypes.gcWithScope();
|
|
@@ -24,7 +24,7 @@ function buildLawFromProfile(extrusionLength, { profile, endFactor = 1 }) {
|
|
|
24
24
|
}
|
|
25
25
|
function weldShapes(facesOrShells) {
|
|
26
26
|
const sewn = occtBoundary.getKernel().sew(facesOrShells.map((s) => s.wrapped));
|
|
27
|
-
return errors.unwrap(
|
|
27
|
+
return errors.unwrap(faceFns.cast(errors.unwrap(faceFns.downcast(sewn))));
|
|
28
28
|
}
|
|
29
29
|
function weldShellsAndFaces(facesOrShells, ignoreType = false) {
|
|
30
30
|
const shell = weldShapes(facesOrShells);
|
|
@@ -117,7 +117,7 @@ function makeEllipsoid(aLength, bLength, cLength) {
|
|
|
117
117
|
});
|
|
118
118
|
ellipsoidTrsf.transform.delete();
|
|
119
119
|
const shell = errors.unwrap(
|
|
120
|
-
|
|
120
|
+
faceFns.cast(r(new oc.BRepBuilderAPI_MakeShell_2(baseSurface.UReversed(), false)).Shell())
|
|
121
121
|
);
|
|
122
122
|
return errors.unwrap(makeSolid([shell]));
|
|
123
123
|
} finally {
|
|
@@ -148,8 +148,8 @@ function makeOffset(face, offset, tolerance = 1e-6) {
|
|
|
148
148
|
progress
|
|
149
149
|
);
|
|
150
150
|
return errors.andThen(
|
|
151
|
-
|
|
152
|
-
(downcasted) => errors.andThen(
|
|
151
|
+
faceFns.downcast(offsetBuilder.Shape()),
|
|
152
|
+
(downcasted) => errors.andThen(faceFns.cast(downcasted), (newShape) => {
|
|
153
153
|
if (!shapeTypes.isShape3D(newShape))
|
|
154
154
|
return errors.err(errors.typeCastError("OFFSET_NOT_3D", "Could not offset to a 3d shape"));
|
|
155
155
|
return errors.ok(newShape);
|
|
@@ -175,7 +175,7 @@ function makeSolid(facesOrShells) {
|
|
|
175
175
|
const r = shapeTypes.gcWithScope();
|
|
176
176
|
const oc = occtBoundary.getKernel().oc;
|
|
177
177
|
const shell = weldShapes(facesOrShells);
|
|
178
|
-
return errors.andThen(
|
|
178
|
+
return errors.andThen(faceFns.cast(r(new oc.ShapeFix_Solid_1()).SolidFromShell(shell.wrapped)), (solid) => {
|
|
179
179
|
if (!shapeTypes.isSolid(solid))
|
|
180
180
|
return errors.err(errors.typeCastError("SOLID_BUILD_FAILED", "Could not make a solid of faces and shells"));
|
|
181
181
|
return errors.ok(solid);
|
|
@@ -187,7 +187,7 @@ const basicFaceExtrusion = (face, extrusionVec) => {
|
|
|
187
187
|
const vec = occtBoundary.toVec3(extrusionVec);
|
|
188
188
|
const ocVec = r(new oc.gp_Vec_4(vec[0], vec[1], vec[2]));
|
|
189
189
|
const solidBuilder = r(new oc.BRepPrimAPI_MakePrism_1(face.wrapped, ocVec, false, true));
|
|
190
|
-
const solid = shapeTypes.createSolid(errors.unwrap(
|
|
190
|
+
const solid = shapeTypes.createSolid(errors.unwrap(faceFns.downcast(solidBuilder.Shape())));
|
|
191
191
|
gc();
|
|
192
192
|
return solid;
|
|
193
193
|
};
|
|
@@ -198,8 +198,8 @@ const revolution = (face, center = [0, 0, 0], direction = [0, 0, 1], angle = 360
|
|
|
198
198
|
const directionVec = occtBoundary.toVec3(direction);
|
|
199
199
|
const ax = r(occtBoundary.makeOcAx1(centerVec, directionVec));
|
|
200
200
|
const revolBuilder = r(new oc.BRepPrimAPI_MakeRevol_1(face.wrapped, ax, angle * vecOps.DEG2RAD, false));
|
|
201
|
-
const result = errors.andThen(
|
|
202
|
-
if (!
|
|
201
|
+
const result = errors.andThen(faceFns.cast(revolBuilder.Shape()), (shape) => {
|
|
202
|
+
if (!faceFns.isShape3D(shape))
|
|
203
203
|
return errors.err(errors.typeCastError("REVOLUTION_NOT_3D", "Revolution did not produce a 3D shape"));
|
|
204
204
|
return errors.ok(shape);
|
|
205
205
|
});
|
|
@@ -224,8 +224,8 @@ function genericSweep(wire, spine, {
|
|
|
224
224
|
if (sweepMode === "simple" && !shellMode) {
|
|
225
225
|
const kernel = occtBoundary.getKernel();
|
|
226
226
|
const resultOc = kernel.simplePipe(wire.wrapped, spine.wrapped);
|
|
227
|
-
const result = errors.andThen(
|
|
228
|
-
if (!
|
|
227
|
+
const result = errors.andThen(faceFns.cast(resultOc), (shape2) => {
|
|
228
|
+
if (!faceFns.isShape3D(shape2))
|
|
229
229
|
return errors.err(errors.typeCastError("SWEEP_NOT_3D", "Simple pipe did not produce a 3D shape"));
|
|
230
230
|
return errors.ok(shape2);
|
|
231
231
|
});
|
|
@@ -275,19 +275,19 @@ function genericSweep(wire, spine, {
|
|
|
275
275
|
if (!shellMode) {
|
|
276
276
|
sweepBuilder.MakeSolid();
|
|
277
277
|
}
|
|
278
|
-
const shape = errors.unwrap(
|
|
279
|
-
if (!
|
|
278
|
+
const shape = errors.unwrap(faceFns.cast(sweepBuilder.Shape()));
|
|
279
|
+
if (!faceFns.isShape3D(shape)) {
|
|
280
280
|
gc();
|
|
281
281
|
return errors.err(errors.typeCastError("SWEEP_NOT_3D", "Sweep did not produce a 3D shape"));
|
|
282
282
|
}
|
|
283
283
|
if (shellMode) {
|
|
284
|
-
const startWire = errors.unwrap(
|
|
285
|
-
const endWire = errors.unwrap(
|
|
286
|
-
if (!
|
|
284
|
+
const startWire = errors.unwrap(faceFns.cast(sweepBuilder.FirstShape()));
|
|
285
|
+
const endWire = errors.unwrap(faceFns.cast(sweepBuilder.LastShape()));
|
|
286
|
+
if (!faceFns.isWire(startWire)) {
|
|
287
287
|
gc();
|
|
288
288
|
return errors.err(errors.typeCastError("SWEEP_START_NOT_WIRE", "Sweep did not produce a start Wire"));
|
|
289
289
|
}
|
|
290
|
-
if (!
|
|
290
|
+
if (!faceFns.isWire(endWire)) {
|
|
291
291
|
gc();
|
|
292
292
|
return errors.err(errors.typeCastError("SWEEP_END_NOT_WIRE", "Sweep did not produce an end Wire"));
|
|
293
293
|
}
|
|
@@ -302,8 +302,8 @@ function complexExtrude(wire, center, normal, profileShape, shellMode = false) {
|
|
|
302
302
|
const centerVec = occtBoundary.toVec3(center);
|
|
303
303
|
const normalVec = occtBoundary.toVec3(normal);
|
|
304
304
|
const endVec = vecOps.vecAdd(centerVec, normalVec);
|
|
305
|
-
const mainSpineEdge = r(
|
|
306
|
-
const spine = r(errors.unwrap(
|
|
305
|
+
const mainSpineEdge = r(surfaceBuilders.makeLine(centerVec, endVec));
|
|
306
|
+
const spine = r(errors.unwrap(surfaceBuilders.assembleWire([mainSpineEdge])));
|
|
307
307
|
const law = profileShape ? r(errors.unwrap(buildLawFromProfile(vecOps.vecLength(normalVec), profileShape))) : null;
|
|
308
308
|
const result = shellMode ? genericSweep(wire, spine, { law }, shellMode) : genericSweep(wire, spine, { law }, shellMode);
|
|
309
309
|
gc();
|
|
@@ -314,12 +314,12 @@ function twistExtrude(wire, angleDegrees, center, normal, profileShape, shellMod
|
|
|
314
314
|
const centerVec = occtBoundary.toVec3(center);
|
|
315
315
|
const normalVec = occtBoundary.toVec3(normal);
|
|
316
316
|
const endVec = vecOps.vecAdd(centerVec, normalVec);
|
|
317
|
-
const mainSpineEdge = r(
|
|
318
|
-
const spine = r(errors.unwrap(
|
|
317
|
+
const mainSpineEdge = r(surfaceBuilders.makeLine(centerVec, endVec));
|
|
318
|
+
const spine = r(errors.unwrap(surfaceBuilders.assembleWire([mainSpineEdge])));
|
|
319
319
|
const extrusionLength = vecOps.vecLength(normalVec);
|
|
320
320
|
const pitch = 360 / angleDegrees * extrusionLength;
|
|
321
321
|
const radius = 1;
|
|
322
|
-
const auxiliarySpine = r(
|
|
322
|
+
const auxiliarySpine = r(surfaceBuilders.makeHelix(pitch, extrusionLength, radius, centerVec, normalVec));
|
|
323
323
|
const law = profileShape ? r(errors.unwrap(buildLawFromProfile(extrusionLength, profileShape))) : null;
|
|
324
324
|
const result = shellMode ? genericSweep(wire, spine, { auxiliarySpine, law }, shellMode) : genericSweep(wire, spine, { auxiliarySpine, law }, shellMode);
|
|
325
325
|
gc();
|
|
@@ -345,8 +345,8 @@ const loft = (wires, { ruled = true, startPoint, endPoint } = {}, returnShell =
|
|
|
345
345
|
gc();
|
|
346
346
|
return errors.err(errors.occtError("LOFT_FAILED", "Loft operation failed"));
|
|
347
347
|
}
|
|
348
|
-
const result = errors.andThen(
|
|
349
|
-
if (!
|
|
348
|
+
const result = errors.andThen(faceFns.cast(loftBuilder.Shape()), (shape) => {
|
|
349
|
+
if (!faceFns.isShape3D(shape))
|
|
350
350
|
return errors.err(errors.typeCastError("LOFT_NOT_3D", "Loft did not produce a 3D shape"));
|
|
351
351
|
return errors.ok(shape);
|
|
352
352
|
});
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { g as getKernel,
|
|
1
|
+
import { g as getKernel, d as toOcPnt, c as makeOcAx2, m as makeOcAx1, a as toVec3 } from "./occtBoundary-CWzWqBCm.js";
|
|
2
2
|
import { D as DEG2RAD, v as vecAdd, g as vecLength } from "./vecOps-ZDdZWbwT.js";
|
|
3
|
-
import { c as cast, d as downcast, a as isShape3D$1, b as isWire } from "./
|
|
4
|
-
import { e as err, x as validationError, l as ok, u as unwrap, p as typeCastError, a as andThen, o as occtError } from "./errors-
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
3
|
+
import { c as cast, d as downcast, a as isShape3D$1, b as isWire } from "./faceFns-CltrEfOo.js";
|
|
4
|
+
import { e as err, x as validationError, l as ok, u as unwrap, p as typeCastError, a as andThen, o as occtError } from "./errors-Coh_5_19.js";
|
|
5
|
+
import { n as gcWithScope, j as isShell, s as createCompound, t as createVertex, u as createSolid, h as isShape3D, k as isSolid, r as localGC } from "./shapeTypes-D0vfRxWb.js";
|
|
6
|
+
import { a as makeLine, b as assembleWire, c as makeHelix } from "./surfaceBuilders-B7Jxob8g.js";
|
|
7
7
|
function buildLawFromProfile(extrusionLength, { profile, endFactor = 1 }) {
|
|
8
8
|
const oc = getKernel().oc;
|
|
9
9
|
const r = gcWithScope();
|
|
@@ -353,17 +353,17 @@ const loft = (wires, { ruled = true, startPoint, endPoint } = {}, returnShell =
|
|
|
353
353
|
return result;
|
|
354
354
|
};
|
|
355
355
|
export {
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
356
|
+
makeSolid as a,
|
|
357
|
+
basicFaceExtrusion as b,
|
|
358
|
+
complexExtrude as c,
|
|
359
|
+
makeCone as d,
|
|
360
|
+
makeCylinder as e,
|
|
361
|
+
makeEllipsoid as f,
|
|
362
|
+
genericSweep as g,
|
|
363
|
+
makeOffset as h,
|
|
364
|
+
makeSphere as i,
|
|
365
|
+
makeTorus as j,
|
|
366
|
+
makeVertex as k,
|
|
367
367
|
loft as l,
|
|
368
368
|
makeCompound as m,
|
|
369
369
|
buildLawFromProfile as n,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { g as getKernel, s as surfaceCurvature } from "./occtBoundary-
|
|
2
|
-
import {
|
|
3
|
-
import { u as uvBounds } from "./faceFns-
|
|
1
|
+
import { g as getKernel, s as surfaceCurvature } from "./occtBoundary-CWzWqBCm.js";
|
|
2
|
+
import { n as gcWithScope } from "./shapeTypes-D0vfRxWb.js";
|
|
3
|
+
import { u as uvBounds } from "./faceFns-CltrEfOo.js";
|
|
4
4
|
function assertShapeNotNull(shape, fn) {
|
|
5
5
|
if (shape.wrapped.IsNull()) {
|
|
6
6
|
throw new Error(`${fn}: shape is a null shape`);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const occtBoundary = require("./occtBoundary-
|
|
3
|
-
const shapeTypes = require("./shapeTypes-
|
|
4
|
-
const faceFns = require("./faceFns-
|
|
2
|
+
const occtBoundary = require("./occtBoundary-DH2VO-rq.cjs");
|
|
3
|
+
const shapeTypes = require("./shapeTypes-CMjrTv36.cjs");
|
|
4
|
+
const faceFns = require("./faceFns-DcndPHWm.cjs");
|
|
5
5
|
function assertShapeNotNull(shape, fn) {
|
|
6
6
|
if (shape.wrapped.IsNull()) {
|
|
7
7
|
throw new Error(`${fn}: shape is a null shape`);
|
package/dist/measurement.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const measurement = require("./measurement-
|
|
3
|
+
const measurement = require("./measurement-DU3ry-0Q.cjs");
|
|
4
4
|
exports.createDistanceQuery = measurement.createDistanceQuery;
|
|
5
5
|
exports.measureArea = measurement.measureArea;
|
|
6
6
|
exports.measureDistance = measurement.measureDistance;
|
package/dist/measurement.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { g as getKernel, u as uniqueIOFilename } from "./occtBoundary-
|
|
2
|
-
import { l as ok, e as err, i as ioError } from "./errors-
|
|
3
|
-
import { g as getFaceOrigins } from "./shapeFns-
|
|
1
|
+
import { g as getKernel, u as uniqueIOFilename } from "./occtBoundary-CWzWqBCm.js";
|
|
2
|
+
import { l as ok, e as err, i as ioError } from "./errors-Coh_5_19.js";
|
|
3
|
+
import { g as getFaceOrigins } from "./shapeFns-4ioRrhih.js";
|
|
4
4
|
function buildMeshCacheKey(tolerance, angularTolerance, skipNormals) {
|
|
5
5
|
return `${tolerance}:${angularTolerance}:${skipNormals}`;
|
|
6
6
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const occtBoundary = require("./occtBoundary-
|
|
3
|
-
const errors = require("./errors-
|
|
4
|
-
const shapeFns = require("./shapeFns-
|
|
2
|
+
const occtBoundary = require("./occtBoundary-DH2VO-rq.cjs");
|
|
3
|
+
const errors = require("./errors-eRQu29oc.cjs");
|
|
4
|
+
const shapeFns = require("./shapeFns-3RYtsUVY.cjs");
|
|
5
5
|
function buildMeshCacheKey(tolerance, angularTolerance, skipNormals) {
|
|
6
6
|
return `${tolerance}:${angularTolerance}:${skipNormals}`;
|
|
7
7
|
}
|
|
@@ -1836,6 +1836,10 @@ function hull(oc, shapes, tolerance) {
|
|
|
1836
1836
|
}
|
|
1837
1837
|
return reconstructBrep(oc, hullResult, tolerance);
|
|
1838
1838
|
}
|
|
1839
|
+
function buildSolidFromFaces(oc, points, faces, tolerance) {
|
|
1840
|
+
const hullResult = { points, faces };
|
|
1841
|
+
return reconstructBrep(oc, hullResult, tolerance);
|
|
1842
|
+
}
|
|
1839
1843
|
function hullFromPoints(oc, points, tolerance) {
|
|
1840
1844
|
if (points.length < 4) {
|
|
1841
1845
|
throw new Error("hullFromPoints: fewer than 4 points");
|
|
@@ -1881,6 +1885,14 @@ class OCCTAdapter {
|
|
|
1881
1885
|
tolerance
|
|
1882
1886
|
);
|
|
1883
1887
|
}
|
|
1888
|
+
buildSolidFromFaces(points, faces, tolerance) {
|
|
1889
|
+
return buildSolidFromFaces(
|
|
1890
|
+
this.oc,
|
|
1891
|
+
points.map((p) => ({ x: p.x, y: p.y, z: p.z })),
|
|
1892
|
+
faces,
|
|
1893
|
+
tolerance
|
|
1894
|
+
);
|
|
1895
|
+
}
|
|
1884
1896
|
// --- Shape construction (delegates to constructorOps.ts) ---
|
|
1885
1897
|
makeVertex(x, y, z) {
|
|
1886
1898
|
return makeVertex(this.oc, x, y, z);
|
|
@@ -2178,10 +2190,10 @@ function makeOcAx3(origin, zDir, xDir) {
|
|
|
2178
2190
|
}
|
|
2179
2191
|
export {
|
|
2180
2192
|
toVec3 as a,
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2193
|
+
toOcVec as b,
|
|
2194
|
+
makeOcAx2 as c,
|
|
2195
|
+
toOcPnt as d,
|
|
2196
|
+
makeOcAx3 as e,
|
|
2185
2197
|
fromOcDir as f,
|
|
2186
2198
|
getKernel as g,
|
|
2187
2199
|
fromOcPnt as h,
|
|
@@ -2189,7 +2201,7 @@ export {
|
|
|
2189
2201
|
initFromOC as j,
|
|
2190
2202
|
withOcPnt as k,
|
|
2191
2203
|
withOcVec as l,
|
|
2192
|
-
|
|
2204
|
+
makeOcAx1 as m,
|
|
2193
2205
|
uniqueId as n,
|
|
2194
2206
|
resolveDirection as r,
|
|
2195
2207
|
surfaceCurvature as s,
|
|
@@ -1837,6 +1837,10 @@ function hull(oc, shapes, tolerance) {
|
|
|
1837
1837
|
}
|
|
1838
1838
|
return reconstructBrep(oc, hullResult, tolerance);
|
|
1839
1839
|
}
|
|
1840
|
+
function buildSolidFromFaces(oc, points, faces, tolerance) {
|
|
1841
|
+
const hullResult = { points, faces };
|
|
1842
|
+
return reconstructBrep(oc, hullResult, tolerance);
|
|
1843
|
+
}
|
|
1840
1844
|
function hullFromPoints(oc, points, tolerance) {
|
|
1841
1845
|
if (points.length < 4) {
|
|
1842
1846
|
throw new Error("hullFromPoints: fewer than 4 points");
|
|
@@ -1882,6 +1886,14 @@ class OCCTAdapter {
|
|
|
1882
1886
|
tolerance
|
|
1883
1887
|
);
|
|
1884
1888
|
}
|
|
1889
|
+
buildSolidFromFaces(points, faces, tolerance) {
|
|
1890
|
+
return buildSolidFromFaces(
|
|
1891
|
+
this.oc,
|
|
1892
|
+
points.map((p) => ({ x: p.x, y: p.y, z: p.z })),
|
|
1893
|
+
faces,
|
|
1894
|
+
tolerance
|
|
1895
|
+
);
|
|
1896
|
+
}
|
|
1885
1897
|
// --- Shape construction (delegates to constructorOps.ts) ---
|
|
1886
1898
|
makeVertex(x, y, z) {
|
|
1887
1899
|
return makeVertex(this.oc, x, y, z);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assemblyFns.d.ts","sourceRoot":"","sources":["../../src/operations/assemblyFns.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAMtD,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,CAAC,EAAE,QAAQ,CAAC;IAC1B,QAAQ,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC;IAC1B,QAAQ,CAAC,MAAM,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,IAAI,CAAA;KAAE,CAAC;IACjD,QAAQ,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACtD,QAAQ,CAAC,QAAQ,EAAE,aAAa,CAAC,YAAY,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":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gB,WAAW,CAAC,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,GAAG,YAAY,CAMjF;AAED,sDAAsD;AACtD,wBAAgB,UAAU,CACxB,IAAI,EAAE,YAAY,EAClB,OAAO,EAAE,OAAO,CAAC,mBAAmB,CAAC,GACpC,YAAY,CAQd;AAMD,yEAAyE;AACzE,wBAAgB,QAAQ,CAAC,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS,CAOnF;AAED,gEAAgE;AAChE,wBAAgB,YAAY,CAC1B,IAAI,EAAE,YAAY,EAClB,OAAO,EAAE,CAAC,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,EACpD,KAAK,SAAI,GACR,IAAI,CAKN;AAED,mCAAmC;AACnC,wBAAgB,UAAU,CAAC,IAAI,EAAE,YAAY,GAAG,MAAM,CAMrD;AAED,oDAAoD;AACpD,wBAAgB,aAAa,CAAC,IAAI,EAAE,YAAY,GAAG,QAAQ,EAAE,CAM5D"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { 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
|
+
/**
|
|
13
|
+
* Sweep a profile wire along a spine, using guide wires to control shape evolution.
|
|
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.
|
|
23
|
+
*/
|
|
24
|
+
export declare function guidedSweep(profile: Wire, spine: Wire, guides: ReadonlyArray<Wire>, options?: GuidedSweepOptions): Result<Solid | Shell>;
|
|
25
|
+
//# sourceMappingURL=guidedSweepFns.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"guidedSweepFns.d.ts","sourceRoot":"","sources":["../../src/operations/guidedSweepFns.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAGhE,OAAO,EAAE,KAAK,MAAM,EAAW,MAAM,mBAAmB,CAAC;AAGzD,qCAAqC;AACrC,MAAM,WAAW,kBAAkB;IACjC,oEAAoE;IACpE,UAAU,CAAC,EAAE,aAAa,GAAG,OAAO,GAAG,OAAO,CAAC;IAC/C,iEAAiE;IACjE,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,2DAA2D;IAC3D,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,WAAW,CACzB,OAAO,EAAE,IAAI,EACb,KAAK,EAAE,IAAI,EACX,MAAM,EAAE,aAAa,CAAC,IAAI,CAAC,EAC3B,OAAO,GAAE,kBAAuB,GAC/B,MAAM,CAAC,KAAK,GAAG,KAAK,CAAC,CAiDvB"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { Face, Edge } from '../core/shapeTypes.js';
|
|
2
|
+
import { Vec3 } from '../core/types.js';
|
|
3
|
+
import { Result } from '../core/result.js';
|
|
4
|
+
import { AssemblyNode } from './assemblyFns.js';
|
|
5
|
+
export interface MateEntity {
|
|
6
|
+
node: string;
|
|
7
|
+
face?: Face;
|
|
8
|
+
edge?: Edge;
|
|
9
|
+
point?: Vec3;
|
|
10
|
+
}
|
|
11
|
+
export type MateConstraint = {
|
|
12
|
+
type: 'coincident';
|
|
13
|
+
entityA: MateEntity;
|
|
14
|
+
entityB: MateEntity;
|
|
15
|
+
} | {
|
|
16
|
+
type: 'concentric';
|
|
17
|
+
axisA: MateEntity;
|
|
18
|
+
axisB: MateEntity;
|
|
19
|
+
} | {
|
|
20
|
+
type: 'distance';
|
|
21
|
+
entityA: MateEntity;
|
|
22
|
+
entityB: MateEntity;
|
|
23
|
+
distance: number;
|
|
24
|
+
} | {
|
|
25
|
+
type: 'angle';
|
|
26
|
+
entityA: MateEntity;
|
|
27
|
+
entityB: MateEntity;
|
|
28
|
+
angle: number;
|
|
29
|
+
} | {
|
|
30
|
+
type: 'fixed';
|
|
31
|
+
entity: MateEntity;
|
|
32
|
+
};
|
|
33
|
+
export interface AssemblySolveResult {
|
|
34
|
+
transforms: Map<string, {
|
|
35
|
+
position: Vec3;
|
|
36
|
+
rotation: [number, number, number, number];
|
|
37
|
+
}>;
|
|
38
|
+
dof: number;
|
|
39
|
+
converged: boolean;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Add a mate constraint to an assembly.
|
|
43
|
+
* Returns a new assembly node with the constraint added.
|
|
44
|
+
*/
|
|
45
|
+
export declare function addMate(assembly: AssemblyNode, constraint: MateConstraint): AssemblyNode;
|
|
46
|
+
/**
|
|
47
|
+
* Solve all mate constraints and compute part transforms.
|
|
48
|
+
*/
|
|
49
|
+
export declare function solveAssembly(assembly: AssemblyNode): Result<AssemblySolveResult>;
|
|
50
|
+
//# sourceMappingURL=mateFns.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mateFns.d.ts","sourceRoot":"","sources":["../../src/operations/mateFns.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,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AAgB,OAAO,CAAC,QAAQ,EAAE,YAAY,EAAE,UAAU,EAAE,cAAc,GAAG,YAAY,CAGxF;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,YAAY,GAAG,MAAM,CAAC,mBAAmB,CAAC,CA0HjF"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { 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;
|
|
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
|
+
/**
|
|
20
|
+
* Sweep multiple profile sections along a spine wire.
|
|
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.
|
|
30
|
+
*/
|
|
31
|
+
export declare function multiSectionSweep(sections: ReadonlyArray<SweepSectionConfig>, spine: Wire, options?: MultiSweepOptions): Result<Solid | Shell>;
|
|
32
|
+
//# sourceMappingURL=multiSweepFns.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"multiSweepFns.d.ts","sourceRoot":"","sources":["../../src/operations/multiSweepFns.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAGhE,OAAO,EAAE,KAAK,MAAM,EAAW,MAAM,mBAAmB,CAAC;AAGzD,mFAAmF;AACnF,MAAM,WAAW,kBAAkB;IACjC,yCAAyC;IACzC,IAAI,EAAE,IAAI,CAAC;IACX,0FAA0F;IAC1F,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,qDAAqD;AACrD,MAAM,WAAW,iBAAiB;IAChC,iEAAiE;IACjE,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,8EAA8E;IAC9E,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,wDAAwD;IACxD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,aAAa,CAAC,kBAAkB,CAAC,EAC3C,KAAK,EAAE,IAAI,EACX,OAAO,CAAC,EAAE,iBAAiB,GAC1B,MAAM,CAAC,KAAK,GAAG,KAAK,CAAC,CAkFvB"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Wire, Solid } from '../core/shapeTypes.js';
|
|
2
|
+
import { Result } from '../core/result.js';
|
|
3
|
+
export interface RoofOptions {
|
|
4
|
+
/** Roof slope angle in degrees (default: 45). */
|
|
5
|
+
readonly angle?: number;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Create a roof solid from a planar wire using the straight skeleton algorithm.
|
|
9
|
+
* Each polygon edge produces a sloped face rising toward the skeleton ridge.
|
|
10
|
+
*
|
|
11
|
+
* @param w - A planar wire defining the roof footprint
|
|
12
|
+
* @param options - Optional angle (degrees) for the roof slope
|
|
13
|
+
* @returns A Result containing the roof Solid, or an error
|
|
14
|
+
*/
|
|
15
|
+
export declare function roof(w: Wire, options?: RoofOptions): Result<Solid>;
|
|
16
|
+
//# sourceMappingURL=roofFns.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"roofFns.d.ts","sourceRoot":"","sources":["../../src/operations/roofFns.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAGzD,OAAO,EAAE,KAAK,MAAM,EAAW,MAAM,mBAAmB,CAAC;AAWzD,MAAM,WAAW,WAAW;IAC1B,iDAAiD;IACjD,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;CACzB;AAmFD;;;;;;;GAOG;AACH,wBAAgB,IAAI,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,MAAM,CAAC,KAAK,CAAC,CA4HlE"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure TypeScript straight skeleton algorithm for simple polygons.
|
|
3
|
+
* No OCCT dependency — operates on 2D point arrays.
|
|
4
|
+
*/
|
|
5
|
+
export interface SkPoint2D {
|
|
6
|
+
readonly x: number;
|
|
7
|
+
readonly y: number;
|
|
8
|
+
}
|
|
9
|
+
export interface SkeletonNode {
|
|
10
|
+
readonly x: number;
|
|
11
|
+
readonly y: number;
|
|
12
|
+
readonly height: number;
|
|
13
|
+
}
|
|
14
|
+
export interface SkeletonFace {
|
|
15
|
+
readonly vertices: SkPoint2D[];
|
|
16
|
+
readonly heights: number[];
|
|
17
|
+
}
|
|
18
|
+
export interface StraightSkeleton {
|
|
19
|
+
readonly nodes: SkeletonNode[];
|
|
20
|
+
readonly faces: SkeletonFace[];
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Compute the straight skeleton of a simple polygon.
|
|
24
|
+
* The polygon vertices must define a simple (non-self-intersecting) polygon.
|
|
25
|
+
* They will be reordered to CCW if necessary.
|
|
26
|
+
*/
|
|
27
|
+
export declare function computeStraightSkeleton(polygon: SkPoint2D[]): StraightSkeleton;
|
|
28
|
+
//# sourceMappingURL=straightSkeleton.d.ts.map
|
|
@@ -0,0 +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;AA+PD;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,SAAS,EAAE,GAAG,gBAAgB,CAiO9E"}
|