brepjs 9.3.9 → 9.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/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-vLo9HuPx.js → Blueprint-Bx9F-b3M.js} +7 -7
- package/dist/{Blueprint-C_ny87tf.cjs → Blueprint-CKGR_t7l.cjs} +7 -7
- package/dist/{boolean2D-C_WtQSZM.cjs → boolean2D-DXpQlTbC.cjs} +10 -10
- package/dist/{boolean2D-G9wVVewF.js → boolean2D-iR7ADbYD.js} +10 -10
- package/dist/{booleanFns-gwskRu9F.js → booleanFns-7rIed0u7.js} +5 -5
- package/dist/{booleanFns-G0j8iAZV.cjs → booleanFns-Bv06tE2O.cjs} +5 -5
- package/dist/brepjs.cjs +179 -106
- package/dist/brepjs.js +225 -152
- package/dist/core/result.d.ts +14 -0
- package/dist/core/result.d.ts.map +1 -1
- package/dist/core.cjs +3 -3
- package/dist/core.js +3 -3
- package/dist/{cornerFinder-56x6NzUP.cjs → cornerFinder-Ci8VuZvA.cjs} +1 -1
- package/dist/{cornerFinder-CrM1kbgV.js → cornerFinder-HW6Pd4KN.js} +1 -1
- package/dist/{curveFns-B7b2uHRl.js → curveFns-DimdPJLf.js} +2 -2
- package/dist/{curveFns-BsxQJoWM.cjs → curveFns-NHndvCbT.cjs} +2 -2
- package/dist/{drawFns-BIoGsiXr.cjs → drawFns-BBaIUkX4.cjs} +12 -12
- package/dist/{drawFns-BD92V6Nt.js → drawFns-D1j4FnWp.js} +12 -12
- package/dist/{errors-HU7EpHt3.cjs → errors-DiTn5EoC.cjs} +33 -0
- package/dist/{errors-C_XjfNt5.js → errors-lBwyc8YG.js} +34 -1
- package/dist/{faceFns-DKAs23b7.js → faceFns-BkJ2_drH.js} +2 -2
- package/dist/{faceFns-A6VJdsJc.cjs → faceFns-BxkKVWoi.cjs} +2 -2
- package/dist/{helpers-C-dHgprx.cjs → helpers-BlW0S8kc.cjs} +5 -5
- package/dist/{helpers-BidbwB1g.js → helpers-nNbxhw97.js} +5 -5
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/io/svgImportFns.d.ts.map +1 -1
- package/dist/io.cjs +10 -4
- package/dist/io.js +10 -4
- package/dist/kernel/advancedOps.d.ts +1 -0
- package/dist/kernel/advancedOps.d.ts.map +1 -1
- package/dist/kernel/brepkitAdapter.d.ts +2 -1
- package/dist/kernel/brepkitAdapter.d.ts.map +1 -1
- package/dist/kernel/brepkitWasmTypes.d.ts +31 -10
- package/dist/kernel/brepkitWasmTypes.d.ts.map +1 -1
- package/dist/kernel/defaultAdapter.d.ts +1 -0
- package/dist/kernel/defaultAdapter.d.ts.map +1 -1
- 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/kernel/types.d.ts +3 -0
- package/dist/kernel/types.d.ts.map +1 -1
- package/dist/{loft-BI8MUcCF.js → loft-C8yS_NS6.js} +4 -4
- package/dist/{loft-B0VRwdIS.cjs → loft-CvTRTIDd.cjs} +4 -4
- package/dist/{measurement-CyIBSu3o.js → measurement-4z0i9NjE.js} +2 -2
- package/dist/{measurement-D5XQSvln.cjs → measurement-mWRWDA69.cjs} +2 -2
- package/dist/measurement.cjs +1 -1
- package/dist/measurement.js +1 -1
- package/dist/{meshFns-ClCp7nft.cjs → meshFns-Bl6gXIPd.cjs} +3 -3
- package/dist/{meshFns-BilAVkvY.js → meshFns-D2eLJfd6.js} +3 -3
- package/dist/operations/historyFns.d.ts +10 -0
- package/dist/operations/historyFns.d.ts.map +1 -1
- package/dist/operations/loftFns.d.ts +1 -1
- package/dist/operations/loftFns.d.ts.map +1 -1
- package/dist/operations/mateFns.d.ts.map +1 -1
- package/dist/operations/multiSweepFns.d.ts.map +1 -1
- package/dist/operations/patternFns.d.ts +14 -0
- package/dist/operations/patternFns.d.ts.map +1 -1
- package/dist/operations/roofFns.d.ts.map +1 -1
- package/dist/{operations-Bw3ZGLPJ.js → operations-6JJEKei9.js} +93 -20
- package/dist/{operations-B1FSxszL.cjs → operations-JLacBa4V.cjs} +77 -4
- package/dist/operations.cjs +3 -2
- package/dist/operations.d.ts +1 -1
- package/dist/operations.d.ts.map +1 -1
- package/dist/operations.js +19 -18
- package/dist/query.cjs +4 -4
- package/dist/query.js +5 -5
- package/dist/result.cjs +1 -1
- package/dist/result.js +2 -2
- package/dist/{shapeFns-D9CKkCnS.js → shapeFns-BO9NK6Oo.js} +3 -3
- package/dist/{shapeFns-O9Ont1Dy.cjs → shapeFns-DdBZDjVs.cjs} +3 -3
- package/dist/{shapeTypes-CBhj5o2y.cjs → shapeTypes-DGDFzV7k.cjs} +1 -1
- package/dist/{shapeTypes-d-jYnZuW.js → shapeTypes-Dh_qy0wO.js} +1 -1
- package/dist/sketching.cjs +2 -2
- package/dist/sketching.js +2 -2
- package/dist/{surfaceBuilders-DwMD54OR.cjs → surfaceBuilders-BQScH37x.cjs} +3 -3
- package/dist/{surfaceBuilders-BX-btdhW.js → surfaceBuilders-CX69g8_x.js} +3 -3
- package/dist/{topology-ChR-we6s.cjs → topology-In3-XjPz.cjs} +7 -7
- package/dist/{topology-DDO_RZ7P.js → topology-JKo9WLos.js} +7 -7
- 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 -1
|
@@ -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-CKGR_t7l.cjs");
|
|
4
|
+
const boolean2D = require("./boolean2D-DXpQlTbC.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-Bx9F-b3M.js";
|
|
2
|
+
import { d, C } from "./Blueprint-Bx9F-b3M.js";
|
|
3
|
+
import { e, C as C2, f, l, g, n, k, q, o, p, r } from "./boolean2D-iR7ADbYD.js";
|
|
4
4
|
function reverseCurve(curve) {
|
|
5
5
|
const cloned = curve.clone();
|
|
6
6
|
cloned.reverse();
|
|
@@ -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
|
-
import { q as getKernel, y as getKernel2D, z as registerForCleanup, A as unregisterFromCleanup, s as createEdge, r as createWire } from "./shapeTypes-
|
|
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-
|
|
3
|
+
import { q as getKernel, y as getKernel2D, z as registerForCleanup, A as unregisterFromCleanup, s as createEdge, r as createWire } from "./shapeTypes-Dh_qy0wO.js";
|
|
4
|
+
import { u as uvBounds, f as faceGeomType, e as faceCenter, h as uvCoordinates, c as cast } from "./faceFns-BkJ2_drH.js";
|
|
5
|
+
import { g as getOrientation } from "./curveFns-DimdPJLf.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-nNbxhw97.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-CX69g8_x.js";
|
|
10
10
|
import { bug } from "./result.js";
|
|
11
11
|
function makePlane(plane, origin) {
|
|
12
12
|
if (plane && typeof plane !== "string") {
|
|
@@ -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
|
-
const shapeTypes = require("./shapeTypes-
|
|
5
|
-
const faceFns = require("./faceFns-
|
|
6
|
-
const curveFns = require("./curveFns-
|
|
7
|
-
const errors = require("./errors-
|
|
8
|
-
const helpers = require("./helpers-
|
|
4
|
+
const shapeTypes = require("./shapeTypes-DGDFzV7k.cjs");
|
|
5
|
+
const faceFns = require("./faceFns-BxkKVWoi.cjs");
|
|
6
|
+
const curveFns = require("./curveFns-NHndvCbT.cjs");
|
|
7
|
+
const errors = require("./errors-DiTn5EoC.cjs");
|
|
8
|
+
const helpers = require("./helpers-BlW0S8kc.cjs");
|
|
9
9
|
const vecOps = require("./vecOps-CjRL1jau.cjs");
|
|
10
|
-
const surfaceBuilders = require("./surfaceBuilders-
|
|
10
|
+
const surfaceBuilders = require("./surfaceBuilders-BQScH37x.cjs");
|
|
11
11
|
const result = require("./result.cjs");
|
|
12
12
|
function makePlane(plane, origin) {
|
|
13
13
|
if (plane && typeof plane !== "string") {
|
|
@@ -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-BxkKVWoi.cjs");
|
|
50
50
|
const types = require("./types-CA_xrgDq.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-CvTRTIDd.cjs");
|
|
53
|
+
const shapeTypes = require("./shapeTypes-DGDFzV7k.cjs");
|
|
54
|
+
const curveFns = require("./curveFns-NHndvCbT.cjs");
|
|
55
|
+
const surfaceBuilders = require("./surfaceBuilders-BQScH37x.cjs");
|
|
56
56
|
const result = require("./result.cjs");
|
|
57
|
-
const helpers = require("./helpers-
|
|
58
|
-
const Blueprint = require("./Blueprint-
|
|
57
|
+
const helpers = require("./helpers-BlW0S8kc.cjs");
|
|
58
|
+
const Blueprint = require("./Blueprint-CKGR_t7l.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) {
|
|
@@ -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-BkJ2_drH.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-
|
|
52
|
-
import { y as getKernel2D, t as createFace, r as createWire, q as getKernel, s as createEdge, D as DisposalScope } 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-C8yS_NS6.js";
|
|
52
|
+
import { y as getKernel2D, t as createFace, r as createWire, q as getKernel, s as createEdge, D as DisposalScope } from "./shapeTypes-Dh_qy0wO.js";
|
|
53
|
+
import { d as curveStartPoint, c as curveTangentAt, e as curveIsClosed } from "./curveFns-DimdPJLf.js";
|
|
54
|
+
import { m as makeFace, l as makeNewFaceWithinFace, b as assembleWire, z as zip } from "./surfaceBuilders-CX69g8_x.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-nNbxhw97.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-Bx9F-b3M.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) {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { q as getKernel, c as castShape, j as isShape3D } from "./shapeTypes-
|
|
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-
|
|
1
|
+
import { q as getKernel, c as castShape, j as isShape3D } from "./shapeTypes-Dh_qy0wO.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-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-BO9NK6Oo.js";
|
|
6
|
+
import { m as makeFace } from "./surfaceBuilders-CX69g8_x.js";
|
|
7
7
|
const shapeTagStore = /* @__PURE__ */ new WeakMap();
|
|
8
8
|
const tagMetadataStore = /* @__PURE__ */ new WeakMap();
|
|
9
9
|
function hasFaceTags(shape) {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const shapeTypes = require("./shapeTypes-
|
|
3
|
-
const errors = require("./errors-
|
|
4
|
-
const vectors = require("./vectors-
|
|
2
|
+
const shapeTypes = require("./shapeTypes-DGDFzV7k.cjs");
|
|
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-DdBZDjVs.cjs");
|
|
7
|
+
const surfaceBuilders = require("./surfaceBuilders-BQScH37x.cjs");
|
|
8
8
|
const shapeTagStore = /* @__PURE__ */ new WeakMap();
|
|
9
9
|
const tagMetadataStore = /* @__PURE__ */ new WeakMap();
|
|
10
10
|
function hasFaceTags(shape) {
|
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 shapeTypes = require("./shapeTypes-
|
|
49
|
-
const errors = require("./errors-
|
|
48
|
+
const shapeTypes = require("./shapeTypes-DGDFzV7k.cjs");
|
|
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-CKGR_t7l.cjs");
|
|
52
|
+
const loft$2 = require("./loft-CvTRTIDd.cjs");
|
|
53
|
+
const operations = require("./operations-JLacBa4V.cjs");
|
|
54
|
+
const boolean2D = require("./boolean2D-DXpQlTbC.cjs");
|
|
55
55
|
const _2d = require("./2d.cjs");
|
|
56
|
-
const helpers = require("./helpers-
|
|
56
|
+
const helpers = require("./helpers-BlW0S8kc.cjs");
|
|
57
57
|
const io = require("./io.cjs");
|
|
58
|
-
const drawFns = require("./drawFns-
|
|
58
|
+
const drawFns = require("./drawFns-BBaIUkX4.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-DdBZDjVs.cjs");
|
|
62
|
+
const booleanFns = require("./booleanFns-Bv06tE2O.cjs");
|
|
63
|
+
const topology = require("./topology-In3-XjPz.cjs");
|
|
64
|
+
const curveFns = require("./curveFns-NHndvCbT.cjs");
|
|
65
|
+
const faceFns = require("./faceFns-BxkKVWoi.cjs");
|
|
66
|
+
const meshFns = require("./meshFns-Bl6gXIPd.cjs");
|
|
67
|
+
const measurement = require("./measurement-mWRWDA69.cjs");
|
|
68
|
+
const surfaceBuilders = require("./surfaceBuilders-BQScH37x.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-Ci8VuZvA.cjs");
|
|
72
72
|
const worker = require("./worker.cjs");
|
|
73
73
|
function supportsProjection(kernel) {
|
|
74
74
|
return "projectShape" in kernel;
|
|
@@ -659,7 +659,30 @@ function multiSectionSweep(sections, spine, options) {
|
|
|
659
659
|
)
|
|
660
660
|
);
|
|
661
661
|
}
|
|
662
|
-
const { solid: solid2 = true, ruled = false, tolerance
|
|
662
|
+
const { solid: solid2 = true, ruled = false, tolerance = 1e-6 } = options ?? {};
|
|
663
|
+
const explicitLocations = sections.map((s) => s.location);
|
|
664
|
+
for (let i = 0; i < explicitLocations.length; i++) {
|
|
665
|
+
const loc = explicitLocations[i];
|
|
666
|
+
if (loc !== void 0 && (loc < 0 || loc > 1)) {
|
|
667
|
+
return errors.err(
|
|
668
|
+
errors.validationError(
|
|
669
|
+
errors.BrepErrorCode.MULTI_SWEEP_FAILED,
|
|
670
|
+
`Section ${i} location ${loc} is out of range [0, 1]`
|
|
671
|
+
)
|
|
672
|
+
);
|
|
673
|
+
}
|
|
674
|
+
}
|
|
675
|
+
const definedLocs = explicitLocations.filter((l) => l !== void 0);
|
|
676
|
+
for (let i = 1; i < definedLocs.length; i++) {
|
|
677
|
+
if ((definedLocs[i] ?? 0) <= (definedLocs[i - 1] ?? 0)) {
|
|
678
|
+
return errors.err(
|
|
679
|
+
errors.validationError(
|
|
680
|
+
errors.BrepErrorCode.MULTI_SWEEP_FAILED,
|
|
681
|
+
"Section locations must be strictly increasing"
|
|
682
|
+
)
|
|
683
|
+
);
|
|
684
|
+
}
|
|
685
|
+
}
|
|
663
686
|
try {
|
|
664
687
|
const kernel = shapeTypes.getKernel();
|
|
665
688
|
const [uFirst, uLast] = kernel.curveParameters(spine.wrapped);
|
|
@@ -678,7 +701,7 @@ function multiSectionSweep(sections, spine, options) {
|
|
|
678
701
|
const positioned = kernel.positionOnCurve(section2.wire.wrapped, spine.wrapped, param);
|
|
679
702
|
positionedWires.push(kernel.downcast(positioned, "wire"));
|
|
680
703
|
}
|
|
681
|
-
const loftResult = kernel.loftAdvanced(positionedWires, { solid: solid2, ruled });
|
|
704
|
+
const loftResult = kernel.loftAdvanced(positionedWires, { solid: solid2, ruled, tolerance });
|
|
682
705
|
const result2 = shapeTypes.castShape(loftResult);
|
|
683
706
|
if (!shapeTypes.isShape3D(result2)) {
|
|
684
707
|
return errors.err(
|
|
@@ -1082,6 +1105,66 @@ function fanTriangulate(count) {
|
|
|
1082
1105
|
}
|
|
1083
1106
|
return tris;
|
|
1084
1107
|
}
|
|
1108
|
+
function cross2d(ax, ay, bx, by, cx, cy) {
|
|
1109
|
+
return (bx - ax) * (cy - ay) - (by - ay) * (cx - ax);
|
|
1110
|
+
}
|
|
1111
|
+
function pointInTriangle(px, py, ax, ay, bx, by, cx, cy) {
|
|
1112
|
+
const d1 = cross2d(ax, ay, bx, by, px, py);
|
|
1113
|
+
const d2 = cross2d(bx, by, cx, cy, px, py);
|
|
1114
|
+
const d3 = cross2d(cx, cy, ax, ay, px, py);
|
|
1115
|
+
const hasNeg = d1 < 0 || d2 < 0 || d3 < 0;
|
|
1116
|
+
const hasPos = d1 > 0 || d2 > 0 || d3 > 0;
|
|
1117
|
+
return !(hasNeg && hasPos);
|
|
1118
|
+
}
|
|
1119
|
+
function earClipTriangulate(poly) {
|
|
1120
|
+
const n = poly.length;
|
|
1121
|
+
if (n < 3) return [];
|
|
1122
|
+
if (n === 3) return [[0, 1, 2]];
|
|
1123
|
+
let area2 = 0;
|
|
1124
|
+
for (let i = 0; i < n; i++) {
|
|
1125
|
+
const a = poly[i];
|
|
1126
|
+
const b = poly[(i + 1) % n];
|
|
1127
|
+
if (a && b) area2 += a.x * b.y - b.x * a.y;
|
|
1128
|
+
}
|
|
1129
|
+
const tris = [];
|
|
1130
|
+
const idx = Array.from({ length: n }, (_, i) => i);
|
|
1131
|
+
if (area2 < 0) idx.reverse();
|
|
1132
|
+
const isEar = (prev, curr, next) => {
|
|
1133
|
+
const a = poly[prev];
|
|
1134
|
+
const b = poly[curr];
|
|
1135
|
+
const c = poly[next];
|
|
1136
|
+
if (!a || !b || !c) return false;
|
|
1137
|
+
if (cross2d(a.x, a.y, b.x, b.y, c.x, c.y) <= 0) return false;
|
|
1138
|
+
for (const vi of idx) {
|
|
1139
|
+
if (vi === prev || vi === curr || vi === next) continue;
|
|
1140
|
+
const p = poly[vi];
|
|
1141
|
+
if (!p) continue;
|
|
1142
|
+
if (pointInTriangle(p.x, p.y, a.x, a.y, b.x, b.y, c.x, c.y)) return false;
|
|
1143
|
+
}
|
|
1144
|
+
return true;
|
|
1145
|
+
};
|
|
1146
|
+
while (idx.length > 3) {
|
|
1147
|
+
let clipped = false;
|
|
1148
|
+
for (let i = 0; i < idx.length; i++) {
|
|
1149
|
+
const prev = idx[(i - 1 + idx.length) % idx.length];
|
|
1150
|
+
const curr = idx[i];
|
|
1151
|
+
const next = idx[(i + 1) % idx.length];
|
|
1152
|
+
if (prev === void 0 || curr === void 0 || next === void 0) continue;
|
|
1153
|
+
if (isEar(prev, curr, next)) {
|
|
1154
|
+
tris.push([prev, curr, next]);
|
|
1155
|
+
idx.splice(i, 1);
|
|
1156
|
+
clipped = true;
|
|
1157
|
+
break;
|
|
1158
|
+
}
|
|
1159
|
+
}
|
|
1160
|
+
if (!clipped) break;
|
|
1161
|
+
}
|
|
1162
|
+
if (idx.length === 3) {
|
|
1163
|
+
const [a, b, c] = idx;
|
|
1164
|
+
if (a !== void 0 && b !== void 0 && c !== void 0) tris.push([a, b, c]);
|
|
1165
|
+
}
|
|
1166
|
+
return tris;
|
|
1167
|
+
}
|
|
1085
1168
|
function roof(w, options) {
|
|
1086
1169
|
const angle = (options?.angle ?? 45) * (Math.PI / 180);
|
|
1087
1170
|
const tanAngle = Math.tan(angle);
|
|
@@ -1134,19 +1217,17 @@ function roof(w, options) {
|
|
|
1134
1217
|
}
|
|
1135
1218
|
}
|
|
1136
1219
|
}
|
|
1137
|
-
const
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
triFaces.push(triFace);
|
|
1149
|
-
}
|
|
1220
|
+
for (const [ai, bi, ci] of earClipTriangulate(polygon2)) {
|
|
1221
|
+
const pa = polygon2[ai];
|
|
1222
|
+
const pb = polygon2[bi];
|
|
1223
|
+
const pc = polygon2[ci];
|
|
1224
|
+
if (!pa || !pb || !pc) continue;
|
|
1225
|
+
const va = [pa.x, pa.y, 0];
|
|
1226
|
+
const vb = [pb.x, pb.y, 0];
|
|
1227
|
+
const vc = [pc.x, pc.y, 0];
|
|
1228
|
+
const triFace = kernel.buildTriFace(va, vc, vb);
|
|
1229
|
+
if (triFace !== null) {
|
|
1230
|
+
triFaces.push(triFace);
|
|
1150
1231
|
}
|
|
1151
1232
|
}
|
|
1152
1233
|
if (triFaces.length === 0) {
|
|
@@ -1170,6 +1251,12 @@ function roof(w, options) {
|
|
|
1170
1251
|
return errors.err(errors.kernelError(errors.BrepErrorCode.ROOF_FAILED, `Roof generation failed: ${msg}`, e));
|
|
1171
1252
|
}
|
|
1172
1253
|
}
|
|
1254
|
+
const UNSUPPORTED_DOF = {
|
|
1255
|
+
coincident: 3,
|
|
1256
|
+
concentric: 4,
|
|
1257
|
+
distance: 1,
|
|
1258
|
+
angle: 1
|
|
1259
|
+
};
|
|
1173
1260
|
function solveConstraints(nodes, constraints) {
|
|
1174
1261
|
const transforms = /* @__PURE__ */ new Map();
|
|
1175
1262
|
for (const node of nodes) {
|
|
@@ -1178,6 +1265,7 @@ function solveConstraints(nodes, constraints) {
|
|
|
1178
1265
|
rotation: [1, 0, 0, 0]
|
|
1179
1266
|
});
|
|
1180
1267
|
}
|
|
1268
|
+
const unsupported = [];
|
|
1181
1269
|
for (const c of constraints) {
|
|
1182
1270
|
if (c.type === "coincident" && c.entityA && c.entityB) {
|
|
1183
1271
|
const a = c.entityA;
|
|
@@ -1189,9 +1277,10 @@ function solveConstraints(nodes, constraints) {
|
|
|
1189
1277
|
const dot = aNormal[0] * (aOrigin[0] - bOrigin[0]) + aNormal[1] * (aOrigin[1] - bOrigin[1]) + aNormal[2] * (aOrigin[2] - bOrigin[2]);
|
|
1190
1278
|
const pos = [dot * aNormal[0], dot * aNormal[1], dot * aNormal[2]];
|
|
1191
1279
|
transforms.set(b.node, { position: pos, rotation: [1, 0, 0, 0] });
|
|
1280
|
+
} else {
|
|
1281
|
+
unsupported.push(`coincident(${a.entity.type}-${b.entity.type})`);
|
|
1192
1282
|
}
|
|
1193
|
-
}
|
|
1194
|
-
if (c.type === "distance" && c.entityA && c.entityB && c.value !== void 0) {
|
|
1283
|
+
} else if (c.type === "distance" && c.entityA && c.entityB && c.value !== void 0) {
|
|
1195
1284
|
const a = c.entityA;
|
|
1196
1285
|
const b = c.entityB;
|
|
1197
1286
|
if (a.entity.type === "plane" && b.entity.type === "plane") {
|
|
@@ -1202,10 +1291,18 @@ function solveConstraints(nodes, constraints) {
|
|
|
1202
1291
|
const offset2 = currentDist + c.value;
|
|
1203
1292
|
const pos = [offset2 * aNormal[0], offset2 * aNormal[1], offset2 * aNormal[2]];
|
|
1204
1293
|
transforms.set(b.node, { position: pos, rotation: [1, 0, 0, 0] });
|
|
1294
|
+
} else {
|
|
1295
|
+
unsupported.push(`distance(${a.entity.type}-${b.entity.type})`);
|
|
1205
1296
|
}
|
|
1297
|
+
} else if (c.type === "concentric" || c.type === "angle") {
|
|
1298
|
+
unsupported.push(c.type);
|
|
1206
1299
|
}
|
|
1207
1300
|
}
|
|
1208
|
-
|
|
1301
|
+
const dof = unsupported.reduce((sum, type) => {
|
|
1302
|
+
const baseDof = UNSUPPORTED_DOF[type] ?? UNSUPPORTED_DOF[type.split("(")[0] ?? ""] ?? 0;
|
|
1303
|
+
return sum + baseDof;
|
|
1304
|
+
}, 0);
|
|
1305
|
+
return { transforms, dof, converged: unsupported.length === 0, unsupported };
|
|
1209
1306
|
}
|
|
1210
1307
|
function extractEntity(mate) {
|
|
1211
1308
|
if (mate.face) {
|
|
@@ -1218,6 +1315,22 @@ function extractEntity(mate) {
|
|
|
1218
1315
|
}
|
|
1219
1316
|
return null;
|
|
1220
1317
|
}
|
|
1318
|
+
function extractPair(a, b) {
|
|
1319
|
+
const entA = extractEntity(a);
|
|
1320
|
+
const entB = extractEntity(b);
|
|
1321
|
+
if (!entA || !entB) {
|
|
1322
|
+
return errors.err(
|
|
1323
|
+
errors.validationError(
|
|
1324
|
+
errors.BrepErrorCode.ASSEMBLY_MATE_INVALID,
|
|
1325
|
+
"solveAssembly: could not extract geometry from mate entities"
|
|
1326
|
+
)
|
|
1327
|
+
);
|
|
1328
|
+
}
|
|
1329
|
+
return errors.ok({
|
|
1330
|
+
entityA: { node: a.node, entity: entA },
|
|
1331
|
+
entityB: { node: b.node, entity: entB }
|
|
1332
|
+
});
|
|
1333
|
+
}
|
|
1221
1334
|
function addMate(assembly, constraint) {
|
|
1222
1335
|
const existing = assembly.mates ?? [];
|
|
1223
1336
|
return { ...assembly, mates: [...existing, constraint] };
|
|
@@ -1244,78 +1357,28 @@ function solveAssembly(assembly) {
|
|
|
1244
1357
|
continue;
|
|
1245
1358
|
}
|
|
1246
1359
|
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
|
-
});
|
|
1360
|
+
const pair = extractPair(mate.entityA, mate.entityB);
|
|
1361
|
+
if (!pair.ok) return pair;
|
|
1362
|
+
solverConstraints.push({ type: "coincident", ...pair.value });
|
|
1363
|
+
} else if (mate.type === "distance") {
|
|
1364
|
+
const pair = extractPair(mate.entityA, mate.entityB);
|
|
1365
|
+
if (!pair.ok) return pair;
|
|
1366
|
+
solverConstraints.push({ type: "distance", ...pair.value, value: mate.distance });
|
|
1367
|
+
} else if (mate.type === "angle") {
|
|
1368
|
+
const pair = extractPair(mate.entityA, mate.entityB);
|
|
1369
|
+
if (!pair.ok) return pair;
|
|
1370
|
+
solverConstraints.push({ type: "angle", ...pair.value, value: mate.angle });
|
|
1371
|
+
} else {
|
|
1372
|
+
const pair = extractPair(mate.axisA, mate.axisB);
|
|
1373
|
+
if (!pair.ok) return pair;
|
|
1374
|
+
solverConstraints.push({ type: "concentric", ...pair.value });
|
|
1315
1375
|
}
|
|
1316
1376
|
}
|
|
1317
1377
|
const result2 = solveConstraints(nodes, solverConstraints);
|
|
1318
|
-
if (!result2.converged)
|
|
1378
|
+
if (!result2.converged) {
|
|
1379
|
+
const detail = result2.unsupported.length > 0 ? `Unsupported constraint types: ${result2.unsupported.join(", ")} (${result2.dof} DOF unresolved)` : "Assembly constraint solver did not converge";
|
|
1380
|
+
return errors.err(errors.kernelError(errors.BrepErrorCode.ASSEMBLY_NOT_CONVERGED, detail));
|
|
1381
|
+
}
|
|
1319
1382
|
return errors.ok({
|
|
1320
1383
|
transforms: result2.transforms,
|
|
1321
1384
|
dof: result2.dof,
|
|
@@ -2284,7 +2347,7 @@ function isValid(shape2) {
|
|
|
2284
2347
|
function isEmpty(shape2) {
|
|
2285
2348
|
return shapeFns.isEmpty(resolve(shape2));
|
|
2286
2349
|
}
|
|
2287
|
-
function loft$1(wires, { ruled = true, startPoint, endPoint, tolerance
|
|
2350
|
+
function loft$1(wires, { ruled = true, startPoint, endPoint, tolerance = 1e-6 } = {}, returnShell = false) {
|
|
2288
2351
|
if (wires.length === 0 && !startPoint && !endPoint) {
|
|
2289
2352
|
return errors.err(errors.validationError("LOFT_EMPTY", "Loft requires at least one wire or start/end point"));
|
|
2290
2353
|
}
|
|
@@ -2297,6 +2360,7 @@ function loft$1(wires, { ruled = true, startPoint, endPoint, tolerance: _toleran
|
|
|
2297
2360
|
{
|
|
2298
2361
|
solid: !returnShell,
|
|
2299
2362
|
ruled,
|
|
2363
|
+
tolerance,
|
|
2300
2364
|
...startVertex ? { startVertex } : {},
|
|
2301
2365
|
...endVertex ? { endVertex } : {}
|
|
2302
2366
|
}
|
|
@@ -2664,11 +2728,13 @@ exports.withScopeResult = shapeTypes.withScopeResult;
|
|
|
2664
2728
|
exports.withScopeResultAsync = shapeTypes.withScopeResultAsync;
|
|
2665
2729
|
exports.BrepErrorCode = errors.BrepErrorCode;
|
|
2666
2730
|
exports.OK = errors.OK;
|
|
2731
|
+
exports.all = errors.all;
|
|
2667
2732
|
exports.andThen = errors.andThen;
|
|
2668
2733
|
exports.collect = errors.collect;
|
|
2669
2734
|
exports.computationError = errors.computationError;
|
|
2670
2735
|
exports.err = errors.err;
|
|
2671
2736
|
exports.flatMap = errors.flatMap;
|
|
2737
|
+
exports.fromNullable = errors.fromNullable;
|
|
2672
2738
|
exports.ioError = errors.ioError;
|
|
2673
2739
|
exports.isErr = errors.isErr;
|
|
2674
2740
|
exports.isOk = errors.isOk;
|
|
@@ -2678,9 +2744,13 @@ exports.mapErr = errors.mapErr;
|
|
|
2678
2744
|
exports.match = errors.match;
|
|
2679
2745
|
exports.moduleInitError = errors.moduleInitError;
|
|
2680
2746
|
exports.ok = errors.ok;
|
|
2747
|
+
exports.or = errors.or;
|
|
2748
|
+
exports.orElse = errors.orElse;
|
|
2681
2749
|
exports.pipeline = errors.pipeline;
|
|
2682
2750
|
exports.queryError = errors.queryError;
|
|
2683
2751
|
exports.sketcherStateError = errors.sketcherStateError;
|
|
2752
|
+
exports.tap = errors.tap;
|
|
2753
|
+
exports.tapErr = errors.tapErr;
|
|
2684
2754
|
exports.tryCatch = errors.tryCatch;
|
|
2685
2755
|
exports.tryCatchAsync = errors.tryCatchAsync;
|
|
2686
2756
|
exports.typeCastError = errors.typeCastError;
|
|
@@ -2689,6 +2759,7 @@ exports.unwrapErr = errors.unwrapErr;
|
|
|
2689
2759
|
exports.unwrapOr = errors.unwrapOr;
|
|
2690
2760
|
exports.unwrapOrElse = errors.unwrapOrElse;
|
|
2691
2761
|
exports.validationError = errors.validationError;
|
|
2762
|
+
exports.zipResults = errors.zip;
|
|
2692
2763
|
exports.DEG2RAD = vecOps.DEG2RAD;
|
|
2693
2764
|
exports.HASH_CODE_MAX = vecOps.HASH_CODE_MAX;
|
|
2694
2765
|
exports.RAD2DEG = vecOps.RAD2DEG;
|
|
@@ -2725,6 +2796,7 @@ exports.createAssembly = operations.createAssembly;
|
|
|
2725
2796
|
exports.createAssemblyNode = operations.createAssemblyNode;
|
|
2726
2797
|
exports.createHistory = operations.createHistory;
|
|
2727
2798
|
exports.createRegistry = operations.createRegistry;
|
|
2799
|
+
exports.deserializeHistory = operations.deserializeHistory;
|
|
2728
2800
|
exports.exportAssemblySTEP = operations.exportAssemblySTEP;
|
|
2729
2801
|
exports.findNode = operations.findNode;
|
|
2730
2802
|
exports.findStep = operations.findStep;
|
|
@@ -2736,6 +2808,7 @@ exports.registerShape = operations.registerShape;
|
|
|
2736
2808
|
exports.removeChild = operations.removeChild;
|
|
2737
2809
|
exports.replayFrom = operations.replayFrom;
|
|
2738
2810
|
exports.replayHistory = operations.replayHistory;
|
|
2811
|
+
exports.serializeHistory = operations.serializeHistory;
|
|
2739
2812
|
exports.stepCount = operations.stepCount;
|
|
2740
2813
|
exports.stepsFrom = operations.stepsFrom;
|
|
2741
2814
|
exports.supportExtrude = operations.supportExtrude;
|