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
package/dist/brepjs.js
CHANGED
|
@@ -26,10 +26,10 @@ var __using = (stack, value, async) => {
|
|
|
26
26
|
return value;
|
|
27
27
|
};
|
|
28
28
|
var __callDispose = (stack, error, hasError) => {
|
|
29
|
-
var
|
|
29
|
+
var E5 = typeof SuppressedError === "function" ? SuppressedError : function(e7, s7, m9, _2) {
|
|
30
30
|
return _2 = Error(m9), _2.name = "SuppressedError", _2.error = e7, _2.suppressed = s7, _2;
|
|
31
31
|
};
|
|
32
|
-
var fail = (e7) => error = hasError ? new
|
|
32
|
+
var fail = (e7) => error = hasError ? new E5(e7, error, "An error was suppressed during disposal") : (hasError = true, e7);
|
|
33
33
|
var next = (it) => {
|
|
34
34
|
while (it = stack.pop()) {
|
|
35
35
|
try {
|
|
@@ -45,43 +45,43 @@ var __callDispose = (stack, error, hasError) => {
|
|
|
45
45
|
};
|
|
46
46
|
import { c as castShape, D as DisposalScope, q as getKernel, e as isFace, k as isShell, l as isSolid, j as isShape3D, x as createSolid, r as createWire, d as isEdge, n as isWire } from "./shapeTypes-d-jYnZuW.js";
|
|
47
47
|
import { u, s, t, a, b, B, v, g, C, i, f, h, m, E, F, w, o, p } from "./shapeTypes-d-jYnZuW.js";
|
|
48
|
-
import { o as ok, y as translateKernelError, e as err, p as typeCastError, q as queryError, x as validationError, B as BrepErrorCode, k as kernelError, i as ioError, d as isErr, u as unwrap } from "./errors-
|
|
49
|
-
import { O, a as a2, c, b as b2, f as f2, g as g2, m as m2, h as h2, j, l,
|
|
48
|
+
import { o as ok, y as translateKernelError, e as err, p as typeCastError, q as queryError, x as validationError, B as BrepErrorCode, k as kernelError, i as ioError, d as isErr, u as unwrap } from "./errors-lBwyc8YG.js";
|
|
49
|
+
import { O, z, a as a2, c, b as b2, f as f2, A, g as g2, m as m2, h as h2, j, l, C as C2, D, E as E2, s as s2, F as F2, G, t as t2, n, r, v as v2, w as w2, H } from "./errors-lBwyc8YG.js";
|
|
50
50
|
import { c as vecDistance, D as DEG2RAD, H as HASH_CODE_MAX, n as vecScale, j as vecNormalize, f as vecIsZero } from "./vecOps-ZDdZWbwT.js";
|
|
51
51
|
import { R, v as v3, a as a3, b as b3, d, e, g as g3, h as h3, i as i2, k, l as l2, m as m3, o as o2 } from "./vecOps-ZDdZWbwT.js";
|
|
52
|
-
import { B as B2, d as d2, C as
|
|
53
|
-
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-
|
|
54
|
-
import { b as b4, g as g4, r as r2 } from "./loft-
|
|
55
|
-
import { w as walkAssembly, e as extrude$1, r as revolve$1, s as sweep, c as circularPattern, l as linearPattern } from "./operations-
|
|
56
|
-
import { a as a4, b as b5, d as d3, f as f3, g as g5, h as h4, i as i3, j as j2, k as k2, m as m4, n as n2, o as o3, p as p2, q, t as t3, u as u2, v as v4, x, y, z as z2, A, B as B3, C as
|
|
57
|
-
import { B as B4, a as a5, e as e2, C as
|
|
52
|
+
import { B as B2, d as d2, C as C3, s as s3 } from "./Blueprint-DBFQJ5ME.js";
|
|
53
|
+
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-CiXi_aga.js";
|
|
54
|
+
import { b as b4, g as g4, r as r2 } from "./loft-CiXi_aga.js";
|
|
55
|
+
import { w as walkAssembly, e as extrude$1, r as revolve$1, s as sweep, c as circularPattern, l as linearPattern } from "./operations-CbE3WgWv.js";
|
|
56
|
+
import { a as a4, b as b5, d as d3, f as f3, g as g5, h as h4, i as i3, j as j2, k as k2, m as m4, n as n2, o as o3, p as p2, q, t as t3, u as u2, v as v4, x, y, z as z2, A as A2, B as B3, C as C4, D as D2, E as E3, F as F3, G as G2 } from "./operations-CbE3WgWv.js";
|
|
57
|
+
import { B as B4, a as a5, e as e2, C as C5, F as F4, S, f as f4, l as l3, g as g6, n as n3, k as k3, q as q2, o as o4, p as p3, r as r3 } from "./boolean2D-BDRf7DqS.js";
|
|
58
58
|
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";
|
|
59
|
-
import { l as createTypedFinder, m as faceFinder } from "./helpers-
|
|
60
|
-
import { g as g7 } from "./helpers-
|
|
59
|
+
import { l as createTypedFinder, m as faceFinder } from "./helpers-j3ILUOP3.js";
|
|
60
|
+
import { g as g7 } from "./helpers-j3ILUOP3.js";
|
|
61
61
|
import { blueprintToDXF, exportDXF, exportGlb, exportGltf, exportOBJ, exportThreeMF, importIGES, importSTEP, importSTL, importSVG, importSVGPathD } from "./io.js";
|
|
62
|
-
import { C as
|
|
62
|
+
import { C as C6, D as D3, a as a6, S as S2, b as b6, X, Y, c as c2, d as d4, e as e3, f as f5, Z, g as g8, h as h5, i as i4, j as j3, k as k4, l as l4, m as m5, n as n4, o as o5, p as p4, q as q3, r as r4, s as s4, t as t4, u as u3, v as v5, w as w3, x as x2, y as y2, z as z3, _, $, a0, a1, A as A3, a2 as a22, B as B5, E as E4, a3 as a32, F as F5, G as G3, 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-D7fQtIj-.js";
|
|
63
63
|
import { a as toVec3 } from "./types-CWDdqcrq.js";
|
|
64
64
|
import { r as r5, t as t5 } from "./types-CWDdqcrq.js";
|
|
65
|
-
import { c as c3, a as a7, p as p5, r as r6, t as t6 } from "./vectors-
|
|
66
|
-
import { v as vertexPosition, a as getFaces, e as getVertices, d as getEdges, h as getBounds, t as translate$1, p as propagateOriginsFromEvolution, g as getFaceOrigins, j as applyMatrix$1, k as clone$1, l as describe$1, m as isEmpty$1, n as mirror$1, r as rotate$1, s as scale$1, o as simplify$1, q as toBREP$1, u as transformCopy$1, c as getWires } from "./shapeFns-
|
|
67
|
-
import { w as w4, f as f6, x as x3, i as i5, y as y3, z as z4, A as
|
|
68
|
-
import { p as propagateFaceTagsFromEvolution, a as propagateColorsFromEvolution, h as hasFaceTags, b as hasColorMetadata, c as cut$1, f as fuse$1, i as intersect$1, s as section$1, d as sectionToFace$1, e as slice$1, g as split$1, j as fuseAll, k as cutAll } from "./booleanFns-
|
|
69
|
-
import { l as l5, m as m6, n as n5, o as o6, q as q4, r as r7, t as t7, u as u4, v as v6 } from "./booleanFns-
|
|
70
|
-
import { c as chamferDistAngle, h as heal$1, i as isValid$1 } from "./topology-
|
|
71
|
-
import { a as a8, b as b7, e as e4, f as f7, d as d5, g as g9, j as j4, s as s5, t as t8, k as k5, l as l6, v as v7, w as w5 } from "./topology-
|
|
72
|
-
import { e as curveIsClosed, d as curveStartPoint, c as curveTangentAt, h as curvePointAt, a as curveEndPoint, i as curveLength } from "./curveFns-
|
|
73
|
-
import { j as j5, k as k6, l as l7, f as f8, b as b8, g as g10, m as m7, o as o7 } from "./curveFns-
|
|
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 f9, q as q5, r as r8, s as s6, p as p6, t as t9, v as v8, u as u5, h as h6 } from "./faceFns-
|
|
76
|
-
import { m as mesh$1, a as meshEdges$1 } from "./meshFns-
|
|
77
|
-
import { c as c5, b as b9, e as e5, d as d7, f as f10 } 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 e6, f as f11, g as g11, h as h7, i as i6 } 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-
|
|
65
|
+
import { c as c3, a as a7, p as p5, r as r6, t as t6 } from "./vectors-B8RRTytu.js";
|
|
66
|
+
import { v as vertexPosition, a as getFaces, e as getVertices, d as getEdges, h as getBounds, t as translate$1, p as propagateOriginsFromEvolution, g as getFaceOrigins, j as applyMatrix$1, k as clone$1, l as describe$1, m as isEmpty$1, n as mirror$1, r as rotate$1, s as scale$1, o as simplify$1, q as toBREP$1, u as transformCopy$1, c as getWires } from "./shapeFns-DvwUGuOx.js";
|
|
67
|
+
import { w as w4, f as f6, x as x3, i as i5, y as y3, z as z4, A as A4, B as B6, C as C7, D as D4 } from "./shapeFns-DvwUGuOx.js";
|
|
68
|
+
import { p as propagateFaceTagsFromEvolution, a as propagateColorsFromEvolution, h as hasFaceTags, b as hasColorMetadata, c as cut$1, f as fuse$1, i as intersect$1, s as section$1, d as sectionToFace$1, e as slice$1, g as split$1, j as fuseAll, k as cutAll } from "./booleanFns-GfGGPjuF.js";
|
|
69
|
+
import { l as l5, m as m6, n as n5, o as o6, q as q4, r as r7, t as t7, u as u4, v as v6 } from "./booleanFns-GfGGPjuF.js";
|
|
70
|
+
import { c as chamferDistAngle, h as heal$1, i as isValid$1 } from "./topology-z4wgJE7T.js";
|
|
71
|
+
import { a as a8, b as b7, e as e4, f as f7, d as d5, g as g9, j as j4, s as s5, t as t8, k as k5, l as l6, v as v7, w as w5 } from "./topology-z4wgJE7T.js";
|
|
72
|
+
import { e as curveIsClosed, d as curveStartPoint, c as curveTangentAt, h as curvePointAt, a as curveEndPoint, i as curveLength } from "./curveFns-BteO-W-V.js";
|
|
73
|
+
import { j as j5, k as k6, l as l7, f as f8, b as b8, g as g10, m as m7, o as o7 } from "./curveFns-BteO-W-V.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-FViaMujJ.js";
|
|
75
|
+
import { l as l8, c as c4, m as m8, d as d6, f as f9, q as q5, r as r8, s as s6, p as p6, t as t9, v as v8, u as u5, h as h6 } from "./faceFns-FViaMujJ.js";
|
|
76
|
+
import { m as mesh$1, a as meshEdges$1 } from "./meshFns-w1baxmAz.js";
|
|
77
|
+
import { c as c5, b as b9, e as e5, d as d7, f as f10 } from "./meshFns-w1baxmAz.js";
|
|
78
|
+
import { m as measureArea, a as measureSurfaceProps, b as measureVolumeProps, c as measureVolume } from "./measurement-BNrssBY_.js";
|
|
79
|
+
import { d as d8, e as e6, f as f11, g as g11, h as h7, i as i6 } from "./measurement-BNrssBY_.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-C67Q29Gt.js";
|
|
81
|
+
import { p as p7 } from "./surfaceBuilders-C67Q29Gt.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-Bke7uLr6.js";
|
|
85
85
|
import { createOperationRegistry, createTaskQueue, createWorkerClient, createWorkerHandler, dequeueTask, enqueueTask, isDisposeRequest, isErrorResponse, isInitRequest, isOperationRequest, isQueueEmpty, isSuccessResponse, pendingCount, registerHandler, rejectAll } from "./worker.js";
|
|
86
86
|
function supportsProjection(kernel) {
|
|
87
87
|
return "projectShape" in kernel;
|
|
@@ -1183,6 +1183,12 @@ function roof(w6, options) {
|
|
|
1183
1183
|
return err(kernelError(BrepErrorCode.ROOF_FAILED, `Roof generation failed: ${msg}`, e7));
|
|
1184
1184
|
}
|
|
1185
1185
|
}
|
|
1186
|
+
const UNSUPPORTED_DOF = {
|
|
1187
|
+
coincident: 3,
|
|
1188
|
+
concentric: 4,
|
|
1189
|
+
distance: 1,
|
|
1190
|
+
angle: 1
|
|
1191
|
+
};
|
|
1186
1192
|
function solveConstraints(nodes, constraints) {
|
|
1187
1193
|
const transforms = /* @__PURE__ */ new Map();
|
|
1188
1194
|
for (const node of nodes) {
|
|
@@ -1191,6 +1197,7 @@ function solveConstraints(nodes, constraints) {
|
|
|
1191
1197
|
rotation: [1, 0, 0, 0]
|
|
1192
1198
|
});
|
|
1193
1199
|
}
|
|
1200
|
+
const unsupported = [];
|
|
1194
1201
|
for (const c7 of constraints) {
|
|
1195
1202
|
if (c7.type === "coincident" && c7.entityA && c7.entityB) {
|
|
1196
1203
|
const a9 = c7.entityA;
|
|
@@ -1202,9 +1209,10 @@ function solveConstraints(nodes, constraints) {
|
|
|
1202
1209
|
const dot = aNormal[0] * (aOrigin[0] - bOrigin[0]) + aNormal[1] * (aOrigin[1] - bOrigin[1]) + aNormal[2] * (aOrigin[2] - bOrigin[2]);
|
|
1203
1210
|
const pos = [dot * aNormal[0], dot * aNormal[1], dot * aNormal[2]];
|
|
1204
1211
|
transforms.set(b10.node, { position: pos, rotation: [1, 0, 0, 0] });
|
|
1212
|
+
} else {
|
|
1213
|
+
unsupported.push(`coincident(${a9.entity.type}-${b10.entity.type})`);
|
|
1205
1214
|
}
|
|
1206
|
-
}
|
|
1207
|
-
if (c7.type === "distance" && c7.entityA && c7.entityB && c7.value !== void 0) {
|
|
1215
|
+
} else if (c7.type === "distance" && c7.entityA && c7.entityB && c7.value !== void 0) {
|
|
1208
1216
|
const a9 = c7.entityA;
|
|
1209
1217
|
const b10 = c7.entityB;
|
|
1210
1218
|
if (a9.entity.type === "plane" && b10.entity.type === "plane") {
|
|
@@ -1215,10 +1223,18 @@ function solveConstraints(nodes, constraints) {
|
|
|
1215
1223
|
const offset2 = currentDist + c7.value;
|
|
1216
1224
|
const pos = [offset2 * aNormal[0], offset2 * aNormal[1], offset2 * aNormal[2]];
|
|
1217
1225
|
transforms.set(b10.node, { position: pos, rotation: [1, 0, 0, 0] });
|
|
1226
|
+
} else {
|
|
1227
|
+
unsupported.push(`distance(${a9.entity.type}-${b10.entity.type})`);
|
|
1218
1228
|
}
|
|
1229
|
+
} else if (c7.type === "concentric" || c7.type === "angle") {
|
|
1230
|
+
unsupported.push(c7.type);
|
|
1219
1231
|
}
|
|
1220
1232
|
}
|
|
1221
|
-
|
|
1233
|
+
const dof = unsupported.reduce((sum, type) => {
|
|
1234
|
+
const baseDof = UNSUPPORTED_DOF[type] ?? UNSUPPORTED_DOF[type.split("(")[0] ?? ""] ?? 0;
|
|
1235
|
+
return sum + baseDof;
|
|
1236
|
+
}, 0);
|
|
1237
|
+
return { transforms, dof, converged: unsupported.length === 0, unsupported };
|
|
1222
1238
|
}
|
|
1223
1239
|
function extractEntity(mate) {
|
|
1224
1240
|
if (mate.face) {
|
|
@@ -1231,6 +1247,22 @@ function extractEntity(mate) {
|
|
|
1231
1247
|
}
|
|
1232
1248
|
return null;
|
|
1233
1249
|
}
|
|
1250
|
+
function extractPair(a9, b10) {
|
|
1251
|
+
const entA = extractEntity(a9);
|
|
1252
|
+
const entB = extractEntity(b10);
|
|
1253
|
+
if (!entA || !entB) {
|
|
1254
|
+
return err(
|
|
1255
|
+
validationError(
|
|
1256
|
+
BrepErrorCode.ASSEMBLY_MATE_INVALID,
|
|
1257
|
+
"solveAssembly: could not extract geometry from mate entities"
|
|
1258
|
+
)
|
|
1259
|
+
);
|
|
1260
|
+
}
|
|
1261
|
+
return ok({
|
|
1262
|
+
entityA: { node: a9.node, entity: entA },
|
|
1263
|
+
entityB: { node: b10.node, entity: entB }
|
|
1264
|
+
});
|
|
1265
|
+
}
|
|
1234
1266
|
function addMate(assembly, constraint) {
|
|
1235
1267
|
const existing = assembly.mates ?? [];
|
|
1236
1268
|
return { ...assembly, mates: [...existing, constraint] };
|
|
@@ -1257,78 +1289,28 @@ function solveAssembly(assembly) {
|
|
|
1257
1289
|
continue;
|
|
1258
1290
|
}
|
|
1259
1291
|
if (mate.type === "coincident") {
|
|
1260
|
-
const
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
solverConstraints.push({
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
});
|
|
1275
|
-
}
|
|
1276
|
-
if (mate.type === "distance") {
|
|
1277
|
-
const entA = extractEntity(mate.entityA);
|
|
1278
|
-
const entB = extractEntity(mate.entityB);
|
|
1279
|
-
if (!entA || !entB) {
|
|
1280
|
-
return err(
|
|
1281
|
-
validationError(
|
|
1282
|
-
BrepErrorCode.ASSEMBLY_MATE_INVALID,
|
|
1283
|
-
"solveAssembly: could not extract geometry from mate entities"
|
|
1284
|
-
)
|
|
1285
|
-
);
|
|
1286
|
-
}
|
|
1287
|
-
solverConstraints.push({
|
|
1288
|
-
type: "distance",
|
|
1289
|
-
entityA: { node: mate.entityA.node, entity: entA },
|
|
1290
|
-
entityB: { node: mate.entityB.node, entity: entB },
|
|
1291
|
-
value: mate.distance
|
|
1292
|
-
});
|
|
1293
|
-
}
|
|
1294
|
-
if (mate.type === "angle") {
|
|
1295
|
-
const entA = extractEntity(mate.entityA);
|
|
1296
|
-
const entB = extractEntity(mate.entityB);
|
|
1297
|
-
if (!entA || !entB) {
|
|
1298
|
-
return err(
|
|
1299
|
-
validationError(
|
|
1300
|
-
BrepErrorCode.ASSEMBLY_MATE_INVALID,
|
|
1301
|
-
"solveAssembly: could not extract geometry from mate entities"
|
|
1302
|
-
)
|
|
1303
|
-
);
|
|
1304
|
-
}
|
|
1305
|
-
solverConstraints.push({
|
|
1306
|
-
type: "angle",
|
|
1307
|
-
entityA: { node: mate.entityA.node, entity: entA },
|
|
1308
|
-
entityB: { node: mate.entityB.node, entity: entB },
|
|
1309
|
-
value: mate.angle
|
|
1310
|
-
});
|
|
1311
|
-
}
|
|
1312
|
-
if (mate.type === "concentric") {
|
|
1313
|
-
const entA = extractEntity(mate.axisA);
|
|
1314
|
-
const entB = extractEntity(mate.axisB);
|
|
1315
|
-
if (!entA || !entB) {
|
|
1316
|
-
return err(
|
|
1317
|
-
validationError(
|
|
1318
|
-
BrepErrorCode.ASSEMBLY_MATE_INVALID,
|
|
1319
|
-
"solveAssembly: could not extract geometry from mate entities"
|
|
1320
|
-
)
|
|
1321
|
-
);
|
|
1322
|
-
}
|
|
1323
|
-
solverConstraints.push({
|
|
1324
|
-
type: "concentric",
|
|
1325
|
-
entityA: { node: mate.axisA.node, entity: entA },
|
|
1326
|
-
entityB: { node: mate.axisB.node, entity: entB }
|
|
1327
|
-
});
|
|
1292
|
+
const pair = extractPair(mate.entityA, mate.entityB);
|
|
1293
|
+
if (!pair.ok) return pair;
|
|
1294
|
+
solverConstraints.push({ type: "coincident", ...pair.value });
|
|
1295
|
+
} else if (mate.type === "distance") {
|
|
1296
|
+
const pair = extractPair(mate.entityA, mate.entityB);
|
|
1297
|
+
if (!pair.ok) return pair;
|
|
1298
|
+
solverConstraints.push({ type: "distance", ...pair.value, value: mate.distance });
|
|
1299
|
+
} else if (mate.type === "angle") {
|
|
1300
|
+
const pair = extractPair(mate.entityA, mate.entityB);
|
|
1301
|
+
if (!pair.ok) return pair;
|
|
1302
|
+
solverConstraints.push({ type: "angle", ...pair.value, value: mate.angle });
|
|
1303
|
+
} else {
|
|
1304
|
+
const pair = extractPair(mate.axisA, mate.axisB);
|
|
1305
|
+
if (!pair.ok) return pair;
|
|
1306
|
+
solverConstraints.push({ type: "concentric", ...pair.value });
|
|
1328
1307
|
}
|
|
1329
1308
|
}
|
|
1330
1309
|
const result = solveConstraints(nodes, solverConstraints);
|
|
1331
|
-
if (!result.converged)
|
|
1310
|
+
if (!result.converged) {
|
|
1311
|
+
const detail = result.unsupported.length > 0 ? `Unsupported constraint types: ${result.unsupported.join(", ")} (${result.dof} DOF unresolved)` : "Assembly constraint solver did not converge";
|
|
1312
|
+
return err(kernelError(BrepErrorCode.ASSEMBLY_NOT_CONVERGED, detail));
|
|
1313
|
+
}
|
|
1332
1314
|
return ok({
|
|
1333
1315
|
transforms: result.transforms,
|
|
1334
1316
|
dof: result.dof,
|
|
@@ -2655,14 +2637,14 @@ export {
|
|
|
2655
2637
|
BrepBugError,
|
|
2656
2638
|
BrepErrorCode,
|
|
2657
2639
|
BrepWrapperError,
|
|
2658
|
-
|
|
2659
|
-
|
|
2660
|
-
|
|
2640
|
+
C5 as CompoundBlueprint,
|
|
2641
|
+
C6 as CompoundSketch,
|
|
2642
|
+
C3 as Curve2D,
|
|
2661
2643
|
DEG2RAD,
|
|
2662
2644
|
DisposalScope,
|
|
2663
|
-
|
|
2645
|
+
D3 as Drawing,
|
|
2664
2646
|
a6 as DrawingPen,
|
|
2665
|
-
|
|
2647
|
+
F4 as FaceSketcher,
|
|
2666
2648
|
HASH_CODE_MAX,
|
|
2667
2649
|
O as OK,
|
|
2668
2650
|
R as RAD2DEG,
|
|
@@ -2674,6 +2656,7 @@ export {
|
|
|
2674
2656
|
addMate,
|
|
2675
2657
|
b5 as addStep,
|
|
2676
2658
|
a8 as adjacentFaces,
|
|
2659
|
+
z as all,
|
|
2677
2660
|
a2 as andThen,
|
|
2678
2661
|
applyGlue,
|
|
2679
2662
|
applyMatrix,
|
|
@@ -2763,6 +2746,7 @@ export {
|
|
|
2763
2746
|
dequeueTask,
|
|
2764
2747
|
describe,
|
|
2765
2748
|
g8 as deserializeDrawing,
|
|
2749
|
+
m4 as deserializeHistory,
|
|
2766
2750
|
fromBREP$1 as deserializeShape,
|
|
2767
2751
|
d6 as downcast,
|
|
2768
2752
|
h5 as draw,
|
|
@@ -2792,7 +2776,7 @@ export {
|
|
|
2792
2776
|
ellipsoid,
|
|
2793
2777
|
enqueueTask,
|
|
2794
2778
|
err,
|
|
2795
|
-
|
|
2779
|
+
n2 as exportAssemblySTEP,
|
|
2796
2780
|
exportDXF,
|
|
2797
2781
|
exportGlb,
|
|
2798
2782
|
exportGltf,
|
|
@@ -2813,8 +2797,8 @@ export {
|
|
|
2813
2797
|
fillet,
|
|
2814
2798
|
findCurveType,
|
|
2815
2799
|
n5 as findFacesByTag,
|
|
2816
|
-
|
|
2817
|
-
|
|
2800
|
+
o3 as findNode,
|
|
2801
|
+
p2 as findStep,
|
|
2818
2802
|
f2 as flatMap,
|
|
2819
2803
|
r8 as flipFaceOrientation,
|
|
2820
2804
|
f8 as flipOrientation,
|
|
@@ -2823,6 +2807,7 @@ export {
|
|
|
2823
2807
|
fromKernelDir,
|
|
2824
2808
|
fromKernelPnt,
|
|
2825
2809
|
fromKernelVec,
|
|
2810
|
+
A as fromNullable,
|
|
2826
2811
|
fuse,
|
|
2827
2812
|
g6 as fuse2D,
|
|
2828
2813
|
fuseAll,
|
|
@@ -2838,7 +2823,7 @@ export {
|
|
|
2838
2823
|
getFaces,
|
|
2839
2824
|
$ as getFont,
|
|
2840
2825
|
f6 as getHashCode,
|
|
2841
|
-
|
|
2826
|
+
q as getHistoryShape,
|
|
2842
2827
|
getKernel,
|
|
2843
2828
|
g10 as getOrientation,
|
|
2844
2829
|
getOrientation2D,
|
|
@@ -2902,7 +2887,7 @@ export {
|
|
|
2902
2887
|
y3 as iterEdges,
|
|
2903
2888
|
z4 as iterFaces,
|
|
2904
2889
|
iterTopo,
|
|
2905
|
-
|
|
2890
|
+
A4 as iterVertices,
|
|
2906
2891
|
B6 as iterWires,
|
|
2907
2892
|
kernelCall,
|
|
2908
2893
|
kernelCallRaw,
|
|
@@ -2912,7 +2897,7 @@ export {
|
|
|
2912
2897
|
linearPattern,
|
|
2913
2898
|
a1 as loadFont,
|
|
2914
2899
|
loft,
|
|
2915
|
-
|
|
2900
|
+
A3 as makeBaseBox,
|
|
2916
2901
|
s3 as makePlane,
|
|
2917
2902
|
a22 as makeProjectedEdges,
|
|
2918
2903
|
m2 as map,
|
|
@@ -2934,7 +2919,7 @@ export {
|
|
|
2934
2919
|
mirror2D,
|
|
2935
2920
|
B5 as mirrorDrawing,
|
|
2936
2921
|
mirrorJoin,
|
|
2937
|
-
|
|
2922
|
+
t3 as modifyStep,
|
|
2938
2923
|
l as moduleInitError,
|
|
2939
2924
|
multiSectionSweep,
|
|
2940
2925
|
normalAt,
|
|
@@ -2942,16 +2927,18 @@ export {
|
|
|
2942
2927
|
offsetFace,
|
|
2943
2928
|
o7 as offsetWire2D,
|
|
2944
2929
|
ok,
|
|
2930
|
+
C2 as or,
|
|
2931
|
+
D as orElse,
|
|
2945
2932
|
o4 as organiseBlueprints,
|
|
2946
2933
|
outerWire,
|
|
2947
2934
|
pendingCount,
|
|
2948
|
-
|
|
2935
|
+
E2 as pipeline,
|
|
2949
2936
|
p5 as pivotPlane,
|
|
2950
2937
|
pocket,
|
|
2951
2938
|
p6 as pointOnSurface,
|
|
2952
2939
|
polygon,
|
|
2953
2940
|
polyhedron,
|
|
2954
|
-
|
|
2941
|
+
E4 as polysideInnerRadius,
|
|
2955
2942
|
p3 as polysidesBlueprint,
|
|
2956
2943
|
a32 as projectEdges,
|
|
2957
2944
|
t9 as projectPointOnFace,
|
|
@@ -2959,13 +2946,13 @@ export {
|
|
|
2959
2946
|
rectangularPattern,
|
|
2960
2947
|
registerHandler,
|
|
2961
2948
|
E as registerKernel,
|
|
2962
|
-
|
|
2963
|
-
|
|
2949
|
+
u2 as registerOperation,
|
|
2950
|
+
v4 as registerShape,
|
|
2964
2951
|
rejectAll,
|
|
2965
|
-
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
|
|
2952
|
+
x as removeChild,
|
|
2953
|
+
y as replayFrom,
|
|
2954
|
+
z2 as replayHistory,
|
|
2955
|
+
C7 as resize,
|
|
2969
2956
|
resolve,
|
|
2970
2957
|
resolve3D,
|
|
2971
2958
|
r5 as resolveDirection,
|
|
@@ -2976,14 +2963,15 @@ export {
|
|
|
2976
2963
|
roof,
|
|
2977
2964
|
rotate,
|
|
2978
2965
|
rotate2D,
|
|
2979
|
-
|
|
2966
|
+
F5 as rotateDrawing,
|
|
2980
2967
|
r3 as roundedRectangleBlueprint,
|
|
2981
2968
|
scale,
|
|
2982
2969
|
scale2D,
|
|
2983
|
-
|
|
2970
|
+
G3 as scaleDrawing,
|
|
2984
2971
|
section,
|
|
2985
2972
|
sectionToFace,
|
|
2986
|
-
|
|
2973
|
+
A2 as serializeHistory,
|
|
2974
|
+
D4 as setShapeOrigin,
|
|
2987
2975
|
u4 as setTagMetadata,
|
|
2988
2976
|
sewShells,
|
|
2989
2977
|
shape,
|
|
@@ -2993,7 +2981,7 @@ export {
|
|
|
2993
2981
|
simplify,
|
|
2994
2982
|
sketch2DOnFace,
|
|
2995
2983
|
sketch2DOnPlane,
|
|
2996
|
-
|
|
2984
|
+
H2 as sketchCircle,
|
|
2997
2985
|
I as sketchEllipse,
|
|
2998
2986
|
J as sketchExtrude,
|
|
2999
2987
|
K as sketchFace,
|
|
@@ -3014,17 +3002,19 @@ export {
|
|
|
3014
3002
|
solveAssembly,
|
|
3015
3003
|
sphere,
|
|
3016
3004
|
split,
|
|
3017
|
-
|
|
3018
|
-
|
|
3005
|
+
B3 as stepCount,
|
|
3006
|
+
C4 as stepsFrom,
|
|
3019
3007
|
stretch2D,
|
|
3020
3008
|
subFace,
|
|
3021
|
-
|
|
3009
|
+
D2 as supportExtrude,
|
|
3022
3010
|
supportsProjection,
|
|
3023
3011
|
surfaceFromGrid,
|
|
3024
3012
|
surfaceFromImage,
|
|
3025
3013
|
sweep,
|
|
3026
3014
|
v6 as tagFaces,
|
|
3027
3015
|
tangentArc,
|
|
3016
|
+
F2 as tap,
|
|
3017
|
+
G as tapErr,
|
|
3028
3018
|
a52 as textBlueprints,
|
|
3029
3019
|
a62 as textMetrics,
|
|
3030
3020
|
thicken,
|
|
@@ -3045,14 +3035,14 @@ export {
|
|
|
3045
3035
|
t6 as translatePlane,
|
|
3046
3036
|
t2 as tryCatch,
|
|
3047
3037
|
n as tryCatchAsync,
|
|
3048
|
-
|
|
3038
|
+
E3 as twistExtrude,
|
|
3049
3039
|
typeCastError,
|
|
3050
|
-
|
|
3040
|
+
F3 as undoLast,
|
|
3051
3041
|
unwrap,
|
|
3052
3042
|
r as unwrapErr,
|
|
3053
3043
|
v2 as unwrapOr,
|
|
3054
3044
|
w2 as unwrapOrElse,
|
|
3055
|
-
|
|
3045
|
+
G2 as updateNode,
|
|
3056
3046
|
u5 as uvBounds,
|
|
3057
3047
|
h6 as uvCoordinates,
|
|
3058
3048
|
validationError,
|
|
@@ -3086,5 +3076,6 @@ export {
|
|
|
3086
3076
|
withKernelVec,
|
|
3087
3077
|
w as withScope,
|
|
3088
3078
|
o as withScopeResult,
|
|
3089
|
-
p as withScopeResultAsync
|
|
3079
|
+
p as withScopeResultAsync,
|
|
3080
|
+
H as zipResults
|
|
3090
3081
|
};
|
package/dist/core/result.d.ts
CHANGED
|
@@ -19,6 +19,20 @@ export declare function mapErr<T, E, F>(result: Result<T, E>, fn: (error: E) =>
|
|
|
19
19
|
export declare function andThen<T, U, E>(result: Result<T, E>, fn: (value: T) => Result<U, E>): Result<U, E>;
|
|
20
20
|
/** Alias for andThen */
|
|
21
21
|
export declare const flatMap: typeof andThen;
|
|
22
|
+
/** Return `a` if Ok, otherwise return `b`. */
|
|
23
|
+
export declare function or<T, E, F>(a: Result<T, E>, b: Result<T, F>): Result<T, F>;
|
|
24
|
+
/** Return `result` if Ok, otherwise call `fn` with the error and return its result. */
|
|
25
|
+
export declare function orElse<T, E, F>(result: Result<T, E>, fn: (error: E) => Result<T, F>): Result<T, F>;
|
|
26
|
+
/** Combine two independent Results into a Result of a tuple. */
|
|
27
|
+
export declare function zip<A, B, E>(a: Result<A, E>, b: Result<B, E>): Result<[A, B], E>;
|
|
28
|
+
/** Collect an array of Results into a Result of an array. Alias for {@link collect}. */
|
|
29
|
+
export declare const all: typeof collect;
|
|
30
|
+
/** Run a side-effect on an Ok value without transforming the result. */
|
|
31
|
+
export declare function tap<T, E>(result: Result<T, E>, fn: (value: T) => void): Result<T, E>;
|
|
32
|
+
/** Run a side-effect on an Err value without transforming the result. */
|
|
33
|
+
export declare function tapErr<T, E>(result: Result<T, E>, fn: (error: E) => void): Result<T, E>;
|
|
34
|
+
/** Convert a nullable value to a Result, using `errorFn` to produce the error for null/undefined. */
|
|
35
|
+
export declare function fromNullable<T, E>(value: T | null | undefined, errorFn: () => E): Result<T, E>;
|
|
22
36
|
export declare function unwrap<T, E>(result: Result<T, E>): T;
|
|
23
37
|
export declare function unwrapOr<T, E>(result: Result<T, E>, defaultValue: T): T;
|
|
24
38
|
export declare function unwrapOrElse<T, E>(result: Result<T, E>, fn: (error: E) => T): T;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"result.d.ts","sourceRoot":"","sources":["../../src/core/result.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAM7C,MAAM,WAAW,EAAE,CAAC,CAA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AAE,MAAM,OAAO,CAAC,CAAC,CAAC,EACpB,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,CAAC,GAC9B,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAMvB;AAMD,iEAAiE;AACjE,MAAM,WAAW,cAAc,CAAC,CAAC,EAAE,CAAC;IAClC,iEAAiE;IACjE,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,cAAc,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAC9D,gCAAgC;IAChC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;CAC/B;AAED;;;;;;;;;GASG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,CAAC,GAAG,SAAS,EAAE,KAAK,EAAE,CAAC,GAAG,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,cAAc,CAAC,CAAC,EAAE,CAAC,CAAC,CA0BxF"}
|
package/dist/core.cjs
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const types = require("./types-CA_xrgDq.cjs");
|
|
4
4
|
const vecOps = require("./vecOps-CjRL1jau.cjs");
|
|
5
|
-
const errors = require("./errors-
|
|
6
|
-
const vectors = require("./vectors-
|
|
5
|
+
const errors = require("./errors-DiTn5EoC.cjs");
|
|
6
|
+
const vectors = require("./vectors-DqQXtR8s.cjs");
|
|
7
7
|
const shapeTypes = require("./shapeTypes-CBhj5o2y.cjs");
|
|
8
8
|
const result = require("./result.cjs");
|
|
9
9
|
exports.resolveDirection = types.resolveDirection;
|
package/dist/core.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { r, t, a } from "./types-CWDdqcrq.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, k as k2, m as m2, h as h2, j as j2, l as l2, o as o2, 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-
|
|
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, k as k2, m as m2, h as h2, j as j2, l as l2, o as o2, q, s, t as t2, n as n2, p, u, r as r2, v as v2, w, x } from "./errors-lBwyc8YG.js";
|
|
4
|
+
import { c as c3, a as a4, p as p2, r as r3, t as t3 } from "./vectors-B8RRTytu.js";
|
|
5
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-d-jYnZuW.js";
|
|
6
6
|
import { BrepBugError, bug } from "./result.js";
|
|
7
7
|
export {
|
|
@@ -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-j3ILUOP3.js";
|
|
2
2
|
import { D as DEG2RAD } from "./vecOps-ZDdZWbwT.js";
|
|
3
3
|
const PI_2 = 2 * Math.PI;
|
|
4
4
|
function positiveHalfAngle(angle) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { q as getKernel, c as castShape, d as isEdge, n as isWire } from "./shapeTypes-d-jYnZuW.js";
|
|
2
|
-
import { e as err, p as typeCastError, o as ok } from "./errors-
|
|
2
|
+
import { e as err, p as typeCastError, o as ok } from "./errors-lBwyc8YG.js";
|
|
3
3
|
function getCurveType(shape) {
|
|
4
4
|
return getKernel().curveType(shape.wrapped);
|
|
5
5
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const shapeTypes = require("./shapeTypes-CBhj5o2y.cjs");
|
|
3
|
-
const errors = require("./errors-
|
|
3
|
+
const errors = require("./errors-DiTn5EoC.cjs");
|
|
4
4
|
function getCurveType(shape) {
|
|
5
5
|
return shapeTypes.getKernel().curveType(shape.wrapped);
|
|
6
6
|
}
|
|
@@ -44,22 +44,22 @@ var __callDispose = (stack, error, hasError) => {
|
|
|
44
44
|
};
|
|
45
45
|
return next();
|
|
46
46
|
};
|
|
47
|
-
const errors = require("./errors-
|
|
48
|
-
const vectors = require("./vectors-
|
|
47
|
+
const errors = require("./errors-DiTn5EoC.cjs");
|
|
48
|
+
const vectors = require("./vectors-DqQXtR8s.cjs");
|
|
49
49
|
const types = require("./types-CA_xrgDq.cjs");
|
|
50
50
|
const vecOps = require("./vecOps-CjRL1jau.cjs");
|
|
51
|
-
const boolean2D = require("./boolean2D-
|
|
52
|
-
const faceFns = require("./faceFns-
|
|
53
|
-
const curveFns = require("./curveFns-
|
|
54
|
-
const surfaceBuilders = require("./surfaceBuilders-
|
|
51
|
+
const boolean2D = require("./boolean2D-FaadcaJX.cjs");
|
|
52
|
+
const faceFns = require("./faceFns-Cshr6Dql.cjs");
|
|
53
|
+
const curveFns = require("./curveFns-DOhZedkN.cjs");
|
|
54
|
+
const surfaceBuilders = require("./surfaceBuilders-mE9oGh7r.cjs");
|
|
55
55
|
const shapeTypes = require("./shapeTypes-CBhj5o2y.cjs");
|
|
56
|
-
const Blueprint = require("./Blueprint-
|
|
56
|
+
const Blueprint = require("./Blueprint-CYDtiBRw.cjs");
|
|
57
57
|
const result = require("./result.cjs");
|
|
58
|
-
const helpers = require("./helpers-
|
|
59
|
-
const shapeFns = require("./shapeFns-
|
|
60
|
-
const loft = require("./loft-
|
|
58
|
+
const helpers = require("./helpers-aY6tdIRv.cjs");
|
|
59
|
+
const shapeFns = require("./shapeFns-BvxOc2M_.cjs");
|
|
60
|
+
const loft = require("./loft-6RVa269J.cjs");
|
|
61
61
|
const opentype = require("opentype.js");
|
|
62
|
-
const cornerFinder = require("./cornerFinder-
|
|
62
|
+
const cornerFinder = require("./cornerFinder-C1oci6gb.cjs");
|
|
63
63
|
const stitchCurves = (curves, precision = 1e-7) => {
|
|
64
64
|
const startPoints = new boolean2D.Flatbush(curves.length);
|
|
65
65
|
curves.forEach((c) => {
|