brepjs 8.8.2 → 8.8.3
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/curves.d.ts.map +1 -1
- package/dist/2d/lib/Curve2D.d.ts.map +1 -1
- package/dist/2d/lib/approximations.d.ts.map +1 -1
- package/dist/2d/lib/makeCurves.d.ts.map +1 -1
- package/dist/2d/lib/ocWrapper.d.ts.map +1 -1
- package/dist/2d.cjs +2 -2
- package/dist/2d.js +3 -3
- package/dist/Blueprint-BmFJ4caY.cjs +1439 -0
- package/dist/Blueprint-DsoGiJNJ.js +1440 -0
- package/dist/{boolean2D-q5FOdOQW.cjs → boolean2D-BQk8LNmZ.cjs} +212 -127
- package/dist/{boolean2D-Dgnuy63w.js → boolean2D-D5O0F3J8.js} +212 -127
- package/dist/{booleanFns-CFit7JYt.cjs → booleanFns-CVM3dOTP.cjs} +210 -130
- package/dist/{booleanFns--Orezl-b.js → booleanFns-DOyKxL7q.js} +210 -130
- package/dist/brepjs.cjs +457 -304
- package/dist/brepjs.js +551 -398
- package/dist/core/disposal.d.ts +44 -3
- package/dist/core/disposal.d.ts.map +1 -1
- package/dist/core/geometryHelpers.d.ts.map +1 -1
- package/dist/core/kernelCall.d.ts +20 -0
- package/dist/core/kernelCall.d.ts.map +1 -1
- package/dist/core/memory.d.ts +1 -1
- package/dist/core/memory.d.ts.map +1 -1
- package/dist/core.cjs +4 -1
- package/dist/core.d.ts +1 -1
- package/dist/core.d.ts.map +1 -1
- package/dist/core.js +11 -8
- package/dist/{cornerFinder-KNTFoGrm.js → cornerFinder-DH6EwYfL.js} +1 -1
- package/dist/{cornerFinder-v4un1Fr9.cjs → cornerFinder-XAV2ywVS.cjs} +1 -1
- package/dist/curveFns-BHRYwxBM.js +281 -0
- package/dist/{curveFns-6ovDM_sR.cjs → curveFns-BsAHC3Qv.cjs} +137 -36
- package/dist/{drawFns-WgXeXHH1.cjs → drawFns-CsmUF97U.cjs} +181 -101
- package/dist/{drawFns-XwroLxdb.js → drawFns-hD05g0ZQ.js} +181 -101
- package/dist/faceFns-DNQss51F.cjs +358 -0
- package/dist/faceFns-q5CR9pOW.js +359 -0
- package/dist/{helpers-CRfqaW0Y.cjs → helpers-aylLv0_I.cjs} +13 -10
- package/dist/{helpers-CtBCzEqs.js → helpers-tNdaX01G.js} +13 -10
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/io/importFns.d.ts.map +1 -1
- package/dist/io.cjs +131 -63
- package/dist/io.js +131 -63
- package/dist/loft-CjEEqz2P.cjs +530 -0
- package/dist/loft-DTRcYrq2.js +531 -0
- package/dist/measurement-B6_cxjpw.cjs +200 -0
- package/dist/measurement-BXqFvcGh.js +201 -0
- package/dist/measurement.cjs +1 -1
- package/dist/measurement.js +1 -1
- package/dist/{meshFns-CPNNlpbw.cjs → meshFns-CTc1CRkF.cjs} +1 -1
- package/dist/{meshFns-DAmWVyEp.js → meshFns-DDFl7gLN.js} +1 -1
- package/dist/operations/exporterFns.d.ts.map +1 -1
- package/dist/operations/exporterUtils.d.ts +3 -3
- package/dist/operations/exporterUtils.d.ts.map +1 -1
- package/dist/operations/exporters.d.ts.map +1 -1
- package/dist/operations/extrude.d.ts.map +1 -1
- package/dist/operations/extrudeFns.d.ts.map +1 -1
- package/dist/operations/loft.d.ts.map +1 -1
- package/dist/operations/multiSweepFns.d.ts.map +1 -1
- package/dist/{operations-vN0tcoaU.js → operations-jRE2QbPo.js} +261 -166
- package/dist/{operations-BQ25CPI8.cjs → operations-pxjbW4Er.cjs} +261 -166
- package/dist/operations.cjs +2 -2
- package/dist/operations.js +2 -2
- package/dist/query/shapeDistanceFilter.d.ts.map +1 -1
- package/dist/query.cjs +66 -14
- package/dist/query.js +67 -15
- package/dist/{shapeFns-C785aeVn.cjs → shapeFns-D4CRxxmF.cjs} +61 -7
- package/dist/{shapeFns-ClpALED4.js → shapeFns-DNnBK8fG.js} +61 -7
- package/dist/{shapeTypes-DnwCo942.js → shapeTypes-Bi_9RZa2.js} +50 -19
- package/dist/{shapeTypes-CIijJxCz.cjs → shapeTypes-CWuX602K.cjs} +32 -1
- package/dist/sketching/CompoundSketch.d.ts.map +1 -1
- package/dist/sketching/Sketch.d.ts.map +1 -1
- package/dist/sketching/Sketcher.d.ts.map +1 -1
- package/dist/sketching/Sketcher2d.d.ts.map +1 -1
- package/dist/sketching/cannedSketches.d.ts.map +1 -1
- package/dist/sketching/draw.d.ts.map +1 -1
- package/dist/sketching.cjs +2 -2
- package/dist/sketching.js +2 -2
- package/dist/surfaceBuilders-CLal3WlK.cjs +429 -0
- package/dist/surfaceBuilders-W9Y25CIb.js +430 -0
- package/dist/topology/curveBuilders.d.ts.map +1 -1
- package/dist/topology/shapeFns.d.ts.map +1 -1
- package/dist/topology/solidBuilders.d.ts.map +1 -1
- package/dist/topology/surfaceBuilders.d.ts.map +1 -1
- package/dist/{topology-CqyxpmEh.js → topology-CMM6vAzx.js} +6 -6
- package/dist/{topology-zG8maSDK.cjs → topology-CNw-wsmG.cjs} +6 -6
- package/dist/topology.cjs +6 -6
- package/dist/topology.js +6 -6
- package/package.json +4 -1
- package/dist/Blueprint-BmbNUnGI.cjs +0 -1185
- package/dist/Blueprint-C-JJkkwL.js +0 -1186
- package/dist/curveFns-BhQECv8e.js +0 -180
- package/dist/faceFns-3PDjBeW7.js +0 -272
- package/dist/faceFns-CxaLWOjc.cjs +0 -271
- package/dist/loft-CVb-IjEI.cjs +0 -372
- package/dist/loft-DMFjK6lk.js +0 -373
- package/dist/measurement-CecYIt3s.cjs +0 -134
- package/dist/measurement-DHDLAH7-.js +0 -135
- package/dist/surfaceBuilders-CC0ZQGix.cjs +0 -289
- package/dist/surfaceBuilders-CrJtFu2a.js +0 -290
package/dist/brepjs.js
CHANGED
|
@@ -1,42 +1,87 @@
|
|
|
1
|
+
var __knownSymbol = (name, symbol) => (symbol = Symbol[name]) ? symbol : /* @__PURE__ */ Symbol.for("Symbol." + name);
|
|
2
|
+
var __typeError = (msg) => {
|
|
3
|
+
throw TypeError(msg);
|
|
4
|
+
};
|
|
5
|
+
var __using = (stack, value, async) => {
|
|
6
|
+
if (value != null) {
|
|
7
|
+
if (typeof value !== "object" && typeof value !== "function") __typeError("Object expected");
|
|
8
|
+
var dispose, inner;
|
|
9
|
+
if (async) dispose = value[__knownSymbol("asyncDispose")];
|
|
10
|
+
if (dispose === void 0) {
|
|
11
|
+
dispose = value[__knownSymbol("dispose")];
|
|
12
|
+
if (async) inner = dispose;
|
|
13
|
+
}
|
|
14
|
+
if (typeof dispose !== "function") __typeError("Object not disposable");
|
|
15
|
+
if (inner) dispose = function() {
|
|
16
|
+
try {
|
|
17
|
+
inner.call(this);
|
|
18
|
+
} catch (e8) {
|
|
19
|
+
return Promise.reject(e8);
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
stack.push([async, dispose, value]);
|
|
23
|
+
} else if (async) {
|
|
24
|
+
stack.push([async]);
|
|
25
|
+
}
|
|
26
|
+
return value;
|
|
27
|
+
};
|
|
28
|
+
var __callDispose = (stack, error, hasError) => {
|
|
29
|
+
var E3 = typeof SuppressedError === "function" ? SuppressedError : function(e8, s6, m9, _2) {
|
|
30
|
+
return _2 = Error(m9), _2.name = "SuppressedError", _2.error = e8, _2.suppressed = s6, _2;
|
|
31
|
+
};
|
|
32
|
+
var fail = (e8) => error = hasError ? new E3(e8, error, "An error was suppressed during disposal") : (hasError = true, e8);
|
|
33
|
+
var next = (it) => {
|
|
34
|
+
while (it = stack.pop()) {
|
|
35
|
+
try {
|
|
36
|
+
var result = it[1] && it[1].call(it[2]);
|
|
37
|
+
if (it[0]) return Promise.resolve(result).then(next, (e8) => (fail(e8), next()));
|
|
38
|
+
} catch (e8) {
|
|
39
|
+
fail(e8);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
if (hasError) throw error;
|
|
43
|
+
};
|
|
44
|
+
return next();
|
|
45
|
+
};
|
|
1
46
|
import { g as getKernel, f as makeTriFace, d as toOcPnt, a as toVec3 } from "./occtBoundary-DvBywHyU.js";
|
|
2
47
|
import { h, i, j, k, r, b, t, w, l, n } from "./occtBoundary-DvBywHyU.js";
|
|
3
48
|
import { l as ok, y as translateOcctError, e as err, q as queryError, x as validationError, B as BrepErrorCode, o as occtError, i as ioError, d as isErr, p as typeCastError, u as unwrap } from "./errors-DJ92ermb.js";
|
|
4
49
|
import { O, a, c, b as b2, f, g, m, h as h2, j as j2, k as k2, z, s, t as t2, n as n2, r as r2, v, w as w2 } from "./errors-DJ92ermb.js";
|
|
5
|
-
import { c as castShape,
|
|
6
|
-
import {
|
|
50
|
+
import { c as castShape, D as DisposalScope, e as isFace, k as isShell, l as isSolid, j as isShape3D, v as createSolid, q as createWire, d as isEdge, n as isWire } from "./shapeTypes-Bi_9RZa2.js";
|
|
51
|
+
import { t as t3, r as r3, s as s2, a as a2, b as b3, z as z2, u, A, B, g as g2, i as i2, f as f2, h as h3, m as m2, C, w as w3, o, p } from "./shapeTypes-Bi_9RZa2.js";
|
|
7
52
|
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 v2, a as a3, b as b4, d, e, g as g3, h as
|
|
9
|
-
import { B, d as d2, C, r as r4, t as t4 } from "./Blueprint-
|
|
10
|
-
import { e as curveIsClosed, d as curveStartPoint, c as curveTangentAt, h as curvePointAt, a as curveEndPoint, i as curveLength } from "./curveFns-
|
|
11
|
-
import { j as j3, k as k4, l as
|
|
12
|
-
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-
|
|
13
|
-
import { b as b6, g as g5, r as r5 } from "./loft-
|
|
14
|
-
import { w as walkAssembly, e as extrude$1, r as revolve$1, s as sweep, c as circularPattern, l as linearPattern } from "./operations-
|
|
15
|
-
import { a as a4, b as b7, d as d3, f as f4, g as g6, h as
|
|
16
|
-
import { B as
|
|
53
|
+
import { H, R, v as v2, a as a3, b as b4, d, e, g as g3, h as h4, i as i3, k as k3, l as l2, m as m3, o as o2 } from "./vecOps-ZDdZWbwT.js";
|
|
54
|
+
import { B as B2, d as d2, C as C2, r as r4, t as t4 } from "./Blueprint-DsoGiJNJ.js";
|
|
55
|
+
import { e as curveIsClosed, d as curveStartPoint, c as curveTangentAt, h as curvePointAt, a as curveEndPoint, i as curveLength } from "./curveFns-BHRYwxBM.js";
|
|
56
|
+
import { j as j3, k as k4, l as l3, f as f3, m as m4, b as b5, g as g4, n as n3, o as o3 } from "./curveFns-BHRYwxBM.js";
|
|
57
|
+
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-DTRcYrq2.js";
|
|
58
|
+
import { b as b6, g as g5, r as r5 } from "./loft-DTRcYrq2.js";
|
|
59
|
+
import { w as walkAssembly, e as extrude$1, r as revolve$1, s as sweep, c as circularPattern, l as linearPattern } from "./operations-jRE2QbPo.js";
|
|
60
|
+
import { a as a4, b as b7, d as d3, f as f4, g as g6, h as h5, i as i4, j as j4, k as k5, m as m5, n as n4, o as o4, p as p2, q, t as t5, u as u2, v as v3, x, y, z as z3, A as A2, B as B3, C as C3, D, E } from "./operations-jRE2QbPo.js";
|
|
61
|
+
import { B as B4, a as a5, e as e2, C as C4, F, S, f as f5, l as l4, g as g7, n as n5, k as k6, q as q2, o as o5, p as p3, r as r6 } from "./boolean2D-D5O0F3J8.js";
|
|
17
62
|
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";
|
|
18
|
-
import { l as createTypedFinder, m as faceFinder } from "./helpers-
|
|
19
|
-
import { g as g8 } from "./helpers-
|
|
63
|
+
import { l as createTypedFinder, m as faceFinder } from "./helpers-tNdaX01G.js";
|
|
64
|
+
import { g as g8 } from "./helpers-tNdaX01G.js";
|
|
20
65
|
import { blueprintToDXF, exportDXF, exportGlb, exportGltf, exportOBJ, exportThreeMF, importIGES, importSTEP, importSTL, importSVG, importSVGPathD } from "./io.js";
|
|
21
|
-
import { C as
|
|
66
|
+
import { C as C5, D as D2, a as a6, S as S2, b as b8, X, Y, c as c2, d as d4, e as e3, f as f6, Z, g as g9, h as h6, i as i5, j as j5, k as k7, l as l5, m as m6, n as n6, o as o6, p as p4, q as q3, r as r7, s as s3, t as t6, u as u3, v as v4, w as w4, x as x2, y as y2, z as z4, _, $, a0, a1, A as A3, a2 as a22, B as B5, E as E2, a3 as a32, F as F2, G, 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-hD05g0ZQ.js";
|
|
22
67
|
import { c as c3, a as a7, p as p5, r as r8, t as t7 } from "./vectors-2lOjaa8N.js";
|
|
23
|
-
import { v as vertexPosition, a as getFaces, f as getVertices, d as getEdges, t as translate$1, p as propagateOrigins, h as applyMatrix$1, j as clone$1, k as describe$1, l as isEmpty$1, m as mirror$1, r as rotate$1, s as scale$1, n as simplify$1, o as toBREP$1, q as transformCopy$1, u as getBounds, c as getWires } from "./shapeFns-
|
|
24
|
-
import { w as w5, g as g10, e as e4, x as x3, i as i6, y as
|
|
25
|
-
import { p as propagateFaceTags, a as propagateColors, c as cut$1, f as fuse$1, i as intersect$1, s as section$1, b as sectionToFace$1, d as slice$1, e as split$1, g as fuseAll, h as cutAll } from "./booleanFns
|
|
26
|
-
import { j as j6, k as k8, l as
|
|
27
|
-
import { c as chamferDistAngle, h as heal$1, i as isValid$1 } from "./topology-
|
|
28
|
-
import { a as a8, b as b9, e as e5, f as f7, d as d5, g as g11, j as j7, s as s4, t as t9, k as k9, l as
|
|
29
|
-
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-
|
|
30
|
-
import { l as
|
|
31
|
-
import { m as mesh$1, a as meshEdges$1 } from "./meshFns-
|
|
32
|
-
import { c as c5, b as b10, e as e6, d as d7, f as f9 } from "./meshFns-
|
|
33
|
-
import { m as measureArea, a as measureSurfaceProps, b as measureVolumeProps, c as measureVolume } from "./measurement-
|
|
34
|
-
import { d as d8, e as e7, f as f10, g as g12, h as
|
|
35
|
-
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-
|
|
36
|
-
import { p as p7 } from "./surfaceBuilders-
|
|
68
|
+
import { v as vertexPosition, a as getFaces, f as getVertices, d as getEdges, t as translate$1, p as propagateOrigins, h as applyMatrix$1, j as clone$1, k as describe$1, l as isEmpty$1, m as mirror$1, r as rotate$1, s as scale$1, n as simplify$1, o as toBREP$1, q as transformCopy$1, u as getBounds, c as getWires } from "./shapeFns-DNnBK8fG.js";
|
|
69
|
+
import { w as w5, g as g10, e as e4, x as x3, i as i6, y as y3, z as z5, A as A4, B as B6, C as C6, D as D3 } from "./shapeFns-DNnBK8fG.js";
|
|
70
|
+
import { p as propagateFaceTags, a as propagateColors, c as cut$1, f as fuse$1, i as intersect$1, s as section$1, b as sectionToFace$1, d as slice$1, e as split$1, g as fuseAll, h as cutAll } from "./booleanFns-DOyKxL7q.js";
|
|
71
|
+
import { j as j6, k as k8, l as l6, m as m7, n as n7, o as o7, q as q4, r as r9, t as t8, u as u4 } from "./booleanFns-DOyKxL7q.js";
|
|
72
|
+
import { c as chamferDistAngle, h as heal$1, i as isValid$1 } from "./topology-CMM6vAzx.js";
|
|
73
|
+
import { a as a8, b as b9, e as e5, f as f7, d as d5, g as g11, j as j7, s as s4, t as t9, k as k9, l as l7, v as v5, w as w6 } from "./topology-CMM6vAzx.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-q5CR9pOW.js";
|
|
75
|
+
import { l as l8, c as c4, m as m8, d as d6, f as f8, q as q5, r as r10, s as s5, p as p6, t as t10, v as v6, u as u5, h as h7 } from "./faceFns-q5CR9pOW.js";
|
|
76
|
+
import { m as mesh$1, a as meshEdges$1 } from "./meshFns-DDFl7gLN.js";
|
|
77
|
+
import { c as c5, b as b10, e as e6, d as d7, f as f9 } from "./meshFns-DDFl7gLN.js";
|
|
78
|
+
import { m as measureArea, a as measureSurfaceProps, b as measureVolumeProps, c as measureVolume } from "./measurement-BXqFvcGh.js";
|
|
79
|
+
import { d as d8, e as e7, f as f10, g as g12, h as h8, i as i7 } from "./measurement-BXqFvcGh.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-W9Y25CIb.js";
|
|
81
|
+
import { p as p7 } from "./surfaceBuilders-W9Y25CIb.js";
|
|
37
82
|
import { edgeFinder } from "./query.js";
|
|
38
83
|
import { BrepBugError, bug } from "./result.js";
|
|
39
|
-
import { c as c6 } from "./cornerFinder-
|
|
84
|
+
import { c as c6 } from "./cornerFinder-DH6EwYfL.js";
|
|
40
85
|
import { createOperationRegistry, createTaskQueue, createWorkerClient, createWorkerHandler, dequeueTask, enqueueTask, isDisposeRequest, isErrorResponse, isInitRequest, isOperationRequest, isQueueEmpty, isSuccessResponse, pendingCount, registerHandler, rejectAll } from "./worker.js";
|
|
41
86
|
const errorFactories = {
|
|
42
87
|
OCCT_OPERATION: (code, message, cause) => ({ kind: "OCCT_OPERATION", code, message, cause }),
|
|
@@ -66,6 +111,17 @@ function kernelCallRaw(fn, code, message, kind = "OCCT_OPERATION") {
|
|
|
66
111
|
return err(errorFactories[kind](code, `${message}: ${translatedMessage}`, e8));
|
|
67
112
|
}
|
|
68
113
|
}
|
|
114
|
+
function kernelCallScoped(fn, code, message, kind = "OCCT_OPERATION") {
|
|
115
|
+
var _stack = [];
|
|
116
|
+
try {
|
|
117
|
+
const scope = __using(_stack, new DisposalScope());
|
|
118
|
+
return kernelCall(() => fn(scope), code, message, kind);
|
|
119
|
+
} catch (_2) {
|
|
120
|
+
var _error = _2, _hasError = true;
|
|
121
|
+
} finally {
|
|
122
|
+
__callDispose(_stack, _error, _hasError);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
69
125
|
function isNumber(r11) {
|
|
70
126
|
return typeof r11 === "number";
|
|
71
127
|
}
|
|
@@ -320,13 +376,13 @@ async function surfaceFromImage(blob, options = {}) {
|
|
|
320
376
|
);
|
|
321
377
|
}
|
|
322
378
|
const w7 = bitmap.width;
|
|
323
|
-
const
|
|
324
|
-
if (w7 < 2 ||
|
|
379
|
+
const h9 = bitmap.height;
|
|
380
|
+
if (w7 < 2 || h9 < 2) {
|
|
325
381
|
bitmap.close();
|
|
326
382
|
return err(
|
|
327
383
|
validationError(
|
|
328
384
|
BrepErrorCode.SURFACE_GRID_TOO_SMALL,
|
|
329
|
-
`surfaceFromImage: image too small (${w7}x${
|
|
385
|
+
`surfaceFromImage: image too small (${w7}x${h9}), need at least 2x2`
|
|
330
386
|
)
|
|
331
387
|
);
|
|
332
388
|
}
|
|
@@ -339,7 +395,7 @@ async function surfaceFromImage(blob, options = {}) {
|
|
|
339
395
|
)
|
|
340
396
|
);
|
|
341
397
|
}
|
|
342
|
-
const canvas = new OffscreenCanvas(w7,
|
|
398
|
+
const canvas = new OffscreenCanvas(w7, h9);
|
|
343
399
|
const ctx = canvas.getContext("2d");
|
|
344
400
|
if (!ctx) {
|
|
345
401
|
bitmap.close();
|
|
@@ -349,13 +405,13 @@ async function surfaceFromImage(blob, options = {}) {
|
|
|
349
405
|
}
|
|
350
406
|
ctx.drawImage(bitmap, 0, 0);
|
|
351
407
|
bitmap.close();
|
|
352
|
-
const imageData = ctx.getImageData(0, 0, w7,
|
|
408
|
+
const imageData = ctx.getImageData(0, 0, w7, h9);
|
|
353
409
|
const data = imageData.data;
|
|
354
410
|
const rows = [];
|
|
355
|
-
for (let
|
|
411
|
+
for (let y4 = 0; y4 < h9; y4 += downsample) {
|
|
356
412
|
const row = [];
|
|
357
413
|
for (let x4 = 0; x4 < w7; x4 += downsample) {
|
|
358
|
-
const idx = (
|
|
414
|
+
const idx = (y4 * w7 + x4) * 4;
|
|
359
415
|
const r11 = data[idx] ?? 0;
|
|
360
416
|
const g13 = data[idx + 1] ?? 0;
|
|
361
417
|
const b11 = data[idx + 2] ?? 0;
|
|
@@ -427,56 +483,70 @@ function hull(shapes, options = {}) {
|
|
|
427
483
|
}
|
|
428
484
|
}
|
|
429
485
|
function detectSphere(shape2) {
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
486
|
+
var _stack = [];
|
|
487
|
+
try {
|
|
488
|
+
const oc = getKernel().oc;
|
|
489
|
+
const faces = getFaces(shape2);
|
|
490
|
+
if (faces.length !== 1) return null;
|
|
491
|
+
const face2 = faces[0];
|
|
492
|
+
const scope = __using(_stack, new DisposalScope());
|
|
493
|
+
const adaptor = scope.register(new oc.BRepAdaptor_Surface_2(face2.wrapped, true));
|
|
494
|
+
const surfType = adaptor.GetType();
|
|
495
|
+
if (surfType !== oc.GeomAbs_SurfaceType.GeomAbs_Sphere) return null;
|
|
496
|
+
const ocSphere = adaptor.Sphere();
|
|
497
|
+
const radius = ocSphere.Radius();
|
|
498
|
+
ocSphere.delete();
|
|
499
|
+
return radius;
|
|
500
|
+
} catch (_2) {
|
|
501
|
+
var _error = _2, _hasError = true;
|
|
502
|
+
} finally {
|
|
503
|
+
__callDispose(_stack, _error, _hasError);
|
|
504
|
+
}
|
|
442
505
|
}
|
|
443
506
|
function minkowskiSphere(shape2, radius, tolerance) {
|
|
444
|
-
|
|
445
|
-
const r11 = gcWithScope();
|
|
507
|
+
var _stack = [];
|
|
446
508
|
try {
|
|
447
|
-
const
|
|
448
|
-
const
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
509
|
+
const oc = getKernel().oc;
|
|
510
|
+
const scope = __using(_stack, new DisposalScope());
|
|
511
|
+
try {
|
|
512
|
+
const offsetMaker = scope.register(new oc.BRepOffsetAPI_MakeOffsetShape());
|
|
513
|
+
const progress = scope.register(new oc.Message_ProgressRange_1());
|
|
514
|
+
offsetMaker.PerformByJoin(
|
|
515
|
+
shape2.wrapped,
|
|
516
|
+
radius,
|
|
517
|
+
tolerance,
|
|
518
|
+
oc.BRepOffset_Mode.BRepOffset_Skin,
|
|
519
|
+
false,
|
|
520
|
+
false,
|
|
521
|
+
oc.GeomAbs_JoinType.GeomAbs_Arc,
|
|
522
|
+
false,
|
|
523
|
+
progress
|
|
524
|
+
);
|
|
525
|
+
const resultShape = offsetMaker.Shape();
|
|
526
|
+
const wrapped = castShape(resultShape);
|
|
527
|
+
if (!isShape3D(wrapped)) {
|
|
528
|
+
wrapped[Symbol.dispose]();
|
|
529
|
+
return err(
|
|
530
|
+
typeCastError(
|
|
531
|
+
BrepErrorCode.MINKOWSKI_NOT_3D,
|
|
532
|
+
"Minkowski sphere offset did not produce a 3D shape"
|
|
533
|
+
)
|
|
534
|
+
);
|
|
535
|
+
}
|
|
536
|
+
return ok(wrapped);
|
|
537
|
+
} catch (e8) {
|
|
538
|
+
const raw = e8 instanceof Error ? e8.message : String(e8);
|
|
464
539
|
return err(
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
"
|
|
468
|
-
)
|
|
540
|
+
occtError(BrepErrorCode.MINKOWSKI_FAILED, `Minkowski sphere offset failed: ${raw}`, e8, {
|
|
541
|
+
operation: "minkowski",
|
|
542
|
+
fastPath: "sphere"
|
|
543
|
+
})
|
|
469
544
|
);
|
|
470
545
|
}
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
occtError(BrepErrorCode.MINKOWSKI_FAILED, `Minkowski sphere offset failed: ${raw}`, e8, {
|
|
476
|
-
operation: "minkowski",
|
|
477
|
-
fastPath: "sphere"
|
|
478
|
-
})
|
|
479
|
-
);
|
|
546
|
+
} catch (_2) {
|
|
547
|
+
var _error = _2, _hasError = true;
|
|
548
|
+
} finally {
|
|
549
|
+
__callDispose(_stack, _error, _hasError);
|
|
480
550
|
}
|
|
481
551
|
}
|
|
482
552
|
function minkowskiGeneral(shape2, tool, tolerance) {
|
|
@@ -498,14 +568,28 @@ function minkowskiGeneral(shape2, tool, tolerance) {
|
|
|
498
568
|
}
|
|
499
569
|
const sumPoints = [];
|
|
500
570
|
for (const sv of shapeVerts) {
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
const
|
|
506
|
-
const
|
|
507
|
-
|
|
508
|
-
|
|
571
|
+
var _stack2 = [];
|
|
572
|
+
try {
|
|
573
|
+
const scope1 = __using(_stack2, new DisposalScope());
|
|
574
|
+
const pa = scope1.register(oc.BRep_Tool.Pnt(sv.wrapped));
|
|
575
|
+
const ax = pa.X(), ay = pa.Y(), az = pa.Z();
|
|
576
|
+
for (const tv of toolVerts) {
|
|
577
|
+
var _stack = [];
|
|
578
|
+
try {
|
|
579
|
+
const scope2 = __using(_stack, new DisposalScope());
|
|
580
|
+
const pb = scope2.register(oc.BRep_Tool.Pnt(tv.wrapped));
|
|
581
|
+
const bx = pb.X(), by = pb.Y(), bz = pb.Z();
|
|
582
|
+
sumPoints.push({ x: ax + bx, y: ay + by, z: az + bz });
|
|
583
|
+
} catch (_2) {
|
|
584
|
+
var _error = _2, _hasError = true;
|
|
585
|
+
} finally {
|
|
586
|
+
__callDispose(_stack, _error, _hasError);
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
} catch (_3) {
|
|
590
|
+
var _error2 = _3, _hasError2 = true;
|
|
591
|
+
} finally {
|
|
592
|
+
__callDispose(_stack2, _error2, _hasError2);
|
|
509
593
|
}
|
|
510
594
|
}
|
|
511
595
|
const kernel = getKernel();
|
|
@@ -586,7 +670,7 @@ function polyhedron(points, faces, options = {}) {
|
|
|
586
670
|
}
|
|
587
671
|
try {
|
|
588
672
|
const kernel = getKernel();
|
|
589
|
-
const ptObjs = points.map(([x4,
|
|
673
|
+
const ptObjs = points.map(([x4, y4, z6]) => ({ x: x4, y: y4, z: z6 }));
|
|
590
674
|
const resultOc = kernel.buildSolidFromFaces(ptObjs, triangles, tolerance);
|
|
591
675
|
const cast = castShape(resultOc);
|
|
592
676
|
if (!isSolid(cast)) {
|
|
@@ -610,48 +694,57 @@ function multiSectionSweep(sections, spine, options) {
|
|
|
610
694
|
}
|
|
611
695
|
const { solid: solid2 = true, ruled = false, tolerance = 1e-6 } = options ?? {};
|
|
612
696
|
try {
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
697
|
+
var _stack = [];
|
|
698
|
+
try {
|
|
699
|
+
const oc = getKernel().oc;
|
|
700
|
+
const scope = __using(_stack, new DisposalScope());
|
|
701
|
+
const adaptor = scope.register(new oc.BRepAdaptor_CompCurve_2(spine.wrapped, false));
|
|
702
|
+
const uFirst = Number(adaptor.FirstParameter());
|
|
703
|
+
const uLast = Number(adaptor.LastParameter());
|
|
704
|
+
const uRange = uLast - uFirst;
|
|
705
|
+
const params = sections.map((s6, i8) => {
|
|
706
|
+
if (s6.location !== void 0) {
|
|
707
|
+
return uFirst + s6.location * uRange;
|
|
708
|
+
}
|
|
709
|
+
return uFirst + i8 / (sections.length - 1) * uRange;
|
|
710
|
+
});
|
|
711
|
+
const builder = scope.register(new oc.BRepOffsetAPI_ThruSections(solid2, ruled, tolerance));
|
|
712
|
+
for (let i8 = 0; i8 < sections.length; i8++) {
|
|
713
|
+
const param = params[i8];
|
|
714
|
+
const section2 = sections[i8];
|
|
715
|
+
if (param === void 0 || section2 === void 0) continue;
|
|
716
|
+
const pnt = scope.register(new oc.gp_Pnt_1());
|
|
717
|
+
const tangent = scope.register(new oc.gp_Vec_1());
|
|
718
|
+
adaptor.D1(param, pnt, tangent);
|
|
719
|
+
const tangentDir = scope.register(new oc.gp_Dir_2(tangent));
|
|
720
|
+
const toAx3 = scope.register(new oc.gp_Ax3_4(pnt, tangentDir));
|
|
721
|
+
const trsf = scope.register(new oc.gp_Trsf_1());
|
|
722
|
+
trsf.SetTransformation_2(toAx3);
|
|
723
|
+
trsf.Invert();
|
|
724
|
+
const transformer = scope.register(
|
|
725
|
+
new oc.BRepBuilderAPI_Transform_2(section2.wire.wrapped, trsf, true)
|
|
726
|
+
);
|
|
727
|
+
const transformedShape = transformer.Shape();
|
|
728
|
+
const transformedWire = oc.TopoDS.Wire_1(transformedShape);
|
|
729
|
+
builder.AddWire(transformedWire);
|
|
622
730
|
}
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
const
|
|
629
|
-
if (
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
const transformedShape = transformer.Shape();
|
|
640
|
-
const transformedWire = oc.TopoDS.Wire_1(transformedShape);
|
|
641
|
-
builder.AddWire(transformedWire);
|
|
642
|
-
}
|
|
643
|
-
const progress = r11(new oc.Message_ProgressRange_1());
|
|
644
|
-
builder.Build(progress);
|
|
645
|
-
if (!builder.IsDone()) {
|
|
646
|
-
return err(occtError(BrepErrorCode.MULTI_SWEEP_FAILED, "Multi-section sweep build failed"));
|
|
647
|
-
}
|
|
648
|
-
const result = castShape(builder.Shape());
|
|
649
|
-
if (!isShape3D(result)) {
|
|
650
|
-
return err(
|
|
651
|
-
typeCastError("MULTI_SWEEP_NOT_3D", "Multi-section sweep did not produce a 3D shape")
|
|
652
|
-
);
|
|
731
|
+
const progress = scope.register(new oc.Message_ProgressRange_1());
|
|
732
|
+
builder.Build(progress);
|
|
733
|
+
if (!builder.IsDone()) {
|
|
734
|
+
return err(occtError(BrepErrorCode.MULTI_SWEEP_FAILED, "Multi-section sweep build failed"));
|
|
735
|
+
}
|
|
736
|
+
const result = castShape(builder.Shape());
|
|
737
|
+
if (!isShape3D(result)) {
|
|
738
|
+
return err(
|
|
739
|
+
typeCastError("MULTI_SWEEP_NOT_3D", "Multi-section sweep did not produce a 3D shape")
|
|
740
|
+
);
|
|
741
|
+
}
|
|
742
|
+
return ok(result);
|
|
743
|
+
} catch (_2) {
|
|
744
|
+
var _error = _2, _hasError = true;
|
|
745
|
+
} finally {
|
|
746
|
+
__callDispose(_stack, _error, _hasError);
|
|
653
747
|
}
|
|
654
|
-
return ok(result);
|
|
655
748
|
} catch (e8) {
|
|
656
749
|
const raw = e8 instanceof Error ? e8.message : String(e8);
|
|
657
750
|
return err(
|
|
@@ -662,36 +755,43 @@ function multiSectionSweep(sections, spine, options) {
|
|
|
662
755
|
function guidedSweep(profile, spine, guides, options = {}) {
|
|
663
756
|
const { transition = "transformed", solid: solid2 = true, tolerance } = options;
|
|
664
757
|
try {
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
builder.
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
758
|
+
var _stack = [];
|
|
759
|
+
try {
|
|
760
|
+
const oc = getKernel().oc;
|
|
761
|
+
const scope = __using(_stack, new DisposalScope());
|
|
762
|
+
const builder = scope.register(new oc.BRepOffsetAPI_MakePipeShell(spine.wrapped));
|
|
763
|
+
const modeMap = {
|
|
764
|
+
transformed: oc.BRepBuilderAPI_TransitionMode.BRepBuilderAPI_Transformed,
|
|
765
|
+
round: oc.BRepBuilderAPI_TransitionMode.BRepBuilderAPI_RoundCorner,
|
|
766
|
+
right: oc.BRepBuilderAPI_TransitionMode.BRepBuilderAPI_RightCorner
|
|
767
|
+
};
|
|
768
|
+
builder.SetTransitionMode(modeMap[transition]);
|
|
769
|
+
if (tolerance !== void 0) {
|
|
770
|
+
builder.SetTolerance(tolerance, tolerance, 1e-7);
|
|
771
|
+
}
|
|
772
|
+
if (guides.length > 0) {
|
|
773
|
+
const firstGuide = guides[0];
|
|
774
|
+
builder.SetMode_5(firstGuide.wrapped, false, oc.BRepFill_TypeOfContact.BRepFill_NoContact);
|
|
775
|
+
}
|
|
776
|
+
builder.Add_1(profile.wrapped, false, false);
|
|
777
|
+
const progress = scope.register(new oc.Message_ProgressRange_1());
|
|
778
|
+
builder.Build(progress);
|
|
779
|
+
if (!builder.IsDone()) {
|
|
780
|
+
return err(occtError(BrepErrorCode.GUIDED_SWEEP_FAILED, "Guided sweep build failed"));
|
|
781
|
+
}
|
|
782
|
+
if (solid2) {
|
|
783
|
+
builder.MakeSolid();
|
|
784
|
+
}
|
|
785
|
+
const result = castShape(builder.Shape());
|
|
786
|
+
if (!isShape3D(result)) {
|
|
787
|
+
return err(typeCastError("GUIDED_SWEEP_NOT_3D", "Guided sweep did not produce a 3D shape"));
|
|
788
|
+
}
|
|
789
|
+
return ok(result);
|
|
790
|
+
} catch (_2) {
|
|
791
|
+
var _error = _2, _hasError = true;
|
|
792
|
+
} finally {
|
|
793
|
+
__callDispose(_stack, _error, _hasError);
|
|
693
794
|
}
|
|
694
|
-
return ok(result);
|
|
695
795
|
} catch (e8) {
|
|
696
796
|
const raw = e8 instanceof Error ? e8.message : String(e8);
|
|
697
797
|
return err(occtError(BrepErrorCode.GUIDED_SWEEP_FAILED, `Guided sweep failed: ${raw}`, e8));
|
|
@@ -704,8 +804,8 @@ function cross2(ax, ay, bx, by) {
|
|
|
704
804
|
function dot2(ax, ay, bx, by) {
|
|
705
805
|
return ax * bx + ay * by;
|
|
706
806
|
}
|
|
707
|
-
function len2(x4,
|
|
708
|
-
return Math.sqrt(x4 * x4 +
|
|
807
|
+
function len2(x4, y4) {
|
|
808
|
+
return Math.sqrt(x4 * x4 + y4 * y4);
|
|
709
809
|
}
|
|
710
810
|
function polyAt(poly, i8) {
|
|
711
811
|
const p8 = poly[(i8 % poly.length + poly.length) % poly.length];
|
|
@@ -845,8 +945,8 @@ function computeEvents(lavNodes) {
|
|
|
845
945
|
const t11 = bisectorIntersectTime(node, node.next);
|
|
846
946
|
if (t11 !== null && t11 > EPS) {
|
|
847
947
|
const x4 = node.x + t11 * node.bx;
|
|
848
|
-
const
|
|
849
|
-
events.push({ time: t11, x: x4, y:
|
|
948
|
+
const y4 = node.y + t11 * node.by;
|
|
949
|
+
events.push({ time: t11, x: x4, y: y4, nodeA: node, nodeB: node.next, type: "edge" });
|
|
850
950
|
}
|
|
851
951
|
if (isLavNodeReflex(node)) {
|
|
852
952
|
let cur = node.next.next;
|
|
@@ -855,8 +955,8 @@ function computeEvents(lavNodes) {
|
|
|
855
955
|
const st = raySplitTime(node, cur, cur.next);
|
|
856
956
|
if (st !== null && st > EPS) {
|
|
857
957
|
const x4 = node.x + st * node.bx;
|
|
858
|
-
const
|
|
859
|
-
events.push({ time: st, x: x4, y:
|
|
958
|
+
const y4 = node.y + st * node.by;
|
|
959
|
+
events.push({ time: st, x: x4, y: y4, nodeA: node, nodeB: cur, type: "split" });
|
|
860
960
|
}
|
|
861
961
|
cur = cur.next;
|
|
862
962
|
count++;
|
|
@@ -1524,10 +1624,10 @@ async function importOBJ(blob) {
|
|
|
1524
1624
|
if (line2.startsWith("v ")) {
|
|
1525
1625
|
const parts = line2.split(/\s+/);
|
|
1526
1626
|
const x4 = parseFloat(parts[1] ?? "");
|
|
1527
|
-
const
|
|
1627
|
+
const y4 = parseFloat(parts[2] ?? "");
|
|
1528
1628
|
const z6 = parseFloat(parts[3] ?? "");
|
|
1529
|
-
if (isNaN(x4) || isNaN(
|
|
1530
|
-
vertices.push([x4,
|
|
1629
|
+
if (isNaN(x4) || isNaN(y4) || isNaN(z6)) continue;
|
|
1630
|
+
vertices.push([x4, y4, z6]);
|
|
1531
1631
|
} else if (line2.startsWith("f ")) {
|
|
1532
1632
|
const parts = line2.split(/\s+/).slice(1);
|
|
1533
1633
|
const indices = [];
|
|
@@ -1766,15 +1866,22 @@ function resolve3D(s6) {
|
|
|
1766
1866
|
return resolve(s6);
|
|
1767
1867
|
}
|
|
1768
1868
|
function box(width, depth, height, options) {
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1869
|
+
var _stack = [];
|
|
1870
|
+
try {
|
|
1871
|
+
const oc = getKernel().oc;
|
|
1872
|
+
const scope = __using(_stack, new DisposalScope());
|
|
1873
|
+
const maker = scope.register(new oc.BRepPrimAPI_MakeBox_2(width, depth, height));
|
|
1874
|
+
const solid2 = createSolid(maker.Solid());
|
|
1875
|
+
const center = options?.at ?? (options?.centered ? [0, 0, 0] : void 0);
|
|
1876
|
+
if (center) {
|
|
1877
|
+
return translate$1(solid2, [center[0] - width / 2, center[1] - depth / 2, center[2] - height / 2]);
|
|
1878
|
+
}
|
|
1879
|
+
return solid2;
|
|
1880
|
+
} catch (_2) {
|
|
1881
|
+
var _error = _2, _hasError = true;
|
|
1882
|
+
} finally {
|
|
1883
|
+
__callDispose(_stack, _error, _hasError);
|
|
1776
1884
|
}
|
|
1777
|
-
return solid2;
|
|
1778
1885
|
}
|
|
1779
1886
|
function cylinder(radius, height, options) {
|
|
1780
1887
|
const at = options?.at ?? [0, 0, 0];
|
|
@@ -1909,18 +2016,25 @@ function thicken$1(shape2, thickness) {
|
|
|
1909
2016
|
const check = validateNotNull(shape2, "thicken: shape");
|
|
1910
2017
|
if (isErr(check)) return check;
|
|
1911
2018
|
try {
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
2019
|
+
var _stack = [];
|
|
2020
|
+
try {
|
|
2021
|
+
const oc = getKernel().oc;
|
|
2022
|
+
const scope = __using(_stack, new DisposalScope());
|
|
2023
|
+
const builder = scope.register(new oc.BRepOffsetAPI_MakeThickSolid());
|
|
2024
|
+
builder.MakeThickSolidBySimple(shape2.wrapped, thickness);
|
|
2025
|
+
const progress = scope.register(new oc.Message_ProgressRange_1());
|
|
2026
|
+
builder.Build(progress);
|
|
2027
|
+
const resultOc = builder.Shape();
|
|
2028
|
+
const cast = castShape(resultOc);
|
|
2029
|
+
propagateOrigins(builder, [shape2], cast);
|
|
2030
|
+
propagateFaceTags(builder, [shape2], cast);
|
|
2031
|
+
propagateColors(builder, [shape2], cast);
|
|
2032
|
+
return ok(cast);
|
|
2033
|
+
} catch (_2) {
|
|
2034
|
+
var _error = _2, _hasError = true;
|
|
2035
|
+
} finally {
|
|
2036
|
+
__callDispose(_stack, _error, _hasError);
|
|
2037
|
+
}
|
|
1924
2038
|
} catch (e8) {
|
|
1925
2039
|
const raw = e8 instanceof Error ? e8.message : String(e8);
|
|
1926
2040
|
return err(occtError("THICKEN_FAILED", `Thicken operation failed: ${raw}`, e8));
|
|
@@ -1964,29 +2078,36 @@ function fillet$1(shape2, edges, radius) {
|
|
|
1964
2078
|
);
|
|
1965
2079
|
}
|
|
1966
2080
|
try {
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
2081
|
+
var _stack = [];
|
|
2082
|
+
try {
|
|
2083
|
+
const oc = getKernel().oc;
|
|
2084
|
+
const scope = __using(_stack, new DisposalScope());
|
|
2085
|
+
const builder = scope.register(
|
|
2086
|
+
new oc.BRepFilletAPI_MakeFillet(shape2.wrapped, oc.ChFi3d_FilletShape.ChFi3d_Rational)
|
|
2087
|
+
);
|
|
2088
|
+
for (const edge of selectedEdges) {
|
|
2089
|
+
const rad = typeof radius === "function" ? radius(edge) ?? 0 : radius;
|
|
2090
|
+
if (typeof rad === "number") {
|
|
2091
|
+
if (rad > 0) builder.Add_2(rad, edge.wrapped);
|
|
2092
|
+
} else {
|
|
2093
|
+
const [r1, r22] = rad;
|
|
2094
|
+
if (r1 > 0 && r22 > 0) builder.Add_3(r1, r22, edge.wrapped);
|
|
2095
|
+
}
|
|
1979
2096
|
}
|
|
2097
|
+
const resultOc = builder.Shape();
|
|
2098
|
+
const cast = castShape(resultOc);
|
|
2099
|
+
if (!isShape3D(cast)) {
|
|
2100
|
+
return err(occtError(BrepErrorCode.FILLET_NOT_3D, "Fillet result is not a 3D shape"));
|
|
2101
|
+
}
|
|
2102
|
+
propagateOrigins(builder, [shape2], cast);
|
|
2103
|
+
propagateFaceTags(builder, [shape2], cast);
|
|
2104
|
+
propagateColors(builder, [shape2], cast);
|
|
2105
|
+
return ok(cast);
|
|
2106
|
+
} catch (_2) {
|
|
2107
|
+
var _error = _2, _hasError = true;
|
|
2108
|
+
} finally {
|
|
2109
|
+
__callDispose(_stack, _error, _hasError);
|
|
1980
2110
|
}
|
|
1981
|
-
const resultOc = builder.Shape();
|
|
1982
|
-
const cast = castShape(resultOc);
|
|
1983
|
-
if (!isShape3D(cast)) {
|
|
1984
|
-
return err(occtError(BrepErrorCode.FILLET_NOT_3D, "Fillet result is not a 3D shape"));
|
|
1985
|
-
}
|
|
1986
|
-
propagateOrigins(builder, [shape2], cast);
|
|
1987
|
-
propagateFaceTags(builder, [shape2], cast);
|
|
1988
|
-
propagateColors(builder, [shape2], cast);
|
|
1989
|
-
return ok(cast);
|
|
1990
2111
|
} catch (e8) {
|
|
1991
2112
|
const raw = e8 instanceof Error ? e8.message : String(e8);
|
|
1992
2113
|
return err(
|
|
@@ -2028,61 +2149,68 @@ function chamfer$1(shape2, edges, distance) {
|
|
|
2028
2149
|
return err(validationError(BrepErrorCode.CHAMFER_NO_EDGES, "No edges found for chamfer"));
|
|
2029
2150
|
}
|
|
2030
2151
|
try {
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
oc.
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
while (faceExp.More()) {
|
|
2040
|
-
const face2 = oc.TopoDS.Face_1(faceExp.Current());
|
|
2041
|
-
const edgeExp = new oc.TopExp_Explorer_2(
|
|
2042
|
-
face2,
|
|
2043
|
-
oc.TopAbs_ShapeEnum.TopAbs_EDGE,
|
|
2152
|
+
var _stack = [];
|
|
2153
|
+
try {
|
|
2154
|
+
let getEdgeFaceMap = function() {
|
|
2155
|
+
if (edgeFaceMap) return edgeFaceMap;
|
|
2156
|
+
edgeFaceMap = /* @__PURE__ */ new Map();
|
|
2157
|
+
const faceExp = new oc.TopExp_Explorer_2(
|
|
2158
|
+
shape2.wrapped,
|
|
2159
|
+
oc.TopAbs_ShapeEnum.TopAbs_FACE,
|
|
2044
2160
|
oc.TopAbs_ShapeEnum.TopAbs_SHAPE
|
|
2045
2161
|
);
|
|
2046
|
-
while (
|
|
2047
|
-
const
|
|
2048
|
-
|
|
2049
|
-
|
|
2162
|
+
while (faceExp.More()) {
|
|
2163
|
+
const face2 = oc.TopoDS.Face_1(faceExp.Current());
|
|
2164
|
+
const edgeExp = new oc.TopExp_Explorer_2(
|
|
2165
|
+
face2,
|
|
2166
|
+
oc.TopAbs_ShapeEnum.TopAbs_EDGE,
|
|
2167
|
+
oc.TopAbs_ShapeEnum.TopAbs_SHAPE
|
|
2168
|
+
);
|
|
2169
|
+
while (edgeExp.More()) {
|
|
2170
|
+
const hash = edgeExp.Current().HashCode(2147483647);
|
|
2171
|
+
if (!edgeFaceMap.has(hash)) {
|
|
2172
|
+
edgeFaceMap.set(hash, face2);
|
|
2173
|
+
}
|
|
2174
|
+
edgeExp.Next();
|
|
2050
2175
|
}
|
|
2051
|
-
edgeExp.
|
|
2176
|
+
edgeExp.delete();
|
|
2177
|
+
faceExp.Next();
|
|
2052
2178
|
}
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
}
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
if (face2) {
|
|
2072
|
-
builder.Add_3(d1, d22, oc.TopoDS.Edge_1(edge.wrapped), face2);
|
|
2179
|
+
faceExp.delete();
|
|
2180
|
+
return edgeFaceMap;
|
|
2181
|
+
};
|
|
2182
|
+
const oc = getKernel().oc;
|
|
2183
|
+
const scope = __using(_stack, new DisposalScope());
|
|
2184
|
+
const builder = scope.register(new oc.BRepFilletAPI_MakeChamfer(shape2.wrapped));
|
|
2185
|
+
let edgeFaceMap = null;
|
|
2186
|
+
for (const edge of selectedEdges) {
|
|
2187
|
+
const d9 = typeof distance === "function" ? distance(edge) ?? 0 : distance;
|
|
2188
|
+
if (typeof d9 === "number") {
|
|
2189
|
+
if (d9 > 0) builder.Add_2(d9, edge.wrapped);
|
|
2190
|
+
} else {
|
|
2191
|
+
const [d1, d22] = d9;
|
|
2192
|
+
if (d1 > 0 && d22 > 0) {
|
|
2193
|
+
const face2 = getEdgeFaceMap().get(edge.wrapped.HashCode(2147483647));
|
|
2194
|
+
if (face2) {
|
|
2195
|
+
builder.Add_3(d1, d22, oc.TopoDS.Edge_1(edge.wrapped), face2);
|
|
2196
|
+
}
|
|
2073
2197
|
}
|
|
2074
2198
|
}
|
|
2075
2199
|
}
|
|
2200
|
+
const resultOc = builder.Shape();
|
|
2201
|
+
const cast = castShape(resultOc);
|
|
2202
|
+
if (!isShape3D(cast)) {
|
|
2203
|
+
return err(occtError(BrepErrorCode.CHAMFER_NOT_3D, "Chamfer result is not a 3D shape"));
|
|
2204
|
+
}
|
|
2205
|
+
propagateOrigins(builder, [shape2], cast);
|
|
2206
|
+
propagateFaceTags(builder, [shape2], cast);
|
|
2207
|
+
propagateColors(builder, [shape2], cast);
|
|
2208
|
+
return ok(cast);
|
|
2209
|
+
} catch (_2) {
|
|
2210
|
+
var _error = _2, _hasError = true;
|
|
2211
|
+
} finally {
|
|
2212
|
+
__callDispose(_stack, _error, _hasError);
|
|
2076
2213
|
}
|
|
2077
|
-
const resultOc = builder.Shape();
|
|
2078
|
-
const cast = castShape(resultOc);
|
|
2079
|
-
if (!isShape3D(cast)) {
|
|
2080
|
-
return err(occtError(BrepErrorCode.CHAMFER_NOT_3D, "Chamfer result is not a 3D shape"));
|
|
2081
|
-
}
|
|
2082
|
-
propagateOrigins(builder, [shape2], cast);
|
|
2083
|
-
propagateFaceTags(builder, [shape2], cast);
|
|
2084
|
-
propagateColors(builder, [shape2], cast);
|
|
2085
|
-
return ok(cast);
|
|
2086
2214
|
} catch (e8) {
|
|
2087
2215
|
const raw = e8 instanceof Error ? e8.message : String(e8);
|
|
2088
2216
|
return err(
|
|
@@ -2104,35 +2232,42 @@ function shell$1(shape2, faces, thickness, tolerance = 1e-3) {
|
|
|
2104
2232
|
return err(validationError("NO_FACES", "At least one face must be specified for shell"));
|
|
2105
2233
|
}
|
|
2106
2234
|
try {
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
facesToRemove.
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2235
|
+
var _stack = [];
|
|
2236
|
+
try {
|
|
2237
|
+
const oc = getKernel().oc;
|
|
2238
|
+
const scope = __using(_stack, new DisposalScope());
|
|
2239
|
+
const facesToRemove = scope.register(new oc.TopTools_ListOfShape_1());
|
|
2240
|
+
for (const face2 of faces) {
|
|
2241
|
+
facesToRemove.Append_1(face2.wrapped);
|
|
2242
|
+
}
|
|
2243
|
+
const progress = scope.register(new oc.Message_ProgressRange_1());
|
|
2244
|
+
const builder = scope.register(new oc.BRepOffsetAPI_MakeThickSolid());
|
|
2245
|
+
builder.MakeThickSolidByJoin(
|
|
2246
|
+
shape2.wrapped,
|
|
2247
|
+
facesToRemove,
|
|
2248
|
+
-thickness,
|
|
2249
|
+
tolerance,
|
|
2250
|
+
oc.BRepOffset_Mode.BRepOffset_Skin,
|
|
2251
|
+
false,
|
|
2252
|
+
false,
|
|
2253
|
+
oc.GeomAbs_JoinType.GeomAbs_Arc,
|
|
2254
|
+
false,
|
|
2255
|
+
progress
|
|
2256
|
+
);
|
|
2257
|
+
const resultOc = builder.Shape();
|
|
2258
|
+
const cast = castShape(resultOc);
|
|
2259
|
+
if (!isShape3D(cast)) {
|
|
2260
|
+
return err(occtError("SHELL_RESULT_NOT_3D", "Shell result is not a 3D shape"));
|
|
2261
|
+
}
|
|
2262
|
+
propagateOrigins(builder, [shape2], cast);
|
|
2263
|
+
propagateFaceTags(builder, [shape2], cast);
|
|
2264
|
+
propagateColors(builder, [shape2], cast);
|
|
2265
|
+
return ok(cast);
|
|
2266
|
+
} catch (_2) {
|
|
2267
|
+
var _error = _2, _hasError = true;
|
|
2268
|
+
} finally {
|
|
2269
|
+
__callDispose(_stack, _error, _hasError);
|
|
2131
2270
|
}
|
|
2132
|
-
propagateOrigins(builder, [shape2], cast);
|
|
2133
|
-
propagateFaceTags(builder, [shape2], cast);
|
|
2134
|
-
propagateColors(builder, [shape2], cast);
|
|
2135
|
-
return ok(cast);
|
|
2136
2271
|
} catch (e8) {
|
|
2137
2272
|
const raw = e8 instanceof Error ? e8.message : String(e8);
|
|
2138
2273
|
return err(
|
|
@@ -2151,30 +2286,37 @@ function offset$1(shape2, distance, tolerance = 1e-6) {
|
|
|
2151
2286
|
return err(validationError("ZERO_OFFSET", "Offset distance cannot be zero"));
|
|
2152
2287
|
}
|
|
2153
2288
|
try {
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2289
|
+
var _stack = [];
|
|
2290
|
+
try {
|
|
2291
|
+
const oc = getKernel().oc;
|
|
2292
|
+
const scope = __using(_stack, new DisposalScope());
|
|
2293
|
+
const progress = scope.register(new oc.Message_ProgressRange_1());
|
|
2294
|
+
const builder = scope.register(new oc.BRepOffsetAPI_MakeOffsetShape());
|
|
2295
|
+
builder.PerformByJoin(
|
|
2296
|
+
shape2.wrapped,
|
|
2297
|
+
distance,
|
|
2298
|
+
tolerance,
|
|
2299
|
+
oc.BRepOffset_Mode.BRepOffset_Skin,
|
|
2300
|
+
false,
|
|
2301
|
+
false,
|
|
2302
|
+
oc.GeomAbs_JoinType.GeomAbs_Arc,
|
|
2303
|
+
false,
|
|
2304
|
+
progress
|
|
2305
|
+
);
|
|
2306
|
+
const resultOc = builder.Shape();
|
|
2307
|
+
const cast = castShape(resultOc);
|
|
2308
|
+
if (!isShape3D(cast)) {
|
|
2309
|
+
return err(occtError("OFFSET_RESULT_NOT_3D", "Offset result is not a 3D shape"));
|
|
2310
|
+
}
|
|
2311
|
+
propagateOrigins(builder, [shape2], cast);
|
|
2312
|
+
propagateFaceTags(builder, [shape2], cast);
|
|
2313
|
+
propagateColors(builder, [shape2], cast);
|
|
2314
|
+
return ok(cast);
|
|
2315
|
+
} catch (_2) {
|
|
2316
|
+
var _error = _2, _hasError = true;
|
|
2317
|
+
} finally {
|
|
2318
|
+
__callDispose(_stack, _error, _hasError);
|
|
2173
2319
|
}
|
|
2174
|
-
propagateOrigins(builder, [shape2], cast);
|
|
2175
|
-
propagateFaceTags(builder, [shape2], cast);
|
|
2176
|
-
propagateColors(builder, [shape2], cast);
|
|
2177
|
-
return ok(cast);
|
|
2178
2320
|
} catch (e8) {
|
|
2179
2321
|
const raw = e8 instanceof Error ? e8.message : String(e8);
|
|
2180
2322
|
return err(occtError("OFFSET_FAILED", `Offset operation failed: ${raw}`, e8));
|
|
@@ -2333,35 +2475,42 @@ function isEmpty(shape2) {
|
|
|
2333
2475
|
return isEmpty$1(resolve(shape2));
|
|
2334
2476
|
}
|
|
2335
2477
|
function loft$1(wires, { ruled = true, startPoint, endPoint } = {}, returnShell = false) {
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
const
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2478
|
+
var _stack = [];
|
|
2479
|
+
try {
|
|
2480
|
+
if (wires.length === 0 && !startPoint && !endPoint) {
|
|
2481
|
+
return err(validationError("LOFT_EMPTY", "Loft requires at least one wire or start/end point"));
|
|
2482
|
+
}
|
|
2483
|
+
const oc = getKernel().oc;
|
|
2484
|
+
const scope = __using(_stack, new DisposalScope());
|
|
2485
|
+
const builder = scope.register(new oc.BRepOffsetAPI_ThruSections(!returnShell, ruled, 1e-6));
|
|
2486
|
+
if (startPoint) {
|
|
2487
|
+
const pnt = scope.register(toOcPnt(toVec3(startPoint)));
|
|
2488
|
+
const vMaker = scope.register(new oc.BRepBuilderAPI_MakeVertex(pnt));
|
|
2489
|
+
builder.AddVertex(vMaker.Vertex());
|
|
2490
|
+
}
|
|
2491
|
+
for (const w7 of wires) {
|
|
2492
|
+
builder.AddWire(w7.wrapped);
|
|
2493
|
+
}
|
|
2494
|
+
if (endPoint) {
|
|
2495
|
+
const pnt = scope.register(toOcPnt(toVec3(endPoint)));
|
|
2496
|
+
const vMaker = scope.register(new oc.BRepBuilderAPI_MakeVertex(pnt));
|
|
2497
|
+
builder.AddVertex(vMaker.Vertex());
|
|
2498
|
+
}
|
|
2499
|
+
const progress = scope.register(new oc.Message_ProgressRange_1());
|
|
2500
|
+
builder.Build(progress);
|
|
2501
|
+
if (!builder.IsDone()) {
|
|
2502
|
+
return err(occtError("LOFT_FAILED", "Loft operation failed"));
|
|
2503
|
+
}
|
|
2504
|
+
const result = castShape(builder.Shape());
|
|
2505
|
+
if (!isShape3D(result)) {
|
|
2506
|
+
return err(typeCastError("LOFT_NOT_3D", "Loft did not produce a 3D shape"));
|
|
2507
|
+
}
|
|
2508
|
+
return ok(result);
|
|
2509
|
+
} catch (_2) {
|
|
2510
|
+
var _error = _2, _hasError = true;
|
|
2511
|
+
} finally {
|
|
2512
|
+
__callDispose(_stack, _error, _hasError);
|
|
2363
2513
|
}
|
|
2364
|
-
return ok(result);
|
|
2365
2514
|
}
|
|
2366
2515
|
function extrude(face2, height) {
|
|
2367
2516
|
const f11 = resolve(face2);
|
|
@@ -2676,20 +2825,20 @@ function shape(s6) {
|
|
|
2676
2825
|
throw new Error("shape() requires a Sketch or branded shape type");
|
|
2677
2826
|
}
|
|
2678
2827
|
export {
|
|
2679
|
-
|
|
2680
|
-
|
|
2828
|
+
B4 as BaseSketcher2d,
|
|
2829
|
+
B2 as Blueprint,
|
|
2681
2830
|
a5 as BlueprintSketcher,
|
|
2682
2831
|
e2 as Blueprints,
|
|
2683
2832
|
d2 as BoundingBox2d,
|
|
2684
2833
|
BrepBugError,
|
|
2685
2834
|
BrepErrorCode,
|
|
2686
2835
|
BrepWrapperError,
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2836
|
+
C4 as CompoundBlueprint,
|
|
2837
|
+
C5 as CompoundSketch,
|
|
2838
|
+
C2 as Curve2D,
|
|
2690
2839
|
DEG2RAD,
|
|
2691
|
-
|
|
2692
|
-
|
|
2840
|
+
DisposalScope,
|
|
2841
|
+
D2 as Drawing,
|
|
2693
2842
|
a6 as DrawingPen,
|
|
2694
2843
|
F as FaceSketcher,
|
|
2695
2844
|
H as HASH_CODE_MAX,
|
|
@@ -2707,7 +2856,7 @@ export {
|
|
|
2707
2856
|
j6 as applyGlue,
|
|
2708
2857
|
applyMatrix,
|
|
2709
2858
|
j3 as approximateCurve,
|
|
2710
|
-
|
|
2859
|
+
l8 as asTopo,
|
|
2711
2860
|
b9 as autoHeal,
|
|
2712
2861
|
r4 as axis2d,
|
|
2713
2862
|
b6 as basicFaceExtrusion,
|
|
@@ -2727,13 +2876,13 @@ export {
|
|
|
2727
2876
|
checkInterference,
|
|
2728
2877
|
circle,
|
|
2729
2878
|
circularPattern,
|
|
2730
|
-
|
|
2879
|
+
m8 as classifyPointOnFace,
|
|
2731
2880
|
c5 as clearMeshCache,
|
|
2732
2881
|
clone,
|
|
2733
2882
|
c as collect,
|
|
2734
2883
|
d3 as collectShapes,
|
|
2735
2884
|
k8 as colorFaces,
|
|
2736
|
-
|
|
2885
|
+
l6 as colorShape,
|
|
2737
2886
|
f4 as complexExtrude,
|
|
2738
2887
|
w5 as composeTransforms,
|
|
2739
2888
|
compound,
|
|
@@ -2746,14 +2895,14 @@ export {
|
|
|
2746
2895
|
cone,
|
|
2747
2896
|
c6 as cornerFinder,
|
|
2748
2897
|
g6 as countNodes,
|
|
2749
|
-
|
|
2898
|
+
h5 as createAssembly,
|
|
2750
2899
|
i4 as createAssemblyNode,
|
|
2751
2900
|
createBlueprint,
|
|
2752
2901
|
Z as createCamera,
|
|
2753
|
-
|
|
2902
|
+
t3 as createCompound,
|
|
2754
2903
|
d8 as createDistanceQuery,
|
|
2755
|
-
|
|
2756
|
-
|
|
2904
|
+
r3 as createEdge,
|
|
2905
|
+
s2 as createFace,
|
|
2757
2906
|
a2 as createHandle,
|
|
2758
2907
|
j4 as createHistory,
|
|
2759
2908
|
b10 as createMeshCache,
|
|
@@ -2762,10 +2911,10 @@ export {
|
|
|
2762
2911
|
createOperationRegistry,
|
|
2763
2912
|
a7 as createPlane,
|
|
2764
2913
|
k5 as createRegistry,
|
|
2765
|
-
|
|
2914
|
+
z2 as createShell,
|
|
2766
2915
|
createSolid,
|
|
2767
2916
|
createTaskQueue,
|
|
2768
|
-
|
|
2917
|
+
u as createVertex,
|
|
2769
2918
|
createWire,
|
|
2770
2919
|
createWorkerClient,
|
|
2771
2920
|
createWorkerHandler,
|
|
@@ -2781,38 +2930,38 @@ export {
|
|
|
2781
2930
|
curveIsClosed,
|
|
2782
2931
|
k4 as curveIsPeriodic,
|
|
2783
2932
|
curveLength,
|
|
2784
|
-
|
|
2933
|
+
l3 as curvePeriod,
|
|
2785
2934
|
curvePointAt,
|
|
2786
2935
|
curveStartPoint,
|
|
2787
2936
|
curveTangentAt,
|
|
2788
2937
|
cut,
|
|
2789
2938
|
f5 as cut2D,
|
|
2790
2939
|
cutAll,
|
|
2791
|
-
|
|
2940
|
+
l4 as cutBlueprints,
|
|
2792
2941
|
cylinder,
|
|
2793
2942
|
dequeueTask,
|
|
2794
2943
|
describe,
|
|
2795
2944
|
g9 as deserializeDrawing,
|
|
2796
2945
|
fromBREP$1 as deserializeShape,
|
|
2797
2946
|
d6 as downcast,
|
|
2798
|
-
|
|
2947
|
+
h6 as draw,
|
|
2799
2948
|
i5 as drawCircle,
|
|
2800
2949
|
j5 as drawEllipse,
|
|
2801
2950
|
k7 as drawFaceOutline,
|
|
2802
|
-
|
|
2803
|
-
|
|
2951
|
+
l5 as drawParametricFunction,
|
|
2952
|
+
m6 as drawPointsInterpolation,
|
|
2804
2953
|
n6 as drawPolysides,
|
|
2805
|
-
|
|
2954
|
+
o6 as drawProjection,
|
|
2806
2955
|
p4 as drawRectangle,
|
|
2807
|
-
|
|
2956
|
+
q3 as drawRoundedRectangle,
|
|
2808
2957
|
r7 as drawSingleCircle,
|
|
2809
2958
|
s3 as drawSingleEllipse,
|
|
2810
2959
|
t6 as drawText,
|
|
2811
|
-
|
|
2960
|
+
u3 as drawingChamfer,
|
|
2812
2961
|
v4 as drawingCut,
|
|
2813
2962
|
w4 as drawingFillet,
|
|
2814
2963
|
x2 as drawingFuse,
|
|
2815
|
-
|
|
2964
|
+
y2 as drawingIntersect,
|
|
2816
2965
|
z4 as drawingToSketchOnPlane,
|
|
2817
2966
|
drill,
|
|
2818
2967
|
edgeFinder,
|
|
@@ -2822,7 +2971,7 @@ export {
|
|
|
2822
2971
|
ellipsoid,
|
|
2823
2972
|
enqueueTask,
|
|
2824
2973
|
err,
|
|
2825
|
-
|
|
2974
|
+
m5 as exportAssemblySTEP,
|
|
2826
2975
|
exportDXF,
|
|
2827
2976
|
exportGlb,
|
|
2828
2977
|
exportGltf,
|
|
@@ -2836,18 +2985,18 @@ export {
|
|
|
2836
2985
|
faceCenter,
|
|
2837
2986
|
faceFinder,
|
|
2838
2987
|
f8 as faceGeomType,
|
|
2839
|
-
|
|
2988
|
+
q5 as faceOrientation,
|
|
2840
2989
|
f7 as facesOfEdge,
|
|
2841
2990
|
p7 as fill,
|
|
2842
2991
|
filledFace,
|
|
2843
2992
|
fillet,
|
|
2844
2993
|
f3 as findCurveType,
|
|
2845
|
-
|
|
2994
|
+
m7 as findFacesByTag,
|
|
2846
2995
|
n4 as findNode,
|
|
2847
|
-
|
|
2996
|
+
o4 as findStep,
|
|
2848
2997
|
f as flatMap,
|
|
2849
2998
|
r10 as flipFaceOrientation,
|
|
2850
|
-
|
|
2999
|
+
m4 as flipOrientation,
|
|
2851
3000
|
_ as fontMetrics,
|
|
2852
3001
|
fromBREP,
|
|
2853
3002
|
h as fromOcDir,
|
|
@@ -2857,8 +3006,8 @@ export {
|
|
|
2857
3006
|
g7 as fuse2D,
|
|
2858
3007
|
fuseAll,
|
|
2859
3008
|
n5 as fuseBlueprints,
|
|
2860
|
-
|
|
2861
|
-
gcWithScope,
|
|
3009
|
+
A as gcWithObject,
|
|
3010
|
+
B as gcWithScope,
|
|
2862
3011
|
g5 as genericSweep,
|
|
2863
3012
|
getBounds,
|
|
2864
3013
|
getBounds2D,
|
|
@@ -2866,7 +3015,7 @@ export {
|
|
|
2866
3015
|
getEdges,
|
|
2867
3016
|
n7 as getFaceColor,
|
|
2868
3017
|
g10 as getFaceOrigins,
|
|
2869
|
-
|
|
3018
|
+
o7 as getFaceTags,
|
|
2870
3019
|
getFaces,
|
|
2871
3020
|
$ as getFont,
|
|
2872
3021
|
e4 as getHashCode,
|
|
@@ -2874,7 +3023,7 @@ export {
|
|
|
2874
3023
|
getKernel,
|
|
2875
3024
|
g4 as getOrientation,
|
|
2876
3025
|
getOrientation2D,
|
|
2877
|
-
|
|
3026
|
+
q4 as getShapeColor,
|
|
2878
3027
|
g2 as getShapeKind,
|
|
2879
3028
|
g8 as getSingleFace,
|
|
2880
3029
|
getSurfaceType,
|
|
@@ -2901,7 +3050,7 @@ export {
|
|
|
2901
3050
|
n3 as interpolateCurve,
|
|
2902
3051
|
intersect,
|
|
2903
3052
|
k6 as intersect2D,
|
|
2904
|
-
|
|
3053
|
+
q2 as intersectBlueprints,
|
|
2905
3054
|
ioError,
|
|
2906
3055
|
isChamferRadius,
|
|
2907
3056
|
s5 as isCompSolid,
|
|
@@ -2916,33 +3065,35 @@ export {
|
|
|
2916
3065
|
isFilletRadius,
|
|
2917
3066
|
isInitRequest,
|
|
2918
3067
|
isInside2D,
|
|
3068
|
+
f2 as isLive,
|
|
2919
3069
|
isNumber,
|
|
2920
3070
|
g as isOk,
|
|
2921
3071
|
isOperationRequest,
|
|
2922
3072
|
a0 as isProjectionPlane,
|
|
2923
3073
|
isQueueEmpty,
|
|
2924
3074
|
i6 as isSameShape,
|
|
2925
|
-
|
|
3075
|
+
h3 as isShape1D,
|
|
2926
3076
|
isShape3D,
|
|
2927
3077
|
isShell,
|
|
2928
3078
|
isSolid,
|
|
2929
3079
|
isSuccessResponse,
|
|
2930
3080
|
isValid,
|
|
2931
|
-
|
|
3081
|
+
m2 as isVertex,
|
|
2932
3082
|
isWire,
|
|
2933
|
-
|
|
3083
|
+
y3 as iterEdges,
|
|
2934
3084
|
z5 as iterFaces,
|
|
2935
3085
|
iterTopo,
|
|
2936
|
-
|
|
2937
|
-
|
|
3086
|
+
A4 as iterVertices,
|
|
3087
|
+
B6 as iterWires,
|
|
2938
3088
|
kernelCall,
|
|
2939
3089
|
kernelCallRaw,
|
|
3090
|
+
kernelCallScoped,
|
|
2940
3091
|
line,
|
|
2941
3092
|
linearPattern,
|
|
2942
3093
|
a1 as loadFont,
|
|
2943
|
-
|
|
3094
|
+
C as localGC,
|
|
2944
3095
|
loft,
|
|
2945
|
-
|
|
3096
|
+
A3 as makeBaseBox,
|
|
2946
3097
|
t4 as makePlane,
|
|
2947
3098
|
a22 as makeProjectedEdges,
|
|
2948
3099
|
m as map,
|
|
@@ -2952,7 +3103,7 @@ export {
|
|
|
2952
3103
|
e7 as measureCurvatureAt,
|
|
2953
3104
|
f10 as measureCurvatureAtMid,
|
|
2954
3105
|
g12 as measureDistance,
|
|
2955
|
-
|
|
3106
|
+
h8 as measureLength,
|
|
2956
3107
|
i7 as measureLinearProps,
|
|
2957
3108
|
measureSurfaceProps,
|
|
2958
3109
|
measureVolume,
|
|
@@ -2962,18 +3113,18 @@ export {
|
|
|
2962
3113
|
minkowski,
|
|
2963
3114
|
mirror,
|
|
2964
3115
|
mirror2D,
|
|
2965
|
-
|
|
3116
|
+
B5 as mirrorDrawing,
|
|
2966
3117
|
mirrorJoin,
|
|
2967
|
-
|
|
3118
|
+
q as modifyStep,
|
|
2968
3119
|
k2 as moduleInitError,
|
|
2969
3120
|
multiSectionSweep,
|
|
2970
3121
|
normalAt,
|
|
2971
3122
|
occtError,
|
|
2972
3123
|
offset,
|
|
2973
3124
|
offsetFace,
|
|
2974
|
-
|
|
3125
|
+
o3 as offsetWire2D,
|
|
2975
3126
|
ok,
|
|
2976
|
-
|
|
3127
|
+
o5 as organiseBlueprints,
|
|
2977
3128
|
outerWire,
|
|
2978
3129
|
pendingCount,
|
|
2979
3130
|
z as pipeline,
|
|
@@ -2990,12 +3141,12 @@ export {
|
|
|
2990
3141
|
rectangularPattern,
|
|
2991
3142
|
registerHandler,
|
|
2992
3143
|
t5 as registerOperation,
|
|
2993
|
-
|
|
3144
|
+
u2 as registerShape,
|
|
2994
3145
|
rejectAll,
|
|
2995
3146
|
v3 as removeChild,
|
|
2996
3147
|
x as replayFrom,
|
|
2997
|
-
|
|
2998
|
-
|
|
3148
|
+
y as replayHistory,
|
|
3149
|
+
C6 as resize,
|
|
2999
3150
|
resolve,
|
|
3000
3151
|
resolve3D,
|
|
3001
3152
|
r as resolveDirection,
|
|
@@ -3013,7 +3164,7 @@ export {
|
|
|
3013
3164
|
G as scaleDrawing,
|
|
3014
3165
|
section,
|
|
3015
3166
|
sectionToFace,
|
|
3016
|
-
|
|
3167
|
+
D3 as setShapeOrigin,
|
|
3017
3168
|
t8 as setTagMetadata,
|
|
3018
3169
|
sewShells,
|
|
3019
3170
|
shape,
|
|
@@ -3045,14 +3196,14 @@ export {
|
|
|
3045
3196
|
sphere,
|
|
3046
3197
|
split,
|
|
3047
3198
|
z3 as stepCount,
|
|
3048
|
-
|
|
3199
|
+
A2 as stepsFrom,
|
|
3049
3200
|
stretch2D,
|
|
3050
3201
|
subFace,
|
|
3051
|
-
|
|
3202
|
+
B3 as supportExtrude,
|
|
3052
3203
|
surfaceFromGrid,
|
|
3053
3204
|
surfaceFromImage,
|
|
3054
3205
|
sweep,
|
|
3055
|
-
|
|
3206
|
+
u4 as tagFaces,
|
|
3056
3207
|
tangentArc,
|
|
3057
3208
|
a52 as textBlueprints,
|
|
3058
3209
|
a62 as textMetrics,
|
|
@@ -3061,7 +3212,7 @@ export {
|
|
|
3061
3212
|
toBREP,
|
|
3062
3213
|
t9 as toBufferGeometryData,
|
|
3063
3214
|
k9 as toGroupedBufferGeometryData,
|
|
3064
|
-
|
|
3215
|
+
l7 as toLineGeometryData,
|
|
3065
3216
|
b as toOcVec,
|
|
3066
3217
|
toSVGPathD,
|
|
3067
3218
|
t as toVec2,
|
|
@@ -3074,16 +3225,16 @@ export {
|
|
|
3074
3225
|
t7 as translatePlane,
|
|
3075
3226
|
t2 as tryCatch,
|
|
3076
3227
|
n2 as tryCatchAsync,
|
|
3077
|
-
|
|
3228
|
+
C3 as twistExtrude,
|
|
3078
3229
|
typeCastError,
|
|
3079
|
-
|
|
3230
|
+
D as undoLast,
|
|
3080
3231
|
unwrap,
|
|
3081
3232
|
r2 as unwrapErr,
|
|
3082
3233
|
v as unwrapOr,
|
|
3083
3234
|
w2 as unwrapOrElse,
|
|
3084
3235
|
E as updateNode,
|
|
3085
|
-
|
|
3086
|
-
|
|
3236
|
+
u5 as uvBounds,
|
|
3237
|
+
h7 as uvCoordinates,
|
|
3087
3238
|
validationError,
|
|
3088
3239
|
v2 as vecAdd,
|
|
3089
3240
|
a3 as vecAngle,
|
|
@@ -3093,14 +3244,14 @@ export {
|
|
|
3093
3244
|
e as vecEquals,
|
|
3094
3245
|
vecIsZero,
|
|
3095
3246
|
g3 as vecLength,
|
|
3096
|
-
|
|
3247
|
+
h4 as vecLengthSq,
|
|
3097
3248
|
i3 as vecNegate,
|
|
3098
3249
|
vecNormalize,
|
|
3099
3250
|
k3 as vecProjectToPlane,
|
|
3100
|
-
|
|
3101
|
-
|
|
3251
|
+
l2 as vecRepr,
|
|
3252
|
+
m3 as vecRotate,
|
|
3102
3253
|
vecScale,
|
|
3103
|
-
|
|
3254
|
+
o2 as vecSub,
|
|
3104
3255
|
vertex,
|
|
3105
3256
|
vertexFinder,
|
|
3106
3257
|
vertexPosition,
|
|
@@ -3112,5 +3263,7 @@ export {
|
|
|
3112
3263
|
w as withOcDir,
|
|
3113
3264
|
l as withOcPnt,
|
|
3114
3265
|
n as withOcVec,
|
|
3115
|
-
w3 as withScope
|
|
3266
|
+
w3 as withScope,
|
|
3267
|
+
o as withScopeResult,
|
|
3268
|
+
p as withScopeResultAsync
|
|
3116
3269
|
};
|