brepjs 8.8.3 → 8.8.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 +3 -3
- package/dist/{Blueprint-DsoGiJNJ.js → Blueprint-C4Rx89oe.js} +8 -8
- package/dist/{Blueprint-BmFJ4caY.cjs → Blueprint-D1Dik12C.cjs} +8 -8
- package/dist/{boolean2D-BQk8LNmZ.cjs → boolean2D-BZnkU_aH.cjs} +10 -10
- package/dist/{boolean2D-D5O0F3J8.js → boolean2D-D4j89vF_.js} +10 -10
- package/dist/{booleanFns-CVM3dOTP.cjs → booleanFns-Cf_0aWNe.cjs} +11 -10
- package/dist/{booleanFns-DOyKxL7q.js → booleanFns-D6SeHoCv.js} +11 -10
- package/dist/brepjs.cjs +37 -26
- package/dist/brepjs.js +51 -40
- package/dist/core/errors.d.ts +2 -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-DH6EwYfL.js → cornerFinder-CypY3T_w.js} +1 -1
- package/dist/{cornerFinder-XAV2ywVS.cjs → cornerFinder-DbRL42YI.cjs} +1 -1
- package/dist/{curveFns-BsAHC3Qv.cjs → curveFns-KDpL9iyo.cjs} +3 -3
- package/dist/{curveFns-BHRYwxBM.js → curveFns-VDZEhY97.js} +3 -3
- package/dist/{drawFns-CsmUF97U.cjs → drawFns-B52K-9DJ.cjs} +13 -13
- package/dist/{drawFns-hD05g0ZQ.js → drawFns-CVPwl2No.js} +13 -13
- package/dist/{errors-NNmTtM5u.cjs → errors-BYb4tL5h.cjs} +3 -0
- package/dist/{errors-DJ92ermb.js → errors-CHfaHQSt.js} +3 -0
- package/dist/{faceFns-DNQss51F.cjs → faceFns-B8xnZw-f.cjs} +3 -3
- package/dist/{faceFns-q5CR9pOW.js → faceFns-DG4bu-QB.js} +3 -3
- package/dist/{helpers-aylLv0_I.cjs → helpers-Cfibxk7U.cjs} +6 -6
- package/dist/{helpers-tNdaX01G.js → helpers-zsENdJlc.js} +6 -6
- package/dist/io.cjs +5 -5
- package/dist/io.js +5 -5
- package/dist/kernel/booleanOps.d.ts.map +1 -1
- package/dist/{loft-CjEEqz2P.cjs → loft-Bhnw5Rfr.cjs} +5 -5
- package/dist/{loft-DTRcYrq2.js → loft-fSnlFn-j.js} +5 -5
- package/dist/{measurement-B6_cxjpw.cjs → measurement-C4Ofuy_y.cjs} +3 -3
- package/dist/{measurement-BXqFvcGh.js → measurement-DzRb6oYN.js} +3 -3
- package/dist/measurement.cjs +1 -1
- package/dist/measurement.js +1 -1
- package/dist/{meshFns-CTc1CRkF.cjs → meshFns-C-6Cq3V-.cjs} +3 -3
- package/dist/{meshFns-DDFl7gLN.js → meshFns-Cw3IFJjg.js} +3 -3
- package/dist/{occtBoundary-Cqfsau2c.cjs → occtBoundary-CN_uQJtA.cjs} +4 -3
- package/dist/{occtBoundary-DvBywHyU.js → occtBoundary-Ct0tN8cs.js} +4 -3
- package/dist/{operations-pxjbW4Er.cjs → operations-DvwWDqIp.cjs} +6 -6
- package/dist/{operations-jRE2QbPo.js → operations-PYuj8GLd.js} +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/{shapeFns-D4CRxxmF.cjs → shapeFns-ByLUl6KE.cjs} +4 -4
- package/dist/{shapeFns-DNnBK8fG.js → shapeFns-QL3zx6uW.js} +4 -4
- package/dist/{shapeTypes-Bi_9RZa2.js → shapeTypes-D34s68Xi.js} +1 -1
- package/dist/{shapeTypes-CWuX602K.cjs → shapeTypes-sXITvFkF.cjs} +1 -1
- package/dist/sketching.cjs +2 -2
- package/dist/sketching.js +2 -2
- package/dist/{surfaceBuilders-W9Y25CIb.js → surfaceBuilders-DYX6h68y.js} +24 -18
- package/dist/{surfaceBuilders-CLal3WlK.cjs → surfaceBuilders-hupjYn0W.cjs} +24 -18
- package/dist/topology/booleanFns.d.ts.map +1 -1
- package/dist/topology/compoundOpsFns.d.ts.map +1 -1
- package/dist/topology/surfaceBuilders.d.ts.map +1 -1
- package/dist/{topology-CNw-wsmG.cjs → topology-DWe9SYAy.cjs} +8 -8
- package/dist/{topology-CMM6vAzx.js → topology-psR8Hqiz.js} +8 -8
- package/dist/topology.cjs +6 -6
- package/dist/topology.js +6 -6
- package/dist/{vectors-CGLqemPY.cjs → vectors-9rrStq8t.cjs} +2 -2
- package/dist/{vectors-2lOjaa8N.js → vectors-Dp5Iu1KH.js} +2 -2
- package/dist/vectors.cjs +2 -2
- package/dist/vectors.js +2 -2
- package/package.json +1 -1
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-D1Dik12C.cjs");
|
|
4
|
+
const boolean2D = require("./boolean2D-BZnkU_aH.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 { d, C, r } from "./Blueprint-
|
|
3
|
-
import { e, C as C2, f, l, g, n, k, q, o, p, r as r2 } from "./boolean2D-
|
|
1
|
+
import { B as Blueprint } from "./Blueprint-C4Rx89oe.js";
|
|
2
|
+
import { d, C, r } from "./Blueprint-C4Rx89oe.js";
|
|
3
|
+
import { e, C as C2, f, l, g, n, k, q, o, p, r as r2 } from "./boolean2D-D4j89vF_.js";
|
|
4
4
|
function reverseCurve(curve) {
|
|
5
5
|
const cloned = curve.clone();
|
|
6
6
|
cloned.reverse();
|
|
@@ -43,14 +43,14 @@ var __callDispose = (stack, error, hasError) => {
|
|
|
43
43
|
};
|
|
44
44
|
return next();
|
|
45
45
|
};
|
|
46
|
-
import { r as resolvePlane } from "./vectors-
|
|
47
|
-
import { g as getKernel, a as toVec3, c as makeOcAx2 } from "./occtBoundary-
|
|
48
|
-
import { D as DisposalScope, x as registerForCleanup, y as unregisterFromCleanup, r as createEdge, q as createWire } from "./shapeTypes-
|
|
49
|
-
import { u as uvBounds, f as faceGeomType, e as faceCenter, h as uvCoordinates, c as cast } from "./faceFns-
|
|
50
|
-
import { f as findCurveType, g as getOrientation } from "./curveFns-
|
|
51
|
-
import { u as unwrap, l as ok, e as err, b as computationError, x as validationError } from "./errors-
|
|
52
|
-
import { z as zip, m as makeFace } from "./surfaceBuilders-
|
|
53
|
-
import { d as distance2d, s as samePoint, b as scalarMultiply2d, c as add2d, n as normalize2d, e as subtract2d, g as getSingleFace } from "./helpers-
|
|
46
|
+
import { r as resolvePlane } from "./vectors-Dp5Iu1KH.js";
|
|
47
|
+
import { g as getKernel, a as toVec3, c as makeOcAx2 } from "./occtBoundary-Ct0tN8cs.js";
|
|
48
|
+
import { D as DisposalScope, x as registerForCleanup, y as unregisterFromCleanup, r as createEdge, q as createWire } from "./shapeTypes-D34s68Xi.js";
|
|
49
|
+
import { u as uvBounds, f as faceGeomType, e as faceCenter, h as uvCoordinates, c as cast } from "./faceFns-DG4bu-QB.js";
|
|
50
|
+
import { f as findCurveType, g as getOrientation } from "./curveFns-VDZEhY97.js";
|
|
51
|
+
import { u as unwrap, l as ok, e as err, b as computationError, x as validationError } from "./errors-CHfaHQSt.js";
|
|
52
|
+
import { z as zip, m as makeFace } from "./surfaceBuilders-DYX6h68y.js";
|
|
53
|
+
import { d as distance2d, s as samePoint, b as scalarMultiply2d, c as add2d, n as normalize2d, e as subtract2d, g as getSingleFace } from "./helpers-zsENdJlc.js";
|
|
54
54
|
import { R as RAD2DEG, D as DEG2RAD } from "./vecOps-ZDdZWbwT.js";
|
|
55
55
|
import { bug } from "./result.js";
|
|
56
56
|
function makePlane(plane, origin) {
|
|
@@ -44,14 +44,14 @@ var __callDispose = (stack, error, hasError) => {
|
|
|
44
44
|
};
|
|
45
45
|
return next();
|
|
46
46
|
};
|
|
47
|
-
const vectors = require("./vectors-
|
|
48
|
-
const occtBoundary = require("./occtBoundary-
|
|
49
|
-
const shapeTypes = require("./shapeTypes-
|
|
50
|
-
const faceFns = require("./faceFns-
|
|
51
|
-
const curveFns = require("./curveFns-
|
|
52
|
-
const errors = require("./errors-
|
|
53
|
-
const surfaceBuilders = require("./surfaceBuilders-
|
|
54
|
-
const helpers = require("./helpers-
|
|
47
|
+
const vectors = require("./vectors-9rrStq8t.cjs");
|
|
48
|
+
const occtBoundary = require("./occtBoundary-CN_uQJtA.cjs");
|
|
49
|
+
const shapeTypes = require("./shapeTypes-sXITvFkF.cjs");
|
|
50
|
+
const faceFns = require("./faceFns-B8xnZw-f.cjs");
|
|
51
|
+
const curveFns = require("./curveFns-KDpL9iyo.cjs");
|
|
52
|
+
const errors = require("./errors-BYb4tL5h.cjs");
|
|
53
|
+
const surfaceBuilders = require("./surfaceBuilders-hupjYn0W.cjs");
|
|
54
|
+
const helpers = require("./helpers-Cfibxk7U.cjs");
|
|
55
55
|
const vecOps = require("./vecOps-CjRL1jau.cjs");
|
|
56
56
|
const result = require("./result.cjs");
|
|
57
57
|
function makePlane(plane, origin) {
|
|
@@ -44,18 +44,18 @@ var __callDispose = (stack, error, hasError) => {
|
|
|
44
44
|
};
|
|
45
45
|
return next();
|
|
46
46
|
};
|
|
47
|
-
const vectors = require("./vectors-
|
|
48
|
-
const errors = require("./errors-
|
|
49
|
-
const faceFns = require("./faceFns-
|
|
50
|
-
const occtBoundary = require("./occtBoundary-
|
|
47
|
+
const vectors = require("./vectors-9rrStq8t.cjs");
|
|
48
|
+
const errors = require("./errors-BYb4tL5h.cjs");
|
|
49
|
+
const faceFns = require("./faceFns-B8xnZw-f.cjs");
|
|
50
|
+
const occtBoundary = require("./occtBoundary-CN_uQJtA.cjs");
|
|
51
51
|
const vecOps = require("./vecOps-CjRL1jau.cjs");
|
|
52
|
-
const loft = require("./loft-
|
|
53
|
-
const shapeTypes = require("./shapeTypes-
|
|
54
|
-
const curveFns = require("./curveFns-
|
|
55
|
-
const surfaceBuilders = require("./surfaceBuilders-
|
|
52
|
+
const loft = require("./loft-Bhnw5Rfr.cjs");
|
|
53
|
+
const shapeTypes = require("./shapeTypes-sXITvFkF.cjs");
|
|
54
|
+
const curveFns = require("./curveFns-KDpL9iyo.cjs");
|
|
55
|
+
const surfaceBuilders = require("./surfaceBuilders-hupjYn0W.cjs");
|
|
56
56
|
const result = require("./result.cjs");
|
|
57
|
-
const helpers = require("./helpers-
|
|
58
|
-
const Blueprint = require("./Blueprint-
|
|
57
|
+
const helpers = require("./helpers-Cfibxk7U.cjs");
|
|
58
|
+
const Blueprint = require("./Blueprint-D1Dik12C.cjs");
|
|
59
59
|
function* pointsIteration(intersector) {
|
|
60
60
|
const nPoints = intersector.NbPoints();
|
|
61
61
|
if (!nPoints) return;
|
|
@@ -43,18 +43,18 @@ var __callDispose = (stack, error, hasError) => {
|
|
|
43
43
|
};
|
|
44
44
|
return next();
|
|
45
45
|
};
|
|
46
|
-
import { a as createPlane } from "./vectors-
|
|
47
|
-
import { l as ok, e as err, b as computationError, u as unwrap, g as isOk } from "./errors-
|
|
48
|
-
import { d as downcast, u as uvBounds, p as pointOnSurface, n as normalAt } from "./faceFns-
|
|
49
|
-
import { g as getKernel, a as toVec3 } from "./occtBoundary-
|
|
46
|
+
import { a as createPlane } from "./vectors-Dp5Iu1KH.js";
|
|
47
|
+
import { l as ok, e as err, b as computationError, u as unwrap, g as isOk } from "./errors-CHfaHQSt.js";
|
|
48
|
+
import { d as downcast, u as uvBounds, p as pointOnSurface, n as normalAt } from "./faceFns-DG4bu-QB.js";
|
|
49
|
+
import { g as getKernel, a as toVec3 } from "./occtBoundary-Ct0tN8cs.js";
|
|
50
50
|
import { n as vecScale, j as vecNormalize, b as vecCross, D as DEG2RAD, R as RAD2DEG } from "./vecOps-ZDdZWbwT.js";
|
|
51
|
-
import { r as revolution, c as complexExtrude, t as twistExtrude, b as basicFaceExtrusion, g as genericSweep, l as loft } from "./loft-
|
|
52
|
-
import { D as DisposalScope, s as createFace, q as createWire, r as createEdge } from "./shapeTypes-
|
|
53
|
-
import { d as curveStartPoint, c as curveTangentAt, e as curveIsClosed } from "./curveFns-
|
|
54
|
-
import { m as makeFace, l as makeNewFaceWithinFace, b as assembleWire, z as zip } from "./surfaceBuilders-
|
|
51
|
+
import { r as revolution, c as complexExtrude, t as twistExtrude, b as basicFaceExtrusion, g as genericSweep, l as loft } from "./loft-fSnlFn-j.js";
|
|
52
|
+
import { D as DisposalScope, s as createFace, q as createWire, r as createEdge } from "./shapeTypes-D34s68Xi.js";
|
|
53
|
+
import { d as curveStartPoint, c as curveTangentAt, e as curveIsClosed } from "./curveFns-VDZEhY97.js";
|
|
54
|
+
import { m as makeFace, l as makeNewFaceWithinFace, b as assembleWire, z as zip } from "./surfaceBuilders-DYX6h68y.js";
|
|
55
55
|
import { bug } from "./result.js";
|
|
56
|
-
import { s as samePoint$1, n as normalize2d, e as subtract2d, c as add2d, i as crossProduct2d, b as scalarMultiply2d, f as polarToCartesian, r as rotate2d, j as cartesianToPolar, d as distance2d, p as polarAngle2d, k as PRECISION_INTERSECTION } from "./helpers-
|
|
57
|
-
import { C as Curve2D, a as make2dSegmentCurve, j as approximateAsBSpline, b as make2dArcFromCenter, k as isPoint2D, g as make2dCircle, l as make2dThreePointArc, d as BoundingBox2d, v as viewbox, n as asSVG, B as Blueprint, o as make2dEllipseArc, p as make2dTangentArc, q as make2dBezierCurve, r as axis2d, s as removeDuplicatePoints } from "./Blueprint-
|
|
56
|
+
import { s as samePoint$1, n as normalize2d, e as subtract2d, c as add2d, i as crossProduct2d, b as scalarMultiply2d, f as polarToCartesian, r as rotate2d, j as cartesianToPolar, d as distance2d, p as polarAngle2d, k as PRECISION_INTERSECTION } from "./helpers-zsENdJlc.js";
|
|
57
|
+
import { C as Curve2D, a as make2dSegmentCurve, j as approximateAsBSpline, b as make2dArcFromCenter, k as isPoint2D, g as make2dCircle, l as make2dThreePointArc, d as BoundingBox2d, v as viewbox, n as asSVG, B as Blueprint, o as make2dEllipseArc, p as make2dTangentArc, q as make2dBezierCurve, r as axis2d, s as removeDuplicatePoints } from "./Blueprint-C4Rx89oe.js";
|
|
58
58
|
function* pointsIteration(intersector) {
|
|
59
59
|
const nPoints = intersector.NbPoints();
|
|
60
60
|
if (!nPoints) return;
|
|
@@ -44,13 +44,13 @@ var __callDispose = (stack, error, hasError) => {
|
|
|
44
44
|
};
|
|
45
45
|
return next();
|
|
46
46
|
};
|
|
47
|
-
const occtBoundary = require("./occtBoundary-
|
|
48
|
-
const shapeTypes = require("./shapeTypes-
|
|
49
|
-
const errors = require("./errors-
|
|
50
|
-
const vectors = require("./vectors-
|
|
47
|
+
const occtBoundary = require("./occtBoundary-CN_uQJtA.cjs");
|
|
48
|
+
const shapeTypes = require("./shapeTypes-sXITvFkF.cjs");
|
|
49
|
+
const errors = require("./errors-BYb4tL5h.cjs");
|
|
50
|
+
const vectors = require("./vectors-9rrStq8t.cjs");
|
|
51
51
|
const vecOps = require("./vecOps-CjRL1jau.cjs");
|
|
52
|
-
const shapeFns = require("./shapeFns-
|
|
53
|
-
const surfaceBuilders = require("./surfaceBuilders-
|
|
52
|
+
const shapeFns = require("./shapeFns-ByLUl6KE.cjs");
|
|
53
|
+
const surfaceBuilders = require("./surfaceBuilders-hupjYn0W.cjs");
|
|
54
54
|
function applyGlue(op, optimisation) {
|
|
55
55
|
const oc = occtBoundary.getKernel().oc;
|
|
56
56
|
if (optimisation === "commonFace") {
|
|
@@ -265,6 +265,7 @@ function propagateColors(op, inputs, result) {
|
|
|
265
265
|
}
|
|
266
266
|
}
|
|
267
267
|
}
|
|
268
|
+
const SIMPLIFY_TOLERANCE = 1e-3;
|
|
268
269
|
function validateShape3D(shape, label) {
|
|
269
270
|
if (shape.wrapped.IsNull()) {
|
|
270
271
|
return errors.err(errors.validationError(errors.BrepErrorCode.NULL_SHAPE_INPUT, `${label} is a null shape`));
|
|
@@ -318,7 +319,7 @@ function fuse(a, b, { optimisation = "none", simplify = false, signal } = {}) {
|
|
|
318
319
|
applyGlue(fuseOp, optimisation);
|
|
319
320
|
fuseOp.SetRunParallel(true);
|
|
320
321
|
fuseOp.Build(progress);
|
|
321
|
-
if (simplify) fuseOp.SimplifyResult(true, true,
|
|
322
|
+
if (simplify) fuseOp.SimplifyResult(true, true, SIMPLIFY_TOLERANCE);
|
|
322
323
|
const fuseResult = castToShape3D(
|
|
323
324
|
fuseOp.Shape(),
|
|
324
325
|
"FUSE_NOT_3D",
|
|
@@ -351,7 +352,7 @@ function cut(base, tool, { optimisation = "none", simplify = false, signal } = {
|
|
|
351
352
|
applyGlue(cutOp, optimisation);
|
|
352
353
|
cutOp.SetRunParallel(true);
|
|
353
354
|
cutOp.Build(progress);
|
|
354
|
-
if (simplify) cutOp.SimplifyResult(true, true,
|
|
355
|
+
if (simplify) cutOp.SimplifyResult(true, true, SIMPLIFY_TOLERANCE);
|
|
355
356
|
const cutResult = castToShape3D(cutOp.Shape(), "CUT_NOT_3D", "Cut did not produce a 3D shape");
|
|
356
357
|
if (cutResult.ok) {
|
|
357
358
|
shapeFns.propagateOrigins(cutOp, [base, tool], cutResult.value);
|
|
@@ -379,7 +380,7 @@ function intersect(a, b, { simplify = false, signal } = {}) {
|
|
|
379
380
|
const intOp = scope.register(new oc.BRepAlgoAPI_Common_3(a.wrapped, b.wrapped, progress));
|
|
380
381
|
intOp.SetRunParallel(true);
|
|
381
382
|
intOp.Build(progress);
|
|
382
|
-
if (simplify) intOp.SimplifyResult(true, true,
|
|
383
|
+
if (simplify) intOp.SimplifyResult(true, true, SIMPLIFY_TOLERANCE);
|
|
383
384
|
const intResult = castToShape3D(
|
|
384
385
|
intOp.Shape(),
|
|
385
386
|
"INTERSECT_NOT_3D",
|
|
@@ -464,7 +465,7 @@ function cutAll(base, tools, { optimisation = "none", simplify = false, signal }
|
|
|
464
465
|
applyGlue(cutOp, optimisation);
|
|
465
466
|
cutOp.SetRunParallel(true);
|
|
466
467
|
cutOp.Build(progress);
|
|
467
|
-
if (simplify) cutOp.SimplifyResult(true, true,
|
|
468
|
+
if (simplify) cutOp.SimplifyResult(true, true, SIMPLIFY_TOLERANCE);
|
|
468
469
|
const cutAllResult = castToShape3D(
|
|
469
470
|
cutOp.Shape(),
|
|
470
471
|
"CUT_ALL_NOT_3D",
|
|
@@ -43,13 +43,13 @@ var __callDispose = (stack, error, hasError) => {
|
|
|
43
43
|
};
|
|
44
44
|
return next();
|
|
45
45
|
};
|
|
46
|
-
import { g as getKernel } from "./occtBoundary-
|
|
47
|
-
import { D as DisposalScope, c as castShape, j as isShape3D } from "./shapeTypes-
|
|
48
|
-
import { l as ok, d as isErr, e as err, x as validationError, B as BrepErrorCode, p as typeCastError, o as occtError } from "./errors-
|
|
49
|
-
import { r as resolvePlane } from "./vectors-
|
|
46
|
+
import { g as getKernel } from "./occtBoundary-Ct0tN8cs.js";
|
|
47
|
+
import { D as DisposalScope, c as castShape, j as isShape3D } from "./shapeTypes-D34s68Xi.js";
|
|
48
|
+
import { l as ok, d as isErr, e as err, x as validationError, B as BrepErrorCode, p as typeCastError, o as occtError } from "./errors-CHfaHQSt.js";
|
|
49
|
+
import { r as resolvePlane } from "./vectors-Dp5Iu1KH.js";
|
|
50
50
|
import { H as HASH_CODE_MAX, n as vecScale, v as vecAdd } from "./vecOps-ZDdZWbwT.js";
|
|
51
|
-
import { a as getFaces, p as propagateOrigins, b as propagateOriginsByHash, c as getWires, d as getEdges } from "./shapeFns-
|
|
52
|
-
import { m as makeFace } from "./surfaceBuilders-
|
|
51
|
+
import { a as getFaces, p as propagateOrigins, b as propagateOriginsByHash, c as getWires, d as getEdges } from "./shapeFns-QL3zx6uW.js";
|
|
52
|
+
import { m as makeFace } from "./surfaceBuilders-DYX6h68y.js";
|
|
53
53
|
function applyGlue(op, optimisation) {
|
|
54
54
|
const oc = getKernel().oc;
|
|
55
55
|
if (optimisation === "commonFace") {
|
|
@@ -264,6 +264,7 @@ function propagateColors(op, inputs, result) {
|
|
|
264
264
|
}
|
|
265
265
|
}
|
|
266
266
|
}
|
|
267
|
+
const SIMPLIFY_TOLERANCE = 1e-3;
|
|
267
268
|
function validateShape3D(shape, label) {
|
|
268
269
|
if (shape.wrapped.IsNull()) {
|
|
269
270
|
return err(validationError(BrepErrorCode.NULL_SHAPE_INPUT, `${label} is a null shape`));
|
|
@@ -317,7 +318,7 @@ function fuse(a, b, { optimisation = "none", simplify = false, signal } = {}) {
|
|
|
317
318
|
applyGlue(fuseOp, optimisation);
|
|
318
319
|
fuseOp.SetRunParallel(true);
|
|
319
320
|
fuseOp.Build(progress);
|
|
320
|
-
if (simplify) fuseOp.SimplifyResult(true, true,
|
|
321
|
+
if (simplify) fuseOp.SimplifyResult(true, true, SIMPLIFY_TOLERANCE);
|
|
321
322
|
const fuseResult = castToShape3D(
|
|
322
323
|
fuseOp.Shape(),
|
|
323
324
|
"FUSE_NOT_3D",
|
|
@@ -350,7 +351,7 @@ function cut(base, tool, { optimisation = "none", simplify = false, signal } = {
|
|
|
350
351
|
applyGlue(cutOp, optimisation);
|
|
351
352
|
cutOp.SetRunParallel(true);
|
|
352
353
|
cutOp.Build(progress);
|
|
353
|
-
if (simplify) cutOp.SimplifyResult(true, true,
|
|
354
|
+
if (simplify) cutOp.SimplifyResult(true, true, SIMPLIFY_TOLERANCE);
|
|
354
355
|
const cutResult = castToShape3D(cutOp.Shape(), "CUT_NOT_3D", "Cut did not produce a 3D shape");
|
|
355
356
|
if (cutResult.ok) {
|
|
356
357
|
propagateOrigins(cutOp, [base, tool], cutResult.value);
|
|
@@ -378,7 +379,7 @@ function intersect(a, b, { simplify = false, signal } = {}) {
|
|
|
378
379
|
const intOp = scope.register(new oc.BRepAlgoAPI_Common_3(a.wrapped, b.wrapped, progress));
|
|
379
380
|
intOp.SetRunParallel(true);
|
|
380
381
|
intOp.Build(progress);
|
|
381
|
-
if (simplify) intOp.SimplifyResult(true, true,
|
|
382
|
+
if (simplify) intOp.SimplifyResult(true, true, SIMPLIFY_TOLERANCE);
|
|
382
383
|
const intResult = castToShape3D(
|
|
383
384
|
intOp.Shape(),
|
|
384
385
|
"INTERSECT_NOT_3D",
|
|
@@ -463,7 +464,7 @@ function cutAll(base, tools, { optimisation = "none", simplify = false, signal }
|
|
|
463
464
|
applyGlue(cutOp, optimisation);
|
|
464
465
|
cutOp.SetRunParallel(true);
|
|
465
466
|
cutOp.Build(progress);
|
|
466
|
-
if (simplify) cutOp.SimplifyResult(true, true,
|
|
467
|
+
if (simplify) cutOp.SimplifyResult(true, true, SIMPLIFY_TOLERANCE);
|
|
467
468
|
const cutAllResult = castToShape3D(
|
|
468
469
|
cutOp.Shape(),
|
|
469
470
|
"CUT_ALL_NOT_3D",
|
package/dist/brepjs.cjs
CHANGED
|
@@ -45,30 +45,30 @@ var __callDispose = (stack, error, hasError) => {
|
|
|
45
45
|
return next();
|
|
46
46
|
};
|
|
47
47
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
48
|
-
const occtBoundary = require("./occtBoundary-
|
|
49
|
-
const errors = require("./errors-
|
|
50
|
-
const shapeTypes = require("./shapeTypes-
|
|
48
|
+
const occtBoundary = require("./occtBoundary-CN_uQJtA.cjs");
|
|
49
|
+
const errors = require("./errors-BYb4tL5h.cjs");
|
|
50
|
+
const shapeTypes = require("./shapeTypes-sXITvFkF.cjs");
|
|
51
51
|
const vecOps = require("./vecOps-CjRL1jau.cjs");
|
|
52
|
-
const Blueprint = require("./Blueprint-
|
|
53
|
-
const curveFns = require("./curveFns-
|
|
54
|
-
const loft$2 = require("./loft-
|
|
55
|
-
const operations = require("./operations-
|
|
56
|
-
const boolean2D = require("./boolean2D-
|
|
52
|
+
const Blueprint = require("./Blueprint-D1Dik12C.cjs");
|
|
53
|
+
const curveFns = require("./curveFns-KDpL9iyo.cjs");
|
|
54
|
+
const loft$2 = require("./loft-Bhnw5Rfr.cjs");
|
|
55
|
+
const operations = require("./operations-DvwWDqIp.cjs");
|
|
56
|
+
const boolean2D = require("./boolean2D-BZnkU_aH.cjs");
|
|
57
57
|
const _2d = require("./2d.cjs");
|
|
58
|
-
const helpers = require("./helpers-
|
|
58
|
+
const helpers = require("./helpers-Cfibxk7U.cjs");
|
|
59
59
|
const io = require("./io.cjs");
|
|
60
|
-
const drawFns = require("./drawFns-
|
|
61
|
-
const vectors = require("./vectors-
|
|
62
|
-
const shapeFns = require("./shapeFns-
|
|
63
|
-
const booleanFns = require("./booleanFns-
|
|
64
|
-
const topology = require("./topology-
|
|
65
|
-
const faceFns = require("./faceFns-
|
|
66
|
-
const meshFns = require("./meshFns-
|
|
67
|
-
const measurement = require("./measurement-
|
|
68
|
-
const surfaceBuilders = require("./surfaceBuilders-
|
|
60
|
+
const drawFns = require("./drawFns-B52K-9DJ.cjs");
|
|
61
|
+
const vectors = require("./vectors-9rrStq8t.cjs");
|
|
62
|
+
const shapeFns = require("./shapeFns-ByLUl6KE.cjs");
|
|
63
|
+
const booleanFns = require("./booleanFns-Cf_0aWNe.cjs");
|
|
64
|
+
const topology = require("./topology-DWe9SYAy.cjs");
|
|
65
|
+
const faceFns = require("./faceFns-B8xnZw-f.cjs");
|
|
66
|
+
const meshFns = require("./meshFns-C-6Cq3V-.cjs");
|
|
67
|
+
const measurement = require("./measurement-C4Ofuy_y.cjs");
|
|
68
|
+
const surfaceBuilders = require("./surfaceBuilders-hupjYn0W.cjs");
|
|
69
69
|
const query = require("./query.cjs");
|
|
70
70
|
const result = require("./result.cjs");
|
|
71
|
-
const cornerFinder = require("./cornerFinder-
|
|
71
|
+
const cornerFinder = require("./cornerFinder-DbRL42YI.cjs");
|
|
72
72
|
const worker = require("./worker.cjs");
|
|
73
73
|
const errorFactories = {
|
|
74
74
|
OCCT_OPERATION: (code, message, cause) => ({ kind: "OCCT_OPERATION", code, message, cause }),
|
|
@@ -2521,7 +2521,9 @@ function resolveTargetFace(shape2, faceSpec) {
|
|
|
2521
2521
|
if (faceSpec === void 0) {
|
|
2522
2522
|
const faces = shapeFns.getFaces(shape2);
|
|
2523
2523
|
if (faces.length === 0) {
|
|
2524
|
-
|
|
2524
|
+
return errors.err(
|
|
2525
|
+
errors.validationError(errors.BrepErrorCode.COMPOUND_NO_FACES, "compoundOps: shape has no faces")
|
|
2526
|
+
);
|
|
2525
2527
|
}
|
|
2526
2528
|
let best = faces[0];
|
|
2527
2529
|
let bestZ = faceFns.faceCenter(best)[2];
|
|
@@ -2533,17 +2535,22 @@ function resolveTargetFace(shape2, faceSpec) {
|
|
|
2533
2535
|
bestZ = z;
|
|
2534
2536
|
}
|
|
2535
2537
|
}
|
|
2536
|
-
return best;
|
|
2538
|
+
return errors.ok(best);
|
|
2537
2539
|
}
|
|
2538
2540
|
if (typeof faceSpec === "function") {
|
|
2539
2541
|
const finder = faceSpec(helpers.faceFinder());
|
|
2540
2542
|
const found = finder.findAll(shape2);
|
|
2541
2543
|
if (found.length === 0) {
|
|
2542
|
-
|
|
2544
|
+
return errors.err(
|
|
2545
|
+
errors.queryError(
|
|
2546
|
+
errors.BrepErrorCode.COMPOUND_FACE_NOT_FOUND,
|
|
2547
|
+
"compoundOps: face finder matched no faces"
|
|
2548
|
+
)
|
|
2549
|
+
);
|
|
2543
2550
|
}
|
|
2544
|
-
return found[0];
|
|
2551
|
+
return errors.ok(found[0]);
|
|
2545
2552
|
}
|
|
2546
|
-
return faceSpec;
|
|
2553
|
+
return errors.ok(faceSpec);
|
|
2547
2554
|
}
|
|
2548
2555
|
function toWire(profile) {
|
|
2549
2556
|
if ("sketchOnPlane" in profile && typeof profile.sketchOnPlane === "function") {
|
|
@@ -2582,7 +2589,9 @@ function pocket(shape2, options) {
|
|
|
2582
2589
|
if (depth <= 0) {
|
|
2583
2590
|
return errors.err(errors.validationError("POCKET_INVALID_DEPTH", "Pocket depth must be positive"));
|
|
2584
2591
|
}
|
|
2585
|
-
const
|
|
2592
|
+
const targetResult = resolveTargetFace(s, options.face);
|
|
2593
|
+
if (errors.isErr(targetResult)) return targetResult;
|
|
2594
|
+
const targetFace = targetResult.value;
|
|
2586
2595
|
const normal = faceFns.normalAt(targetFace);
|
|
2587
2596
|
const w = toWire(profile);
|
|
2588
2597
|
const faceResult = surfaceBuilders.makeFace(w);
|
|
@@ -2598,7 +2607,9 @@ function boss(shape2, options) {
|
|
|
2598
2607
|
if (height <= 0) {
|
|
2599
2608
|
return errors.err(errors.validationError("BOSS_INVALID_HEIGHT", "Boss height must be positive"));
|
|
2600
2609
|
}
|
|
2601
|
-
const
|
|
2610
|
+
const targetResult = resolveTargetFace(s, options.face);
|
|
2611
|
+
if (errors.isErr(targetResult)) return targetResult;
|
|
2612
|
+
const targetFace = targetResult.value;
|
|
2602
2613
|
const normal = faceFns.normalAt(targetFace);
|
|
2603
2614
|
const w = toWire(profile);
|
|
2604
2615
|
const faceResult = surfaceBuilders.makeFace(w);
|
package/dist/brepjs.js
CHANGED
|
@@ -43,45 +43,45 @@ var __callDispose = (stack, error, hasError) => {
|
|
|
43
43
|
};
|
|
44
44
|
return next();
|
|
45
45
|
};
|
|
46
|
-
import { g as getKernel, f as makeTriFace, d as toOcPnt, a as toVec3 } from "./occtBoundary-
|
|
47
|
-
import { h, i, j, k, r, b, t, w, l, n } from "./occtBoundary-
|
|
48
|
-
import { l as ok, y as translateOcctError, e as err, q as queryError, x as validationError, B as BrepErrorCode, o as occtError, i as ioError, d as isErr, p as typeCastError, u as unwrap } from "./errors-
|
|
49
|
-
import { O, a, c, b as b2, f, g, m, h as h2, j as j2, k as k2, z, s, t as t2, n as n2, r as r2, v, w as w2 } from "./errors-
|
|
50
|
-
import { c as castShape, D as DisposalScope, e as isFace, k as isShell, l as isSolid, j as isShape3D, v as createSolid, q as createWire, d as isEdge, n as isWire } from "./shapeTypes-
|
|
51
|
-
import { t as t3, r as r3, s as s2, a as a2, b as b3, z as z2, u, A, B, g as g2, i as i2, f as f2, h as h3, m as m2, C, w as w3, o, p } from "./shapeTypes-
|
|
46
|
+
import { g as getKernel, f as makeTriFace, d as toOcPnt, a as toVec3 } from "./occtBoundary-Ct0tN8cs.js";
|
|
47
|
+
import { h, i, j, k, r, b, t, w, l, n } from "./occtBoundary-Ct0tN8cs.js";
|
|
48
|
+
import { l as ok, y as translateOcctError, e as err, q as queryError, x as validationError, B as BrepErrorCode, o as occtError, i as ioError, d as isErr, p as typeCastError, u as unwrap } from "./errors-CHfaHQSt.js";
|
|
49
|
+
import { O, a, c, b as b2, f, g, m, h as h2, j as j2, k as k2, z, s, t as t2, n as n2, r as r2, v, w as w2 } from "./errors-CHfaHQSt.js";
|
|
50
|
+
import { c as castShape, D as DisposalScope, e as isFace, k as isShell, l as isSolid, j as isShape3D, v as createSolid, q as createWire, d as isEdge, n as isWire } from "./shapeTypes-D34s68Xi.js";
|
|
51
|
+
import { t as t3, r as r3, s as s2, a as a2, b as b3, z as z2, u, A, B, g as g2, i as i2, f as f2, h as h3, m as m2, C, w as w3, o, p } from "./shapeTypes-D34s68Xi.js";
|
|
52
52
|
import { c as vecDistance, D as DEG2RAD, n as vecScale, j as vecNormalize, f as vecIsZero } from "./vecOps-ZDdZWbwT.js";
|
|
53
53
|
import { H, R, v as v2, a as a3, b as b4, d, e, g as g3, h as h4, i as i3, k as k3, l as l2, m as m3, o as o2 } from "./vecOps-ZDdZWbwT.js";
|
|
54
|
-
import { B as B2, d as d2, C as C2, r as r4, t as t4 } from "./Blueprint-
|
|
55
|
-
import { e as curveIsClosed, d as curveStartPoint, c as curveTangentAt, h as curvePointAt, a as curveEndPoint, i as curveLength } from "./curveFns-
|
|
56
|
-
import { j as j3, k as k4, l as l3, f as f3, m as m4, b as b5, g as g4, n as n3, o as o3 } from "./curveFns-
|
|
57
|
-
import { m as makeCompound, d as makeCone, e as makeCylinder, f as makeEllipsoid, h as makeOffset, w as weldShellsAndFaces, a as makeSolid, i as makeSphere, j as makeTorus, k as makeVertex } from "./loft-
|
|
58
|
-
import { b as b6, g as g5, r as r5 } from "./loft-
|
|
59
|
-
import { w as walkAssembly, e as extrude$1, r as revolve$1, s as sweep, c as circularPattern, l as linearPattern } from "./operations-
|
|
60
|
-
import { a as a4, b as b7, d as d3, f as f4, g as g6, h as h5, i as i4, j as j4, k as k5, m as m5, n as n4, o as o4, p as p2, q, t as t5, u as u2, v as v3, x, y, z as z3, A as A2, B as B3, C as C3, D, E } from "./operations-
|
|
61
|
-
import { B as B4, a as a5, e as e2, C as C4, F, S, f as f5, l as l4, g as g7, n as n5, k as k6, q as q2, o as o5, p as p3, r as r6 } from "./boolean2D-
|
|
54
|
+
import { B as B2, d as d2, C as C2, r as r4, t as t4 } from "./Blueprint-C4Rx89oe.js";
|
|
55
|
+
import { e as curveIsClosed, d as curveStartPoint, c as curveTangentAt, h as curvePointAt, a as curveEndPoint, i as curveLength } from "./curveFns-VDZEhY97.js";
|
|
56
|
+
import { j as j3, k as k4, l as l3, f as f3, m as m4, b as b5, g as g4, n as n3, o as o3 } from "./curveFns-VDZEhY97.js";
|
|
57
|
+
import { m as makeCompound, d as makeCone, e as makeCylinder, f as makeEllipsoid, h as makeOffset, w as weldShellsAndFaces, a as makeSolid, i as makeSphere, j as makeTorus, k as makeVertex } from "./loft-fSnlFn-j.js";
|
|
58
|
+
import { b as b6, g as g5, r as r5 } from "./loft-fSnlFn-j.js";
|
|
59
|
+
import { w as walkAssembly, e as extrude$1, r as revolve$1, s as sweep, c as circularPattern, l as linearPattern } from "./operations-PYuj8GLd.js";
|
|
60
|
+
import { a as a4, b as b7, d as d3, f as f4, g as g6, h as h5, i as i4, j as j4, k as k5, m as m5, n as n4, o as o4, p as p2, q, t as t5, u as u2, v as v3, x, y, z as z3, A as A2, B as B3, C as C3, D, E } from "./operations-PYuj8GLd.js";
|
|
61
|
+
import { B as B4, a as a5, e as e2, C as C4, F, S, f as f5, l as l4, g as g7, n as n5, k as k6, q as q2, o as o5, p as p3, r as r6 } from "./boolean2D-D4j89vF_.js";
|
|
62
62
|
import { createBlueprint, curve2dBoundingBox, curve2dDistanceFrom, curve2dFirstPoint, curve2dIsOnCurve, curve2dLastPoint, curve2dParameter, curve2dSplitAt, curve2dTangentAt, getBounds2D, getOrientation2D, isInside2D, mirror2D, reverseCurve, rotate2D, scale2D, sketch2DOnFace, sketch2DOnPlane, stretch2D, toSVGPathD, translate2D } from "./2d.js";
|
|
63
|
-
import { l as createTypedFinder, m as faceFinder } from "./helpers-
|
|
64
|
-
import { g as g8 } from "./helpers-
|
|
63
|
+
import { l as createTypedFinder, m as faceFinder } from "./helpers-zsENdJlc.js";
|
|
64
|
+
import { g as g8 } from "./helpers-zsENdJlc.js";
|
|
65
65
|
import { blueprintToDXF, exportDXF, exportGlb, exportGltf, exportOBJ, exportThreeMF, importIGES, importSTEP, importSTL, importSVG, importSVGPathD } from "./io.js";
|
|
66
|
-
import { C as C5, D as D2, a as a6, S as S2, b as b8, X, Y, c as c2, d as d4, e as e3, f as f6, Z, g as g9, h as h6, i as i5, j as j5, k as k7, l as l5, m as m6, n as n6, o as o6, p as p4, q as q3, r as r7, s as s3, t as t6, u as u3, v as v4, w as w4, x as x2, y as y2, z as z4, _, $, a0, a1, A as A3, a2 as a22, B as B5, E as E2, a3 as a32, F as F2, G, H as H2, I, J, K, L, M, N, O as O2, P, Q, R as R2, T, U, a4 as a42, V, a5 as a52, a6 as a62, W } from "./drawFns-
|
|
67
|
-
import { c as c3, a as a7, p as p5, r as r8, t as t7 } from "./vectors-
|
|
68
|
-
import { v as vertexPosition, a as getFaces, f as getVertices, d as getEdges, t as translate$1, p as propagateOrigins, h as applyMatrix$1, j as clone$1, k as describe$1, l as isEmpty$1, m as mirror$1, r as rotate$1, s as scale$1, n as simplify$1, o as toBREP$1, q as transformCopy$1, u as getBounds, c as getWires } from "./shapeFns-
|
|
69
|
-
import { w as w5, g as g10, e as e4, x as x3, i as i6, y as y3, z as z5, A as A4, B as B6, C as C6, D as D3 } from "./shapeFns-
|
|
70
|
-
import { p as propagateFaceTags, a as propagateColors, c as cut$1, f as fuse$1, i as intersect$1, s as section$1, b as sectionToFace$1, d as slice$1, e as split$1, g as fuseAll, h as cutAll } from "./booleanFns-
|
|
71
|
-
import { j as j6, k as k8, l as l6, m as m7, n as n7, o as o7, q as q4, r as r9, t as t8, u as u4 } from "./booleanFns-
|
|
72
|
-
import { c as chamferDistAngle, h as heal$1, i as isValid$1 } from "./topology-
|
|
73
|
-
import { a as a8, b as b9, e as e5, f as f7, d as d5, g as g11, j as j7, s as s4, t as t9, k as k9, l as l7, v as v5, w as w6 } from "./topology-
|
|
74
|
-
import { i as iterTopo, e as faceCenter, n as normalAt, j as fromBREP$1, k as innerWires, o as outerWire, g as getSurfaceType } from "./faceFns-
|
|
75
|
-
import { l as l8, c as c4, m as m8, d as d6, f as f8, q as q5, r as r10, s as s5, p as p6, t as t10, v as v6, u as u5, h as h7 } from "./faceFns-
|
|
76
|
-
import { m as mesh$1, a as meshEdges$1 } from "./meshFns-
|
|
77
|
-
import { c as c5, b as b10, e as e6, d as d7, f as f9 } from "./meshFns-
|
|
78
|
-
import { m as measureArea, a as measureSurfaceProps, b as measureVolumeProps, c as measureVolume } from "./measurement-
|
|
79
|
-
import { d as d8, e as e7, f as f10, g as g12, h as h8, i as i7 } from "./measurement-
|
|
80
|
-
import { h as addHolesInFace, g as makeBezierCurve, k as makeBSplineApproximation, i as makeCircle, j as makeEllipse, f as makeEllipseArc, m as makeFace, n as makeNonPlanarFace, c as makeHelix, a as makeLine, o as makePolygon, l as makeNewFaceWithinFace, e as makeTangentArc, d as makeThreePointArc, b as assembleWire } from "./surfaceBuilders-
|
|
81
|
-
import { p as p7 } from "./surfaceBuilders-
|
|
66
|
+
import { C as C5, D as D2, a as a6, S as S2, b as b8, X, Y, c as c2, d as d4, e as e3, f as f6, Z, g as g9, h as h6, i as i5, j as j5, k as k7, l as l5, m as m6, n as n6, o as o6, p as p4, q as q3, r as r7, s as s3, t as t6, u as u3, v as v4, w as w4, x as x2, y as y2, z as z4, _, $, a0, a1, A as A3, a2 as a22, B as B5, E as E2, a3 as a32, F as F2, G, H as H2, I, J, K, L, M, N, O as O2, P, Q, R as R2, T, U, a4 as a42, V, a5 as a52, a6 as a62, W } from "./drawFns-CVPwl2No.js";
|
|
67
|
+
import { c as c3, a as a7, p as p5, r as r8, t as t7 } from "./vectors-Dp5Iu1KH.js";
|
|
68
|
+
import { v as vertexPosition, a as getFaces, f as getVertices, d as getEdges, t as translate$1, p as propagateOrigins, h as applyMatrix$1, j as clone$1, k as describe$1, l as isEmpty$1, m as mirror$1, r as rotate$1, s as scale$1, n as simplify$1, o as toBREP$1, q as transformCopy$1, u as getBounds, c as getWires } from "./shapeFns-QL3zx6uW.js";
|
|
69
|
+
import { w as w5, g as g10, e as e4, x as x3, i as i6, y as y3, z as z5, A as A4, B as B6, C as C6, D as D3 } from "./shapeFns-QL3zx6uW.js";
|
|
70
|
+
import { p as propagateFaceTags, a as propagateColors, c as cut$1, f as fuse$1, i as intersect$1, s as section$1, b as sectionToFace$1, d as slice$1, e as split$1, g as fuseAll, h as cutAll } from "./booleanFns-D6SeHoCv.js";
|
|
71
|
+
import { j as j6, k as k8, l as l6, m as m7, n as n7, o as o7, q as q4, r as r9, t as t8, u as u4 } from "./booleanFns-D6SeHoCv.js";
|
|
72
|
+
import { c as chamferDistAngle, h as heal$1, i as isValid$1 } from "./topology-psR8Hqiz.js";
|
|
73
|
+
import { a as a8, b as b9, e as e5, f as f7, d as d5, g as g11, j as j7, s as s4, t as t9, k as k9, l as l7, v as v5, w as w6 } from "./topology-psR8Hqiz.js";
|
|
74
|
+
import { i as iterTopo, e as faceCenter, n as normalAt, j as fromBREP$1, k as innerWires, o as outerWire, g as getSurfaceType } from "./faceFns-DG4bu-QB.js";
|
|
75
|
+
import { l as l8, c as c4, m as m8, d as d6, f as f8, q as q5, r as r10, s as s5, p as p6, t as t10, v as v6, u as u5, h as h7 } from "./faceFns-DG4bu-QB.js";
|
|
76
|
+
import { m as mesh$1, a as meshEdges$1 } from "./meshFns-Cw3IFJjg.js";
|
|
77
|
+
import { c as c5, b as b10, e as e6, d as d7, f as f9 } from "./meshFns-Cw3IFJjg.js";
|
|
78
|
+
import { m as measureArea, a as measureSurfaceProps, b as measureVolumeProps, c as measureVolume } from "./measurement-DzRb6oYN.js";
|
|
79
|
+
import { d as d8, e as e7, f as f10, g as g12, h as h8, i as i7 } from "./measurement-DzRb6oYN.js";
|
|
80
|
+
import { h as addHolesInFace, g as makeBezierCurve, k as makeBSplineApproximation, i as makeCircle, j as makeEllipse, f as makeEllipseArc, m as makeFace, n as makeNonPlanarFace, c as makeHelix, a as makeLine, o as makePolygon, l as makeNewFaceWithinFace, e as makeTangentArc, d as makeThreePointArc, b as assembleWire } from "./surfaceBuilders-DYX6h68y.js";
|
|
81
|
+
import { p as p7 } from "./surfaceBuilders-DYX6h68y.js";
|
|
82
82
|
import { edgeFinder } from "./query.js";
|
|
83
83
|
import { BrepBugError, bug } from "./result.js";
|
|
84
|
-
import { c as c6 } from "./cornerFinder-
|
|
84
|
+
import { c as c6 } from "./cornerFinder-CypY3T_w.js";
|
|
85
85
|
import { createOperationRegistry, createTaskQueue, createWorkerClient, createWorkerHandler, dequeueTask, enqueueTask, isDisposeRequest, isErrorResponse, isInitRequest, isOperationRequest, isQueueEmpty, isSuccessResponse, pendingCount, registerHandler, rejectAll } from "./worker.js";
|
|
86
86
|
const errorFactories = {
|
|
87
87
|
OCCT_OPERATION: (code, message, cause) => ({ kind: "OCCT_OPERATION", code, message, cause }),
|
|
@@ -2534,7 +2534,9 @@ function resolveTargetFace(shape2, faceSpec) {
|
|
|
2534
2534
|
if (faceSpec === void 0) {
|
|
2535
2535
|
const faces = getFaces(shape2);
|
|
2536
2536
|
if (faces.length === 0) {
|
|
2537
|
-
|
|
2537
|
+
return err(
|
|
2538
|
+
validationError(BrepErrorCode.COMPOUND_NO_FACES, "compoundOps: shape has no faces")
|
|
2539
|
+
);
|
|
2538
2540
|
}
|
|
2539
2541
|
let best = faces[0];
|
|
2540
2542
|
let bestZ = faceCenter(best)[2];
|
|
@@ -2546,17 +2548,22 @@ function resolveTargetFace(shape2, faceSpec) {
|
|
|
2546
2548
|
bestZ = z6;
|
|
2547
2549
|
}
|
|
2548
2550
|
}
|
|
2549
|
-
return best;
|
|
2551
|
+
return ok(best);
|
|
2550
2552
|
}
|
|
2551
2553
|
if (typeof faceSpec === "function") {
|
|
2552
2554
|
const finder = faceSpec(faceFinder());
|
|
2553
2555
|
const found = finder.findAll(shape2);
|
|
2554
2556
|
if (found.length === 0) {
|
|
2555
|
-
|
|
2557
|
+
return err(
|
|
2558
|
+
queryError(
|
|
2559
|
+
BrepErrorCode.COMPOUND_FACE_NOT_FOUND,
|
|
2560
|
+
"compoundOps: face finder matched no faces"
|
|
2561
|
+
)
|
|
2562
|
+
);
|
|
2556
2563
|
}
|
|
2557
|
-
return found[0];
|
|
2564
|
+
return ok(found[0]);
|
|
2558
2565
|
}
|
|
2559
|
-
return faceSpec;
|
|
2566
|
+
return ok(faceSpec);
|
|
2560
2567
|
}
|
|
2561
2568
|
function toWire(profile) {
|
|
2562
2569
|
if ("sketchOnPlane" in profile && typeof profile.sketchOnPlane === "function") {
|
|
@@ -2595,7 +2602,9 @@ function pocket(shape2, options) {
|
|
|
2595
2602
|
if (depth <= 0) {
|
|
2596
2603
|
return err(validationError("POCKET_INVALID_DEPTH", "Pocket depth must be positive"));
|
|
2597
2604
|
}
|
|
2598
|
-
const
|
|
2605
|
+
const targetResult = resolveTargetFace(s6, options.face);
|
|
2606
|
+
if (isErr(targetResult)) return targetResult;
|
|
2607
|
+
const targetFace = targetResult.value;
|
|
2599
2608
|
const normal = normalAt(targetFace);
|
|
2600
2609
|
const w7 = toWire(profile);
|
|
2601
2610
|
const faceResult = makeFace(w7);
|
|
@@ -2611,7 +2620,9 @@ function boss(shape2, options) {
|
|
|
2611
2620
|
if (height <= 0) {
|
|
2612
2621
|
return err(validationError("BOSS_INVALID_HEIGHT", "Boss height must be positive"));
|
|
2613
2622
|
}
|
|
2614
|
-
const
|
|
2623
|
+
const targetResult = resolveTargetFace(s6, options.face);
|
|
2624
|
+
if (isErr(targetResult)) return targetResult;
|
|
2625
|
+
const targetFace = targetResult.value;
|
|
2615
2626
|
const normal = normalAt(targetFace);
|
|
2616
2627
|
const w7 = toWire(profile);
|
|
2617
2628
|
const faceResult = makeFace(w7);
|
package/dist/core/errors.d.ts
CHANGED
|
@@ -76,6 +76,8 @@ export declare const BrepErrorCode: {
|
|
|
76
76
|
readonly PARAMETER_NOT_FOUND: "PARAMETER_NOT_FOUND";
|
|
77
77
|
readonly INTERSECTION_FAILED: "INTERSECTION_FAILED";
|
|
78
78
|
readonly SELF_INTERSECTION_FAILED: "SELF_INTERSECTION_FAILED";
|
|
79
|
+
readonly COMPOUND_NO_FACES: "COMPOUND_NO_FACES";
|
|
80
|
+
readonly COMPOUND_FACE_NOT_FOUND: "COMPOUND_FACE_NOT_FOUND";
|
|
79
81
|
readonly FINDER_NOT_UNIQUE: "FINDER_NOT_UNIQUE";
|
|
80
82
|
readonly HULL_EMPTY_INPUT: "HULL_EMPTY_INPUT";
|
|
81
83
|
readonly HULL_FAILED: "HULL_FAILED";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/core/errors.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAMpD,8CAA8C;AAC9C,MAAM,MAAM,aAAa,GACrB,gBAAgB,GAChB,YAAY,GACZ,WAAW,GACX,gBAAgB,GAChB,aAAa,GACb,aAAa,GACb,IAAI,GACJ,OAAO,CAAC;AAMZ;;;;GAIG;AACH,eAAO,MAAM,aAAa
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/core/errors.ts"],"names":[],"mappings":"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"}
|
package/dist/core.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const occtBoundary = require("./occtBoundary-
|
|
3
|
+
const occtBoundary = require("./occtBoundary-CN_uQJtA.cjs");
|
|
4
4
|
const vecOps = require("./vecOps-CjRL1jau.cjs");
|
|
5
|
-
const errors = require("./errors-
|
|
6
|
-
const vectors = require("./vectors-
|
|
7
|
-
const shapeTypes = require("./shapeTypes-
|
|
5
|
+
const errors = require("./errors-BYb4tL5h.cjs");
|
|
6
|
+
const vectors = require("./vectors-9rrStq8t.cjs");
|
|
7
|
+
const shapeTypes = require("./shapeTypes-sXITvFkF.cjs");
|
|
8
8
|
const result = require("./result.cjs");
|
|
9
9
|
exports.resolveDirection = occtBoundary.resolveDirection;
|
|
10
10
|
exports.toVec2 = occtBoundary.toVec2;
|
package/dist/core.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { r, t, a } from "./occtBoundary-
|
|
1
|
+
import { r, t, a } from "./occtBoundary-Ct0tN8cs.js";
|
|
2
2
|
import { D, H, R, v, a as a2, b, c, d, e, f, g, h, i, j, k, l, m, n, o } from "./vecOps-ZDdZWbwT.js";
|
|
3
|
-
import { O, a as a3, c as c2, b as b2, e as e2, f as f2, i as i2, d as d2, g as g2, m as m2, h as h2, j as j2, k as k2, o as o2, l as l2, q, s, t as t2, n as n2, p, u, r as r2, v as v2, w, x } from "./errors-
|
|
4
|
-
import { c as c3, a as a4, p as p2, r as r3, t as t3 } from "./vectors-
|
|
5
|
-
import { D as D2, c as c4, a as a5, b as b3, g as g3, i as i3, d as d3, e as e3, f as f3, h as h3, j as j3, k as k3, l as l3, m as m3, n as n3, w as w2, o as o3, p as p3 } from "./shapeTypes-
|
|
3
|
+
import { O, a as a3, c as c2, b as b2, e as e2, f as f2, i as i2, d as d2, g as g2, m as m2, h as h2, j as j2, k as k2, o as o2, l as l2, q, s, t as t2, n as n2, p, u, r as r2, v as v2, w, x } from "./errors-CHfaHQSt.js";
|
|
4
|
+
import { c as c3, a as a4, p as p2, r as r3, t as t3 } from "./vectors-Dp5Iu1KH.js";
|
|
5
|
+
import { D as D2, c as c4, a as a5, b as b3, g as g3, i as i3, d as d3, e as e3, f as f3, h as h3, j as j3, k as k3, l as l3, m as m3, n as n3, w as w2, o as o3, p as p3 } from "./shapeTypes-D34s68Xi.js";
|
|
6
6
|
import { BrepBugError, bug } from "./result.js";
|
|
7
7
|
export {
|
|
8
8
|
BrepBugError,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as angle2d, s as samePoint, d as distance2d } from "./helpers-
|
|
1
|
+
import { a as angle2d, s as samePoint, d as distance2d } from "./helpers-zsENdJlc.js";
|
|
2
2
|
import { D as DEG2RAD } from "./vecOps-ZDdZWbwT.js";
|
|
3
3
|
const PI_2 = 2 * Math.PI;
|
|
4
4
|
function positiveHalfAngle(angle) {
|
|
@@ -44,9 +44,9 @@ var __callDispose = (stack, error, hasError) => {
|
|
|
44
44
|
};
|
|
45
45
|
return next();
|
|
46
46
|
};
|
|
47
|
-
const occtBoundary = require("./occtBoundary-
|
|
48
|
-
const shapeTypes = require("./shapeTypes-
|
|
49
|
-
const errors = require("./errors-
|
|
47
|
+
const occtBoundary = require("./occtBoundary-CN_uQJtA.cjs");
|
|
48
|
+
const shapeTypes = require("./shapeTypes-sXITvFkF.cjs");
|
|
49
|
+
const errors = require("./errors-BYb4tL5h.cjs");
|
|
50
50
|
let CURVE_TYPES_MAP = null;
|
|
51
51
|
const getCurveTypesMap = (refresh) => {
|
|
52
52
|
if (CURVE_TYPES_MAP && !refresh) return CURVE_TYPES_MAP;
|
|
@@ -43,9 +43,9 @@ var __callDispose = (stack, error, hasError) => {
|
|
|
43
43
|
};
|
|
44
44
|
return next();
|
|
45
45
|
};
|
|
46
|
-
import { g as getKernel } from "./occtBoundary-
|
|
47
|
-
import { D as DisposalScope, c as castShape, d as isEdge, n as isWire } from "./shapeTypes-
|
|
48
|
-
import { e as err, p as typeCastError, l as ok, u as unwrap } from "./errors-
|
|
46
|
+
import { g as getKernel } from "./occtBoundary-Ct0tN8cs.js";
|
|
47
|
+
import { D as DisposalScope, c as castShape, d as isEdge, n as isWire } from "./shapeTypes-D34s68Xi.js";
|
|
48
|
+
import { e as err, p as typeCastError, l as ok, u as unwrap } from "./errors-CHfaHQSt.js";
|
|
49
49
|
let CURVE_TYPES_MAP = null;
|
|
50
50
|
const getCurveTypesMap = (refresh) => {
|
|
51
51
|
if (CURVE_TYPES_MAP && !refresh) return CURVE_TYPES_MAP;
|