brepjs 12.2.11 → 12.3.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.cjs +2 -2
- package/dist/2d.js +3 -3
- package/dist/{Blueprint-BWAzjtvF.js → Blueprint-BBLKmtl9.js} +5 -5
- package/dist/{Blueprint-CX2oh-NE.cjs → Blueprint-Bh6166KA.cjs} +5 -5
- package/dist/{boolean2D-G9edb4Pw.cjs → boolean2D-Bl4iyJfa.cjs} +7 -7
- package/dist/{boolean2D-B17ZPZ63.js → boolean2D-D2s-G0Wm.js} +7 -7
- package/dist/{booleanFns-EsNGs4Zu.js → booleanFns-CKWVFBtF.js} +3 -3
- package/dist/{booleanFns-DQj7i7qb.cjs → booleanFns-DdbAk1KC.cjs} +3 -3
- package/dist/brepjs.cjs +158 -35
- package/dist/brepjs.js +198 -75
- package/dist/core.cjs +1 -1
- package/dist/core.js +1 -1
- package/dist/{cornerFinder-57qxNypG.js → cornerFinder-C-o3TN3q.js} +1 -1
- package/dist/{cornerFinder-NbeO5KWC.cjs → cornerFinder-zd2oBgyp.cjs} +1 -1
- package/dist/{curveFns-DRb_8jyd.js → curveFns-DyVPTb1r.js} +1 -1
- package/dist/{curveFns-BN9bWCIl.cjs → curveFns-p0x8jy0i.cjs} +1 -1
- package/dist/{drawFns-Br57GZWI.cjs → drawFns-DXwZzno9.cjs} +11 -11
- package/dist/{drawFns-DWTCgzlb.js → drawFns-DpAQM_F6.js} +11 -11
- package/dist/{faceFns-Dka8xvYk.js → faceFns-CvR-ZEQA.js} +6 -2
- package/dist/{faceFns-Cfvj4nxx.cjs → faceFns-SVADeb01.cjs} +5 -1
- package/dist/{helpers-Cu_7Qo9J.cjs → helpers-3fsqd4mW.cjs} +4 -4
- package/dist/{helpers-10HaneKK.js → helpers-F_D1WON3.js} +4 -4
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/io.cjs +3 -3
- package/dist/io.js +3 -3
- package/dist/kernel/advancedOps.d.ts +2 -0
- package/dist/kernel/advancedOps.d.ts.map +1 -1
- package/dist/kernel/brepkitAdapter.d.ts +29 -0
- package/dist/kernel/brepkitAdapter.d.ts.map +1 -1
- package/dist/kernel/brepkitWasmTypes.d.ts +2 -0
- 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 +2 -2
- package/dist/kernel/index.d.ts.map +1 -1
- package/dist/kernel/types.d.ts +17 -0
- package/dist/kernel/types.d.ts.map +1 -1
- package/dist/{loft-BDnb8toT.cjs → loft-98s9uwpg.cjs} +4 -4
- package/dist/{loft-DTFP5fVL.js → loft-BvZFfPqO.js} +4 -4
- package/dist/{measurement-ypLLNq5y.cjs → measurement-g8ldN7oe.cjs} +2 -2
- package/dist/{measurement-9v764TRE.js → measurement-vbHd9lpV.js} +2 -2
- package/dist/measurement.cjs +1 -1
- package/dist/measurement.js +1 -1
- package/dist/{meshFns-xWim4bEU.cjs → meshFns-CF-JdX5P.cjs} +2 -2
- package/dist/{meshFns-B1FRGCo4.js → meshFns-RN83Wiry.js} +2 -2
- package/dist/{operations-CLaaoj2N.cjs → operations-CrLZ6fyL.cjs} +5 -5
- package/dist/{operations-C0597E2p.js → operations-CxvdnWzU.js} +5 -5
- package/dist/operations.cjs +2 -2
- package/dist/operations.js +2 -2
- package/dist/query.cjs +4 -4
- package/dist/query.js +5 -5
- package/dist/{shapeFns-Dim8UTHh.js → shapeFns-38GljA_p.js} +2 -2
- package/dist/{shapeFns-ZbzAD8yC.cjs → shapeFns-BoN5g5Bx.cjs} +2 -2
- package/dist/{shapeTypes-ByN4-0Hp.js → shapeTypes-5DPsHB8i.js} +21 -0
- package/dist/{shapeTypes-BQGbhdgi.cjs → shapeTypes-DTGA0liC.cjs} +21 -0
- package/dist/sketching.cjs +2 -2
- package/dist/sketching.js +2 -2
- package/dist/{solidBuilders-Bc6kgqJ9.js → solidBuilders-BWkneWjU.js} +2 -2
- package/dist/{solidBuilders-CYEEZgiP.cjs → solidBuilders-CUc2rvWv.cjs} +2 -2
- package/dist/{surfaceBuilders-Bdn7iqv5.js → surfaceBuilders-CXbEDGBQ.js} +2 -2
- package/dist/{surfaceBuilders-CXarnCh8.cjs → surfaceBuilders-tYoe8sri.cjs} +2 -2
- package/dist/topology/faceFns.d.ts +5 -0
- package/dist/topology/faceFns.d.ts.map +1 -1
- package/dist/{topology-Cq1j_bp1.js → topology-Bq7mZh3W.js} +8 -8
- package/dist/{topology-CPYjaISY.cjs → topology-CH4LBfQg.cjs} +8 -8
- package/dist/topology.cjs +6 -6
- package/dist/topology.js +7 -7
- package/package.json +1 -1
package/dist/brepjs.js
CHANGED
|
@@ -43,49 +43,52 @@ var __callDispose = (stack, error, hasError) => {
|
|
|
43
43
|
};
|
|
44
44
|
return next();
|
|
45
45
|
};
|
|
46
|
-
import { c as castShape, D as DisposalScope, B as getKernel, k as isFace, q as isShell, r as isSolid, p as isShape3D, F as createSolid, G as createWire, j as isEdge, u as isWire } from "./shapeTypes-
|
|
47
|
-
import { M, N, O, a, C, H, I, b, d, P, E, g, Q, i, e, f, h, l, m, n, o, s, t, v, w, R, x, S, y, z, A } from "./shapeTypes-
|
|
46
|
+
import { c as castShape, D as DisposalScope, B as getKernel, k as isFace, q as isShell, r as isSolid, p as isShape3D, F as createSolid, G as createWire, j as isEdge, u as isWire } from "./shapeTypes-5DPsHB8i.js";
|
|
47
|
+
import { M, N, O, a, C, H, I, b, d, P, E, g, Q, i, e, f, h, l, m, n, o, s, t, v, w, R, x, S, y, z, A } from "./shapeTypes-5DPsHB8i.js";
|
|
48
48
|
import { o as ok, z as translateKernelError, e as err, p as typeCastError, q as queryError, y as validationError, B as BrepErrorCode, k as kernelError, i as ioError, d as isErr, r as unwrap$1 } from "./errors-B7kgv0cd.js";
|
|
49
49
|
import { O as O2, A as A2, a as a2, c, b as b2, f as f2, C as C2, g as g2, m as m2, h as h2, j, l as l2, D, E as E2, F, s as s2, G, H as H2, t as t2, n as n2, u, v as v2, w as w2, x as x2, I as I2 } from "./errors-B7kgv0cd.js";
|
|
50
50
|
import { c as vecDistance, H as HASH_CODE_MAX, n as vecScale, j as vecNormalize, f as vecIsZero } from "./vecOps-ZDdZWbwT.js";
|
|
51
51
|
import { D as D2, R as R2, v as v3, a as a3, b as b3, d as d2, e as e2, g as g3, h as h3, i as i2, k, l as l3, m as m3, o as o2 } from "./vecOps-ZDdZWbwT.js";
|
|
52
|
-
import { B, d as d3, C as C3, t as t3 } from "./Blueprint-
|
|
53
|
-
import { b as b4, g as g4, r } from "./loft-
|
|
54
|
-
import { w as walkAssembly, e as extrude$1, r as revolve$1, s as sweep, c as circularPattern, l as linearPattern } from "./operations-
|
|
55
|
-
import { a as a4, b as b5, d as d4, f as f3, g as g5, h as h4, i as i3, j as j2, k as k2, m as m4, n as n3, o as o3, p, q, t as t4, u as u2, v as v4, x as x3, y as y2, z as z2, A as A3, B as B2, C as C4, D as D3, E as E3, F as F2, G as G2 } from "./operations-
|
|
56
|
-
import { B as B3, a as a5, e as e3, C as C5, F as F3, S as S2, f as f4, l as l4, g as g6, n as n4, k as k3, q as q2, o as o4, p as p2, r as r2 } from "./boolean2D-
|
|
52
|
+
import { B, d as d3, C as C3, t as t3 } from "./Blueprint-BBLKmtl9.js";
|
|
53
|
+
import { b as b4, g as g4, r } from "./loft-BvZFfPqO.js";
|
|
54
|
+
import { w as walkAssembly, e as extrude$1, r as revolve$1, s as sweep, c as circularPattern, l as linearPattern } from "./operations-CxvdnWzU.js";
|
|
55
|
+
import { a as a4, b as b5, d as d4, f as f3, g as g5, h as h4, i as i3, j as j2, k as k2, m as m4, n as n3, o as o3, p, q, t as t4, u as u2, v as v4, x as x3, y as y2, z as z2, A as A3, B as B2, C as C4, D as D3, E as E3, F as F2, G as G2 } from "./operations-CxvdnWzU.js";
|
|
56
|
+
import { B as B3, a as a5, e as e3, C as C5, F as F3, S as S2, f as f4, l as l4, g as g6, n as n4, k as k3, q as q2, o as o4, p as p2, r as r2 } from "./boolean2D-D2s-G0Wm.js";
|
|
57
57
|
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";
|
|
58
|
-
import { l as createTypedFinder, m as faceFinder } from "./helpers-
|
|
59
|
-
import { g as g7 } from "./helpers-
|
|
58
|
+
import { l as createTypedFinder, m as faceFinder } from "./helpers-F_D1WON3.js";
|
|
59
|
+
import { g as g7 } from "./helpers-F_D1WON3.js";
|
|
60
60
|
import { blueprintToDXF, exportDXF, exportGlb, exportGltf, exportOBJ, exportThreeMF, importIGES, importSTEP, importSTL, importSVG, importSVGPathD } from "./io.js";
|
|
61
|
-
import { C as C6, D as D4, a as a6, S as S3, b as b6, X, Y, c as c2, d as d5, e as e4, f as f5, Z, g as g8, h as h5, i as i4, j as j3, k as k4, l as l5, m as m5, n as n5, o as o5, p as p3, q as q3, r as r3, s as s3, t as t5, u as u3, v as v5, w as w3, x as x4, y as y3, z as z3, _, $, a0, a1, A as A4, a2 as a22, B as B4, E as E4, a3 as a32, F as F4, G as G3, H as H3, I as I3, J, K, L, M as M2, N as N2, O as O3, P as P2, Q as Q2, R as R3, T, U, a4 as a42, V, a5 as a52, a6 as a62, W } from "./drawFns-
|
|
61
|
+
import { C as C6, D as D4, a as a6, S as S3, b as b6, X, Y, c as c2, d as d5, e as e4, f as f5, Z, g as g8, h as h5, i as i4, j as j3, k as k4, l as l5, m as m5, n as n5, o as o5, p as p3, q as q3, r as r3, s as s3, t as t5, u as u3, v as v5, w as w3, x as x4, y as y3, z as z3, _, $, a0, a1, A as A4, a2 as a22, B as B4, E as E4, a3 as a32, F as F4, G as G3, H as H3, I as I3, J, K, L, M as M2, N as N2, O as O3, P as P2, Q as Q2, R as R3, T, U, a4 as a42, V, a5 as a52, a6 as a62, W } from "./drawFns-DpAQM_F6.js";
|
|
62
62
|
import { a as toVec3 } from "./types-CWDdqcrq.js";
|
|
63
63
|
import { r as r4, t as t6 } from "./types-CWDdqcrq.js";
|
|
64
64
|
import { c as c3, a as a7, p as p4, r as r5, t as t7 } from "./vectors-cec8p8NQ.js";
|
|
65
|
-
import { v as vertexPosition, a as getFaces, e as getVertices, d as getEdges, h as getBounds, b 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, t as toBREP$1, q as transformCopy$1, u as translate$1, c as getWires } from "./shapeFns-
|
|
66
|
-
import { w as w4, f as f6, x as x5, i as i5, y as y4, z as z4, A as A5, B as B5, C as C7, D as D5 } from "./shapeFns-
|
|
67
|
-
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-
|
|
68
|
-
import { l as l6, m as m6, n as n6, o as o6, q as q4, r as r6, t as t8, u as u4, v as v6 } from "./booleanFns-
|
|
69
|
-
import { c as chamferDistAngle, h as heal$1, i as isValid$1 } from "./topology-
|
|
70
|
-
import { a as a8, b as b7, d as d6, e as e5, f as f7, g as g9, j as j4, k as k5, l as l7, m as m7, n as n7, o as o7, p as p5, q as q5, r as r7, s as s4, t as t9, u as u5, v as v7, w as w5, x as x6, y as y5, z as z5, A as A6, B as B6, C as C8, D as D6, E as E5, F as F5, G as G4, H as H4, I as I4, J as J2, K as K2, L as L2, M as M3, N as N3, O as O4, P as P3, Q as Q3 } from "./topology-
|
|
71
|
-
import { e as curveIsClosed, d as curveStartPoint, c as curveTangentAt, h as curvePointAt, a as curveEndPoint, i as curveLength } from "./curveFns-
|
|
72
|
-
import { j as j5, k as k6, l as l8, f as f8, b as b8, g as g10, m as m8, o as o8 } from "./curveFns-
|
|
73
|
-
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-
|
|
74
|
-
import { l as l9, c as c4, m as m9, d as d7, f as f9, q as q6, r as r8, s as s5, p as p6, t as t10, v as v8, u as u6, h as h6 } from "./faceFns-
|
|
75
|
-
import { m as mesh$1, a as meshEdges$1 } from "./meshFns-
|
|
76
|
-
import { c as c5, b as b9, e as e6, d as d8, f as f10 } from "./meshFns-
|
|
77
|
-
import { m as measureArea, a as measureSurfaceProps, b as measureVolumeProps, c as measureVolume } from "./measurement-
|
|
78
|
-
import { d as d9, e as e7, f as f11, g as g11, h as h7, i as i6 } from "./measurement-
|
|
79
|
-
import { m as makeFace } from "./surfaceBuilders-
|
|
80
|
-
import { n as n8 } from "./surfaceBuilders-
|
|
65
|
+
import { v as vertexPosition, a as getFaces, e as getVertices, d as getEdges, h as getBounds, b 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, t as toBREP$1, q as transformCopy$1, u as translate$1, c as getWires } from "./shapeFns-38GljA_p.js";
|
|
66
|
+
import { w as w4, f as f6, x as x5, i as i5, y as y4, z as z4, A as A5, B as B5, C as C7, D as D5 } from "./shapeFns-38GljA_p.js";
|
|
67
|
+
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-CKWVFBtF.js";
|
|
68
|
+
import { l as l6, m as m6, n as n6, o as o6, q as q4, r as r6, t as t8, u as u4, v as v6 } from "./booleanFns-CKWVFBtF.js";
|
|
69
|
+
import { c as chamferDistAngle, h as heal$1, i as isValid$1 } from "./topology-Bq7mZh3W.js";
|
|
70
|
+
import { a as a8, b as b7, d as d6, e as e5, f as f7, g as g9, j as j4, k as k5, l as l7, m as m7, n as n7, o as o7, p as p5, q as q5, r as r7, s as s4, t as t9, u as u5, v as v7, w as w5, x as x6, y as y5, z as z5, A as A6, B as B6, C as C8, D as D6, E as E5, F as F5, G as G4, H as H4, I as I4, J as J2, K as K2, L as L2, M as M3, N as N3, O as O4, P as P3, Q as Q3 } from "./topology-Bq7mZh3W.js";
|
|
71
|
+
import { e as curveIsClosed, d as curveStartPoint, c as curveTangentAt, h as curvePointAt, a as curveEndPoint, i as curveLength } from "./curveFns-DyVPTb1r.js";
|
|
72
|
+
import { j as j5, k as k6, l as l8, f as f8, b as b8, g as g10, m as m8, o as o8 } from "./curveFns-DyVPTb1r.js";
|
|
73
|
+
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-CvR-ZEQA.js";
|
|
74
|
+
import { l as l9, c as c4, m as m9, d as d7, f as f9, q as q6, r as r8, s as s5, p as p6, t as t10, v as v8, w as w6, u as u6, h as h6 } from "./faceFns-CvR-ZEQA.js";
|
|
75
|
+
import { m as mesh$1, a as meshEdges$1 } from "./meshFns-RN83Wiry.js";
|
|
76
|
+
import { c as c5, b as b9, e as e6, d as d8, f as f10 } from "./meshFns-RN83Wiry.js";
|
|
77
|
+
import { m as measureArea, a as measureSurfaceProps, b as measureVolumeProps, c as measureVolume } from "./measurement-vbHd9lpV.js";
|
|
78
|
+
import { d as d9, e as e7, f as f11, g as g11, h as h7, i as i6 } from "./measurement-vbHd9lpV.js";
|
|
79
|
+
import { m as makeFace } from "./surfaceBuilders-CXbEDGBQ.js";
|
|
80
|
+
import { n as n8 } from "./surfaceBuilders-CXbEDGBQ.js";
|
|
81
81
|
import { edgeFinder } from "./query.js";
|
|
82
|
-
import { c as makeCylinder } from "./solidBuilders-
|
|
82
|
+
import { c as makeCylinder } from "./solidBuilders-BWkneWjU.js";
|
|
83
83
|
import { BrepBugError, bug } from "./result.js";
|
|
84
|
-
import { c as c6 } from "./cornerFinder-
|
|
84
|
+
import { c as c6 } from "./cornerFinder-C-o3TN3q.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;
|
|
88
88
|
}
|
|
89
|
+
function supportsConstraintSketch(kernel) {
|
|
90
|
+
return "sketchNew" in kernel && "sketchDof" in kernel;
|
|
91
|
+
}
|
|
89
92
|
function evaluateCurve2d(c7, t11) {
|
|
90
93
|
switch (c7.__bk2d) {
|
|
91
94
|
case "line":
|
|
@@ -940,6 +943,22 @@ class BrepkitAdapter {
|
|
|
940
943
|
fuseAll(shapes, options) {
|
|
941
944
|
if (shapes.length === 0) throw new Error("brepkit: fuseAll requires at least one shape");
|
|
942
945
|
if (shapes.length === 1) return shapes[0];
|
|
946
|
+
if (this.bk.compoundFuse) {
|
|
947
|
+
const solidIds = [];
|
|
948
|
+
for (const shape2 of shapes) {
|
|
949
|
+
const h8 = shape2;
|
|
950
|
+
if (h8.type === "compound") {
|
|
951
|
+
solidIds.push(...toArray(this.bk.getCompoundSolids(h8.id)));
|
|
952
|
+
} else {
|
|
953
|
+
solidIds.push(unwrapSolidOrThrow(shape2, "fuseAll"));
|
|
954
|
+
}
|
|
955
|
+
}
|
|
956
|
+
if (solidIds.length === 0) {
|
|
957
|
+
throw new Error("brepkit: fuseAll resolved to zero solid IDs");
|
|
958
|
+
}
|
|
959
|
+
const result = this.bk.compoundFuse(new Uint32Array(solidIds));
|
|
960
|
+
return solidHandle(result);
|
|
961
|
+
}
|
|
943
962
|
let current = [...shapes];
|
|
944
963
|
while (current.length > 1) {
|
|
945
964
|
const next = [];
|
|
@@ -1314,10 +1333,10 @@ class BrepkitAdapter {
|
|
|
1314
1333
|
return compoundHandle(id);
|
|
1315
1334
|
}
|
|
1316
1335
|
makeBoxFromCorners(p1, p22) {
|
|
1317
|
-
const
|
|
1336
|
+
const w7 = Math.abs(p22[0] - p1[0]);
|
|
1318
1337
|
const h8 = Math.abs(p22[1] - p1[1]);
|
|
1319
1338
|
const d10 = Math.abs(p22[2] - p1[2]);
|
|
1320
|
-
const box = this.makeBox(
|
|
1339
|
+
const box = this.makeBox(w7, h8, d10);
|
|
1321
1340
|
const minX = Math.min(p1[0], p22[0]);
|
|
1322
1341
|
const minY = Math.min(p1[1], p22[1]);
|
|
1323
1342
|
const minZ = Math.min(p1[2], p22[2]);
|
|
@@ -1395,12 +1414,12 @@ class BrepkitAdapter {
|
|
|
1395
1414
|
"Loft options (ruled, startShape, endShape) not supported; ignored."
|
|
1396
1415
|
);
|
|
1397
1416
|
}
|
|
1398
|
-
const faceIds = wires.map((
|
|
1399
|
-
const h8 =
|
|
1417
|
+
const faceIds = wires.map((w7) => {
|
|
1418
|
+
const h8 = w7;
|
|
1400
1419
|
if (h8.type === "wire") {
|
|
1401
1420
|
return this.bk.makeFaceFromWire(h8.id);
|
|
1402
1421
|
}
|
|
1403
|
-
return unwrap(
|
|
1422
|
+
return unwrap(w7, "face");
|
|
1404
1423
|
});
|
|
1405
1424
|
const id = this.bk.loft(faceIds);
|
|
1406
1425
|
return solidHandle(id);
|
|
@@ -2033,7 +2052,7 @@ class BrepkitAdapter {
|
|
|
2033
2052
|
const deflection = options.tolerance || DEFAULT_DEFLECTION;
|
|
2034
2053
|
let result;
|
|
2035
2054
|
if (bkHandle.type === "solid") {
|
|
2036
|
-
result = this.meshSolid(h8, deflection);
|
|
2055
|
+
result = this.meshSolid(h8, deflection, !!options.includeUVs);
|
|
2037
2056
|
} else if (bkHandle.type === "face") {
|
|
2038
2057
|
result = this.meshSingleFace(h8, deflection, 0);
|
|
2039
2058
|
} else {
|
|
@@ -2874,10 +2893,10 @@ class BrepkitAdapter {
|
|
|
2874
2893
|
return shape2;
|
|
2875
2894
|
}
|
|
2876
2895
|
loftAdvanced(wires, options) {
|
|
2877
|
-
const faceIds = wires.map((
|
|
2878
|
-
const h8 =
|
|
2896
|
+
const faceIds = wires.map((w7) => {
|
|
2897
|
+
const h8 = w7;
|
|
2879
2898
|
if (h8.type === "wire") return this.bk.makeFaceFromWire(h8.id);
|
|
2880
|
-
return unwrap(
|
|
2899
|
+
return unwrap(w7, "face");
|
|
2881
2900
|
});
|
|
2882
2901
|
try {
|
|
2883
2902
|
const opts = {};
|
|
@@ -2980,12 +2999,14 @@ class BrepkitAdapter {
|
|
|
2980
2999
|
return this.makeFace(wire, true);
|
|
2981
3000
|
}
|
|
2982
3001
|
addHolesInFace(face, holeWires) {
|
|
2983
|
-
const wireIds = holeWires.map((
|
|
3002
|
+
const wireIds = holeWires.map((w7) => unwrap(w7, "wire"));
|
|
2984
3003
|
const id = this.bk.addHolesToFace(unwrap(face, "face"), wireIds);
|
|
2985
3004
|
return faceHandle(id);
|
|
2986
3005
|
}
|
|
2987
|
-
|
|
2988
|
-
|
|
3006
|
+
removeHolesFromFace(face) {
|
|
3007
|
+
const id = this.bk.removeHolesFromFace(unwrap(face, "face"));
|
|
3008
|
+
return faceHandle(id);
|
|
3009
|
+
}
|
|
2989
3010
|
makeFaceOnSurface(_surface, wire) {
|
|
2990
3011
|
return this.makeFace(wire, true);
|
|
2991
3012
|
}
|
|
@@ -3246,9 +3267,25 @@ class BrepkitAdapter {
|
|
|
3246
3267
|
// ═══════════════════════════════════════════════════════════════════════
|
|
3247
3268
|
// Dispose
|
|
3248
3269
|
// ═══════════════════════════════════════════════════════════════════════
|
|
3249
|
-
|
|
3250
|
-
|
|
3251
|
-
|
|
3270
|
+
/**
|
|
3271
|
+
* Create an arena checkpoint. Returns checkpoint index.
|
|
3272
|
+
* Use {@link restoreCheckpoint} to roll back or {@link discardCheckpoint} to keep.
|
|
3273
|
+
*/
|
|
3274
|
+
checkpoint() {
|
|
3275
|
+
return this.bk.checkpoint();
|
|
3276
|
+
}
|
|
3277
|
+
/** Get the current number of active checkpoints. */
|
|
3278
|
+
checkpointCount() {
|
|
3279
|
+
return this.bk.checkpointCount();
|
|
3280
|
+
}
|
|
3281
|
+
/** Restore arena to a checkpoint, freeing all handles created after it. */
|
|
3282
|
+
restoreCheckpoint(cp) {
|
|
3283
|
+
this.bk.restore(cp);
|
|
3284
|
+
}
|
|
3285
|
+
/** Discard a checkpoint without restoring (keep all handles). */
|
|
3286
|
+
discardCheckpoint(cp) {
|
|
3287
|
+
this.bk.discardCheckpoint(cp);
|
|
3288
|
+
}
|
|
3252
3289
|
dispose(_handle) {
|
|
3253
3290
|
}
|
|
3254
3291
|
// ═══════════════════════════════════════════════════════════════════════
|
|
@@ -3875,22 +3912,62 @@ class BrepkitAdapter {
|
|
|
3875
3912
|
}
|
|
3876
3913
|
extractCurve2dFromEdge(edge, face) {
|
|
3877
3914
|
const eid = unwrap(edge, "edge");
|
|
3878
|
-
unwrap(face, "face");
|
|
3915
|
+
const fid = unwrap(face, "face");
|
|
3879
3916
|
const params = this.bk.getEdgeCurveParameters(eid);
|
|
3880
3917
|
const tMin = params[0] ?? 0;
|
|
3881
3918
|
const tMax = params[1] ?? 1;
|
|
3882
|
-
const
|
|
3883
|
-
const
|
|
3884
|
-
|
|
3885
|
-
|
|
3919
|
+
const BASE_N = 20;
|
|
3920
|
+
const MAX_N = 80;
|
|
3921
|
+
const REFINE_THRESHOLD = 0.05;
|
|
3922
|
+
const tValues = [];
|
|
3923
|
+
for (let i7 = 0; i7 <= BASE_N; i7++) {
|
|
3924
|
+
tValues.push(tMin + (tMax - tMin) * i7 / BASE_N);
|
|
3925
|
+
}
|
|
3926
|
+
const evaluateUV = (t11) => {
|
|
3886
3927
|
const pt = this.bk.evaluateEdgeCurve(eid, t11);
|
|
3887
|
-
|
|
3928
|
+
const uv = this.bk.projectPointOnSurface(fid, pt[0], pt[1], pt[2]);
|
|
3929
|
+
return [uv[0], uv[1]];
|
|
3930
|
+
};
|
|
3931
|
+
const uvSamples = tValues.map((t11) => ({
|
|
3932
|
+
t: t11,
|
|
3933
|
+
uv: evaluateUV(t11)
|
|
3934
|
+
}));
|
|
3935
|
+
let refinements = 0;
|
|
3936
|
+
while (uvSamples.length < MAX_N) {
|
|
3937
|
+
const insertions = [];
|
|
3938
|
+
for (let i7 = 0; i7 < uvSamples.length - 1; i7++) {
|
|
3939
|
+
const a9 = uvSamples[i7];
|
|
3940
|
+
const b10 = uvSamples[i7 + 1];
|
|
3941
|
+
const tMid = (a9.t + b10.t) / 2;
|
|
3942
|
+
const uvMid = evaluateUV(tMid);
|
|
3943
|
+
const interpU = (a9.uv[0] + b10.uv[0]) / 2;
|
|
3944
|
+
const interpV = (a9.uv[1] + b10.uv[1]) / 2;
|
|
3945
|
+
const deviation = Math.sqrt((uvMid[0] - interpU) ** 2 + (uvMid[1] - interpV) ** 2);
|
|
3946
|
+
if (deviation > REFINE_THRESHOLD) {
|
|
3947
|
+
insertions.push({ index: i7 + 1, t: tMid, uv: uvMid });
|
|
3948
|
+
}
|
|
3949
|
+
}
|
|
3950
|
+
if (insertions.length === 0) break;
|
|
3951
|
+
let budget = MAX_N - uvSamples.length;
|
|
3952
|
+
for (let j6 = insertions.length - 1; j6 >= 0 && budget > 0; j6--) {
|
|
3953
|
+
const ins = insertions[j6];
|
|
3954
|
+
uvSamples.splice(ins.index, 0, { t: ins.t, uv: ins.uv });
|
|
3955
|
+
budget--;
|
|
3956
|
+
}
|
|
3957
|
+
refinements++;
|
|
3958
|
+
if (refinements > 3) break;
|
|
3888
3959
|
}
|
|
3960
|
+
const uvPoints = uvSamples.map((s6) => s6.uv);
|
|
3889
3961
|
if (uvPoints.length >= 2) {
|
|
3890
3962
|
return this.makeBSpline2d(uvPoints);
|
|
3891
3963
|
}
|
|
3892
3964
|
const verts = this.bk.getEdgeVertices(eid);
|
|
3893
|
-
|
|
3965
|
+
if (verts.length >= 6) {
|
|
3966
|
+
const uv1 = this.bk.projectPointOnSurface(fid, verts[0], verts[1], verts[2]);
|
|
3967
|
+
const uv2 = this.bk.projectPointOnSurface(fid, verts[3], verts[4], verts[5]);
|
|
3968
|
+
return makeLine2d(uv1[0], uv1[1], uv2[0], uv2[1]);
|
|
3969
|
+
}
|
|
3970
|
+
throw new Error(`brepkit: extractCurve2dFromEdge: degenerate edge (${verts.length} coords)`);
|
|
3894
3971
|
}
|
|
3895
3972
|
buildCurves3d(_wire) {
|
|
3896
3973
|
}
|
|
@@ -4007,9 +4084,9 @@ class BrepkitAdapter {
|
|
|
4007
4084
|
return result;
|
|
4008
4085
|
}
|
|
4009
4086
|
/** Tessellate a solid with per-face groups for brepjs mesh format. */
|
|
4010
|
-
meshSolid(solidId, deflection) {
|
|
4087
|
+
meshSolid(solidId, deflection, includeUVs) {
|
|
4011
4088
|
try {
|
|
4012
|
-
return this.meshSolidGrouped(solidId, deflection);
|
|
4089
|
+
return this.meshSolidGrouped(solidId, deflection, includeUVs);
|
|
4013
4090
|
} catch (e8) {
|
|
4014
4091
|
console.warn(
|
|
4015
4092
|
`brepkit: tessellateSolidGrouped failed (solidId=${solidId}), falling back to per-face:`,
|
|
@@ -4021,8 +4098,11 @@ class BrepkitAdapter {
|
|
|
4021
4098
|
/**
|
|
4022
4099
|
* Batch tessellation via `tessellateSolidGrouped` — single WASM call for
|
|
4023
4100
|
* all faces. Falls back to `meshSolidPerFace` on error.
|
|
4101
|
+
*
|
|
4102
|
+
* When `includeUVs` is true, makes an additional `tessellateSolidUV` call
|
|
4103
|
+
* to populate real surface parametrization coordinates.
|
|
4024
4104
|
*/
|
|
4025
|
-
meshSolidGrouped(solidId, deflection) {
|
|
4105
|
+
meshSolidGrouped(solidId, deflection, includeUVs) {
|
|
4026
4106
|
const json = this.bk.tessellateSolidGrouped(solidId, deflection);
|
|
4027
4107
|
const data = JSON.parse(json);
|
|
4028
4108
|
const faceIds = toArray(this.bk.getSolidFaces(solidId));
|
|
@@ -4043,12 +4123,26 @@ class BrepkitAdapter {
|
|
|
4043
4123
|
faceHash: faceIds[i7] ?? 0
|
|
4044
4124
|
});
|
|
4045
4125
|
}
|
|
4126
|
+
let uvs = new Float32Array(0);
|
|
4127
|
+
if (includeUVs) {
|
|
4128
|
+
const expectedUvLen = data.positions.length / 3 * 2;
|
|
4129
|
+
try {
|
|
4130
|
+
const uvJson = this.bk.tessellateSolidUV(solidId, deflection);
|
|
4131
|
+
const uvData = JSON.parse(uvJson);
|
|
4132
|
+
if (uvData.uvs.length === expectedUvLen) {
|
|
4133
|
+
uvs = new Float32Array(uvData.uvs);
|
|
4134
|
+
} else {
|
|
4135
|
+
uvs = new Float32Array(expectedUvLen);
|
|
4136
|
+
}
|
|
4137
|
+
} catch {
|
|
4138
|
+
uvs = new Float32Array(expectedUvLen);
|
|
4139
|
+
}
|
|
4140
|
+
}
|
|
4046
4141
|
return {
|
|
4047
4142
|
vertices: new Float32Array(data.positions),
|
|
4048
4143
|
normals: new Float32Array(data.normals),
|
|
4049
4144
|
triangles: new Uint32Array(data.indices),
|
|
4050
|
-
|
|
4051
|
-
uvs: new Float32Array(0),
|
|
4145
|
+
uvs,
|
|
4052
4146
|
faceGroups
|
|
4053
4147
|
};
|
|
4054
4148
|
}
|
|
@@ -4332,6 +4426,33 @@ class BrepkitAdapter {
|
|
|
4332
4426
|
}
|
|
4333
4427
|
return { point: [0, 0, 0], normal };
|
|
4334
4428
|
}
|
|
4429
|
+
// ═══════════════════════════════════════════════════════════════════════
|
|
4430
|
+
// Constraint sketch solver (brepkit-only capability)
|
|
4431
|
+
// ═══════════════════════════════════════════════════════════════════════
|
|
4432
|
+
/** Create a new constraint sketch. Returns an opaque sketch handle. */
|
|
4433
|
+
sketchNew() {
|
|
4434
|
+
return this.bk.sketchNew();
|
|
4435
|
+
}
|
|
4436
|
+
/** Add a point to a constraint sketch. Returns the point index. */
|
|
4437
|
+
sketchAddPoint(sketch, x7, y6, fixed) {
|
|
4438
|
+
return this.bk.sketchAddPoint(sketch, x7, y6, fixed);
|
|
4439
|
+
}
|
|
4440
|
+
/** Add a constraint to a sketch (JSON-encoded constraint descriptor). */
|
|
4441
|
+
sketchAddConstraint(sketch, constraintJson) {
|
|
4442
|
+
this.bk.sketchAddConstraint(sketch, constraintJson);
|
|
4443
|
+
}
|
|
4444
|
+
/**
|
|
4445
|
+
* Solve sketch constraints. Returns a JSON result with solved point positions.
|
|
4446
|
+
* @param maxIterations — solver iteration limit (e.g. 100)
|
|
4447
|
+
* @param tolerance — convergence tolerance (e.g. 1e-10)
|
|
4448
|
+
*/
|
|
4449
|
+
sketchSolve(sketch, maxIterations, tolerance) {
|
|
4450
|
+
return this.bk.sketchSolve(sketch, maxIterations, tolerance);
|
|
4451
|
+
}
|
|
4452
|
+
/** Get degrees of freedom remaining in a solved or partially-constrained sketch. */
|
|
4453
|
+
sketchDof(sketch) {
|
|
4454
|
+
return this.bk.sketchDof(sketch);
|
|
4455
|
+
}
|
|
4335
4456
|
}
|
|
4336
4457
|
function multiplyMatrices(a9, b10) {
|
|
4337
4458
|
const result = new Array(16).fill(0);
|
|
@@ -4663,14 +4784,14 @@ async function surfaceFromImage(blob, options = {}) {
|
|
|
4663
4784
|
)
|
|
4664
4785
|
);
|
|
4665
4786
|
}
|
|
4666
|
-
const
|
|
4787
|
+
const w7 = bitmap.width;
|
|
4667
4788
|
const h8 = bitmap.height;
|
|
4668
|
-
if (
|
|
4789
|
+
if (w7 < 2 || h8 < 2) {
|
|
4669
4790
|
bitmap.close();
|
|
4670
4791
|
return err(
|
|
4671
4792
|
validationError(
|
|
4672
4793
|
BrepErrorCode.SURFACE_GRID_TOO_SMALL,
|
|
4673
|
-
`surfaceFromImage: image too small (${
|
|
4794
|
+
`surfaceFromImage: image too small (${w7}x${h8}), need at least 2x2`
|
|
4674
4795
|
)
|
|
4675
4796
|
);
|
|
4676
4797
|
}
|
|
@@ -4683,7 +4804,7 @@ async function surfaceFromImage(blob, options = {}) {
|
|
|
4683
4804
|
)
|
|
4684
4805
|
);
|
|
4685
4806
|
}
|
|
4686
|
-
const canvas = new OffscreenCanvas(
|
|
4807
|
+
const canvas = new OffscreenCanvas(w7, h8);
|
|
4687
4808
|
const ctx = canvas.getContext("2d");
|
|
4688
4809
|
if (!ctx) {
|
|
4689
4810
|
bitmap.close();
|
|
@@ -4693,13 +4814,13 @@ async function surfaceFromImage(blob, options = {}) {
|
|
|
4693
4814
|
}
|
|
4694
4815
|
ctx.drawImage(bitmap, 0, 0);
|
|
4695
4816
|
bitmap.close();
|
|
4696
|
-
const imageData = ctx.getImageData(0, 0,
|
|
4817
|
+
const imageData = ctx.getImageData(0, 0, w7, h8);
|
|
4697
4818
|
const data = imageData.data;
|
|
4698
4819
|
const rows = [];
|
|
4699
4820
|
for (let y6 = 0; y6 < h8; y6 += downsample) {
|
|
4700
4821
|
const row = [];
|
|
4701
|
-
for (let x7 = 0; x7 <
|
|
4702
|
-
const idx = (y6 *
|
|
4822
|
+
for (let x7 = 0; x7 < w7; x7 += downsample) {
|
|
4823
|
+
const idx = (y6 * w7 + x7) * 4;
|
|
4703
4824
|
const r9 = data[idx] ?? 0;
|
|
4704
4825
|
const g12 = data[idx + 1] ?? 0;
|
|
4705
4826
|
const b10 = data[idx + 2] ?? 0;
|
|
@@ -5359,8 +5480,8 @@ function computeStraightSkeleton(polygon) {
|
|
|
5359
5480
|
}
|
|
5360
5481
|
return { nodes: uniqueNodes, faces };
|
|
5361
5482
|
}
|
|
5362
|
-
function extractPolygon(
|
|
5363
|
-
const edges = getEdges(
|
|
5483
|
+
function extractPolygon(w7) {
|
|
5484
|
+
const edges = getEdges(w7);
|
|
5364
5485
|
const pts = edges.map((e8) => {
|
|
5365
5486
|
const pt = curveStartPoint(e8);
|
|
5366
5487
|
return { x: pt[0], y: pt[1] };
|
|
@@ -5439,11 +5560,11 @@ function earClipTriangulate(poly) {
|
|
|
5439
5560
|
}
|
|
5440
5561
|
return tris;
|
|
5441
5562
|
}
|
|
5442
|
-
function roof(
|
|
5563
|
+
function roof(w7, options) {
|
|
5443
5564
|
const angle = (options?.angle ?? 45) * (Math.PI / 180);
|
|
5444
5565
|
const tanAngle = Math.tan(angle);
|
|
5445
5566
|
try {
|
|
5446
|
-
const polygon = extractPolygon(
|
|
5567
|
+
const polygon = extractPolygon(w7);
|
|
5447
5568
|
if (polygon.length < 3) {
|
|
5448
5569
|
return err(
|
|
5449
5570
|
kernelError(
|
|
@@ -6506,7 +6627,7 @@ function loft$1(wires, { ruled = true, startPoint, endPoint, tolerance = 1e-6 }
|
|
|
6506
6627
|
const endVertex = endPoint ? kernel.makeVertex(...toVec3(endPoint)) : void 0;
|
|
6507
6628
|
try {
|
|
6508
6629
|
const shape2 = kernel.loftAdvanced(
|
|
6509
|
-
wires.map((
|
|
6630
|
+
wires.map((w7) => w7.wrapped),
|
|
6510
6631
|
{
|
|
6511
6632
|
solid: !returnShell,
|
|
6512
6633
|
ruled,
|
|
@@ -6539,7 +6660,7 @@ function revolve(face, options) {
|
|
|
6539
6660
|
);
|
|
6540
6661
|
}
|
|
6541
6662
|
function loft(wires, options) {
|
|
6542
|
-
const resolvedWires = wires.map((
|
|
6663
|
+
const resolvedWires = wires.map((w7) => resolve(w7));
|
|
6543
6664
|
return loft$1(resolvedWires, options);
|
|
6544
6665
|
}
|
|
6545
6666
|
function resolveTargetFace(shape2, faceSpec) {
|
|
@@ -6636,8 +6757,8 @@ function pocket(shape2, options) {
|
|
|
6636
6757
|
if (isErr(targetResult)) return targetResult;
|
|
6637
6758
|
const targetFace = targetResult.value;
|
|
6638
6759
|
const normal = normalAt(targetFace);
|
|
6639
|
-
const
|
|
6640
|
-
const faceResult = makeFace(
|
|
6760
|
+
const w7 = toWire(profile);
|
|
6761
|
+
const faceResult = makeFace(w7);
|
|
6641
6762
|
if (isErr(faceResult)) return faceResult;
|
|
6642
6763
|
const extDir = vecScale(vecNormalize(normal), -depth);
|
|
6643
6764
|
const toolResult = extrude$1(faceResult.value, extDir);
|
|
@@ -6654,8 +6775,8 @@ function boss(shape2, options) {
|
|
|
6654
6775
|
if (isErr(targetResult)) return targetResult;
|
|
6655
6776
|
const targetFace = targetResult.value;
|
|
6656
6777
|
const normal = normalAt(targetFace);
|
|
6657
|
-
const
|
|
6658
|
-
const faceResult = makeFace(
|
|
6778
|
+
const w7 = toWire(profile);
|
|
6779
|
+
const faceResult = makeFace(w7);
|
|
6659
6780
|
if (isErr(faceResult)) return faceResult;
|
|
6660
6781
|
const extDir = vecScale(vecNormalize(normal), height);
|
|
6661
6782
|
const toolResult = extrude$1(faceResult.value, extDir);
|
|
@@ -6823,8 +6944,8 @@ function createWrappedCurve(val) {
|
|
|
6823
6944
|
isClosed: () => curveIsClosed(val),
|
|
6824
6945
|
sweep(spine, opts) {
|
|
6825
6946
|
if (!isWire(val)) throw new Error("sweep requires a Wire");
|
|
6826
|
-
const
|
|
6827
|
-
const result = unwrapOrThrow(sweep(
|
|
6947
|
+
const w7 = val;
|
|
6948
|
+
const result = unwrapOrThrow(sweep(w7, resolve(spine), opts));
|
|
6828
6949
|
const shape3D = Array.isArray(result) ? result[0] : result;
|
|
6829
6950
|
return wrap3D(shape3D);
|
|
6830
6951
|
}
|
|
@@ -7201,6 +7322,7 @@ export {
|
|
|
7201
7322
|
v4 as registerShape,
|
|
7202
7323
|
rejectAll,
|
|
7203
7324
|
x3 as removeChild,
|
|
7325
|
+
v8 as removeHolesFromFace,
|
|
7204
7326
|
y2 as replayFrom,
|
|
7205
7327
|
z2 as replayHistory,
|
|
7206
7328
|
C7 as resize,
|
|
@@ -7226,7 +7348,7 @@ export {
|
|
|
7226
7348
|
u4 as setTagMetadata,
|
|
7227
7349
|
B6 as sewShells,
|
|
7228
7350
|
shape,
|
|
7229
|
-
|
|
7351
|
+
w6 as shapeType,
|
|
7230
7352
|
C8 as sharedEdges,
|
|
7231
7353
|
shell,
|
|
7232
7354
|
simplify,
|
|
@@ -7258,6 +7380,7 @@ export {
|
|
|
7258
7380
|
stretch2D,
|
|
7259
7381
|
F5 as subFace,
|
|
7260
7382
|
D3 as supportExtrude,
|
|
7383
|
+
supportsConstraintSketch,
|
|
7261
7384
|
supportsProjection,
|
|
7262
7385
|
surfaceFromGrid,
|
|
7263
7386
|
surfaceFromImage,
|
package/dist/core.cjs
CHANGED
|
@@ -4,7 +4,7 @@ const types = require("./types-CA_xrgDq.cjs");
|
|
|
4
4
|
const vecOps = require("./vecOps-CjRL1jau.cjs");
|
|
5
5
|
const errors = require("./errors-9fDehDNc.cjs");
|
|
6
6
|
const vectors = require("./vectors-TlfO1hu2.cjs");
|
|
7
|
-
const shapeTypes = require("./shapeTypes-
|
|
7
|
+
const shapeTypes = require("./shapeTypes-DTGA0liC.cjs");
|
|
8
8
|
const result = require("./result.cjs");
|
|
9
9
|
exports.resolveDirection = types.resolveDirection;
|
|
10
10
|
exports.toVec2 = types.toVec2;
|
package/dist/core.js
CHANGED
|
@@ -2,7 +2,7 @@ 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
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, y } from "./errors-B7kgv0cd.js";
|
|
4
4
|
import { c as c3, a as a4, p as p2, r as r3, t as t3 } from "./vectors-cec8p8NQ.js";
|
|
5
|
-
import { D as D2, c as c4, a as a5, b as b3, d as d3, g as g3, i as i3, e as e3, f as f3, h as h3, j as j3, k as k3, l as l3, m as m3, n as n3, o as o3, p as p3, q as q2, r as r4, s as s2, t as t4, u as u2, v as v3, w as w2, x as x2, y as y2, z, A } from "./shapeTypes-
|
|
5
|
+
import { D as D2, c as c4, a as a5, b as b3, d as d3, g as g3, i as i3, e as e3, f as f3, h as h3, j as j3, k as k3, l as l3, m as m3, n as n3, o as o3, p as p3, q as q2, r as r4, s as s2, t as t4, u as u2, v as v3, w as w2, x as x2, y as y2, z, A } from "./shapeTypes-5DPsHB8i.js";
|
|
6
6
|
import { BrepBugError, bug } from "./result.js";
|
|
7
7
|
export {
|
|
8
8
|
BrepBugError,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { D as DEG2RAD } from "./vecOps-ZDdZWbwT.js";
|
|
2
|
-
import { a as angle2d, s as samePoint, d as distance2d } from "./helpers-
|
|
2
|
+
import { a as angle2d, s as samePoint, d as distance2d } from "./helpers-F_D1WON3.js";
|
|
3
3
|
const PI_2 = 2 * Math.PI;
|
|
4
4
|
function positiveHalfAngle(angle) {
|
|
5
5
|
const limitedAngle = angle % PI_2;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const vecOps = require("./vecOps-CjRL1jau.cjs");
|
|
3
|
-
const helpers = require("./helpers-
|
|
3
|
+
const helpers = require("./helpers-3fsqd4mW.cjs");
|
|
4
4
|
const PI_2 = 2 * Math.PI;
|
|
5
5
|
function positiveHalfAngle(angle) {
|
|
6
6
|
const limitedAngle = angle % PI_2;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as getKernel, c as castShape, j as isEdge, u as isWire } from "./shapeTypes-
|
|
1
|
+
import { B as getKernel, c as castShape, j as isEdge, u as isWire } from "./shapeTypes-5DPsHB8i.js";
|
|
2
2
|
import { e as err, p as typeCastError, o as ok } from "./errors-B7kgv0cd.js";
|
|
3
3
|
function getCurveType(shape) {
|
|
4
4
|
return getKernel().curveType(shape.wrapped);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const shapeTypes = require("./shapeTypes-
|
|
2
|
+
const shapeTypes = require("./shapeTypes-DTGA0liC.cjs");
|
|
3
3
|
const errors = require("./errors-9fDehDNc.cjs");
|
|
4
4
|
function getCurveType(shape) {
|
|
5
5
|
return shapeTypes.getKernel().curveType(shape.wrapped);
|
|
@@ -48,19 +48,19 @@ const errors = require("./errors-9fDehDNc.cjs");
|
|
|
48
48
|
const vectors = require("./vectors-TlfO1hu2.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-
|
|
55
|
-
const shapeTypes = require("./shapeTypes-
|
|
56
|
-
const Blueprint = require("./Blueprint-
|
|
51
|
+
const boolean2D = require("./boolean2D-Bl4iyJfa.cjs");
|
|
52
|
+
const faceFns = require("./faceFns-SVADeb01.cjs");
|
|
53
|
+
const curveFns = require("./curveFns-p0x8jy0i.cjs");
|
|
54
|
+
const surfaceBuilders = require("./surfaceBuilders-tYoe8sri.cjs");
|
|
55
|
+
const shapeTypes = require("./shapeTypes-DTGA0liC.cjs");
|
|
56
|
+
const Blueprint = require("./Blueprint-Bh6166KA.cjs");
|
|
57
57
|
const result = require("./result.cjs");
|
|
58
|
-
const helpers = require("./helpers-
|
|
59
|
-
const shapeFns = require("./shapeFns-
|
|
60
|
-
const solidBuilders = require("./solidBuilders-
|
|
61
|
-
const loft = require("./loft-
|
|
58
|
+
const helpers = require("./helpers-3fsqd4mW.cjs");
|
|
59
|
+
const shapeFns = require("./shapeFns-BoN5g5Bx.cjs");
|
|
60
|
+
const solidBuilders = require("./solidBuilders-CUc2rvWv.cjs");
|
|
61
|
+
const loft = require("./loft-98s9uwpg.cjs");
|
|
62
62
|
const opentype = require("opentype.js");
|
|
63
|
-
const cornerFinder = require("./cornerFinder-
|
|
63
|
+
const cornerFinder = require("./cornerFinder-zd2oBgyp.cjs");
|
|
64
64
|
const stitchCurves = (curves, precision = 1e-7) => {
|
|
65
65
|
const startPoints = new boolean2D.Flatbush(curves.length);
|
|
66
66
|
curves.forEach((c) => {
|
|
@@ -47,19 +47,19 @@ import { r as unwrap, g as isOk, e as err, y as validationError, o as ok } from
|
|
|
47
47
|
import { r as resolvePlane, b as planeToWorld, d as planeToLocal } from "./vectors-cec8p8NQ.js";
|
|
48
48
|
import { a as toVec3 } from "./types-CWDdqcrq.js";
|
|
49
49
|
import { n as vecScale, j as vecNormalize, v as vecAdd, o as vecSub, b as vecCross, m as vecRotate, R as RAD2DEG, g as vecLength, e as vecEquals, D as DEG2RAD } from "./vecOps-ZDdZWbwT.js";
|
|
50
|
-
import { b as Flatbush, c as convertSvgEllipseParams, d as defaultsSplineOptions, S as Sketch, r as roundedRectangleBlueprint, e as Blueprints, C as CompoundBlueprint, f as cut2D, i as intersectCurves, g as fuse2D, m as make2dOffset, h as filletCurves, j as chamferCurves, o as organiseBlueprints, a as BlueprintSketcher, k as intersect2D, B as BaseSketcher2d, p as polysidesBlueprint } from "./boolean2D-
|
|
51
|
-
import { d as downcast, c as cast, e as faceCenter, n as normalAt, o as outerWire } from "./faceFns-
|
|
52
|
-
import { c as curveTangentAt, a as curveEndPoint, f as flipOrientation, b as getCurveType, o as offsetWire2D } from "./curveFns-
|
|
53
|
-
import { a as makeLine, d as makeThreePointArc, e as makeTangentArc, f as makeEllipseArc, g as makeBezierCurve, b as assembleWire, h as addHolesInFace, m as makeFace, i as makeCircle, j as makeEllipse, c as makeHelix, k as makeBSplineApproximation } from "./surfaceBuilders-
|
|
54
|
-
import { D as DisposalScope, B as getKernel, G as createWire, I as createFace, k as isFace, c as castShape } from "./shapeTypes-
|
|
55
|
-
import { m as mirror, B as Blueprint, C as Curve2D, a as make2dSegmentCurve, b as make2dArcFromCenter, c as approximateAsSvgCompatibleCurve, d as BoundingBox2d, e as edgeToCurve, f as make2dInerpolatedBSplineCurve, g as make2dCircle, h as make2dEllipse, i as deserializeCurve2D } from "./Blueprint-
|
|
50
|
+
import { b as Flatbush, c as convertSvgEllipseParams, d as defaultsSplineOptions, S as Sketch, r as roundedRectangleBlueprint, e as Blueprints, C as CompoundBlueprint, f as cut2D, i as intersectCurves, g as fuse2D, m as make2dOffset, h as filletCurves, j as chamferCurves, o as organiseBlueprints, a as BlueprintSketcher, k as intersect2D, B as BaseSketcher2d, p as polysidesBlueprint } from "./boolean2D-D2s-G0Wm.js";
|
|
51
|
+
import { d as downcast, c as cast, e as faceCenter, n as normalAt, o as outerWire } from "./faceFns-CvR-ZEQA.js";
|
|
52
|
+
import { c as curveTangentAt, a as curveEndPoint, f as flipOrientation, b as getCurveType, o as offsetWire2D } from "./curveFns-DyVPTb1r.js";
|
|
53
|
+
import { a as makeLine, d as makeThreePointArc, e as makeTangentArc, f as makeEllipseArc, g as makeBezierCurve, b as assembleWire, h as addHolesInFace, m as makeFace, i as makeCircle, j as makeEllipse, c as makeHelix, k as makeBSplineApproximation } from "./surfaceBuilders-CXbEDGBQ.js";
|
|
54
|
+
import { D as DisposalScope, B as getKernel, G as createWire, I as createFace, k as isFace, c as castShape } from "./shapeTypes-5DPsHB8i.js";
|
|
55
|
+
import { m as mirror, B as Blueprint, C as Curve2D, a as make2dSegmentCurve, b as make2dArcFromCenter, c as approximateAsSvgCompatibleCurve, d as BoundingBox2d, e as edgeToCurve, f as make2dInerpolatedBSplineCurve, g as make2dCircle, h as make2dEllipse, i as deserializeCurve2D } from "./Blueprint-BBLKmtl9.js";
|
|
56
56
|
import { bug } from "./result.js";
|
|
57
|
-
import { d as distance2d, p as polarAngle2d, f as polarToCartesian, P as PRECISION_OFFSET, h as squareDistance2d, s as samePoint$1, e as subtract2d, c as add2d } from "./helpers-
|
|
58
|
-
import { d as getEdges } from "./shapeFns-
|
|
59
|
-
import { a as makeCompound, b as makeSolid } from "./solidBuilders-
|
|
60
|
-
import { b as basicFaceExtrusion, r as revolution, c as complexExtrude, t as twistExtrude } from "./loft-
|
|
57
|
+
import { d as distance2d, p as polarAngle2d, f as polarToCartesian, P as PRECISION_OFFSET, h as squareDistance2d, s as samePoint$1, e as subtract2d, c as add2d } from "./helpers-F_D1WON3.js";
|
|
58
|
+
import { d as getEdges } from "./shapeFns-38GljA_p.js";
|
|
59
|
+
import { a as makeCompound, b as makeSolid } from "./solidBuilders-BWkneWjU.js";
|
|
60
|
+
import { b as basicFaceExtrusion, r as revolution, c as complexExtrude, t as twistExtrude } from "./loft-BvZFfPqO.js";
|
|
61
61
|
import opentype from "opentype.js";
|
|
62
|
-
import { c as cornerFinder } from "./cornerFinder-
|
|
62
|
+
import { c as cornerFinder } from "./cornerFinder-C-o3TN3q.js";
|
|
63
63
|
const stitchCurves = (curves, precision = 1e-7) => {
|
|
64
64
|
const startPoints = new Flatbush(curves.length);
|
|
65
65
|
curves.forEach((c) => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as getKernel, c as castShape, p as isShape3D$1, u as isWire$1 } from "./shapeTypes-
|
|
1
|
+
import { B as getKernel, c as castShape, p as isShape3D$1, u as isWire$1 } from "./shapeTypes-5DPsHB8i.js";
|
|
2
2
|
import { a as toVec3 } from "./types-CWDdqcrq.js";
|
|
3
3
|
import { e as err, p as typeCastError, o as ok, r as unwrap } from "./errors-B7kgv0cd.js";
|
|
4
4
|
const TOPO_ENUM = {
|
|
@@ -160,6 +160,9 @@ function classifyPointOnFace(face, point, tolerance = 1e-6) {
|
|
|
160
160
|
function outerWire(face) {
|
|
161
161
|
return castShape(getKernel().outerWire(face.wrapped));
|
|
162
162
|
}
|
|
163
|
+
function removeHolesFromFace(face) {
|
|
164
|
+
return castShape(getKernel().removeHolesFromFace(face.wrapped));
|
|
165
|
+
}
|
|
163
166
|
function innerWires(face) {
|
|
164
167
|
const outer = outerWire(face);
|
|
165
168
|
const allWires = Array.from(iterTopo(face.wrapped, "wire")).map(
|
|
@@ -190,5 +193,6 @@ export {
|
|
|
190
193
|
isCompSolid as s,
|
|
191
194
|
projectPointOnFace as t,
|
|
192
195
|
uvBounds as u,
|
|
193
|
-
|
|
196
|
+
removeHolesFromFace as v,
|
|
197
|
+
shapeType as w
|
|
194
198
|
};
|