brepjs 8.2.0 → 8.4.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/lib/Curve2D.d.ts.map +1 -1
- package/dist/2d.cjs +2 -2
- package/dist/2d.js +3 -3
- package/dist/{Blueprint-D_luVeES.js → Blueprint-Bp45tnh0.js} +16 -12
- package/dist/{Blueprint-CTAwjJMN.cjs → Blueprint-zgFe_5Qj.cjs} +17 -13
- package/dist/{boolean2D-B5axNhjN.cjs → boolean2D-CfEbRMPF.cjs} +11 -11
- package/dist/{boolean2D-vw76Gayn.js → boolean2D-DN6ETTCq.js} +11 -11
- package/dist/{booleanFns-Yc3EBxdm.cjs → booleanFns-5dDG0jpA.cjs} +46 -9
- package/dist/{booleanFns-BhqXpQoZ.js → booleanFns-C-M6qqvB.js} +46 -9
- package/dist/brepjs.cjs +364 -109
- package/dist/brepjs.js +433 -177
- package/dist/{cast-C107o5ow.cjs → cast-CPNOTNFm.cjs} +3 -3
- package/dist/{cast-D0OhP1nV.js → cast-Cerqtxtb.js} +3 -3
- package/dist/core/errors.d.ts +7 -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-DuStF5jK.cjs → cornerFinder-BQ-_VJx0.cjs} +1 -1
- package/dist/{cornerFinder-CPm2baSJ.js → cornerFinder-CC_MunIh.js} +1 -1
- package/dist/{curveBuilders-CN72XaIQ.js → curveBuilders-BREwqvuc.js} +3 -3
- package/dist/{curveBuilders-Du03_Yyf.cjs → curveBuilders-BkEJ-RVn.cjs} +3 -3
- package/dist/curveFns-VMxgfkqw.cjs +177 -0
- package/dist/curveFns-ZuQUBZvd.js +178 -0
- package/dist/{drawFns-CzBbcoXA.js → drawFns-BbhX1IUq.js} +19 -15
- package/dist/{drawFns-CiNxPu6J.cjs → drawFns-CKaHgGSK.cjs} +22 -18
- package/dist/{errors-wGhcJMpB.js → errors-CSYOlCCR.js} +10 -1
- package/dist/{errors-DK1VAdP4.cjs → errors-D13q2HCk.cjs} +10 -1
- package/dist/{faceFns-ub3CugDN.js → faceFns-CfJIbHY3.js} +4 -4
- package/dist/{faceFns-D1Sqnlu6.cjs → faceFns-es3GENII.cjs} +4 -4
- package/dist/{helpers-Dje6wrKi.cjs → helpers-C0q_FVxq.cjs} +10 -10
- package/dist/{helpers-BSQfs538.js → helpers-CmVkMubc.js} +7 -7
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/io.cjs +5 -5
- package/dist/io.js +5 -5
- package/dist/kernel/hullOps.d.ts +22 -0
- package/dist/kernel/hullOps.d.ts.map +1 -0
- package/dist/kernel/occtAdapter.d.ts +6 -0
- package/dist/kernel/occtAdapter.d.ts.map +1 -1
- package/dist/kernel/types.d.ts +6 -0
- package/dist/kernel/types.d.ts.map +1 -1
- package/dist/{loft-PMRx9iMG.cjs → loft-B-UCPW9P.cjs} +5 -5
- package/dist/{loft-BHn7GKm8.js → loft-oJq2OD3A.js} +5 -5
- package/dist/{measurement-B06hNs89.cjs → measurement-CYmT-C77.cjs} +3 -3
- package/dist/{measurement-BfhEneUl.js → measurement-Cf_SoIiR.js} +3 -3
- package/dist/measurement.cjs +1 -1
- package/dist/measurement.js +1 -1
- package/dist/{meshFns-BKSPaPXS.js → meshFns-CqNwW0PO.js} +6 -3
- package/dist/{meshFns-CFVxKBlE.cjs → meshFns-DDC_2U81.cjs} +6 -3
- package/dist/{occtBoundary-BFAaUtA7.cjs → occtBoundary-CocN2VKx.cjs} +419 -2
- package/dist/{occtBoundary-CoXB2xvx.js → occtBoundary-D_gjqgzo.js} +419 -2
- package/dist/{operations-CjQHEu1h.js → operations-6hdpuYmY.js} +6 -6
- package/dist/{operations-CdGb6IBU.cjs → operations-BQeW_DSM.cjs} +6 -6
- package/dist/operations.cjs +2 -2
- package/dist/operations.js +2 -2
- package/dist/query.cjs +5 -5
- package/dist/query.js +6 -6
- package/dist/result.cjs +1 -1
- package/dist/result.js +1 -1
- package/dist/{curveFns-ByeCqutv.cjs → shapeFns-B0zSdO9c.cjs} +98 -177
- package/dist/{curveFns-C5gSZ5EY.js → shapeFns-k1YHFwmB.js} +117 -196
- package/dist/{shapeTypes-UqVCIO_T.cjs → shapeTypes-BxVxLdiD.cjs} +1 -1
- package/dist/{shapeTypes-BU2LKv2S.js → shapeTypes-c-_pgYCx.js} +1 -1
- package/dist/sketching.cjs +2 -2
- package/dist/sketching.js +2 -2
- package/dist/text/textBlueprints.d.ts.map +1 -1
- package/dist/topology/booleanFns.d.ts.map +1 -1
- package/dist/topology/hullFns.d.ts +16 -0
- package/dist/topology/hullFns.d.ts.map +1 -0
- package/dist/topology/meshFns.d.ts +1 -0
- package/dist/topology/meshFns.d.ts.map +1 -1
- package/dist/topology/minkowskiFns.d.ts +20 -0
- package/dist/topology/minkowskiFns.d.ts.map +1 -0
- package/dist/topology/modifierFns.d.ts.map +1 -1
- package/dist/topology/shapeFns.d.ts +30 -0
- package/dist/topology/shapeFns.d.ts.map +1 -1
- package/dist/{topology-D8Au8q4i.cjs → topology-CycEc6Oe.cjs} +14 -13
- package/dist/{topology-BFB3LI_y.js → topology-tMKHJgw2.js} +9 -8
- package/dist/topology.cjs +34 -33
- package/dist/topology.js +59 -58
- package/dist/{vectors-BhfKwL9J.js → vectors-DE0XriuQ.js} +2 -2
- package/dist/{vectors-t1XG4LpL.cjs → vectors-DVmHF4zt.cjs} +2 -2
- package/dist/vectors.cjs +2 -2
- package/dist/vectors.js +2 -2
- package/package.json +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Curve2D.d.ts","sourceRoot":"","sources":["../../../src/2d/lib/Curve2D.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAEpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAE9D,OAAO,EAAE,KAAK,MAAM,EAAmB,M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7E,IAAI,UAAU,IAAI,MAAM,CAEvB;IAED,6FAA6F;IAC7F,SAAS,IAAI,MAAM;IAKnB,yEAAyE;IACzE,KAAK,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO;IAOjC,8EAA8E;IAC9E,IAAI,UAAU,IAAI,OAAO,CAKxB;IAED,4EAA4E;IAC5E,IAAI,SAAS,IAAI,OAAO,CAKvB;IAED,4DAA4D;IAC5D,IAAI,cAAc,IAAI,MAAM,CAE3B;IAED,0DAA0D;IAC1D,IAAI,aAAa,IAAI,MAAM,CAE1B;IAED,mFAAmF;IACnF,OAAO,IAAI,MAAM;IAKjB,wFAAwF;IACxF,IAAI,QAAQ,IAAI,SAAS,CAKxB;IAED,qDAAqD;IACrD,KAAK,IAAI,OAAO;IAQhB,sDAAsD;IACtD,OAAO,IAAI,IAAI;IAQf,OAAO,CAAC,iBAAiB;IAqBzB,OAAO,CAAC,iBAAiB;IAgCzB,gFAAgF;IAChF,YAAY,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,GAAG,MAAM;IAQhD,8EAA8E;IAC9E,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO;IAIlC;;;;OAIG;IACH,SAAS,CAAC,KAAK,EAAE,OAAO,EAAE,SAAS,SAAO,GAAG,MAAM,CAAC,MAAM,CAAC;IA6B3D;;;;OAIG;IACH,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,GAAG,OAAO;IAwB3C;;;;OAIG;IACH,OAAO,CAAC,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,EAAE,EAAE,SAAS,SAAO,GAAG,OAAO,EAAE;CAmEnE"}
|
package/dist/2d.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const Blueprint = require("./Blueprint-
|
|
4
|
-
const boolean2D = require("./boolean2D-
|
|
3
|
+
const Blueprint = require("./Blueprint-zgFe_5Qj.cjs");
|
|
4
|
+
const boolean2D = require("./boolean2D-CfEbRMPF.cjs");
|
|
5
5
|
function reverseCurve(curve) {
|
|
6
6
|
const cloned = curve.clone();
|
|
7
7
|
cloned.reverse();
|
package/dist/2d.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { B as Blueprint } from "./Blueprint-
|
|
2
|
-
import { e, C, f } from "./Blueprint-
|
|
3
|
-
import { b, C as C2, c, d, f as f2, e as e2, i, g, o, p, r } from "./boolean2D-
|
|
1
|
+
import { B as Blueprint } from "./Blueprint-Bp45tnh0.js";
|
|
2
|
+
import { e, C, f } from "./Blueprint-Bp45tnh0.js";
|
|
3
|
+
import { b, C as C2, c, d, f as f2, e as e2, i, g, o, p, r } from "./boolean2D-DN6ETTCq.js";
|
|
4
4
|
function reverseCurve(curve) {
|
|
5
5
|
const cloned = curve.clone();
|
|
6
6
|
cloned.reverse();
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { r as resolvePlane } from "./vectors-
|
|
2
|
-
import { g as getKernel, a as toVec3, m as makeOcAx2 } from "./occtBoundary-
|
|
3
|
-
import { t as localGC, u as createFace, e as isFace, y as registerForCleanup, z as unregisterFromCleanup, p as gcWithScope, o as createEdge, n as createWire } from "./shapeTypes-
|
|
4
|
-
import { u as uvBounds, a as faceGeomType, f as faceCenter, h as uvCoordinates } from "./faceFns-
|
|
5
|
-
import {
|
|
6
|
-
import { e as err, o as occtError, l as ok, a as andThen, x as validationError, u as unwrap, b as computationError } from "./errors-
|
|
7
|
-
import { d as distance2d, s as samePoint, k as scalarMultiply2d, i as add2d, n as normalize2d, h as subtract2d, g as getSingleFace } from "./helpers-
|
|
8
|
-
import { c as cast } from "./cast-
|
|
1
|
+
import { r as resolvePlane } from "./vectors-DE0XriuQ.js";
|
|
2
|
+
import { g as getKernel, a as toVec3, m as makeOcAx2 } from "./occtBoundary-D_gjqgzo.js";
|
|
3
|
+
import { t as localGC, u as createFace, e as isFace, y as registerForCleanup, z as unregisterFromCleanup, p as gcWithScope, o as createEdge, n as createWire } from "./shapeTypes-c-_pgYCx.js";
|
|
4
|
+
import { u as uvBounds, a as faceGeomType, f as faceCenter, h as uvCoordinates } from "./faceFns-CfJIbHY3.js";
|
|
5
|
+
import { j as findCurveType, m as getOrientation } from "./curveFns-ZuQUBZvd.js";
|
|
6
|
+
import { e as err, o as occtError, l as ok, a as andThen, x as validationError, u as unwrap, b as computationError } from "./errors-CSYOlCCR.js";
|
|
7
|
+
import { d as distance2d, s as samePoint, k as scalarMultiply2d, i as add2d, n as normalize2d, h as subtract2d, g as getSingleFace } from "./helpers-CmVkMubc.js";
|
|
8
|
+
import { c as cast } from "./cast-Cerqtxtb.js";
|
|
9
9
|
import { R as RAD2DEG, D as DEG2RAD } from "./vecOps-ZDdZWbwT.js";
|
|
10
|
-
import {
|
|
10
|
+
import { e as getEdges } from "./shapeFns-k1YHFwmB.js";
|
|
11
|
+
import { m as makeLine, a as assembleWire$1 } from "./curveBuilders-BREwqvuc.js";
|
|
11
12
|
import { bug } from "./result.js";
|
|
12
13
|
function makePlane(plane, origin) {
|
|
13
14
|
if (plane && typeof plane !== "string") {
|
|
@@ -362,7 +363,7 @@ class Curve2D {
|
|
|
362
363
|
const oc = getKernel().oc;
|
|
363
364
|
const r = gcWithScope();
|
|
364
365
|
const projector = r(new oc.Geom2dAPI_ProjectPointOnCurve_2(r(pnt(point)), this.wrapped));
|
|
365
|
-
let curveToPoint
|
|
366
|
+
let curveToPoint;
|
|
366
367
|
try {
|
|
367
368
|
curveToPoint = projector.LowerDistance();
|
|
368
369
|
} catch {
|
|
@@ -377,7 +378,7 @@ class Curve2D {
|
|
|
377
378
|
distanceFromCurve(curve) {
|
|
378
379
|
const oc = getKernel().oc;
|
|
379
380
|
const r = gcWithScope();
|
|
380
|
-
let curveDistance
|
|
381
|
+
let curveDistance;
|
|
381
382
|
const projector = r(
|
|
382
383
|
new oc.Geom2dAPI_ExtremaCurveCurve(
|
|
383
384
|
this.wrapped,
|
|
@@ -516,7 +517,10 @@ class Curve2D {
|
|
|
516
517
|
const trimmed = new oc.Geom2d_TrimmedCurve(this.wrapped, first, last, true, true);
|
|
517
518
|
return new Curve2D(new oc.Handle_Geom2d_Curve_2(trimmed));
|
|
518
519
|
} catch (e) {
|
|
519
|
-
throw new Error(
|
|
520
|
+
throw new Error(
|
|
521
|
+
`Failed to split the curve: ${e instanceof Error ? e.message : String(e)}`,
|
|
522
|
+
{ cause: e }
|
|
523
|
+
);
|
|
520
524
|
}
|
|
521
525
|
});
|
|
522
526
|
}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const vectors = require("./vectors-
|
|
3
|
-
const occtBoundary = require("./occtBoundary-
|
|
4
|
-
const shapeTypes = require("./shapeTypes-
|
|
5
|
-
const faceFns = require("./faceFns-
|
|
6
|
-
const curveFns = require("./curveFns-
|
|
7
|
-
const errors = require("./errors-
|
|
8
|
-
const helpers = require("./helpers-
|
|
9
|
-
const cast = require("./cast-
|
|
2
|
+
const vectors = require("./vectors-DVmHF4zt.cjs");
|
|
3
|
+
const occtBoundary = require("./occtBoundary-CocN2VKx.cjs");
|
|
4
|
+
const shapeTypes = require("./shapeTypes-BxVxLdiD.cjs");
|
|
5
|
+
const faceFns = require("./faceFns-es3GENII.cjs");
|
|
6
|
+
const curveFns = require("./curveFns-VMxgfkqw.cjs");
|
|
7
|
+
const errors = require("./errors-D13q2HCk.cjs");
|
|
8
|
+
const helpers = require("./helpers-C0q_FVxq.cjs");
|
|
9
|
+
const cast = require("./cast-CPNOTNFm.cjs");
|
|
10
10
|
const vecOps = require("./vecOps-CjRL1jau.cjs");
|
|
11
|
-
const
|
|
11
|
+
const shapeFns = require("./shapeFns-B0zSdO9c.cjs");
|
|
12
|
+
const curveBuilders = require("./curveBuilders-BkEJ-RVn.cjs");
|
|
12
13
|
const result = require("./result.cjs");
|
|
13
14
|
function makePlane(plane, origin) {
|
|
14
15
|
if (plane && typeof plane !== "string") {
|
|
@@ -83,7 +84,7 @@ function makeNonPlanarFace(wire) {
|
|
|
83
84
|
const faceBuilder = r(
|
|
84
85
|
new oc.BRepOffsetAPI_MakeFilling(3, 15, 2, false, 1e-5, 1e-4, 0.01, 0.1, 8, 9)
|
|
85
86
|
);
|
|
86
|
-
|
|
87
|
+
shapeFns.getEdges(wire).forEach((edge) => {
|
|
87
88
|
faceBuilder.Add_1(
|
|
88
89
|
edge.wrapped,
|
|
89
90
|
oc.GeomAbs_Shape.GeomAbs_C0,
|
|
@@ -363,7 +364,7 @@ class Curve2D {
|
|
|
363
364
|
const oc = occtBoundary.getKernel().oc;
|
|
364
365
|
const r = shapeTypes.gcWithScope();
|
|
365
366
|
const projector = r(new oc.Geom2dAPI_ProjectPointOnCurve_2(r(pnt(point)), this.wrapped));
|
|
366
|
-
let curveToPoint
|
|
367
|
+
let curveToPoint;
|
|
367
368
|
try {
|
|
368
369
|
curveToPoint = projector.LowerDistance();
|
|
369
370
|
} catch {
|
|
@@ -378,7 +379,7 @@ class Curve2D {
|
|
|
378
379
|
distanceFromCurve(curve) {
|
|
379
380
|
const oc = occtBoundary.getKernel().oc;
|
|
380
381
|
const r = shapeTypes.gcWithScope();
|
|
381
|
-
let curveDistance
|
|
382
|
+
let curveDistance;
|
|
382
383
|
const projector = r(
|
|
383
384
|
new oc.Geom2dAPI_ExtremaCurveCurve(
|
|
384
385
|
this.wrapped,
|
|
@@ -517,7 +518,10 @@ class Curve2D {
|
|
|
517
518
|
const trimmed = new oc.Geom2d_TrimmedCurve(this.wrapped, first, last, true, true);
|
|
518
519
|
return new Curve2D(new oc.Handle_Geom2d_Curve_2(trimmed));
|
|
519
520
|
} catch (e) {
|
|
520
|
-
throw new Error(
|
|
521
|
+
throw new Error(
|
|
522
|
+
`Failed to split the curve: ${e instanceof Error ? e.message : String(e)}`,
|
|
523
|
+
{ cause: e }
|
|
524
|
+
);
|
|
521
525
|
}
|
|
522
526
|
});
|
|
523
527
|
}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const vectors = require("./vectors-
|
|
3
|
-
const errors = require("./errors-
|
|
4
|
-
const cast = require("./cast-
|
|
5
|
-
const occtBoundary = require("./occtBoundary-
|
|
2
|
+
const vectors = require("./vectors-DVmHF4zt.cjs");
|
|
3
|
+
const errors = require("./errors-D13q2HCk.cjs");
|
|
4
|
+
const cast = require("./cast-CPNOTNFm.cjs");
|
|
5
|
+
const occtBoundary = require("./occtBoundary-CocN2VKx.cjs");
|
|
6
6
|
const vecOps = require("./vecOps-CjRL1jau.cjs");
|
|
7
|
-
const loft = require("./loft-
|
|
8
|
-
const shapeTypes = require("./shapeTypes-
|
|
9
|
-
const curveFns = require("./curveFns-
|
|
10
|
-
const Blueprint = require("./Blueprint-
|
|
11
|
-
const faceFns = require("./faceFns-
|
|
7
|
+
const loft = require("./loft-B-UCPW9P.cjs");
|
|
8
|
+
const shapeTypes = require("./shapeTypes-BxVxLdiD.cjs");
|
|
9
|
+
const curveFns = require("./curveFns-VMxgfkqw.cjs");
|
|
10
|
+
const Blueprint = require("./Blueprint-zgFe_5Qj.cjs");
|
|
11
|
+
const faceFns = require("./faceFns-es3GENII.cjs");
|
|
12
12
|
const result = require("./result.cjs");
|
|
13
|
-
const helpers = require("./helpers-
|
|
14
|
-
const curveBuilders = require("./curveBuilders-
|
|
13
|
+
const helpers = require("./helpers-C0q_FVxq.cjs");
|
|
14
|
+
const curveBuilders = require("./curveBuilders-BkEJ-RVn.cjs");
|
|
15
15
|
function* pointsIteration(intersector) {
|
|
16
16
|
const nPoints = intersector.NbPoints();
|
|
17
17
|
if (!nPoints) return;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { a as createPlane } from "./vectors-
|
|
2
|
-
import { l as ok, e as err, b as computationError, u as unwrap, g as isOk } from "./errors-
|
|
3
|
-
import { d as downcast } from "./cast-
|
|
4
|
-
import { g as getKernel, a as toVec3 } from "./occtBoundary-
|
|
1
|
+
import { a as createPlane } from "./vectors-DE0XriuQ.js";
|
|
2
|
+
import { l as ok, e as err, b as computationError, u as unwrap, g as isOk } from "./errors-CSYOlCCR.js";
|
|
3
|
+
import { d as downcast } from "./cast-Cerqtxtb.js";
|
|
4
|
+
import { g as getKernel, a as toVec3 } from "./occtBoundary-D_gjqgzo.js";
|
|
5
5
|
import { n as vecScale, j as vecNormalize, b as vecCross, D as DEG2RAD, R as RAD2DEG } from "./vecOps-ZDdZWbwT.js";
|
|
6
|
-
import { r as revolution, k as complexExtrude, t as twistExtrude, i as basicFaceExtrusion, j as genericSweep, l as loft } from "./loft-
|
|
7
|
-
import { p as gcWithScope, u as createFace, n as createWire, t as localGC, o as createEdge } from "./shapeTypes-
|
|
8
|
-
import {
|
|
9
|
-
import { C as Curve2D, i as make2dSegmentCurve, r as approximateAsBSpline, j as make2dArcFromCenter, s as isPoint2D, o as make2dCircle, t as make2dThreePointArc, e as BoundingBox2d, v as viewbox, u as asSVG, B as Blueprint, m as makeFace, d as makeNewFaceWithinFace, w as make2dEllipseArc, x as make2dTangentArc, y as make2dBezierCurve, f as axis2d, z as zip, A as removeDuplicatePoints } from "./Blueprint-
|
|
10
|
-
import { u as uvBounds, p as pointOnSurface, n as normalAt } from "./faceFns-
|
|
6
|
+
import { r as revolution, k as complexExtrude, t as twistExtrude, i as basicFaceExtrusion, j as genericSweep, l as loft } from "./loft-oJq2OD3A.js";
|
|
7
|
+
import { p as gcWithScope, u as createFace, n as createWire, t as localGC, o as createEdge } from "./shapeTypes-c-_pgYCx.js";
|
|
8
|
+
import { e as curveStartPoint, a as curveTangentAt, c as curveIsClosed } from "./curveFns-ZuQUBZvd.js";
|
|
9
|
+
import { C as Curve2D, i as make2dSegmentCurve, r as approximateAsBSpline, j as make2dArcFromCenter, s as isPoint2D, o as make2dCircle, t as make2dThreePointArc, e as BoundingBox2d, v as viewbox, u as asSVG, B as Blueprint, m as makeFace, d as makeNewFaceWithinFace, w as make2dEllipseArc, x as make2dTangentArc, y as make2dBezierCurve, f as axis2d, z as zip, A as removeDuplicatePoints } from "./Blueprint-Bp45tnh0.js";
|
|
10
|
+
import { u as uvBounds, p as pointOnSurface, n as normalAt } from "./faceFns-CfJIbHY3.js";
|
|
11
11
|
import { bug } from "./result.js";
|
|
12
|
-
import { s as samePoint$1, n as normalize2d, h as subtract2d, i as add2d, j as crossProduct2d, k as scalarMultiply2d, b as polarToCartesian, r as rotate2d, l as cartesianToPolar, d as distance2d, p as polarAngle2d, m as PRECISION_INTERSECTION } from "./helpers-
|
|
13
|
-
import { a as assembleWire } from "./curveBuilders-
|
|
12
|
+
import { s as samePoint$1, n as normalize2d, h as subtract2d, i as add2d, j as crossProduct2d, k as scalarMultiply2d, b as polarToCartesian, r as rotate2d, l as cartesianToPolar, d as distance2d, p as polarAngle2d, m as PRECISION_INTERSECTION } from "./helpers-CmVkMubc.js";
|
|
13
|
+
import { a as assembleWire } from "./curveBuilders-BREwqvuc.js";
|
|
14
14
|
function* pointsIteration(intersector) {
|
|
15
15
|
const nPoints = intersector.NbPoints();
|
|
16
16
|
if (!nPoints) return;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const occtBoundary = require("./occtBoundary-
|
|
3
|
-
const shapeTypes = require("./shapeTypes-
|
|
4
|
-
const errors = require("./errors-
|
|
5
|
-
const vectors = require("./vectors-
|
|
2
|
+
const occtBoundary = require("./occtBoundary-CocN2VKx.cjs");
|
|
3
|
+
const shapeTypes = require("./shapeTypes-BxVxLdiD.cjs");
|
|
4
|
+
const errors = require("./errors-D13q2HCk.cjs");
|
|
5
|
+
const vectors = require("./vectors-DVmHF4zt.cjs");
|
|
6
6
|
const vecOps = require("./vecOps-CjRL1jau.cjs");
|
|
7
|
+
const shapeFns = require("./shapeFns-B0zSdO9c.cjs");
|
|
7
8
|
function applyGlue(op, optimisation) {
|
|
8
9
|
const oc = occtBoundary.getKernel().oc;
|
|
9
10
|
if (optimisation === "commonFace") {
|
|
@@ -64,7 +65,15 @@ function fuse(a, b, { optimisation = "none", simplify = false, signal } = {}) {
|
|
|
64
65
|
applyGlue(fuseOp, optimisation);
|
|
65
66
|
fuseOp.Build(progress);
|
|
66
67
|
if (simplify) fuseOp.SimplifyResult(true, true, 1e-3);
|
|
67
|
-
|
|
68
|
+
const fuseResult = castToShape3D(
|
|
69
|
+
fuseOp.Shape(),
|
|
70
|
+
"FUSE_NOT_3D",
|
|
71
|
+
"Fuse did not produce a 3D shape"
|
|
72
|
+
);
|
|
73
|
+
if (fuseResult.ok) {
|
|
74
|
+
shapeFns.propagateOrigins(fuseOp, [a, b], fuseResult.value);
|
|
75
|
+
}
|
|
76
|
+
return fuseResult;
|
|
68
77
|
}
|
|
69
78
|
function cut(base, tool, { optimisation = "none", simplify = false, signal } = {}) {
|
|
70
79
|
if (signal?.aborted) throw signal.reason;
|
|
@@ -79,7 +88,11 @@ function cut(base, tool, { optimisation = "none", simplify = false, signal } = {
|
|
|
79
88
|
applyGlue(cutOp, optimisation);
|
|
80
89
|
cutOp.Build(progress);
|
|
81
90
|
if (simplify) cutOp.SimplifyResult(true, true, 1e-3);
|
|
82
|
-
|
|
91
|
+
const cutResult = castToShape3D(cutOp.Shape(), "CUT_NOT_3D", "Cut did not produce a 3D shape");
|
|
92
|
+
if (cutResult.ok) {
|
|
93
|
+
shapeFns.propagateOrigins(cutOp, [base, tool], cutResult.value);
|
|
94
|
+
}
|
|
95
|
+
return cutResult;
|
|
83
96
|
}
|
|
84
97
|
function intersect(a, b, { simplify = false, signal } = {}) {
|
|
85
98
|
if (signal?.aborted) throw signal.reason;
|
|
@@ -93,7 +106,15 @@ function intersect(a, b, { simplify = false, signal } = {}) {
|
|
|
93
106
|
const intOp = r(new oc.BRepAlgoAPI_Common_3(a.wrapped, b.wrapped, progress));
|
|
94
107
|
intOp.Build(progress);
|
|
95
108
|
if (simplify) intOp.SimplifyResult(true, true, 1e-3);
|
|
96
|
-
|
|
109
|
+
const intResult = castToShape3D(
|
|
110
|
+
intOp.Shape(),
|
|
111
|
+
"INTERSECT_NOT_3D",
|
|
112
|
+
"Intersect did not produce a 3D shape"
|
|
113
|
+
);
|
|
114
|
+
if (intResult.ok) {
|
|
115
|
+
shapeFns.propagateOrigins(intOp, [a, b], intResult.value);
|
|
116
|
+
}
|
|
117
|
+
return intResult;
|
|
97
118
|
}
|
|
98
119
|
function fuseAllPairwise(shapes, start, end, optimisation, simplify, isTopLevel, signal) {
|
|
99
120
|
if (signal?.aborted) throw signal.reason;
|
|
@@ -131,7 +152,15 @@ function fuseAll(shapes, { optimisation = "none", simplify = false, strategy = "
|
|
|
131
152
|
shapes.map((s) => s.wrapped),
|
|
132
153
|
{ optimisation, simplify, strategy, ...signal ? { signal } : {} }
|
|
133
154
|
);
|
|
134
|
-
|
|
155
|
+
const fuseAllResult = castToShape3D(
|
|
156
|
+
result,
|
|
157
|
+
"FUSE_ALL_NOT_3D",
|
|
158
|
+
"fuseAll did not produce a 3D shape"
|
|
159
|
+
);
|
|
160
|
+
if (fuseAllResult.ok) {
|
|
161
|
+
shapeFns.propagateOriginsByHash(shapes, fuseAllResult.value);
|
|
162
|
+
}
|
|
163
|
+
return fuseAllResult;
|
|
135
164
|
}
|
|
136
165
|
return fuseAllPairwise(shapes, 0, shapes.length, optimisation, simplify, true, signal);
|
|
137
166
|
}
|
|
@@ -152,7 +181,15 @@ function cutAll(base, tools, { optimisation = "none", simplify = false, signal }
|
|
|
152
181
|
applyGlue(cutOp, optimisation);
|
|
153
182
|
cutOp.Build(progress);
|
|
154
183
|
if (simplify) cutOp.SimplifyResult(true, true, 1e-3);
|
|
155
|
-
|
|
184
|
+
const cutAllResult = castToShape3D(
|
|
185
|
+
cutOp.Shape(),
|
|
186
|
+
"CUT_ALL_NOT_3D",
|
|
187
|
+
"cutAll did not produce a 3D shape"
|
|
188
|
+
);
|
|
189
|
+
if (cutAllResult.ok) {
|
|
190
|
+
shapeFns.propagateOrigins(cutOp, [base, ...tools], cutAllResult.value);
|
|
191
|
+
}
|
|
192
|
+
return cutAllResult;
|
|
156
193
|
}
|
|
157
194
|
function makeSectionFace(plane, size) {
|
|
158
195
|
const oc = occtBoundary.getKernel().oc;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { g as getKernel } from "./occtBoundary-
|
|
2
|
-
import { p as gcWithScope, c as castShape, h as isShape3D } from "./shapeTypes-
|
|
3
|
-
import { l as ok, d as isErr, e as err, x as validationError, B as BrepErrorCode, p as typeCastError, o as occtError } from "./errors-
|
|
4
|
-
import { r as resolvePlane } from "./vectors-
|
|
1
|
+
import { g as getKernel } from "./occtBoundary-D_gjqgzo.js";
|
|
2
|
+
import { p as gcWithScope, c as castShape, h as isShape3D } from "./shapeTypes-c-_pgYCx.js";
|
|
3
|
+
import { l as ok, d as isErr, e as err, x as validationError, B as BrepErrorCode, p as typeCastError, o as occtError } from "./errors-CSYOlCCR.js";
|
|
4
|
+
import { r as resolvePlane } from "./vectors-DE0XriuQ.js";
|
|
5
5
|
import { n as vecScale, v as vecAdd } from "./vecOps-ZDdZWbwT.js";
|
|
6
|
+
import { p as propagateOrigins, a as propagateOriginsByHash } from "./shapeFns-k1YHFwmB.js";
|
|
6
7
|
function applyGlue(op, optimisation) {
|
|
7
8
|
const oc = getKernel().oc;
|
|
8
9
|
if (optimisation === "commonFace") {
|
|
@@ -63,7 +64,15 @@ function fuse(a, b, { optimisation = "none", simplify = false, signal } = {}) {
|
|
|
63
64
|
applyGlue(fuseOp, optimisation);
|
|
64
65
|
fuseOp.Build(progress);
|
|
65
66
|
if (simplify) fuseOp.SimplifyResult(true, true, 1e-3);
|
|
66
|
-
|
|
67
|
+
const fuseResult = castToShape3D(
|
|
68
|
+
fuseOp.Shape(),
|
|
69
|
+
"FUSE_NOT_3D",
|
|
70
|
+
"Fuse did not produce a 3D shape"
|
|
71
|
+
);
|
|
72
|
+
if (fuseResult.ok) {
|
|
73
|
+
propagateOrigins(fuseOp, [a, b], fuseResult.value);
|
|
74
|
+
}
|
|
75
|
+
return fuseResult;
|
|
67
76
|
}
|
|
68
77
|
function cut(base, tool, { optimisation = "none", simplify = false, signal } = {}) {
|
|
69
78
|
if (signal?.aborted) throw signal.reason;
|
|
@@ -78,7 +87,11 @@ function cut(base, tool, { optimisation = "none", simplify = false, signal } = {
|
|
|
78
87
|
applyGlue(cutOp, optimisation);
|
|
79
88
|
cutOp.Build(progress);
|
|
80
89
|
if (simplify) cutOp.SimplifyResult(true, true, 1e-3);
|
|
81
|
-
|
|
90
|
+
const cutResult = castToShape3D(cutOp.Shape(), "CUT_NOT_3D", "Cut did not produce a 3D shape");
|
|
91
|
+
if (cutResult.ok) {
|
|
92
|
+
propagateOrigins(cutOp, [base, tool], cutResult.value);
|
|
93
|
+
}
|
|
94
|
+
return cutResult;
|
|
82
95
|
}
|
|
83
96
|
function intersect(a, b, { simplify = false, signal } = {}) {
|
|
84
97
|
if (signal?.aborted) throw signal.reason;
|
|
@@ -92,7 +105,15 @@ function intersect(a, b, { simplify = false, signal } = {}) {
|
|
|
92
105
|
const intOp = r(new oc.BRepAlgoAPI_Common_3(a.wrapped, b.wrapped, progress));
|
|
93
106
|
intOp.Build(progress);
|
|
94
107
|
if (simplify) intOp.SimplifyResult(true, true, 1e-3);
|
|
95
|
-
|
|
108
|
+
const intResult = castToShape3D(
|
|
109
|
+
intOp.Shape(),
|
|
110
|
+
"INTERSECT_NOT_3D",
|
|
111
|
+
"Intersect did not produce a 3D shape"
|
|
112
|
+
);
|
|
113
|
+
if (intResult.ok) {
|
|
114
|
+
propagateOrigins(intOp, [a, b], intResult.value);
|
|
115
|
+
}
|
|
116
|
+
return intResult;
|
|
96
117
|
}
|
|
97
118
|
function fuseAllPairwise(shapes, start, end, optimisation, simplify, isTopLevel, signal) {
|
|
98
119
|
if (signal?.aborted) throw signal.reason;
|
|
@@ -130,7 +151,15 @@ function fuseAll(shapes, { optimisation = "none", simplify = false, strategy = "
|
|
|
130
151
|
shapes.map((s) => s.wrapped),
|
|
131
152
|
{ optimisation, simplify, strategy, ...signal ? { signal } : {} }
|
|
132
153
|
);
|
|
133
|
-
|
|
154
|
+
const fuseAllResult = castToShape3D(
|
|
155
|
+
result,
|
|
156
|
+
"FUSE_ALL_NOT_3D",
|
|
157
|
+
"fuseAll did not produce a 3D shape"
|
|
158
|
+
);
|
|
159
|
+
if (fuseAllResult.ok) {
|
|
160
|
+
propagateOriginsByHash(shapes, fuseAllResult.value);
|
|
161
|
+
}
|
|
162
|
+
return fuseAllResult;
|
|
134
163
|
}
|
|
135
164
|
return fuseAllPairwise(shapes, 0, shapes.length, optimisation, simplify, true, signal);
|
|
136
165
|
}
|
|
@@ -151,7 +180,15 @@ function cutAll(base, tools, { optimisation = "none", simplify = false, signal }
|
|
|
151
180
|
applyGlue(cutOp, optimisation);
|
|
152
181
|
cutOp.Build(progress);
|
|
153
182
|
if (simplify) cutOp.SimplifyResult(true, true, 1e-3);
|
|
154
|
-
|
|
183
|
+
const cutAllResult = castToShape3D(
|
|
184
|
+
cutOp.Shape(),
|
|
185
|
+
"CUT_ALL_NOT_3D",
|
|
186
|
+
"cutAll did not produce a 3D shape"
|
|
187
|
+
);
|
|
188
|
+
if (cutAllResult.ok) {
|
|
189
|
+
propagateOrigins(cutOp, [base, ...tools], cutAllResult.value);
|
|
190
|
+
}
|
|
191
|
+
return cutAllResult;
|
|
155
192
|
}
|
|
156
193
|
function makeSectionFace(plane, size) {
|
|
157
194
|
const oc = getKernel().oc;
|