brepjs 9.3.8 → 9.3.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/2d/blueprints/intersectionSegments.d.ts +6 -0
- package/dist/2d/blueprints/intersectionSegments.d.ts.map +1 -1
- package/dist/2d/lib/offset.d.ts.map +1 -1
- package/dist/2d.cjs +2 -2
- package/dist/2d.js +3 -3
- package/dist/{Blueprint-C_ny87tf.cjs → Blueprint-CYDtiBRw.cjs} +6 -6
- package/dist/{Blueprint-vLo9HuPx.js → Blueprint-DBFQJ5ME.js} +6 -6
- package/dist/{boolean2D-G9wVVewF.js → boolean2D-BDRf7DqS.js} +9 -9
- package/dist/{boolean2D-C_WtQSZM.cjs → boolean2D-FaadcaJX.cjs} +9 -9
- package/dist/{booleanFns-G0j8iAZV.cjs → booleanFns-DHFR4zO7.cjs} +4 -4
- package/dist/{booleanFns-gwskRu9F.js → booleanFns-GfGGPjuF.js} +4 -4
- package/dist/brepjs.cjs +80 -89
- package/dist/brepjs.js +125 -134
- package/dist/core/result.d.ts +14 -0
- package/dist/core/result.d.ts.map +1 -1
- package/dist/core.cjs +2 -2
- package/dist/core.js +2 -2
- package/dist/{cornerFinder-CrM1kbgV.js → cornerFinder-Bke7uLr6.js} +1 -1
- package/dist/{cornerFinder-56x6NzUP.cjs → cornerFinder-C1oci6gb.cjs} +1 -1
- package/dist/{curveFns-B7b2uHRl.js → curveFns-BteO-W-V.js} +1 -1
- package/dist/{curveFns-BsxQJoWM.cjs → curveFns-DOhZedkN.cjs} +1 -1
- package/dist/{drawFns-BIoGsiXr.cjs → drawFns-4kaeEGpt.cjs} +11 -11
- package/dist/{drawFns-BD92V6Nt.js → drawFns-D7fQtIj-.js} +11 -11
- package/dist/{errors-HU7EpHt3.cjs → errors-DiTn5EoC.cjs} +33 -0
- package/dist/{errors-C_XjfNt5.js → errors-lBwyc8YG.js} +34 -1
- package/dist/{faceFns-A6VJdsJc.cjs → faceFns-Cshr6Dql.cjs} +1 -1
- package/dist/{faceFns-DKAs23b7.js → faceFns-FViaMujJ.js} +1 -1
- package/dist/{helpers-C-dHgprx.cjs → helpers-aY6tdIRv.cjs} +4 -4
- package/dist/{helpers-BidbwB1g.js → helpers-j3ILUOP3.js} +4 -4
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/io.cjs +3 -3
- package/dist/io.js +3 -3
- package/dist/kernel/index.d.ts.map +1 -1
- package/dist/kernel/measureOps.d.ts +18 -0
- package/dist/kernel/measureOps.d.ts.map +1 -1
- package/dist/kernel/solverAdapter.d.ts +4 -1
- package/dist/kernel/solverAdapter.d.ts.map +1 -1
- package/dist/kernel/transformOps.d.ts +30 -0
- package/dist/kernel/transformOps.d.ts.map +1 -1
- package/dist/{loft-B0VRwdIS.cjs → loft-6RVa269J.cjs} +3 -3
- package/dist/{loft-BI8MUcCF.js → loft-CiXi_aga.js} +3 -3
- package/dist/{measurement-CyIBSu3o.js → measurement-BNrssBY_.js} +1 -1
- package/dist/{measurement-D5XQSvln.cjs → measurement-Crrs7ULW.cjs} +1 -1
- package/dist/measurement.cjs +1 -1
- package/dist/measurement.js +1 -1
- package/dist/{meshFns-BilAVkvY.js → meshFns-w1baxmAz.js} +2 -2
- package/dist/{meshFns-ClCp7nft.cjs → meshFns-xdRr7G4g.cjs} +2 -2
- package/dist/operations/historyFns.d.ts +10 -0
- package/dist/operations/historyFns.d.ts.map +1 -1
- package/dist/operations/mateFns.d.ts.map +1 -1
- package/dist/{operations-Bw3ZGLPJ.js → operations-CbE3WgWv.js} +64 -19
- package/dist/{operations-B1FSxszL.cjs → operations-Ds393Tne.cjs} +48 -3
- package/dist/operations.cjs +2 -2
- package/dist/operations.js +18 -18
- package/dist/query.cjs +3 -3
- package/dist/query.js +4 -4
- package/dist/result.cjs +1 -1
- package/dist/result.js +2 -2
- package/dist/{shapeFns-O9Ont1Dy.cjs → shapeFns-BvxOc2M_.cjs} +2 -2
- package/dist/{shapeFns-D9CKkCnS.js → shapeFns-DvwUGuOx.js} +2 -2
- package/dist/sketching.cjs +2 -2
- package/dist/sketching.js +2 -2
- package/dist/{surfaceBuilders-BX-btdhW.js → surfaceBuilders-C67Q29Gt.js} +2 -2
- package/dist/{surfaceBuilders-DwMD54OR.cjs → surfaceBuilders-mE9oGh7r.cjs} +2 -2
- package/dist/{topology-ChR-we6s.cjs → topology-DKWBbtZ3.cjs} +6 -6
- package/dist/{topology-DDO_RZ7P.js → topology-z4wgJE7T.js} +6 -6
- package/dist/topology.cjs +6 -6
- package/dist/topology.js +6 -6
- package/dist/{vectors-CpZfWX0T.js → vectors-B8RRTytu.js} +1 -1
- package/dist/{vectors-BwRTfFd1.cjs → vectors-DqQXtR8s.cjs} +1 -1
- package/dist/vectors.cjs +1 -1
- package/dist/vectors.js +1 -1
- package/package.json +2 -2
|
@@ -1,5 +1,11 @@
|
|
|
1
|
+
import { Point2D } from '../lib/index.js';
|
|
1
2
|
import { default as Blueprint } from './Blueprint.js';
|
|
2
3
|
import { IntersectionSegment } from './booleanHelpers.js';
|
|
4
|
+
/**
|
|
5
|
+
* Check whether a segment's start/end points match one of the common segment
|
|
6
|
+
* point pairs.
|
|
7
|
+
*/
|
|
8
|
+
export declare function isCommonSegmentMatch(commonSegmentsPoints: Point2D[][], segmentStart: Point2D, segmentEnd: Point2D): boolean;
|
|
3
9
|
/**
|
|
4
10
|
* Given two closed blueprints, find their intersection points, split each
|
|
5
11
|
* blueprint's curves at those points, and pair up the resulting segments.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"intersectionSegments.d.ts","sourceRoot":"","sources":["../../../src/2d/blueprints/intersectionSegments.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"intersectionSegments.d.ts","sourceRoot":"","sources":["../../../src/2d/blueprints/intersectionSegments.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAW,MAAM,iBAAiB,CAAC;AAGxD,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAC;AAY5C,OAAO,KAAK,EAAW,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AA0IxE;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,oBAAoB,EAAE,OAAO,EAAE,EAAE,EACjC,YAAY,EAAE,OAAO,EACrB,UAAU,EAAE,OAAO,GAClB,OAAO,CAQT;AAMD;;;;;;;GAOG;AACH,wBAAgB,8BAA8B,CAC5C,KAAK,EAAE,SAAS,EAChB,MAAM,EAAE,SAAS,GAChB,mBAAmB,EAAE,GAAG,IAAI,CAwE9B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"offset.d.ts","sourceRoot":"","sources":["../../../src/2d/lib/offset.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAmBhD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,YAAY,GACvB,OAAO,OAAO,EACd,QAAQ,MAAM,KACb,OAAO,GAAG;IAAE,SAAS,EAAE,IAAI,CAAC;IAAC,UAAU,EAAE,OAAO,CAAC;IAAC,SAAS,EAAE,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"offset.d.ts","sourceRoot":"","sources":["../../../src/2d/lib/offset.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAmBhD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,YAAY,GACvB,OAAO,OAAO,EACd,QAAQ,MAAM,KACb,OAAO,GAAG;IAAE,SAAS,EAAE,IAAI,CAAC;IAAC,UAAU,EAAE,OAAO,CAAC;IAAC,SAAS,EAAE,OAAO,CAAA;CA4EtE,CAAC"}
|
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-CYDtiBRw.cjs");
|
|
4
|
+
const boolean2D = require("./boolean2D-FaadcaJX.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 } from "./Blueprint-
|
|
3
|
-
import { e, C as C2, f, l, g, n, k, q, o, p, r } from "./boolean2D-
|
|
1
|
+
import { B as Blueprint } from "./Blueprint-DBFQJ5ME.js";
|
|
2
|
+
import { d, C } from "./Blueprint-DBFQJ5ME.js";
|
|
3
|
+
import { e, C as C2, f, l, g, n, k, q, o, p, r } from "./boolean2D-BDRf7DqS.js";
|
|
4
4
|
function reverseCurve(curve) {
|
|
5
5
|
const cloned = curve.clone();
|
|
6
6
|
cloned.reverse();
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const vectors = require("./vectors-
|
|
2
|
+
const vectors = require("./vectors-DqQXtR8s.cjs");
|
|
3
3
|
const types = require("./types-CA_xrgDq.cjs");
|
|
4
4
|
const shapeTypes = require("./shapeTypes-CBhj5o2y.cjs");
|
|
5
|
-
const faceFns = require("./faceFns-
|
|
6
|
-
const curveFns = require("./curveFns-
|
|
7
|
-
const errors = require("./errors-
|
|
8
|
-
const helpers = require("./helpers-
|
|
5
|
+
const faceFns = require("./faceFns-Cshr6Dql.cjs");
|
|
6
|
+
const curveFns = require("./curveFns-DOhZedkN.cjs");
|
|
7
|
+
const errors = require("./errors-DiTn5EoC.cjs");
|
|
8
|
+
const helpers = require("./helpers-aY6tdIRv.cjs");
|
|
9
9
|
const vecOps = require("./vecOps-CjRL1jau.cjs");
|
|
10
|
-
const surfaceBuilders = require("./surfaceBuilders-
|
|
10
|
+
const surfaceBuilders = require("./surfaceBuilders-mE9oGh7r.cjs");
|
|
11
11
|
const result = require("./result.cjs");
|
|
12
12
|
function makePlane(plane, origin) {
|
|
13
13
|
if (plane && typeof plane !== "string") {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { r as resolvePlane } from "./vectors-
|
|
1
|
+
import { r as resolvePlane } from "./vectors-B8RRTytu.js";
|
|
2
2
|
import { a as toVec3 } from "./types-CWDdqcrq.js";
|
|
3
3
|
import { q as getKernel, y as getKernel2D, z as registerForCleanup, A as unregisterFromCleanup, s as createEdge, r as createWire } from "./shapeTypes-d-jYnZuW.js";
|
|
4
|
-
import { u as uvBounds, f as faceGeomType, e as faceCenter, h as uvCoordinates, c as cast } from "./faceFns-
|
|
5
|
-
import { g as getOrientation } from "./curveFns-
|
|
6
|
-
import { o as ok, e as err, b as computationError, u as unwrap, x as validationError } from "./errors-
|
|
7
|
-
import { d as distance2d, s as samePoint, b as scalarMultiply2d, c as add2d, n as normalize2d, e as subtract2d, g as getSingleFace } from "./helpers-
|
|
4
|
+
import { u as uvBounds, f as faceGeomType, e as faceCenter, h as uvCoordinates, c as cast } from "./faceFns-FViaMujJ.js";
|
|
5
|
+
import { g as getOrientation } from "./curveFns-BteO-W-V.js";
|
|
6
|
+
import { o as ok, e as err, b as computationError, u as unwrap, x as validationError } from "./errors-lBwyc8YG.js";
|
|
7
|
+
import { d as distance2d, s as samePoint, b as scalarMultiply2d, c as add2d, n as normalize2d, e as subtract2d, g as getSingleFace } from "./helpers-j3ILUOP3.js";
|
|
8
8
|
import { R as RAD2DEG, D as DEG2RAD } from "./vecOps-ZDdZWbwT.js";
|
|
9
|
-
import { m as makeFace } from "./surfaceBuilders-
|
|
9
|
+
import { m as makeFace } from "./surfaceBuilders-C67Q29Gt.js";
|
|
10
10
|
import { bug } from "./result.js";
|
|
11
11
|
function makePlane(plane, origin) {
|
|
12
12
|
if (plane && typeof plane !== "string") {
|
|
@@ -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 { o 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-
|
|
46
|
+
import { a as createPlane } from "./vectors-B8RRTytu.js";
|
|
47
|
+
import { o as ok, e as err, b as computationError, u as unwrap, g as isOk } from "./errors-lBwyc8YG.js";
|
|
48
|
+
import { d as downcast, u as uvBounds, p as pointOnSurface, n as normalAt } from "./faceFns-FViaMujJ.js";
|
|
49
49
|
import { a as toVec3 } from "./types-CWDdqcrq.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-
|
|
51
|
+
import { r as revolution, c as complexExtrude, t as twistExtrude, b as basicFaceExtrusion, g as genericSweep, l as loft } from "./loft-CiXi_aga.js";
|
|
52
52
|
import { y as getKernel2D, t as createFace, r as createWire, q as getKernel, s as createEdge, D as DisposalScope } from "./shapeTypes-d-jYnZuW.js";
|
|
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-
|
|
53
|
+
import { d as curveStartPoint, c as curveTangentAt, e as curveIsClosed } from "./curveFns-BteO-W-V.js";
|
|
54
|
+
import { m as makeFace, l as makeNewFaceWithinFace, b as assembleWire, z as zip } from "./surfaceBuilders-C67Q29Gt.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 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-j3ILUOP3.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 removeDuplicatePoints } from "./Blueprint-DBFQJ5ME.js";
|
|
58
58
|
const intersectCurves = (first, second, precision = 1e-9) => {
|
|
59
59
|
if (first.boundingBox.isOut(second.boundingBox))
|
|
60
60
|
return ok({ intersections: [], commonSegments: [], commonSegmentsPoints: [] });
|
|
@@ -1973,7 +1973,7 @@ function splitCurvesAtIntersections(curves, curvePoints) {
|
|
|
1973
1973
|
function isCommonSegmentMatch(commonSegmentsPoints, segmentStart, segmentEnd) {
|
|
1974
1974
|
return commonSegmentsPoints.some(([startPoint, endPoint]) => {
|
|
1975
1975
|
if (startPoint === void 0 || endPoint === void 0) return false;
|
|
1976
|
-
return samePoint(startPoint, segmentStart) && samePoint(endPoint, segmentEnd) || samePoint(startPoint, segmentEnd) && samePoint(
|
|
1976
|
+
return samePoint(startPoint, segmentStart) && samePoint(endPoint, segmentEnd) || samePoint(startPoint, segmentEnd) && samePoint(endPoint, segmentStart);
|
|
1977
1977
|
});
|
|
1978
1978
|
}
|
|
1979
1979
|
function blueprintsIntersectionSegments(first, second) {
|
|
@@ -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-
|
|
47
|
+
const vectors = require("./vectors-DqQXtR8s.cjs");
|
|
48
|
+
const errors = require("./errors-DiTn5EoC.cjs");
|
|
49
|
+
const faceFns = require("./faceFns-Cshr6Dql.cjs");
|
|
50
50
|
const types = require("./types-CA_xrgDq.cjs");
|
|
51
51
|
const vecOps = require("./vecOps-CjRL1jau.cjs");
|
|
52
|
-
const loft = require("./loft-
|
|
52
|
+
const loft = require("./loft-6RVa269J.cjs");
|
|
53
53
|
const shapeTypes = require("./shapeTypes-CBhj5o2y.cjs");
|
|
54
|
-
const curveFns = require("./curveFns-
|
|
55
|
-
const surfaceBuilders = require("./surfaceBuilders-
|
|
54
|
+
const curveFns = require("./curveFns-DOhZedkN.cjs");
|
|
55
|
+
const surfaceBuilders = require("./surfaceBuilders-mE9oGh7r.cjs");
|
|
56
56
|
const result = require("./result.cjs");
|
|
57
|
-
const helpers = require("./helpers-
|
|
58
|
-
const Blueprint = require("./Blueprint-
|
|
57
|
+
const helpers = require("./helpers-aY6tdIRv.cjs");
|
|
58
|
+
const Blueprint = require("./Blueprint-CYDtiBRw.cjs");
|
|
59
59
|
const intersectCurves = (first, second, precision = 1e-9) => {
|
|
60
60
|
if (first.boundingBox.isOut(second.boundingBox))
|
|
61
61
|
return errors.ok({ intersections: [], commonSegments: [], commonSegmentsPoints: [] });
|
|
@@ -1974,7 +1974,7 @@ function splitCurvesAtIntersections(curves, curvePoints) {
|
|
|
1974
1974
|
function isCommonSegmentMatch(commonSegmentsPoints, segmentStart, segmentEnd) {
|
|
1975
1975
|
return commonSegmentsPoints.some(([startPoint, endPoint]) => {
|
|
1976
1976
|
if (startPoint === void 0 || endPoint === void 0) return false;
|
|
1977
|
-
return samePoint(startPoint, segmentStart) && samePoint(endPoint, segmentEnd) || samePoint(startPoint, segmentEnd) && samePoint(
|
|
1977
|
+
return samePoint(startPoint, segmentStart) && samePoint(endPoint, segmentEnd) || samePoint(startPoint, segmentEnd) && samePoint(endPoint, segmentStart);
|
|
1978
1978
|
});
|
|
1979
1979
|
}
|
|
1980
1980
|
function blueprintsIntersectionSegments(first, second) {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const shapeTypes = require("./shapeTypes-CBhj5o2y.cjs");
|
|
3
|
-
const errors = require("./errors-
|
|
4
|
-
const vectors = require("./vectors-
|
|
3
|
+
const errors = require("./errors-DiTn5EoC.cjs");
|
|
4
|
+
const vectors = require("./vectors-DqQXtR8s.cjs");
|
|
5
5
|
const vecOps = require("./vecOps-CjRL1jau.cjs");
|
|
6
|
-
const shapeFns = require("./shapeFns-
|
|
7
|
-
const surfaceBuilders = require("./surfaceBuilders-
|
|
6
|
+
const shapeFns = require("./shapeFns-BvxOc2M_.cjs");
|
|
7
|
+
const surfaceBuilders = require("./surfaceBuilders-mE9oGh7r.cjs");
|
|
8
8
|
const shapeTagStore = /* @__PURE__ */ new WeakMap();
|
|
9
9
|
const tagMetadataStore = /* @__PURE__ */ new WeakMap();
|
|
10
10
|
function hasFaceTags(shape) {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { q as getKernel, c as castShape, j as isShape3D } from "./shapeTypes-d-jYnZuW.js";
|
|
2
|
-
import { o as ok, d as isErr, e as err, x as validationError, B as BrepErrorCode, p as typeCastError, k as kernelError } from "./errors-
|
|
3
|
-
import { r as resolvePlane } from "./vectors-
|
|
2
|
+
import { o as ok, d as isErr, e as err, x as validationError, B as BrepErrorCode, p as typeCastError, k as kernelError } from "./errors-lBwyc8YG.js";
|
|
3
|
+
import { r as resolvePlane } from "./vectors-B8RRTytu.js";
|
|
4
4
|
import { H as HASH_CODE_MAX, n as vecScale, v as vecAdd } from "./vecOps-ZDdZWbwT.js";
|
|
5
|
-
import { a as getFaces, p as propagateOriginsFromEvolution, b as propagateOriginsByHash, g as getFaceOrigins, c as getWires, d as getEdges, e as getVertices } from "./shapeFns-
|
|
6
|
-
import { m as makeFace } from "./surfaceBuilders-
|
|
5
|
+
import { a as getFaces, p as propagateOriginsFromEvolution, b as propagateOriginsByHash, g as getFaceOrigins, c as getWires, d as getEdges, e as getVertices } from "./shapeFns-DvwUGuOx.js";
|
|
6
|
+
import { m as makeFace } from "./surfaceBuilders-C67Q29Gt.js";
|
|
7
7
|
const shapeTagStore = /* @__PURE__ */ new WeakMap();
|
|
8
8
|
const tagMetadataStore = /* @__PURE__ */ new WeakMap();
|
|
9
9
|
function hasFaceTags(shape) {
|
package/dist/brepjs.cjs
CHANGED
|
@@ -46,29 +46,29 @@ var __callDispose = (stack, error, hasError) => {
|
|
|
46
46
|
};
|
|
47
47
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
48
48
|
const shapeTypes = require("./shapeTypes-CBhj5o2y.cjs");
|
|
49
|
-
const errors = require("./errors-
|
|
49
|
+
const errors = require("./errors-DiTn5EoC.cjs");
|
|
50
50
|
const vecOps = require("./vecOps-CjRL1jau.cjs");
|
|
51
|
-
const Blueprint = require("./Blueprint-
|
|
52
|
-
const loft$2 = require("./loft-
|
|
53
|
-
const operations = require("./operations-
|
|
54
|
-
const boolean2D = require("./boolean2D-
|
|
51
|
+
const Blueprint = require("./Blueprint-CYDtiBRw.cjs");
|
|
52
|
+
const loft$2 = require("./loft-6RVa269J.cjs");
|
|
53
|
+
const operations = require("./operations-Ds393Tne.cjs");
|
|
54
|
+
const boolean2D = require("./boolean2D-FaadcaJX.cjs");
|
|
55
55
|
const _2d = require("./2d.cjs");
|
|
56
|
-
const helpers = require("./helpers-
|
|
56
|
+
const helpers = require("./helpers-aY6tdIRv.cjs");
|
|
57
57
|
const io = require("./io.cjs");
|
|
58
|
-
const drawFns = require("./drawFns-
|
|
58
|
+
const drawFns = require("./drawFns-4kaeEGpt.cjs");
|
|
59
59
|
const types = require("./types-CA_xrgDq.cjs");
|
|
60
|
-
const vectors = require("./vectors-
|
|
61
|
-
const shapeFns = require("./shapeFns-
|
|
62
|
-
const booleanFns = require("./booleanFns-
|
|
63
|
-
const topology = require("./topology-
|
|
64
|
-
const curveFns = require("./curveFns-
|
|
65
|
-
const faceFns = require("./faceFns-
|
|
66
|
-
const meshFns = require("./meshFns-
|
|
67
|
-
const measurement = require("./measurement-
|
|
68
|
-
const surfaceBuilders = require("./surfaceBuilders-
|
|
60
|
+
const vectors = require("./vectors-DqQXtR8s.cjs");
|
|
61
|
+
const shapeFns = require("./shapeFns-BvxOc2M_.cjs");
|
|
62
|
+
const booleanFns = require("./booleanFns-DHFR4zO7.cjs");
|
|
63
|
+
const topology = require("./topology-DKWBbtZ3.cjs");
|
|
64
|
+
const curveFns = require("./curveFns-DOhZedkN.cjs");
|
|
65
|
+
const faceFns = require("./faceFns-Cshr6Dql.cjs");
|
|
66
|
+
const meshFns = require("./meshFns-xdRr7G4g.cjs");
|
|
67
|
+
const measurement = require("./measurement-Crrs7ULW.cjs");
|
|
68
|
+
const surfaceBuilders = require("./surfaceBuilders-mE9oGh7r.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-C1oci6gb.cjs");
|
|
72
72
|
const worker = require("./worker.cjs");
|
|
73
73
|
function supportsProjection(kernel) {
|
|
74
74
|
return "projectShape" in kernel;
|
|
@@ -1170,6 +1170,12 @@ function roof(w, options) {
|
|
|
1170
1170
|
return errors.err(errors.kernelError(errors.BrepErrorCode.ROOF_FAILED, `Roof generation failed: ${msg}`, e));
|
|
1171
1171
|
}
|
|
1172
1172
|
}
|
|
1173
|
+
const UNSUPPORTED_DOF = {
|
|
1174
|
+
coincident: 3,
|
|
1175
|
+
concentric: 4,
|
|
1176
|
+
distance: 1,
|
|
1177
|
+
angle: 1
|
|
1178
|
+
};
|
|
1173
1179
|
function solveConstraints(nodes, constraints) {
|
|
1174
1180
|
const transforms = /* @__PURE__ */ new Map();
|
|
1175
1181
|
for (const node of nodes) {
|
|
@@ -1178,6 +1184,7 @@ function solveConstraints(nodes, constraints) {
|
|
|
1178
1184
|
rotation: [1, 0, 0, 0]
|
|
1179
1185
|
});
|
|
1180
1186
|
}
|
|
1187
|
+
const unsupported = [];
|
|
1181
1188
|
for (const c of constraints) {
|
|
1182
1189
|
if (c.type === "coincident" && c.entityA && c.entityB) {
|
|
1183
1190
|
const a = c.entityA;
|
|
@@ -1189,9 +1196,10 @@ function solveConstraints(nodes, constraints) {
|
|
|
1189
1196
|
const dot = aNormal[0] * (aOrigin[0] - bOrigin[0]) + aNormal[1] * (aOrigin[1] - bOrigin[1]) + aNormal[2] * (aOrigin[2] - bOrigin[2]);
|
|
1190
1197
|
const pos = [dot * aNormal[0], dot * aNormal[1], dot * aNormal[2]];
|
|
1191
1198
|
transforms.set(b.node, { position: pos, rotation: [1, 0, 0, 0] });
|
|
1199
|
+
} else {
|
|
1200
|
+
unsupported.push(`coincident(${a.entity.type}-${b.entity.type})`);
|
|
1192
1201
|
}
|
|
1193
|
-
}
|
|
1194
|
-
if (c.type === "distance" && c.entityA && c.entityB && c.value !== void 0) {
|
|
1202
|
+
} else if (c.type === "distance" && c.entityA && c.entityB && c.value !== void 0) {
|
|
1195
1203
|
const a = c.entityA;
|
|
1196
1204
|
const b = c.entityB;
|
|
1197
1205
|
if (a.entity.type === "plane" && b.entity.type === "plane") {
|
|
@@ -1202,10 +1210,18 @@ function solveConstraints(nodes, constraints) {
|
|
|
1202
1210
|
const offset2 = currentDist + c.value;
|
|
1203
1211
|
const pos = [offset2 * aNormal[0], offset2 * aNormal[1], offset2 * aNormal[2]];
|
|
1204
1212
|
transforms.set(b.node, { position: pos, rotation: [1, 0, 0, 0] });
|
|
1213
|
+
} else {
|
|
1214
|
+
unsupported.push(`distance(${a.entity.type}-${b.entity.type})`);
|
|
1205
1215
|
}
|
|
1216
|
+
} else if (c.type === "concentric" || c.type === "angle") {
|
|
1217
|
+
unsupported.push(c.type);
|
|
1206
1218
|
}
|
|
1207
1219
|
}
|
|
1208
|
-
|
|
1220
|
+
const dof = unsupported.reduce((sum, type) => {
|
|
1221
|
+
const baseDof = UNSUPPORTED_DOF[type] ?? UNSUPPORTED_DOF[type.split("(")[0] ?? ""] ?? 0;
|
|
1222
|
+
return sum + baseDof;
|
|
1223
|
+
}, 0);
|
|
1224
|
+
return { transforms, dof, converged: unsupported.length === 0, unsupported };
|
|
1209
1225
|
}
|
|
1210
1226
|
function extractEntity(mate) {
|
|
1211
1227
|
if (mate.face) {
|
|
@@ -1218,6 +1234,22 @@ function extractEntity(mate) {
|
|
|
1218
1234
|
}
|
|
1219
1235
|
return null;
|
|
1220
1236
|
}
|
|
1237
|
+
function extractPair(a, b) {
|
|
1238
|
+
const entA = extractEntity(a);
|
|
1239
|
+
const entB = extractEntity(b);
|
|
1240
|
+
if (!entA || !entB) {
|
|
1241
|
+
return errors.err(
|
|
1242
|
+
errors.validationError(
|
|
1243
|
+
errors.BrepErrorCode.ASSEMBLY_MATE_INVALID,
|
|
1244
|
+
"solveAssembly: could not extract geometry from mate entities"
|
|
1245
|
+
)
|
|
1246
|
+
);
|
|
1247
|
+
}
|
|
1248
|
+
return errors.ok({
|
|
1249
|
+
entityA: { node: a.node, entity: entA },
|
|
1250
|
+
entityB: { node: b.node, entity: entB }
|
|
1251
|
+
});
|
|
1252
|
+
}
|
|
1221
1253
|
function addMate(assembly, constraint) {
|
|
1222
1254
|
const existing = assembly.mates ?? [];
|
|
1223
1255
|
return { ...assembly, mates: [...existing, constraint] };
|
|
@@ -1244,78 +1276,28 @@ function solveAssembly(assembly) {
|
|
|
1244
1276
|
continue;
|
|
1245
1277
|
}
|
|
1246
1278
|
if (mate.type === "coincident") {
|
|
1247
|
-
const
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
solverConstraints.push({
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
});
|
|
1262
|
-
}
|
|
1263
|
-
if (mate.type === "distance") {
|
|
1264
|
-
const entA = extractEntity(mate.entityA);
|
|
1265
|
-
const entB = extractEntity(mate.entityB);
|
|
1266
|
-
if (!entA || !entB) {
|
|
1267
|
-
return errors.err(
|
|
1268
|
-
errors.validationError(
|
|
1269
|
-
errors.BrepErrorCode.ASSEMBLY_MATE_INVALID,
|
|
1270
|
-
"solveAssembly: could not extract geometry from mate entities"
|
|
1271
|
-
)
|
|
1272
|
-
);
|
|
1273
|
-
}
|
|
1274
|
-
solverConstraints.push({
|
|
1275
|
-
type: "distance",
|
|
1276
|
-
entityA: { node: mate.entityA.node, entity: entA },
|
|
1277
|
-
entityB: { node: mate.entityB.node, entity: entB },
|
|
1278
|
-
value: mate.distance
|
|
1279
|
-
});
|
|
1280
|
-
}
|
|
1281
|
-
if (mate.type === "angle") {
|
|
1282
|
-
const entA = extractEntity(mate.entityA);
|
|
1283
|
-
const entB = extractEntity(mate.entityB);
|
|
1284
|
-
if (!entA || !entB) {
|
|
1285
|
-
return errors.err(
|
|
1286
|
-
errors.validationError(
|
|
1287
|
-
errors.BrepErrorCode.ASSEMBLY_MATE_INVALID,
|
|
1288
|
-
"solveAssembly: could not extract geometry from mate entities"
|
|
1289
|
-
)
|
|
1290
|
-
);
|
|
1291
|
-
}
|
|
1292
|
-
solverConstraints.push({
|
|
1293
|
-
type: "angle",
|
|
1294
|
-
entityA: { node: mate.entityA.node, entity: entA },
|
|
1295
|
-
entityB: { node: mate.entityB.node, entity: entB },
|
|
1296
|
-
value: mate.angle
|
|
1297
|
-
});
|
|
1298
|
-
}
|
|
1299
|
-
if (mate.type === "concentric") {
|
|
1300
|
-
const entA = extractEntity(mate.axisA);
|
|
1301
|
-
const entB = extractEntity(mate.axisB);
|
|
1302
|
-
if (!entA || !entB) {
|
|
1303
|
-
return errors.err(
|
|
1304
|
-
errors.validationError(
|
|
1305
|
-
errors.BrepErrorCode.ASSEMBLY_MATE_INVALID,
|
|
1306
|
-
"solveAssembly: could not extract geometry from mate entities"
|
|
1307
|
-
)
|
|
1308
|
-
);
|
|
1309
|
-
}
|
|
1310
|
-
solverConstraints.push({
|
|
1311
|
-
type: "concentric",
|
|
1312
|
-
entityA: { node: mate.axisA.node, entity: entA },
|
|
1313
|
-
entityB: { node: mate.axisB.node, entity: entB }
|
|
1314
|
-
});
|
|
1279
|
+
const pair = extractPair(mate.entityA, mate.entityB);
|
|
1280
|
+
if (!pair.ok) return pair;
|
|
1281
|
+
solverConstraints.push({ type: "coincident", ...pair.value });
|
|
1282
|
+
} else if (mate.type === "distance") {
|
|
1283
|
+
const pair = extractPair(mate.entityA, mate.entityB);
|
|
1284
|
+
if (!pair.ok) return pair;
|
|
1285
|
+
solverConstraints.push({ type: "distance", ...pair.value, value: mate.distance });
|
|
1286
|
+
} else if (mate.type === "angle") {
|
|
1287
|
+
const pair = extractPair(mate.entityA, mate.entityB);
|
|
1288
|
+
if (!pair.ok) return pair;
|
|
1289
|
+
solverConstraints.push({ type: "angle", ...pair.value, value: mate.angle });
|
|
1290
|
+
} else {
|
|
1291
|
+
const pair = extractPair(mate.axisA, mate.axisB);
|
|
1292
|
+
if (!pair.ok) return pair;
|
|
1293
|
+
solverConstraints.push({ type: "concentric", ...pair.value });
|
|
1315
1294
|
}
|
|
1316
1295
|
}
|
|
1317
1296
|
const result2 = solveConstraints(nodes, solverConstraints);
|
|
1318
|
-
if (!result2.converged)
|
|
1297
|
+
if (!result2.converged) {
|
|
1298
|
+
const detail = result2.unsupported.length > 0 ? `Unsupported constraint types: ${result2.unsupported.join(", ")} (${result2.dof} DOF unresolved)` : "Assembly constraint solver did not converge";
|
|
1299
|
+
return errors.err(errors.kernelError(errors.BrepErrorCode.ASSEMBLY_NOT_CONVERGED, detail));
|
|
1300
|
+
}
|
|
1319
1301
|
return errors.ok({
|
|
1320
1302
|
transforms: result2.transforms,
|
|
1321
1303
|
dof: result2.dof,
|
|
@@ -2664,11 +2646,13 @@ exports.withScopeResult = shapeTypes.withScopeResult;
|
|
|
2664
2646
|
exports.withScopeResultAsync = shapeTypes.withScopeResultAsync;
|
|
2665
2647
|
exports.BrepErrorCode = errors.BrepErrorCode;
|
|
2666
2648
|
exports.OK = errors.OK;
|
|
2649
|
+
exports.all = errors.all;
|
|
2667
2650
|
exports.andThen = errors.andThen;
|
|
2668
2651
|
exports.collect = errors.collect;
|
|
2669
2652
|
exports.computationError = errors.computationError;
|
|
2670
2653
|
exports.err = errors.err;
|
|
2671
2654
|
exports.flatMap = errors.flatMap;
|
|
2655
|
+
exports.fromNullable = errors.fromNullable;
|
|
2672
2656
|
exports.ioError = errors.ioError;
|
|
2673
2657
|
exports.isErr = errors.isErr;
|
|
2674
2658
|
exports.isOk = errors.isOk;
|
|
@@ -2678,9 +2662,13 @@ exports.mapErr = errors.mapErr;
|
|
|
2678
2662
|
exports.match = errors.match;
|
|
2679
2663
|
exports.moduleInitError = errors.moduleInitError;
|
|
2680
2664
|
exports.ok = errors.ok;
|
|
2665
|
+
exports.or = errors.or;
|
|
2666
|
+
exports.orElse = errors.orElse;
|
|
2681
2667
|
exports.pipeline = errors.pipeline;
|
|
2682
2668
|
exports.queryError = errors.queryError;
|
|
2683
2669
|
exports.sketcherStateError = errors.sketcherStateError;
|
|
2670
|
+
exports.tap = errors.tap;
|
|
2671
|
+
exports.tapErr = errors.tapErr;
|
|
2684
2672
|
exports.tryCatch = errors.tryCatch;
|
|
2685
2673
|
exports.tryCatchAsync = errors.tryCatchAsync;
|
|
2686
2674
|
exports.typeCastError = errors.typeCastError;
|
|
@@ -2689,6 +2677,7 @@ exports.unwrapErr = errors.unwrapErr;
|
|
|
2689
2677
|
exports.unwrapOr = errors.unwrapOr;
|
|
2690
2678
|
exports.unwrapOrElse = errors.unwrapOrElse;
|
|
2691
2679
|
exports.validationError = errors.validationError;
|
|
2680
|
+
exports.zipResults = errors.zip;
|
|
2692
2681
|
exports.DEG2RAD = vecOps.DEG2RAD;
|
|
2693
2682
|
exports.HASH_CODE_MAX = vecOps.HASH_CODE_MAX;
|
|
2694
2683
|
exports.RAD2DEG = vecOps.RAD2DEG;
|
|
@@ -2725,6 +2714,7 @@ exports.createAssembly = operations.createAssembly;
|
|
|
2725
2714
|
exports.createAssemblyNode = operations.createAssemblyNode;
|
|
2726
2715
|
exports.createHistory = operations.createHistory;
|
|
2727
2716
|
exports.createRegistry = operations.createRegistry;
|
|
2717
|
+
exports.deserializeHistory = operations.deserializeHistory;
|
|
2728
2718
|
exports.exportAssemblySTEP = operations.exportAssemblySTEP;
|
|
2729
2719
|
exports.findNode = operations.findNode;
|
|
2730
2720
|
exports.findStep = operations.findStep;
|
|
@@ -2736,6 +2726,7 @@ exports.registerShape = operations.registerShape;
|
|
|
2736
2726
|
exports.removeChild = operations.removeChild;
|
|
2737
2727
|
exports.replayFrom = operations.replayFrom;
|
|
2738
2728
|
exports.replayHistory = operations.replayHistory;
|
|
2729
|
+
exports.serializeHistory = operations.serializeHistory;
|
|
2739
2730
|
exports.stepCount = operations.stepCount;
|
|
2740
2731
|
exports.stepsFrom = operations.stepsFrom;
|
|
2741
2732
|
exports.supportExtrude = operations.supportExtrude;
|