brepjs 8.2.0 → 8.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/lib/Curve2D.d.ts.map +1 -1
- package/dist/2d.cjs +2 -2
- package/dist/2d.js +3 -3
- package/dist/{Blueprint-D_luVeES.js → Blueprint-Bp45tnh0.js} +16 -12
- package/dist/{Blueprint-CTAwjJMN.cjs → Blueprint-zgFe_5Qj.cjs} +17 -13
- package/dist/{boolean2D-B5axNhjN.cjs → boolean2D-CfEbRMPF.cjs} +11 -11
- package/dist/{boolean2D-vw76Gayn.js → boolean2D-DN6ETTCq.js} +11 -11
- package/dist/{booleanFns-Yc3EBxdm.cjs → booleanFns-5dDG0jpA.cjs} +46 -9
- package/dist/{booleanFns-BhqXpQoZ.js → booleanFns-C-M6qqvB.js} +46 -9
- package/dist/brepjs.cjs +364 -109
- package/dist/brepjs.js +433 -177
- package/dist/{cast-C107o5ow.cjs → cast-CPNOTNFm.cjs} +3 -3
- package/dist/{cast-D0OhP1nV.js → cast-Cerqtxtb.js} +3 -3
- package/dist/core/errors.d.ts +7 -0
- package/dist/core/errors.d.ts.map +1 -1
- package/dist/core.cjs +4 -4
- package/dist/core.js +4 -4
- package/dist/{cornerFinder-DuStF5jK.cjs → cornerFinder-BQ-_VJx0.cjs} +1 -1
- package/dist/{cornerFinder-CPm2baSJ.js → cornerFinder-CC_MunIh.js} +1 -1
- package/dist/{curveBuilders-CN72XaIQ.js → curveBuilders-BREwqvuc.js} +3 -3
- package/dist/{curveBuilders-Du03_Yyf.cjs → curveBuilders-BkEJ-RVn.cjs} +3 -3
- package/dist/curveFns-VMxgfkqw.cjs +177 -0
- package/dist/curveFns-ZuQUBZvd.js +178 -0
- package/dist/{drawFns-CzBbcoXA.js → drawFns-BbhX1IUq.js} +19 -15
- package/dist/{drawFns-CiNxPu6J.cjs → drawFns-CKaHgGSK.cjs} +22 -18
- package/dist/{errors-wGhcJMpB.js → errors-CSYOlCCR.js} +10 -1
- package/dist/{errors-DK1VAdP4.cjs → errors-D13q2HCk.cjs} +10 -1
- package/dist/{faceFns-ub3CugDN.js → faceFns-CfJIbHY3.js} +4 -4
- package/dist/{faceFns-D1Sqnlu6.cjs → faceFns-es3GENII.cjs} +4 -4
- package/dist/{helpers-Dje6wrKi.cjs → helpers-C0q_FVxq.cjs} +10 -10
- package/dist/{helpers-BSQfs538.js → helpers-CmVkMubc.js} +7 -7
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/io.cjs +5 -5
- package/dist/io.js +5 -5
- package/dist/kernel/hullOps.d.ts +22 -0
- package/dist/kernel/hullOps.d.ts.map +1 -0
- package/dist/kernel/occtAdapter.d.ts +6 -0
- package/dist/kernel/occtAdapter.d.ts.map +1 -1
- package/dist/kernel/types.d.ts +6 -0
- package/dist/kernel/types.d.ts.map +1 -1
- package/dist/{loft-PMRx9iMG.cjs → loft-B-UCPW9P.cjs} +5 -5
- package/dist/{loft-BHn7GKm8.js → loft-oJq2OD3A.js} +5 -5
- package/dist/{measurement-B06hNs89.cjs → measurement-CYmT-C77.cjs} +3 -3
- package/dist/{measurement-BfhEneUl.js → measurement-Cf_SoIiR.js} +3 -3
- package/dist/measurement.cjs +1 -1
- package/dist/measurement.js +1 -1
- package/dist/{meshFns-BKSPaPXS.js → meshFns-CqNwW0PO.js} +6 -3
- package/dist/{meshFns-CFVxKBlE.cjs → meshFns-DDC_2U81.cjs} +6 -3
- package/dist/{occtBoundary-BFAaUtA7.cjs → occtBoundary-CocN2VKx.cjs} +419 -2
- package/dist/{occtBoundary-CoXB2xvx.js → occtBoundary-D_gjqgzo.js} +419 -2
- package/dist/{operations-CjQHEu1h.js → operations-6hdpuYmY.js} +6 -6
- package/dist/{operations-CdGb6IBU.cjs → operations-BQeW_DSM.cjs} +6 -6
- package/dist/operations.cjs +2 -2
- package/dist/operations.js +2 -2
- package/dist/query.cjs +5 -5
- package/dist/query.js +6 -6
- package/dist/result.cjs +1 -1
- package/dist/result.js +1 -1
- package/dist/{curveFns-ByeCqutv.cjs → shapeFns-B0zSdO9c.cjs} +98 -177
- package/dist/{curveFns-C5gSZ5EY.js → shapeFns-k1YHFwmB.js} +117 -196
- package/dist/{shapeTypes-UqVCIO_T.cjs → shapeTypes-BxVxLdiD.cjs} +1 -1
- package/dist/{shapeTypes-BU2LKv2S.js → shapeTypes-c-_pgYCx.js} +1 -1
- package/dist/sketching.cjs +2 -2
- package/dist/sketching.js +2 -2
- package/dist/text/textBlueprints.d.ts.map +1 -1
- package/dist/topology/booleanFns.d.ts.map +1 -1
- package/dist/topology/hullFns.d.ts +16 -0
- package/dist/topology/hullFns.d.ts.map +1 -0
- package/dist/topology/meshFns.d.ts +1 -0
- package/dist/topology/meshFns.d.ts.map +1 -1
- package/dist/topology/minkowskiFns.d.ts +20 -0
- package/dist/topology/minkowskiFns.d.ts.map +1 -0
- package/dist/topology/modifierFns.d.ts.map +1 -1
- package/dist/topology/shapeFns.d.ts +30 -0
- package/dist/topology/shapeFns.d.ts.map +1 -1
- package/dist/{topology-D8Au8q4i.cjs → topology-CycEc6Oe.cjs} +14 -13
- package/dist/{topology-BFB3LI_y.js → topology-tMKHJgw2.js} +9 -8
- package/dist/topology.cjs +34 -33
- package/dist/topology.js +59 -58
- package/dist/{vectors-BhfKwL9J.js → vectors-DE0XriuQ.js} +2 -2
- package/dist/{vectors-t1XG4LpL.cjs → vectors-DVmHF4zt.cjs} +2 -2
- package/dist/vectors.cjs +2 -2
- package/dist/vectors.js +2 -2
- package/package.json +5 -5
package/dist/brepjs.js
CHANGED
|
@@ -1,42 +1,44 @@
|
|
|
1
|
-
import { g as getKernel, b as toOcPnt, a as toVec3 } from "./occtBoundary-
|
|
2
|
-
import { f, h, i, j, r, c, t, w, k, l } from "./occtBoundary-
|
|
3
|
-
import { l as ok, y as translateOcctError, e as err, q as queryError,
|
|
4
|
-
import { O, a, c as c2, b, f as f2, i as i2, g, m, h as h2, j as j2, k as k2, z, s, t as t2, n, r as r2, v, w as w2 } from "./errors-
|
|
5
|
-
import { c as castShape,
|
|
6
|
-
import { D, q, o, u, a as a2, b as b2, v as v2, r as r3, n as n2, x, g as g2, i as i3, f as f3, j as j3,
|
|
1
|
+
import { g as getKernel, b as toOcPnt, a as toVec3 } from "./occtBoundary-D_gjqgzo.js";
|
|
2
|
+
import { f, h, i, j, r, c, t, w, k, l } from "./occtBoundary-D_gjqgzo.js";
|
|
3
|
+
import { l as ok, y as translateOcctError, e as err, q as queryError, x as validationError, B as BrepErrorCode, d as isErr, o as occtError, p as typeCastError, u as unwrap } from "./errors-CSYOlCCR.js";
|
|
4
|
+
import { O, a, c as c2, b, f as f2, i as i2, g, m, h as h2, j as j2, k as k2, z, s, t as t2, n, r as r2, v, w as w2 } from "./errors-CSYOlCCR.js";
|
|
5
|
+
import { c as castShape, k as isSolid, h as isShape3D, p as gcWithScope, s as createSolid, e as isFace, d as isEdge, m as isWire } from "./shapeTypes-c-_pgYCx.js";
|
|
6
|
+
import { D, q, o, u, a as a2, b as b2, v as v2, r as r3, n as n2, x, g as g2, i as i3, f as f3, j as j3, l as l2, t as t3, w as w3 } from "./shapeTypes-c-_pgYCx.js";
|
|
7
7
|
import { c as vecDistance, D as DEG2RAD, n as vecScale, j as vecNormalize, f as vecIsZero } from "./vecOps-ZDdZWbwT.js";
|
|
8
|
-
import { H, R, v as v3, a as a3, b as b3, d, e, g as g3, h as h3, i as i4, k as
|
|
9
|
-
import { a as addHolesInFace, m as makeFace, b as makeNonPlanarFace, c as makePolygon, d as makeNewFaceWithinFace } from "./Blueprint-
|
|
10
|
-
import { B, e as e2, C, f as f4, g as g4 } from "./Blueprint-
|
|
11
|
-
import { c as curveIsClosed,
|
|
12
|
-
import {
|
|
13
|
-
import { m as makeCompound, a as makeCone, b as makeCylinder, c as makeEllipsoid, d as makeOffset, w as weldShellsAndFaces, e as makeSolid, f as makeSphere, g as makeTorus, h as makeVertex } from "./loft-
|
|
14
|
-
import { i as i6, j as
|
|
15
|
-
import { e as extrude$1, r as revolve$1, s as sweep, c as circularPattern, l as linearPattern } from "./operations-
|
|
16
|
-
import { a as a4, b as b4, d as d2, f as f5, g as g6, h as
|
|
17
|
-
import { B as
|
|
8
|
+
import { H, R, v as v3, a as a3, b as b3, d, e, g as g3, h as h3, i as i4, k as k3, l as l3, m as m2, o as o2 } from "./vecOps-ZDdZWbwT.js";
|
|
9
|
+
import { a as addHolesInFace, m as makeFace, b as makeNonPlanarFace, c as makePolygon, d as makeNewFaceWithinFace } from "./Blueprint-Bp45tnh0.js";
|
|
10
|
+
import { B, e as e2, C, f as f4, g as g4 } from "./Blueprint-Bp45tnh0.js";
|
|
11
|
+
import { c as curveIsClosed, a as curveTangentAt, b as curvePointAt, d as curveEndPoint, e as curveStartPoint, f as curveLength } from "./curveFns-ZuQUBZvd.js";
|
|
12
|
+
import { g as g5, h as h4, i as i5, j as j4, k as k4, l as l4, m as m3, n as n3, o as o3 } from "./curveFns-ZuQUBZvd.js";
|
|
13
|
+
import { m as makeCompound, a as makeCone, b as makeCylinder, c as makeEllipsoid, d as makeOffset, w as weldShellsAndFaces, e as makeSolid, f as makeSphere, g as makeTorus, h as makeVertex } from "./loft-oJq2OD3A.js";
|
|
14
|
+
import { i as i6, j as j5, r as r4 } from "./loft-oJq2OD3A.js";
|
|
15
|
+
import { e as extrude$1, r as revolve$1, s as sweep, c as circularPattern, l as linearPattern } from "./operations-6hdpuYmY.js";
|
|
16
|
+
import { a as a4, b as b4, d as d2, f as f5, g as g6, h as h5, i as i7, j as j6, k as k5, m as m4, n as n4, o as o4, p, q as q2, t as t4, u as u2, v as v4, w as w4, x as x2, y, z as z2, A, B as B2, C as C2, D as D2, E } from "./operations-6hdpuYmY.js";
|
|
17
|
+
import { B as B3, a as a5, b as b5, C as C3, F, S, c as c3, d as d3, f as f6, e as e3, i as i8, g as g7, o as o5, p as p2, r as r5 } from "./boolean2D-DN6ETTCq.js";
|
|
18
18
|
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";
|
|
19
|
-
import { c as createTypedFinder, f as faceFinder } from "./helpers-
|
|
20
|
-
import { g as g8 } from "./helpers-
|
|
19
|
+
import { c as createTypedFinder, f as faceFinder } from "./helpers-CmVkMubc.js";
|
|
20
|
+
import { g as g8 } from "./helpers-CmVkMubc.js";
|
|
21
21
|
import { blueprintToDXF, exportDXF, exportGlb, exportGltf, exportOBJ, exportThreeMF, importIGES, importSTEP, importSTL, importSVG, importSVGPathD } from "./io.js";
|
|
22
|
-
import { C as
|
|
23
|
-
import { c as c5, a as a7, p as p4, r as r7, t as t6 } from "./vectors-
|
|
24
|
-
import { c as
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import { c as
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
22
|
+
import { C as C4, D as D3, a as a6, S as S2, b as b6, X, Y, c as c4, d as d4, e as e4, f as f7, Z, g as g9, h as h6, i as i9, j as j7, k as k6, l as l5, m as m5, n as n5, o as o6, p as p3, q as q3, r as r6, s as s2, t as t5, u as u3, v as v5, w as w5, x as x3, y as y2, z as z3, _, $, a0, A as A2, a1, B as B4, E as E2, a2 as a22, F as F2, G, H as H2, I, J, K, L, M, N, O as O2, P, Q, R as R2, T, U, a3 as a32, V, a4 as a42, W } from "./drawFns-BbhX1IUq.js";
|
|
23
|
+
import { c as c5, a as a7, p as p4, r as r7, t as t6 } from "./vectors-DE0XriuQ.js";
|
|
24
|
+
import { v as vertexPosition, c as getFaces, d as getVertices, t as translate$1, e as getEdges, p as propagateOrigins, f as applyMatrix$1, h as clone$1, j as describe$1, k as isEmpty$1, m as mirror$1, r as rotate$1, s as scale$1, l as simplify$1, n as toBREP$1, o as transformCopy$1, q as getBounds, u as getWires } from "./shapeFns-k1YHFwmB.js";
|
|
25
|
+
import { w as w6, g as g10, b as b7, x as x4, i as i10, y as y3, z as z4, A as A3, B as B5, C as C5 } from "./shapeFns-k1YHFwmB.js";
|
|
26
|
+
import { c as chamferDistAngle, h as heal$1, i as isValid$1 } from "./topology-tMKHJgw2.js";
|
|
27
|
+
import { a as a8, b as b8, e as e5, f as f8, d as d5, g as g11, j as j8, s as s3, t as t7, k as k7, l as l6, v as v6, w as w7 } from "./topology-tMKHJgw2.js";
|
|
28
|
+
import { n as normalAt, f as faceCenter, i as innerWires, o as outerWire, g as getSurfaceType } from "./faceFns-CfJIbHY3.js";
|
|
29
|
+
import { c as c6, a as a9, b as b9, d as d6, p as p5, e as e6, u as u4, h as h7 } from "./faceFns-CfJIbHY3.js";
|
|
30
|
+
import { m as mesh$1, a as meshEdges$1 } from "./meshFns-CqNwW0PO.js";
|
|
31
|
+
import { c as c7, b as b10, e as e7, d as d7, f as f9 } from "./meshFns-CqNwW0PO.js";
|
|
32
|
+
import { c as cut$1, f as fuse$1, i as intersect$1, s as section$1, a as slice$1, b as split$1, d as fuseAll, e as cutAll } from "./booleanFns-C-M6qqvB.js";
|
|
33
|
+
import { g as g12 } from "./booleanFns-C-M6qqvB.js";
|
|
34
|
+
import { m as measureArea, a as measureSurfaceProps, b as measureVolumeProps, c as measureVolume } from "./measurement-Cf_SoIiR.js";
|
|
35
|
+
import { d as d8, e as e8, f as f10, g as g13, h as h8, i as i11 } from "./measurement-Cf_SoIiR.js";
|
|
36
|
+
import { c as makeBezierCurve, d as makeBSplineApproximation, e as makeCircle, f as makeEllipse, g as makeEllipseArc, b as makeHelix, m as makeLine, h as makeTangentArc, i as makeThreePointArc, a as assembleWire } from "./curveBuilders-BREwqvuc.js";
|
|
37
|
+
import { i as iterTopo, f as fromBREP$1 } from "./cast-Cerqtxtb.js";
|
|
38
|
+
import { e as e9, c as c8, d as d9, g as g14, s as s4 } from "./cast-Cerqtxtb.js";
|
|
37
39
|
import { edgeFinder } from "./query.js";
|
|
38
40
|
import { BrepBugError, bug } from "./result.js";
|
|
39
|
-
import { c as c9 } from "./cornerFinder-
|
|
41
|
+
import { c as c9 } from "./cornerFinder-CC_MunIh.js";
|
|
40
42
|
import { createOperationRegistry, createTaskQueue, createWorkerClient, createWorkerHandler, dequeueTask, enqueueTask, isDisposeRequest, isErrorResponse, isInitRequest, isOperationRequest, isQueueEmpty, isSuccessResponse, pendingCount, registerHandler, rejectAll } from "./worker.js";
|
|
41
43
|
const errorFactories = {
|
|
42
44
|
OCCT_OPERATION: (code, message, cause) => ({ kind: "OCCT_OPERATION", code, message, cause }),
|
|
@@ -111,11 +113,11 @@ function withNearestPostFilter(baseFinder, nearestPoint) {
|
|
|
111
113
|
if (candidates.length === 0) return [];
|
|
112
114
|
let bestIdx = 0;
|
|
113
115
|
let bestDist = vecDistance(vertexPosition(candidates[0]), nearestPoint);
|
|
114
|
-
for (let
|
|
115
|
-
const d10 = vecDistance(vertexPosition(candidates[
|
|
116
|
+
for (let i12 = 1; i12 < candidates.length; i12++) {
|
|
117
|
+
const d10 = vecDistance(vertexPosition(candidates[i12]), nearestPoint);
|
|
116
118
|
if (d10 < bestDist) {
|
|
117
119
|
bestDist = d10;
|
|
118
|
-
bestIdx =
|
|
120
|
+
bestIdx = i12;
|
|
119
121
|
}
|
|
120
122
|
}
|
|
121
123
|
return [candidates[bestIdx]];
|
|
@@ -157,6 +159,170 @@ function buildVertexFinder(filters) {
|
|
|
157
159
|
function vertexFinder() {
|
|
158
160
|
return buildVertexFinder([]);
|
|
159
161
|
}
|
|
162
|
+
function validateNotNull$1(shape2, label) {
|
|
163
|
+
if (shape2.wrapped.IsNull()) {
|
|
164
|
+
return err(validationError(BrepErrorCode.NULL_SHAPE_INPUT, `${label} is a null shape`));
|
|
165
|
+
}
|
|
166
|
+
return ok(void 0);
|
|
167
|
+
}
|
|
168
|
+
function hull(shapes, options = {}) {
|
|
169
|
+
if (shapes.length === 0) {
|
|
170
|
+
return err(
|
|
171
|
+
validationError(
|
|
172
|
+
BrepErrorCode.HULL_EMPTY_INPUT,
|
|
173
|
+
"hull: at least one shape is required",
|
|
174
|
+
void 0,
|
|
175
|
+
void 0,
|
|
176
|
+
"Provide one or more shapes to compute a convex hull"
|
|
177
|
+
)
|
|
178
|
+
);
|
|
179
|
+
}
|
|
180
|
+
for (const [i12, shape2] of shapes.entries()) {
|
|
181
|
+
const check = validateNotNull$1(shape2, `hull: shapes[${i12}]`);
|
|
182
|
+
if (isErr(check)) return check;
|
|
183
|
+
}
|
|
184
|
+
const tolerance = options.tolerance ?? 0.1;
|
|
185
|
+
try {
|
|
186
|
+
const kernel = getKernel();
|
|
187
|
+
const ocShapes = shapes.map((s5) => s5.wrapped);
|
|
188
|
+
const resultOc = kernel.hull(ocShapes, tolerance);
|
|
189
|
+
const cast = castShape(resultOc);
|
|
190
|
+
if (!isSolid(cast)) {
|
|
191
|
+
return err(
|
|
192
|
+
occtError(BrepErrorCode.HULL_NOT_3D, "Hull result is not a solid; input may be degenerate")
|
|
193
|
+
);
|
|
194
|
+
}
|
|
195
|
+
return ok(cast);
|
|
196
|
+
} catch (e10) {
|
|
197
|
+
const raw = e10 instanceof Error ? e10.message : String(e10);
|
|
198
|
+
if (raw.includes("coplanar") || raw.includes("fewer than") || raw.includes("degenerate")) {
|
|
199
|
+
return err(occtError(BrepErrorCode.HULL_DEGENERATE, `Hull degenerate: ${raw}`, e10));
|
|
200
|
+
}
|
|
201
|
+
return err(occtError(BrepErrorCode.HULL_FAILED, `Hull operation failed: ${raw}`, e10));
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
function detectSphere(shape2) {
|
|
205
|
+
const oc = getKernel().oc;
|
|
206
|
+
const faces = getFaces(shape2);
|
|
207
|
+
if (faces.length !== 1) return null;
|
|
208
|
+
const face2 = faces[0];
|
|
209
|
+
const r8 = gcWithScope();
|
|
210
|
+
const adaptor = r8(new oc.BRepAdaptor_Surface_2(face2.wrapped, true));
|
|
211
|
+
const surfType = adaptor.GetType();
|
|
212
|
+
if (surfType !== oc.GeomAbs_SurfaceType.GeomAbs_Sphere) return null;
|
|
213
|
+
const ocSphere = adaptor.Sphere();
|
|
214
|
+
const radius = ocSphere.Radius();
|
|
215
|
+
ocSphere.delete();
|
|
216
|
+
return radius;
|
|
217
|
+
}
|
|
218
|
+
function minkowskiSphere(shape2, radius, tolerance) {
|
|
219
|
+
const oc = getKernel().oc;
|
|
220
|
+
const r8 = gcWithScope();
|
|
221
|
+
try {
|
|
222
|
+
const offsetMaker = r8(new oc.BRepOffsetAPI_MakeOffsetShape());
|
|
223
|
+
const progress = r8(new oc.Message_ProgressRange_1());
|
|
224
|
+
offsetMaker.PerformByJoin(
|
|
225
|
+
shape2.wrapped,
|
|
226
|
+
radius,
|
|
227
|
+
tolerance,
|
|
228
|
+
oc.BRepOffset_Mode.BRepOffset_Skin,
|
|
229
|
+
false,
|
|
230
|
+
false,
|
|
231
|
+
oc.GeomAbs_JoinType.GeomAbs_Arc,
|
|
232
|
+
false,
|
|
233
|
+
progress
|
|
234
|
+
);
|
|
235
|
+
const resultShape = offsetMaker.Shape();
|
|
236
|
+
const wrapped = castShape(resultShape);
|
|
237
|
+
if (!isShape3D(wrapped)) {
|
|
238
|
+
wrapped[Symbol.dispose]();
|
|
239
|
+
return err(
|
|
240
|
+
typeCastError(
|
|
241
|
+
BrepErrorCode.MINKOWSKI_NOT_3D,
|
|
242
|
+
"Minkowski sphere offset did not produce a 3D shape"
|
|
243
|
+
)
|
|
244
|
+
);
|
|
245
|
+
}
|
|
246
|
+
return ok(wrapped);
|
|
247
|
+
} catch (e10) {
|
|
248
|
+
const raw = e10 instanceof Error ? e10.message : String(e10);
|
|
249
|
+
return err(
|
|
250
|
+
occtError(BrepErrorCode.MINKOWSKI_FAILED, `Minkowski sphere offset failed: ${raw}`, e10, {
|
|
251
|
+
operation: "minkowski",
|
|
252
|
+
fastPath: "sphere"
|
|
253
|
+
})
|
|
254
|
+
);
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
function minkowskiGeneral(shape2, tool, _tolerance) {
|
|
258
|
+
const oc = getKernel().oc;
|
|
259
|
+
try {
|
|
260
|
+
const shapeVerts = getVertices(shape2);
|
|
261
|
+
const toolVerts = getVertices(tool);
|
|
262
|
+
if (shapeVerts.length === 0 || toolVerts.length === 0) {
|
|
263
|
+
return err(
|
|
264
|
+
occtError(
|
|
265
|
+
BrepErrorCode.MINKOWSKI_FAILED,
|
|
266
|
+
"Minkowski sum: one or both shapes have no vertices",
|
|
267
|
+
void 0,
|
|
268
|
+
{
|
|
269
|
+
operation: "minkowski"
|
|
270
|
+
}
|
|
271
|
+
)
|
|
272
|
+
);
|
|
273
|
+
}
|
|
274
|
+
const sumPoints = [];
|
|
275
|
+
for (const sv of shapeVerts) {
|
|
276
|
+
const r1 = gcWithScope();
|
|
277
|
+
const pa = r1(oc.BRep_Tool.Pnt(sv.wrapped));
|
|
278
|
+
const ax = pa.X(), ay = pa.Y(), az = pa.Z();
|
|
279
|
+
for (const tv of toolVerts) {
|
|
280
|
+
const r22 = gcWithScope();
|
|
281
|
+
const pb = r22(oc.BRep_Tool.Pnt(tv.wrapped));
|
|
282
|
+
const bx = pb.X(), by = pb.Y(), bz = pb.Z();
|
|
283
|
+
sumPoints.push({ x: ax + bx, y: ay + by, z: az + bz });
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
const kernel = getKernel();
|
|
287
|
+
const hullShape = kernel.hullFromPoints(sumPoints, _tolerance);
|
|
288
|
+
const wrapped = castShape(hullShape);
|
|
289
|
+
if (!isShape3D(wrapped)) {
|
|
290
|
+
wrapped[Symbol.dispose]();
|
|
291
|
+
return err(
|
|
292
|
+
typeCastError(BrepErrorCode.MINKOWSKI_NOT_3D, "Minkowski hull did not produce a 3D shape")
|
|
293
|
+
);
|
|
294
|
+
}
|
|
295
|
+
return ok(wrapped);
|
|
296
|
+
} catch (e10) {
|
|
297
|
+
const raw = e10 instanceof Error ? e10.message : String(e10);
|
|
298
|
+
return err(
|
|
299
|
+
occtError(BrepErrorCode.MINKOWSKI_FAILED, `Minkowski general path failed: ${raw}`, e10, {
|
|
300
|
+
operation: "minkowski"
|
|
301
|
+
})
|
|
302
|
+
);
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
function minkowski(shape2, tool, options = {}) {
|
|
306
|
+
const { tolerance = 1e-6 } = options;
|
|
307
|
+
if (shape2.wrapped.IsNull()) {
|
|
308
|
+
return err(validationError(BrepErrorCode.NULL_SHAPE_INPUT, "minkowski: shape is a null shape"));
|
|
309
|
+
}
|
|
310
|
+
if (tool.wrapped.IsNull()) {
|
|
311
|
+
return err(
|
|
312
|
+
validationError(BrepErrorCode.MINKOWSKI_NULL_TOOL, "minkowski: tool is a null shape")
|
|
313
|
+
);
|
|
314
|
+
}
|
|
315
|
+
if (!isShape3D(shape2) || !isShape3D(tool)) {
|
|
316
|
+
return err(
|
|
317
|
+
validationError(BrepErrorCode.MINKOWSKI_NOT_3D, "minkowski: both shape and tool must be 3D")
|
|
318
|
+
);
|
|
319
|
+
}
|
|
320
|
+
const sphereRadius = detectSphere(tool);
|
|
321
|
+
if (sphereRadius !== null) {
|
|
322
|
+
return minkowskiSphere(shape2, sphereRadius, tolerance);
|
|
323
|
+
}
|
|
324
|
+
return minkowskiGeneral(shape2, tool, tolerance);
|
|
325
|
+
}
|
|
160
326
|
function checkInterference(shape1, shape2, tolerance = 1e-6) {
|
|
161
327
|
if (shape1.wrapped.IsNull()) {
|
|
162
328
|
return err(
|
|
@@ -184,11 +350,11 @@ function checkInterference(shape1, shape2, tolerance = 1e-6) {
|
|
|
184
350
|
}
|
|
185
351
|
function checkAllInterferences(shapes, tolerance = 1e-6) {
|
|
186
352
|
const pairs = [];
|
|
187
|
-
shapes.forEach((si,
|
|
188
|
-
for (let
|
|
189
|
-
const result = unwrap(checkInterference(si, shapes[
|
|
353
|
+
shapes.forEach((si, i12) => {
|
|
354
|
+
for (let j9 = i12 + 1; j9 < shapes.length; j9++) {
|
|
355
|
+
const result = unwrap(checkInterference(si, shapes[j9], tolerance));
|
|
190
356
|
if (result.hasInterference) {
|
|
191
|
-
pairs.push({ i:
|
|
357
|
+
pairs.push({ i: i12, j: j9, result });
|
|
192
358
|
}
|
|
193
359
|
}
|
|
194
360
|
});
|
|
@@ -307,14 +473,14 @@ function tangentArc(startPoint, startTgt, endPoint) {
|
|
|
307
473
|
function wire(listOfEdges) {
|
|
308
474
|
return assembleWire(listOfEdges);
|
|
309
475
|
}
|
|
310
|
-
function face(
|
|
311
|
-
return makeFace(
|
|
476
|
+
function face(w8, holes) {
|
|
477
|
+
return makeFace(w8, holes);
|
|
312
478
|
}
|
|
313
|
-
function filledFace(
|
|
314
|
-
return makeNonPlanarFace(
|
|
479
|
+
function filledFace(w8) {
|
|
480
|
+
return makeNonPlanarFace(w8);
|
|
315
481
|
}
|
|
316
|
-
function subFace(originFace,
|
|
317
|
-
return makeNewFaceWithinFace(originFace,
|
|
482
|
+
function subFace(originFace, w8) {
|
|
483
|
+
return makeNewFaceWithinFace(originFace, w8);
|
|
318
484
|
}
|
|
319
485
|
function polygon(points) {
|
|
320
486
|
return makePolygon(points);
|
|
@@ -346,11 +512,21 @@ function validateNotNull(shape2, label) {
|
|
|
346
512
|
function thicken$1(shape2, thickness) {
|
|
347
513
|
const check = validateNotNull(shape2, "thicken: shape");
|
|
348
514
|
if (isErr(check)) return check;
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
515
|
+
try {
|
|
516
|
+
const oc = getKernel().oc;
|
|
517
|
+
const r8 = gcWithScope();
|
|
518
|
+
const builder = r8(new oc.BRepOffsetAPI_MakeThickSolid());
|
|
519
|
+
builder.MakeThickSolidBySimple(shape2.wrapped, thickness);
|
|
520
|
+
const progress = r8(new oc.Message_ProgressRange_1());
|
|
521
|
+
builder.Build(progress);
|
|
522
|
+
const resultOc = builder.Shape();
|
|
523
|
+
const cast = castShape(resultOc);
|
|
524
|
+
propagateOrigins(builder, [shape2], cast);
|
|
525
|
+
return ok(cast);
|
|
526
|
+
} catch (e10) {
|
|
527
|
+
const raw = e10 instanceof Error ? e10.message : String(e10);
|
|
528
|
+
return err(occtError("THICKEN_FAILED", `Thicken operation failed: ${raw}`, e10));
|
|
529
|
+
}
|
|
354
530
|
}
|
|
355
531
|
function fillet$1(shape2, edges, radius) {
|
|
356
532
|
const check = validateNotNull(shape2, "fillet: shape");
|
|
@@ -390,23 +566,26 @@ function fillet$1(shape2, edges, radius) {
|
|
|
390
566
|
);
|
|
391
567
|
}
|
|
392
568
|
try {
|
|
393
|
-
const
|
|
394
|
-
const
|
|
395
|
-
|
|
396
|
-
(
|
|
397
|
-
const edgeWrapped = castShape(ocEdge);
|
|
398
|
-
return radius(edgeWrapped) ?? 0;
|
|
399
|
-
})
|
|
400
|
-
) : radius;
|
|
401
|
-
const result = kernel.fillet(
|
|
402
|
-
shape2.wrapped,
|
|
403
|
-
selectedEdges.map((e10) => e10.wrapped),
|
|
404
|
-
kernelRadius
|
|
569
|
+
const oc = getKernel().oc;
|
|
570
|
+
const r8 = gcWithScope();
|
|
571
|
+
const builder = r8(
|
|
572
|
+
new oc.BRepFilletAPI_MakeFillet(shape2.wrapped, oc.ChFi3d_FilletShape.ChFi3d_Rational)
|
|
405
573
|
);
|
|
406
|
-
const
|
|
574
|
+
for (const edge of selectedEdges) {
|
|
575
|
+
const rad = typeof radius === "function" ? radius(edge) ?? 0 : radius;
|
|
576
|
+
if (typeof rad === "number") {
|
|
577
|
+
if (rad > 0) builder.Add_2(rad, edge.wrapped);
|
|
578
|
+
} else {
|
|
579
|
+
const [r1, r22] = rad;
|
|
580
|
+
if (r1 > 0 && r22 > 0) builder.Add_3(r1, r22, edge.wrapped);
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
const resultOc = builder.Shape();
|
|
584
|
+
const cast = castShape(resultOc);
|
|
407
585
|
if (!isShape3D(cast)) {
|
|
408
586
|
return err(occtError("FILLET_RESULT_NOT_3D", "Fillet result is not a 3D shape"));
|
|
409
587
|
}
|
|
588
|
+
propagateOrigins(builder, [shape2], cast);
|
|
410
589
|
return ok(cast);
|
|
411
590
|
} catch (e10) {
|
|
412
591
|
const raw = e10 instanceof Error ? e10.message : String(e10);
|
|
@@ -449,23 +628,58 @@ function chamfer$1(shape2, edges, distance) {
|
|
|
449
628
|
return err(validationError("NO_EDGES", "No edges found for chamfer"));
|
|
450
629
|
}
|
|
451
630
|
try {
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
631
|
+
let getEdgeFaceMap = function() {
|
|
632
|
+
if (edgeFaceMap) return edgeFaceMap;
|
|
633
|
+
edgeFaceMap = /* @__PURE__ */ new Map();
|
|
634
|
+
const faceExp = new oc.TopExp_Explorer_2(
|
|
635
|
+
shape2.wrapped,
|
|
636
|
+
oc.TopAbs_ShapeEnum.TopAbs_FACE,
|
|
637
|
+
oc.TopAbs_ShapeEnum.TopAbs_SHAPE
|
|
638
|
+
);
|
|
639
|
+
while (faceExp.More()) {
|
|
640
|
+
const face2 = oc.TopoDS.Face_1(faceExp.Current());
|
|
641
|
+
const edgeExp = new oc.TopExp_Explorer_2(
|
|
642
|
+
face2,
|
|
643
|
+
oc.TopAbs_ShapeEnum.TopAbs_EDGE,
|
|
644
|
+
oc.TopAbs_ShapeEnum.TopAbs_SHAPE
|
|
645
|
+
);
|
|
646
|
+
while (edgeExp.More()) {
|
|
647
|
+
const hash = edgeExp.Current().HashCode(2147483647);
|
|
648
|
+
if (!edgeFaceMap.has(hash)) {
|
|
649
|
+
edgeFaceMap.set(hash, face2);
|
|
650
|
+
}
|
|
651
|
+
edgeExp.Next();
|
|
652
|
+
}
|
|
653
|
+
edgeExp.delete();
|
|
654
|
+
faceExp.Next();
|
|
655
|
+
}
|
|
656
|
+
faceExp.delete();
|
|
657
|
+
return edgeFaceMap;
|
|
658
|
+
};
|
|
659
|
+
const oc = getKernel().oc;
|
|
660
|
+
const r8 = gcWithScope();
|
|
661
|
+
const builder = r8(new oc.BRepFilletAPI_MakeChamfer(shape2.wrapped));
|
|
662
|
+
let edgeFaceMap = null;
|
|
663
|
+
for (const edge of selectedEdges) {
|
|
664
|
+
const d10 = typeof distance === "function" ? distance(edge) ?? 0 : distance;
|
|
665
|
+
if (typeof d10 === "number") {
|
|
666
|
+
if (d10 > 0) builder.Add_2(d10, edge.wrapped);
|
|
667
|
+
} else {
|
|
668
|
+
const [d1, d22] = d10;
|
|
669
|
+
if (d1 > 0 && d22 > 0) {
|
|
670
|
+
const face2 = getEdgeFaceMap().get(edge.wrapped.HashCode(2147483647));
|
|
671
|
+
if (face2) {
|
|
672
|
+
builder.Add_3(d1, d22, oc.TopoDS.Edge_1(edge.wrapped), face2);
|
|
673
|
+
}
|
|
674
|
+
}
|
|
675
|
+
}
|
|
676
|
+
}
|
|
677
|
+
const resultOc = builder.Shape();
|
|
678
|
+
const cast = castShape(resultOc);
|
|
466
679
|
if (!isShape3D(cast)) {
|
|
467
680
|
return err(occtError("CHAMFER_RESULT_NOT_3D", "Chamfer result is not a 3D shape"));
|
|
468
681
|
}
|
|
682
|
+
propagateOrigins(builder, [shape2], cast);
|
|
469
683
|
return ok(cast);
|
|
470
684
|
} catch (e10) {
|
|
471
685
|
const raw = e10 instanceof Error ? e10.message : String(e10);
|
|
@@ -488,16 +702,32 @@ function shell$1(shape2, faces, thickness, tolerance = 1e-3) {
|
|
|
488
702
|
return err(validationError("NO_FACES", "At least one face must be specified for shell"));
|
|
489
703
|
}
|
|
490
704
|
try {
|
|
491
|
-
const
|
|
705
|
+
const oc = getKernel().oc;
|
|
706
|
+
const r8 = gcWithScope();
|
|
707
|
+
const facesToRemove = r8(new oc.TopTools_ListOfShape_1());
|
|
708
|
+
for (const face2 of faces) {
|
|
709
|
+
facesToRemove.Append_1(face2.wrapped);
|
|
710
|
+
}
|
|
711
|
+
const progress = r8(new oc.Message_ProgressRange_1());
|
|
712
|
+
const builder = r8(new oc.BRepOffsetAPI_MakeThickSolid());
|
|
713
|
+
builder.MakeThickSolidByJoin(
|
|
492
714
|
shape2.wrapped,
|
|
493
|
-
|
|
494
|
-
thickness,
|
|
495
|
-
tolerance
|
|
715
|
+
facesToRemove,
|
|
716
|
+
-thickness,
|
|
717
|
+
tolerance,
|
|
718
|
+
oc.BRepOffset_Mode.BRepOffset_Skin,
|
|
719
|
+
false,
|
|
720
|
+
false,
|
|
721
|
+
oc.GeomAbs_JoinType.GeomAbs_Arc,
|
|
722
|
+
false,
|
|
723
|
+
progress
|
|
496
724
|
);
|
|
497
|
-
const
|
|
725
|
+
const resultOc = builder.Shape();
|
|
726
|
+
const cast = castShape(resultOc);
|
|
498
727
|
if (!isShape3D(cast)) {
|
|
499
728
|
return err(occtError("SHELL_RESULT_NOT_3D", "Shell result is not a 3D shape"));
|
|
500
729
|
}
|
|
730
|
+
propagateOrigins(builder, [shape2], cast);
|
|
501
731
|
return ok(cast);
|
|
502
732
|
} catch (e10) {
|
|
503
733
|
const raw = e10 instanceof Error ? e10.message : String(e10);
|
|
@@ -516,11 +746,33 @@ function offset$1(shape2, distance, tolerance = 1e-6) {
|
|
|
516
746
|
if (distance === 0) {
|
|
517
747
|
return err(validationError("ZERO_OFFSET", "Offset distance cannot be zero"));
|
|
518
748
|
}
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
749
|
+
try {
|
|
750
|
+
const oc = getKernel().oc;
|
|
751
|
+
const r8 = gcWithScope();
|
|
752
|
+
const progress = r8(new oc.Message_ProgressRange_1());
|
|
753
|
+
const builder = r8(new oc.BRepOffsetAPI_MakeOffsetShape());
|
|
754
|
+
builder.PerformByJoin(
|
|
755
|
+
shape2.wrapped,
|
|
756
|
+
distance,
|
|
757
|
+
tolerance,
|
|
758
|
+
oc.BRepOffset_Mode.BRepOffset_Skin,
|
|
759
|
+
false,
|
|
760
|
+
false,
|
|
761
|
+
oc.GeomAbs_JoinType.GeomAbs_Arc,
|
|
762
|
+
false,
|
|
763
|
+
progress
|
|
764
|
+
);
|
|
765
|
+
const resultOc = builder.Shape();
|
|
766
|
+
const cast = castShape(resultOc);
|
|
767
|
+
if (!isShape3D(cast)) {
|
|
768
|
+
return err(occtError("OFFSET_RESULT_NOT_3D", "Offset result is not a 3D shape"));
|
|
769
|
+
}
|
|
770
|
+
propagateOrigins(builder, [shape2], cast);
|
|
771
|
+
return ok(cast);
|
|
772
|
+
} catch (e10) {
|
|
773
|
+
const raw = e10 instanceof Error ? e10.message : String(e10);
|
|
774
|
+
return err(occtError("OFFSET_FAILED", `Offset operation failed: ${raw}`, e10));
|
|
775
|
+
}
|
|
524
776
|
}
|
|
525
777
|
function translate(shape2, v7) {
|
|
526
778
|
return translate$1(resolve(shape2), v7);
|
|
@@ -545,14 +797,14 @@ function applyMatrix(shape2, matrix) {
|
|
|
545
797
|
function transformCopy(shape2, composed) {
|
|
546
798
|
return transformCopy$1(resolve(shape2), composed);
|
|
547
799
|
}
|
|
548
|
-
function fuse(a10,
|
|
549
|
-
return fuse$1(resolve(a10), resolve(
|
|
800
|
+
function fuse(a10, b11, options) {
|
|
801
|
+
return fuse$1(resolve(a10), resolve(b11), options);
|
|
550
802
|
}
|
|
551
803
|
function cut(base, tool, options) {
|
|
552
804
|
return cut$1(resolve(base), resolve(tool), options);
|
|
553
805
|
}
|
|
554
|
-
function intersect(a10,
|
|
555
|
-
return intersect$1(resolve(a10), resolve(
|
|
806
|
+
function intersect(a10, b11, options) {
|
|
807
|
+
return intersect$1(resolve(a10), resolve(b11), options);
|
|
556
808
|
}
|
|
557
809
|
function section(shape2, plane, options) {
|
|
558
810
|
return section$1(resolve(shape2), plane, options);
|
|
@@ -686,8 +938,8 @@ function loft$1(wires, { ruled = true, startPoint, endPoint } = {}, returnShell
|
|
|
686
938
|
const vMaker = r8(new oc.BRepBuilderAPI_MakeVertex(pnt));
|
|
687
939
|
builder.AddVertex(vMaker.Vertex());
|
|
688
940
|
}
|
|
689
|
-
for (const
|
|
690
|
-
builder.AddWire(
|
|
941
|
+
for (const w8 of wires) {
|
|
942
|
+
builder.AddWire(w8.wrapped);
|
|
691
943
|
}
|
|
692
944
|
if (endPoint) {
|
|
693
945
|
const pnt = r8(toOcPnt(toVec3(endPoint)));
|
|
@@ -720,7 +972,7 @@ function revolve(face2, options) {
|
|
|
720
972
|
);
|
|
721
973
|
}
|
|
722
974
|
function loft(wires, options) {
|
|
723
|
-
const resolvedWires = wires.map((
|
|
975
|
+
const resolvedWires = wires.map((w8) => resolve(w8));
|
|
724
976
|
return loft$1(resolvedWires, options);
|
|
725
977
|
}
|
|
726
978
|
function resolveTargetFace(shape2, faceSpec) {
|
|
@@ -731,8 +983,8 @@ function resolveTargetFace(shape2, faceSpec) {
|
|
|
731
983
|
}
|
|
732
984
|
let best = faces[0];
|
|
733
985
|
let bestZ = faceCenter(best)[2];
|
|
734
|
-
for (let
|
|
735
|
-
const f11 = faces[
|
|
986
|
+
for (let i12 = 1; i12 < faces.length; i12++) {
|
|
987
|
+
const f11 = faces[i12];
|
|
736
988
|
const z5 = faceCenter(f11)[2];
|
|
737
989
|
if (z5 > bestZ) {
|
|
738
990
|
best = f11;
|
|
@@ -771,10 +1023,10 @@ function drill(shape2, options) {
|
|
|
771
1023
|
const pos = at.length === 2 ? [at[0], at[1], 0] : [at[0], at[1], at[2]];
|
|
772
1024
|
let depth = options.depth;
|
|
773
1025
|
if (depth === void 0) {
|
|
774
|
-
const
|
|
775
|
-
const dx =
|
|
776
|
-
const dy =
|
|
777
|
-
const dz =
|
|
1026
|
+
const b11 = getBounds(s5);
|
|
1027
|
+
const dx = b11.xMax - b11.xMin;
|
|
1028
|
+
const dy = b11.yMax - b11.yMin;
|
|
1029
|
+
const dz = b11.zMax - b11.zMin;
|
|
778
1030
|
depth = Math.sqrt(dx * dx + dy * dy + dz * dz) + 1;
|
|
779
1031
|
}
|
|
780
1032
|
const cyl = makeCylinder(radius, depth, pos, dir);
|
|
@@ -790,8 +1042,8 @@ function pocket(shape2, options) {
|
|
|
790
1042
|
}
|
|
791
1043
|
const targetFace = resolveTargetFace(s5, options.face);
|
|
792
1044
|
const normal = normalAt(targetFace);
|
|
793
|
-
const
|
|
794
|
-
const faceResult = makeFace(
|
|
1045
|
+
const w8 = toWire(profile);
|
|
1046
|
+
const faceResult = makeFace(w8);
|
|
795
1047
|
if (isErr(faceResult)) return faceResult;
|
|
796
1048
|
const extDir = vecScale(vecNormalize(normal), -depth);
|
|
797
1049
|
const toolResult = extrude$1(faceResult.value, extDir);
|
|
@@ -806,8 +1058,8 @@ function boss(shape2, options) {
|
|
|
806
1058
|
}
|
|
807
1059
|
const targetFace = resolveTargetFace(s5, options.face);
|
|
808
1060
|
const normal = normalAt(targetFace);
|
|
809
|
-
const
|
|
810
|
-
const faceResult = makeFace(
|
|
1061
|
+
const w8 = toWire(profile);
|
|
1062
|
+
const faceResult = makeFace(w8);
|
|
811
1063
|
if (isErr(faceResult)) return faceResult;
|
|
812
1064
|
const extDir = vecScale(vecNormalize(normal), height);
|
|
813
1065
|
const toolResult = extrude$1(faceResult.value, extDir);
|
|
@@ -975,8 +1227,8 @@ function createWrappedCurve(val) {
|
|
|
975
1227
|
isClosed: () => curveIsClosed(val),
|
|
976
1228
|
sweep(spine, opts) {
|
|
977
1229
|
if (!isWire(val)) throw new Error("sweep requires a Wire");
|
|
978
|
-
const
|
|
979
|
-
const result = unwrapOrThrow(sweep(
|
|
1230
|
+
const w8 = val;
|
|
1231
|
+
const result = unwrapOrThrow(sweep(w8, resolve(spine), opts));
|
|
980
1232
|
const shape3D = Array.isArray(result) ? result[0] : result;
|
|
981
1233
|
return wrap3D(shape3D);
|
|
982
1234
|
}
|
|
@@ -1018,7 +1270,7 @@ function shape(s5) {
|
|
|
1018
1270
|
throw new Error("shape() requires a Sketch or branded shape type");
|
|
1019
1271
|
}
|
|
1020
1272
|
export {
|
|
1021
|
-
|
|
1273
|
+
B3 as BaseSketcher2d,
|
|
1022
1274
|
B as Blueprint,
|
|
1023
1275
|
a5 as BlueprintSketcher,
|
|
1024
1276
|
b5 as Blueprints,
|
|
@@ -1026,14 +1278,14 @@ export {
|
|
|
1026
1278
|
BrepBugError,
|
|
1027
1279
|
BrepErrorCode,
|
|
1028
1280
|
BrepWrapperError,
|
|
1029
|
-
|
|
1030
|
-
|
|
1281
|
+
C3 as CompoundBlueprint,
|
|
1282
|
+
C4 as CompoundSketch,
|
|
1031
1283
|
C as Curve2D,
|
|
1032
1284
|
DEG2RAD,
|
|
1033
1285
|
D as DisposalScope,
|
|
1034
|
-
|
|
1286
|
+
D3 as Drawing,
|
|
1035
1287
|
a6 as DrawingPen,
|
|
1036
|
-
|
|
1288
|
+
F as FaceSketcher,
|
|
1037
1289
|
H as HASH_CODE_MAX,
|
|
1038
1290
|
O as OK,
|
|
1039
1291
|
R as RAD2DEG,
|
|
@@ -1045,11 +1297,11 @@ export {
|
|
|
1045
1297
|
b4 as addStep,
|
|
1046
1298
|
a8 as adjacentFaces,
|
|
1047
1299
|
a as andThen,
|
|
1048
|
-
|
|
1300
|
+
g12 as applyGlue,
|
|
1049
1301
|
applyMatrix,
|
|
1050
|
-
|
|
1302
|
+
g5 as approximateCurve,
|
|
1051
1303
|
e9 as asTopo,
|
|
1052
|
-
|
|
1304
|
+
b8 as autoHeal,
|
|
1053
1305
|
f4 as axis2d,
|
|
1054
1306
|
i6 as basicFaceExtrusion,
|
|
1055
1307
|
bezier,
|
|
@@ -1074,7 +1326,7 @@ export {
|
|
|
1074
1326
|
c2 as collect,
|
|
1075
1327
|
d2 as collectShapes,
|
|
1076
1328
|
f5 as complexExtrude,
|
|
1077
|
-
|
|
1329
|
+
w6 as composeTransforms,
|
|
1078
1330
|
compound,
|
|
1079
1331
|
c4 as compoundSketchExtrude,
|
|
1080
1332
|
d4 as compoundSketchFace,
|
|
@@ -1084,7 +1336,7 @@ export {
|
|
|
1084
1336
|
cone,
|
|
1085
1337
|
c9 as cornerFinder,
|
|
1086
1338
|
g6 as countNodes,
|
|
1087
|
-
|
|
1339
|
+
h5 as createAssembly,
|
|
1088
1340
|
i7 as createAssemblyNode,
|
|
1089
1341
|
createBlueprint,
|
|
1090
1342
|
Z as createCamera,
|
|
@@ -1093,8 +1345,8 @@ export {
|
|
|
1093
1345
|
o as createEdge,
|
|
1094
1346
|
u as createFace,
|
|
1095
1347
|
a2 as createHandle,
|
|
1096
|
-
|
|
1097
|
-
|
|
1348
|
+
j6 as createHistory,
|
|
1349
|
+
b10 as createMeshCache,
|
|
1098
1350
|
c5 as createNamedPlane,
|
|
1099
1351
|
b2 as createOcHandle,
|
|
1100
1352
|
createOperationRegistry,
|
|
@@ -1117,9 +1369,9 @@ export {
|
|
|
1117
1369
|
curve2dTangentAt,
|
|
1118
1370
|
curveEndPoint,
|
|
1119
1371
|
curveIsClosed,
|
|
1120
|
-
|
|
1372
|
+
h4 as curveIsPeriodic,
|
|
1121
1373
|
curveLength,
|
|
1122
|
-
|
|
1374
|
+
i5 as curvePeriod,
|
|
1123
1375
|
curvePointAt,
|
|
1124
1376
|
curveStartPoint,
|
|
1125
1377
|
curveTangentAt,
|
|
@@ -1133,14 +1385,14 @@ export {
|
|
|
1133
1385
|
g9 as deserializeDrawing,
|
|
1134
1386
|
fromBREP$1 as deserializeShape,
|
|
1135
1387
|
d9 as downcast,
|
|
1136
|
-
|
|
1388
|
+
h6 as draw,
|
|
1137
1389
|
i9 as drawCircle,
|
|
1138
|
-
|
|
1390
|
+
j7 as drawEllipse,
|
|
1139
1391
|
k6 as drawFaceOutline,
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1392
|
+
l5 as drawParametricFunction,
|
|
1393
|
+
m5 as drawPointsInterpolation,
|
|
1394
|
+
n5 as drawPolysides,
|
|
1395
|
+
o6 as drawProjection,
|
|
1144
1396
|
p3 as drawRectangle,
|
|
1145
1397
|
q3 as drawRoundedRectangle,
|
|
1146
1398
|
r6 as drawSingleCircle,
|
|
@@ -1151,7 +1403,7 @@ export {
|
|
|
1151
1403
|
w5 as drawingFillet,
|
|
1152
1404
|
x3 as drawingFuse,
|
|
1153
1405
|
y2 as drawingIntersect,
|
|
1154
|
-
|
|
1406
|
+
z3 as drawingToSketchOnPlane,
|
|
1155
1407
|
drill,
|
|
1156
1408
|
edgeFinder,
|
|
1157
1409
|
e5 as edgesOfFace,
|
|
@@ -1160,7 +1412,7 @@ export {
|
|
|
1160
1412
|
ellipsoid,
|
|
1161
1413
|
enqueueTask,
|
|
1162
1414
|
err,
|
|
1163
|
-
|
|
1415
|
+
m4 as exportAssemblySTEP,
|
|
1164
1416
|
exportDXF,
|
|
1165
1417
|
exportGlb,
|
|
1166
1418
|
exportGltf,
|
|
@@ -1174,16 +1426,16 @@ export {
|
|
|
1174
1426
|
faceCenter,
|
|
1175
1427
|
faceFinder,
|
|
1176
1428
|
a9 as faceGeomType,
|
|
1177
|
-
|
|
1429
|
+
b9 as faceOrientation,
|
|
1178
1430
|
f8 as facesOfEdge,
|
|
1179
1431
|
filledFace,
|
|
1180
1432
|
fillet,
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1433
|
+
j4 as findCurveType,
|
|
1434
|
+
n4 as findNode,
|
|
1435
|
+
o4 as findStep,
|
|
1184
1436
|
f2 as flatMap,
|
|
1185
1437
|
d6 as flipFaceOrientation,
|
|
1186
|
-
|
|
1438
|
+
k4 as flipOrientation,
|
|
1187
1439
|
fromBREP,
|
|
1188
1440
|
f as fromOcDir,
|
|
1189
1441
|
h as fromOcPnt,
|
|
@@ -1194,17 +1446,18 @@ export {
|
|
|
1194
1446
|
e3 as fuseBlueprints,
|
|
1195
1447
|
x as gcWithObject,
|
|
1196
1448
|
gcWithScope,
|
|
1197
|
-
|
|
1449
|
+
j5 as genericSweep,
|
|
1198
1450
|
getBounds,
|
|
1199
1451
|
getBounds2D,
|
|
1200
|
-
|
|
1452
|
+
l4 as getCurveType,
|
|
1201
1453
|
getEdges,
|
|
1454
|
+
g10 as getFaceOrigins,
|
|
1202
1455
|
getFaces,
|
|
1203
1456
|
_ as getFont,
|
|
1204
|
-
|
|
1457
|
+
b7 as getHashCode,
|
|
1205
1458
|
p as getHistoryShape,
|
|
1206
1459
|
getKernel,
|
|
1207
|
-
|
|
1460
|
+
m3 as getOrientation,
|
|
1208
1461
|
getOrientation2D,
|
|
1209
1462
|
g2 as getShapeKind,
|
|
1210
1463
|
g8 as getSingleFace,
|
|
@@ -1213,9 +1466,10 @@ export {
|
|
|
1213
1466
|
getWires,
|
|
1214
1467
|
heal,
|
|
1215
1468
|
d5 as healFace,
|
|
1216
|
-
|
|
1217
|
-
|
|
1469
|
+
g11 as healSolid,
|
|
1470
|
+
j8 as healWire,
|
|
1218
1471
|
helix,
|
|
1472
|
+
hull,
|
|
1219
1473
|
importIGES,
|
|
1220
1474
|
importSTEP,
|
|
1221
1475
|
importSTL,
|
|
@@ -1223,18 +1477,18 @@ export {
|
|
|
1223
1477
|
importSVGPathD,
|
|
1224
1478
|
j as initFromOC,
|
|
1225
1479
|
innerWires,
|
|
1226
|
-
|
|
1480
|
+
n3 as interpolateCurve,
|
|
1227
1481
|
intersect,
|
|
1228
1482
|
i8 as intersect2D,
|
|
1229
1483
|
g7 as intersectBlueprints,
|
|
1230
1484
|
i2 as ioError,
|
|
1231
1485
|
isChamferRadius,
|
|
1232
|
-
|
|
1486
|
+
g14 as isCompSolid,
|
|
1233
1487
|
i3 as isCompound,
|
|
1234
1488
|
isDisposeRequest,
|
|
1235
1489
|
isEdge,
|
|
1236
1490
|
isEmpty,
|
|
1237
|
-
|
|
1491
|
+
x4 as isEqualShape,
|
|
1238
1492
|
isErr,
|
|
1239
1493
|
isErrorResponse,
|
|
1240
1494
|
isFace,
|
|
@@ -1246,20 +1500,20 @@ export {
|
|
|
1246
1500
|
isOperationRequest,
|
|
1247
1501
|
$ as isProjectionPlane,
|
|
1248
1502
|
isQueueEmpty,
|
|
1249
|
-
|
|
1503
|
+
i10 as isSameShape,
|
|
1250
1504
|
f3 as isShape1D,
|
|
1251
1505
|
isShape3D,
|
|
1252
1506
|
j3 as isShell,
|
|
1253
|
-
|
|
1507
|
+
isSolid,
|
|
1254
1508
|
isSuccessResponse,
|
|
1255
1509
|
isValid,
|
|
1256
1510
|
l2 as isVertex,
|
|
1257
1511
|
isWire,
|
|
1258
|
-
|
|
1259
|
-
|
|
1512
|
+
y3 as iterEdges,
|
|
1513
|
+
z4 as iterFaces,
|
|
1260
1514
|
iterTopo,
|
|
1261
|
-
|
|
1262
|
-
|
|
1515
|
+
A3 as iterVertices,
|
|
1516
|
+
B5 as iterWires,
|
|
1263
1517
|
kernelCall,
|
|
1264
1518
|
kernelCallRaw,
|
|
1265
1519
|
line,
|
|
@@ -1267,7 +1521,7 @@ export {
|
|
|
1267
1521
|
a0 as loadFont,
|
|
1268
1522
|
t3 as localGC,
|
|
1269
1523
|
loft,
|
|
1270
|
-
|
|
1524
|
+
A2 as makeBaseBox,
|
|
1271
1525
|
g4 as makePlane,
|
|
1272
1526
|
a1 as makeProjectedEdges,
|
|
1273
1527
|
m as map,
|
|
@@ -1276,17 +1530,18 @@ export {
|
|
|
1276
1530
|
measureArea,
|
|
1277
1531
|
e8 as measureCurvatureAt,
|
|
1278
1532
|
f10 as measureCurvatureAtMid,
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1533
|
+
g13 as measureDistance,
|
|
1534
|
+
h8 as measureLength,
|
|
1535
|
+
i11 as measureLinearProps,
|
|
1282
1536
|
measureSurfaceProps,
|
|
1283
1537
|
measureVolume,
|
|
1284
1538
|
measureVolumeProps,
|
|
1285
1539
|
mesh,
|
|
1286
1540
|
meshEdges,
|
|
1541
|
+
minkowski,
|
|
1287
1542
|
mirror,
|
|
1288
1543
|
mirror2D,
|
|
1289
|
-
|
|
1544
|
+
B4 as mirrorDrawing,
|
|
1290
1545
|
mirrorJoin,
|
|
1291
1546
|
q2 as modifyStep,
|
|
1292
1547
|
k2 as moduleInitError,
|
|
@@ -1294,9 +1549,9 @@ export {
|
|
|
1294
1549
|
occtError,
|
|
1295
1550
|
offset,
|
|
1296
1551
|
offsetFace,
|
|
1297
|
-
|
|
1552
|
+
o3 as offsetWire2D,
|
|
1298
1553
|
ok,
|
|
1299
|
-
|
|
1554
|
+
o5 as organiseBlueprints,
|
|
1300
1555
|
outerWire,
|
|
1301
1556
|
pendingCount,
|
|
1302
1557
|
z as pipeline,
|
|
@@ -1304,7 +1559,7 @@ export {
|
|
|
1304
1559
|
pocket,
|
|
1305
1560
|
p5 as pointOnSurface,
|
|
1306
1561
|
polygon,
|
|
1307
|
-
|
|
1562
|
+
E2 as polysideInnerRadius,
|
|
1308
1563
|
p2 as polysidesBlueprint,
|
|
1309
1564
|
a22 as projectEdges,
|
|
1310
1565
|
e6 as projectPointOnFace,
|
|
@@ -1326,12 +1581,13 @@ export {
|
|
|
1326
1581
|
revolve,
|
|
1327
1582
|
rotate,
|
|
1328
1583
|
rotate2D,
|
|
1329
|
-
|
|
1584
|
+
F2 as rotateDrawing,
|
|
1330
1585
|
r5 as roundedRectangleBlueprint,
|
|
1331
1586
|
scale,
|
|
1332
1587
|
scale2D,
|
|
1333
|
-
|
|
1588
|
+
G as scaleDrawing,
|
|
1334
1589
|
section,
|
|
1590
|
+
C5 as setShapeOrigin,
|
|
1335
1591
|
sewShells,
|
|
1336
1592
|
shape,
|
|
1337
1593
|
s4 as shapeType,
|
|
@@ -1340,13 +1596,13 @@ export {
|
|
|
1340
1596
|
simplify,
|
|
1341
1597
|
sketch2DOnFace,
|
|
1342
1598
|
sketch2DOnPlane,
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1599
|
+
H2 as sketchCircle,
|
|
1600
|
+
I as sketchEllipse,
|
|
1601
|
+
J as sketchExtrude,
|
|
1602
|
+
K as sketchFace,
|
|
1603
|
+
L as sketchFaceOffset,
|
|
1604
|
+
M as sketchHelix,
|
|
1605
|
+
N as sketchLoft,
|
|
1350
1606
|
O2 as sketchParametricFunction,
|
|
1351
1607
|
P as sketchPolysides,
|
|
1352
1608
|
Q as sketchRectangle,
|
|
@@ -1361,10 +1617,10 @@ export {
|
|
|
1361
1617
|
sphere,
|
|
1362
1618
|
split,
|
|
1363
1619
|
y as stepCount,
|
|
1364
|
-
|
|
1620
|
+
z2 as stepsFrom,
|
|
1365
1621
|
stretch2D,
|
|
1366
1622
|
subFace,
|
|
1367
|
-
|
|
1623
|
+
A as supportExtrude,
|
|
1368
1624
|
sweep,
|
|
1369
1625
|
tangentArc,
|
|
1370
1626
|
a42 as textBlueprints,
|
|
@@ -1373,7 +1629,7 @@ export {
|
|
|
1373
1629
|
toBREP,
|
|
1374
1630
|
t7 as toBufferGeometryData,
|
|
1375
1631
|
k7 as toGroupedBufferGeometryData,
|
|
1376
|
-
|
|
1632
|
+
l6 as toLineGeometryData,
|
|
1377
1633
|
c as toOcVec,
|
|
1378
1634
|
toSVGPathD,
|
|
1379
1635
|
t as toVec2,
|
|
@@ -1386,16 +1642,16 @@ export {
|
|
|
1386
1642
|
t6 as translatePlane,
|
|
1387
1643
|
t2 as tryCatch,
|
|
1388
1644
|
n as tryCatchAsync,
|
|
1389
|
-
|
|
1645
|
+
B2 as twistExtrude,
|
|
1390
1646
|
typeCastError,
|
|
1391
|
-
|
|
1647
|
+
C2 as undoLast,
|
|
1392
1648
|
unwrap,
|
|
1393
1649
|
r2 as unwrapErr,
|
|
1394
1650
|
v as unwrapOr,
|
|
1395
1651
|
w2 as unwrapOrElse,
|
|
1396
|
-
|
|
1652
|
+
D2 as updateNode,
|
|
1397
1653
|
u4 as uvBounds,
|
|
1398
|
-
|
|
1654
|
+
h7 as uvCoordinates,
|
|
1399
1655
|
validationError,
|
|
1400
1656
|
v3 as vecAdd,
|
|
1401
1657
|
a3 as vecAngle,
|
|
@@ -1408,7 +1664,7 @@ export {
|
|
|
1408
1664
|
h3 as vecLengthSq,
|
|
1409
1665
|
i4 as vecNegate,
|
|
1410
1666
|
vecNormalize,
|
|
1411
|
-
|
|
1667
|
+
k3 as vecProjectToPlane,
|
|
1412
1668
|
l3 as vecRepr,
|
|
1413
1669
|
m2 as vecRotate,
|
|
1414
1670
|
vecScale,
|
|
@@ -1417,10 +1673,10 @@ export {
|
|
|
1417
1673
|
vertexFinder,
|
|
1418
1674
|
vertexPosition,
|
|
1419
1675
|
v6 as verticesOfEdge,
|
|
1420
|
-
|
|
1676
|
+
E as walkAssembly,
|
|
1421
1677
|
wire,
|
|
1422
1678
|
wireFinder,
|
|
1423
|
-
|
|
1679
|
+
w7 as wiresOfFace,
|
|
1424
1680
|
w as withOcDir,
|
|
1425
1681
|
k as withOcPnt,
|
|
1426
1682
|
l as withOcVec,
|