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
|
@@ -0,0 +1,430 @@
|
|
|
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 (e) {
|
|
19
|
+
return Promise.reject(e);
|
|
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 E = typeof SuppressedError === "function" ? SuppressedError : function(e, s, m, _) {
|
|
30
|
+
return _ = Error(m), _.name = "SuppressedError", _.error = e, _.suppressed = s, _;
|
|
31
|
+
};
|
|
32
|
+
var fail = (e) => error = hasError ? new E(e, error, "An error was suppressed during disposal") : (hasError = true, e);
|
|
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, (e) => (fail(e), next()));
|
|
38
|
+
} catch (e) {
|
|
39
|
+
fail(e);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
if (hasError) throw error;
|
|
43
|
+
};
|
|
44
|
+
return next();
|
|
45
|
+
};
|
|
46
|
+
import { g as getKernel, d as toOcPnt, b as toOcVec, c as makeOcAx2, e as makeOcAx3 } from "./occtBoundary-DvBywHyU.js";
|
|
47
|
+
import { e as err, o as occtError, l as ok, x as validationError, a as andThen } from "./errors-DJ92ermb.js";
|
|
48
|
+
import { D as DisposalScope, d as isEdge, n as isWire, q as createWire, r as createEdge, s as createFace, e as isFace } from "./shapeTypes-Bi_9RZa2.js";
|
|
49
|
+
import { d as getEdges } from "./shapeFns-DNnBK8fG.js";
|
|
50
|
+
import { o as outerWire, c as cast } from "./faceFns-q5CR9pOW.js";
|
|
51
|
+
function range(len) {
|
|
52
|
+
return Array.from(Array(len).keys());
|
|
53
|
+
}
|
|
54
|
+
function zip(arrays) {
|
|
55
|
+
const minLength = Math.min(...arrays.map((arr) => arr.length));
|
|
56
|
+
return range(minLength).map((i) => arrays.map((arr) => arr[i]));
|
|
57
|
+
}
|
|
58
|
+
function makeLine(v1, v2) {
|
|
59
|
+
var _stack = [];
|
|
60
|
+
try {
|
|
61
|
+
const oc = getKernel().oc;
|
|
62
|
+
const scope = __using(_stack, new DisposalScope());
|
|
63
|
+
const p1 = scope.register(toOcPnt(v1));
|
|
64
|
+
const p2 = scope.register(toOcPnt(v2));
|
|
65
|
+
const maker = scope.register(new oc.BRepBuilderAPI_MakeEdge_3(p1, p2));
|
|
66
|
+
return createEdge(maker.Edge());
|
|
67
|
+
} catch (_) {
|
|
68
|
+
var _error = _, _hasError = true;
|
|
69
|
+
} finally {
|
|
70
|
+
__callDispose(_stack, _error, _hasError);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
function makeCircle(radius, center = [0, 0, 0], normal = [0, 0, 1]) {
|
|
74
|
+
var _stack = [];
|
|
75
|
+
try {
|
|
76
|
+
const oc = getKernel().oc;
|
|
77
|
+
const scope = __using(_stack, new DisposalScope());
|
|
78
|
+
const ax = scope.register(makeOcAx2(center, normal));
|
|
79
|
+
const circleGp = scope.register(new oc.gp_Circ_2(ax, radius));
|
|
80
|
+
const edgeMaker = scope.register(new oc.BRepBuilderAPI_MakeEdge_8(circleGp));
|
|
81
|
+
return createEdge(edgeMaker.Edge());
|
|
82
|
+
} catch (_) {
|
|
83
|
+
var _error = _, _hasError = true;
|
|
84
|
+
} finally {
|
|
85
|
+
__callDispose(_stack, _error, _hasError);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
function makeEllipse(majorRadius, minorRadius, center = [0, 0, 0], normal = [0, 0, 1], xDir) {
|
|
89
|
+
var _stack = [];
|
|
90
|
+
try {
|
|
91
|
+
if (minorRadius > majorRadius) {
|
|
92
|
+
return err(
|
|
93
|
+
validationError("ELLIPSE_RADII", "The minor radius must be smaller than the major one")
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
const oc = getKernel().oc;
|
|
97
|
+
const scope = __using(_stack, new DisposalScope());
|
|
98
|
+
const ax = scope.register(makeOcAx2(center, normal, xDir));
|
|
99
|
+
const ellipseGp = scope.register(new oc.gp_Elips_2(ax, majorRadius, minorRadius));
|
|
100
|
+
const edgeMaker = scope.register(new oc.BRepBuilderAPI_MakeEdge_12(ellipseGp));
|
|
101
|
+
return ok(createEdge(edgeMaker.Edge()));
|
|
102
|
+
} catch (_) {
|
|
103
|
+
var _error = _, _hasError = true;
|
|
104
|
+
} finally {
|
|
105
|
+
__callDispose(_stack, _error, _hasError);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
function makeHelix(pitch, height, radius, center = [0, 0, 0], dir = [0, 0, 1], lefthand = false) {
|
|
109
|
+
var _stack = [];
|
|
110
|
+
try {
|
|
111
|
+
const oc = getKernel().oc;
|
|
112
|
+
const scope = __using(_stack, new DisposalScope());
|
|
113
|
+
const angularStep = lefthand ? -2 * Math.PI : 2 * Math.PI;
|
|
114
|
+
const geomLine = scope.register(
|
|
115
|
+
new oc.Geom2d_Line_3(
|
|
116
|
+
scope.register(new oc.gp_Pnt2d_3(0, 0)),
|
|
117
|
+
scope.register(new oc.gp_Dir2d_4(angularStep, pitch))
|
|
118
|
+
)
|
|
119
|
+
);
|
|
120
|
+
const nTurns = height / pitch;
|
|
121
|
+
const uStart = scope.register(geomLine.Value(0));
|
|
122
|
+
const uStop = scope.register(geomLine.Value(nTurns * Math.sqrt((2 * Math.PI) ** 2 + pitch ** 2)));
|
|
123
|
+
const geomSeg = scope.register(new oc.GCE2d_MakeSegment_1(uStart, uStop));
|
|
124
|
+
const geomSurf = new oc.Geom_CylindricalSurface_1(scope.register(makeOcAx3(center, dir)), radius);
|
|
125
|
+
const e = scope.register(
|
|
126
|
+
new oc.BRepBuilderAPI_MakeEdge_30(
|
|
127
|
+
scope.register(new oc.Handle_Geom2d_Curve_2(geomSeg.Value().get())),
|
|
128
|
+
scope.register(new oc.Handle_Geom_Surface_2(geomSurf))
|
|
129
|
+
)
|
|
130
|
+
).Edge();
|
|
131
|
+
const w = scope.register(new oc.BRepBuilderAPI_MakeWire_2(e)).Wire();
|
|
132
|
+
oc.BRepLib.BuildCurves3d_2(w);
|
|
133
|
+
return createWire(w);
|
|
134
|
+
} catch (_) {
|
|
135
|
+
var _error = _, _hasError = true;
|
|
136
|
+
} finally {
|
|
137
|
+
__callDispose(_stack, _error, _hasError);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
function makeThreePointArc(v1, v2, v3) {
|
|
141
|
+
var _stack = [];
|
|
142
|
+
try {
|
|
143
|
+
const oc = getKernel().oc;
|
|
144
|
+
const scope = __using(_stack, new DisposalScope());
|
|
145
|
+
const p1 = scope.register(toOcPnt(v1));
|
|
146
|
+
const p2 = scope.register(toOcPnt(v2));
|
|
147
|
+
const p3 = scope.register(toOcPnt(v3));
|
|
148
|
+
const arcMaker = scope.register(new oc.GC_MakeArcOfCircle_4(p1, p2, p3));
|
|
149
|
+
const circleGeom = scope.register(arcMaker.Value());
|
|
150
|
+
const curve = scope.register(new oc.Handle_Geom_Curve_2(circleGeom.get()));
|
|
151
|
+
const edgeMaker = scope.register(new oc.BRepBuilderAPI_MakeEdge_24(curve));
|
|
152
|
+
return createEdge(edgeMaker.Edge());
|
|
153
|
+
} catch (_) {
|
|
154
|
+
var _error = _, _hasError = true;
|
|
155
|
+
} finally {
|
|
156
|
+
__callDispose(_stack, _error, _hasError);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
function makeEllipseArc(majorRadius, minorRadius, startAngle, endAngle, center = [0, 0, 0], normal = [0, 0, 1], xDir) {
|
|
160
|
+
var _stack = [];
|
|
161
|
+
try {
|
|
162
|
+
if (minorRadius > majorRadius) {
|
|
163
|
+
return err(
|
|
164
|
+
validationError("ELLIPSE_RADII", "The minor radius must be smaller than the major one")
|
|
165
|
+
);
|
|
166
|
+
}
|
|
167
|
+
const oc = getKernel().oc;
|
|
168
|
+
const scope = __using(_stack, new DisposalScope());
|
|
169
|
+
const ax = scope.register(makeOcAx2(center, normal, xDir));
|
|
170
|
+
const ellipseGp = scope.register(new oc.gp_Elips_2(ax, majorRadius, minorRadius));
|
|
171
|
+
const edgeMaker = scope.register(
|
|
172
|
+
new oc.BRepBuilderAPI_MakeEdge_13(ellipseGp, startAngle, endAngle)
|
|
173
|
+
);
|
|
174
|
+
return ok(createEdge(edgeMaker.Edge()));
|
|
175
|
+
} catch (_) {
|
|
176
|
+
var _error = _, _hasError = true;
|
|
177
|
+
} finally {
|
|
178
|
+
__callDispose(_stack, _error, _hasError);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
function makeBSplineApproximation(points, { tolerance = 1e-3, smoothing = null, degMax = 6, degMin = 1 } = {}) {
|
|
182
|
+
var _stack = [];
|
|
183
|
+
try {
|
|
184
|
+
const oc = getKernel().oc;
|
|
185
|
+
const scope = __using(_stack, new DisposalScope());
|
|
186
|
+
const pnts = scope.register(new oc.TColgp_Array1OfPnt_2(1, points.length));
|
|
187
|
+
points.forEach((point, index) => {
|
|
188
|
+
pnts.SetValue(index + 1, scope.register(toOcPnt(point)));
|
|
189
|
+
});
|
|
190
|
+
let splineBuilder;
|
|
191
|
+
if (smoothing) {
|
|
192
|
+
splineBuilder = scope.register(
|
|
193
|
+
new oc.GeomAPI_PointsToBSpline_5(
|
|
194
|
+
pnts,
|
|
195
|
+
smoothing[0],
|
|
196
|
+
smoothing[1],
|
|
197
|
+
smoothing[2],
|
|
198
|
+
degMax,
|
|
199
|
+
oc.GeomAbs_Shape.GeomAbs_C2,
|
|
200
|
+
tolerance
|
|
201
|
+
)
|
|
202
|
+
);
|
|
203
|
+
} else {
|
|
204
|
+
splineBuilder = scope.register(
|
|
205
|
+
new oc.GeomAPI_PointsToBSpline_2(
|
|
206
|
+
pnts,
|
|
207
|
+
degMin,
|
|
208
|
+
degMax,
|
|
209
|
+
oc.GeomAbs_Shape.GeomAbs_C2,
|
|
210
|
+
tolerance
|
|
211
|
+
)
|
|
212
|
+
);
|
|
213
|
+
}
|
|
214
|
+
if (!splineBuilder.IsDone()) {
|
|
215
|
+
return err(occtError("BSPLINE_FAILED", "B-spline approximation failed"));
|
|
216
|
+
}
|
|
217
|
+
const splineGeom = scope.register(splineBuilder.Curve());
|
|
218
|
+
const curve = scope.register(new oc.Handle_Geom_Curve_2(splineGeom.get()));
|
|
219
|
+
return ok(createEdge(new oc.BRepBuilderAPI_MakeEdge_24(curve).Edge()));
|
|
220
|
+
} catch (_) {
|
|
221
|
+
var _error = _, _hasError = true;
|
|
222
|
+
} finally {
|
|
223
|
+
__callDispose(_stack, _error, _hasError);
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
function makeBezierCurve(points) {
|
|
227
|
+
var _stack = [];
|
|
228
|
+
try {
|
|
229
|
+
if (points.length < 2) {
|
|
230
|
+
return err(
|
|
231
|
+
validationError(
|
|
232
|
+
"BEZIER_MIN_POINTS",
|
|
233
|
+
`Need at least 2 points for a Bezier curve, got ${points.length}`,
|
|
234
|
+
void 0,
|
|
235
|
+
{
|
|
236
|
+
pointCount: points.length
|
|
237
|
+
}
|
|
238
|
+
)
|
|
239
|
+
);
|
|
240
|
+
}
|
|
241
|
+
const oc = getKernel().oc;
|
|
242
|
+
const scope = __using(_stack, new DisposalScope());
|
|
243
|
+
const arrayOfPoints = scope.register(new oc.TColgp_Array1OfPnt_2(1, points.length));
|
|
244
|
+
points.forEach((p, i) => {
|
|
245
|
+
arrayOfPoints.SetValue(i + 1, scope.register(toOcPnt(p)));
|
|
246
|
+
});
|
|
247
|
+
const bezCurve = new oc.Geom_BezierCurve_1(arrayOfPoints);
|
|
248
|
+
const curve = scope.register(new oc.Handle_Geom_Curve_2(bezCurve));
|
|
249
|
+
const edgeMaker = scope.register(new oc.BRepBuilderAPI_MakeEdge_24(curve));
|
|
250
|
+
return ok(createEdge(edgeMaker.Edge()));
|
|
251
|
+
} catch (_) {
|
|
252
|
+
var _error = _, _hasError = true;
|
|
253
|
+
} finally {
|
|
254
|
+
__callDispose(_stack, _error, _hasError);
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
function makeTangentArc(startPoint, startTgt, endPoint) {
|
|
258
|
+
var _stack = [];
|
|
259
|
+
try {
|
|
260
|
+
const oc = getKernel().oc;
|
|
261
|
+
const scope = __using(_stack, new DisposalScope());
|
|
262
|
+
const circleGeom = scope.register(
|
|
263
|
+
new oc.GC_MakeArcOfCircle_5(
|
|
264
|
+
scope.register(toOcPnt(startPoint)),
|
|
265
|
+
scope.register(toOcVec(startTgt)),
|
|
266
|
+
scope.register(toOcPnt(endPoint))
|
|
267
|
+
).Value()
|
|
268
|
+
);
|
|
269
|
+
const curve = scope.register(new oc.Handle_Geom_Curve_2(circleGeom.get()));
|
|
270
|
+
const edgeMaker = scope.register(new oc.BRepBuilderAPI_MakeEdge_24(curve));
|
|
271
|
+
return createEdge(edgeMaker.Edge());
|
|
272
|
+
} catch (_) {
|
|
273
|
+
var _error = _, _hasError = true;
|
|
274
|
+
} finally {
|
|
275
|
+
__callDispose(_stack, _error, _hasError);
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
function assembleWire(listOfEdges) {
|
|
279
|
+
var _stack = [];
|
|
280
|
+
try {
|
|
281
|
+
const oc = getKernel().oc;
|
|
282
|
+
const scope = __using(_stack, new DisposalScope());
|
|
283
|
+
const wireBuilder = scope.register(new oc.BRepBuilderAPI_MakeWire_1());
|
|
284
|
+
listOfEdges.forEach((e) => {
|
|
285
|
+
if (isEdge(e)) {
|
|
286
|
+
wireBuilder.Add_1(e.wrapped);
|
|
287
|
+
}
|
|
288
|
+
if (isWire(e)) {
|
|
289
|
+
wireBuilder.Add_2(e.wrapped);
|
|
290
|
+
}
|
|
291
|
+
});
|
|
292
|
+
const progress = scope.register(new oc.Message_ProgressRange_1());
|
|
293
|
+
wireBuilder.Build(progress);
|
|
294
|
+
const res = wireBuilder.Error();
|
|
295
|
+
if (res !== oc.BRepBuilderAPI_WireError.BRepBuilderAPI_WireDone) {
|
|
296
|
+
const errorNames = /* @__PURE__ */ new Map([
|
|
297
|
+
[oc.BRepBuilderAPI_WireError.BRepBuilderAPI_EmptyWire, "empty wire"],
|
|
298
|
+
[oc.BRepBuilderAPI_WireError.BRepBuilderAPI_NonManifoldWire, "non manifold wire"],
|
|
299
|
+
[oc.BRepBuilderAPI_WireError.BRepBuilderAPI_DisconnectedWire, "disconnected wire"]
|
|
300
|
+
]);
|
|
301
|
+
return err(
|
|
302
|
+
occtError(
|
|
303
|
+
"WIRE_BUILD_FAILED",
|
|
304
|
+
`Failed to build the wire, ${errorNames.get(res) || "unknown error"}`
|
|
305
|
+
)
|
|
306
|
+
);
|
|
307
|
+
}
|
|
308
|
+
return ok(createWire(wireBuilder.Wire()));
|
|
309
|
+
} catch (_) {
|
|
310
|
+
var _error = _, _hasError = true;
|
|
311
|
+
} finally {
|
|
312
|
+
__callDispose(_stack, _error, _hasError);
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
function makeFace(wire, holes) {
|
|
316
|
+
const oc = getKernel().oc;
|
|
317
|
+
const faceBuilder = new oc.BRepBuilderAPI_MakeFace_15(wire.wrapped, false);
|
|
318
|
+
holes?.forEach((hole) => {
|
|
319
|
+
faceBuilder.Add(hole.wrapped);
|
|
320
|
+
});
|
|
321
|
+
if (!faceBuilder.IsDone()) {
|
|
322
|
+
faceBuilder.delete();
|
|
323
|
+
return err(
|
|
324
|
+
occtError("FACE_BUILD_FAILED", "Failed to build the face. Your wire might be non planar.")
|
|
325
|
+
);
|
|
326
|
+
}
|
|
327
|
+
const face = faceBuilder.Face();
|
|
328
|
+
faceBuilder.delete();
|
|
329
|
+
return ok(createFace(face));
|
|
330
|
+
}
|
|
331
|
+
function fill(face) {
|
|
332
|
+
const outer = outerWire(face);
|
|
333
|
+
return makeFace(outer);
|
|
334
|
+
}
|
|
335
|
+
function makeNewFaceWithinFace(originFace, wire) {
|
|
336
|
+
var _stack = [];
|
|
337
|
+
try {
|
|
338
|
+
const oc = getKernel().oc;
|
|
339
|
+
const scope = __using(_stack, new DisposalScope());
|
|
340
|
+
const surface = scope.register(oc.BRep_Tool.Surface_2(originFace.wrapped));
|
|
341
|
+
const faceBuilder = scope.register(
|
|
342
|
+
new oc.BRepBuilderAPI_MakeFace_21(surface, wire.wrapped, true)
|
|
343
|
+
);
|
|
344
|
+
const face = faceBuilder.Face();
|
|
345
|
+
return createFace(face);
|
|
346
|
+
} catch (_) {
|
|
347
|
+
var _error = _, _hasError = true;
|
|
348
|
+
} finally {
|
|
349
|
+
__callDispose(_stack, _error, _hasError);
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
function makeNonPlanarFace(wire) {
|
|
353
|
+
var _stack = [];
|
|
354
|
+
try {
|
|
355
|
+
const oc = getKernel().oc;
|
|
356
|
+
const scope = __using(_stack, new DisposalScope());
|
|
357
|
+
const faceBuilder = scope.register(
|
|
358
|
+
new oc.BRepOffsetAPI_MakeFilling(3, 15, 2, false, 1e-5, 1e-4, 0.01, 0.1, 8, 9)
|
|
359
|
+
);
|
|
360
|
+
getEdges(wire).forEach((edge) => {
|
|
361
|
+
faceBuilder.Add_1(
|
|
362
|
+
edge.wrapped,
|
|
363
|
+
oc.GeomAbs_Shape.GeomAbs_C0,
|
|
364
|
+
true
|
|
365
|
+
);
|
|
366
|
+
});
|
|
367
|
+
const progress = scope.register(new oc.Message_ProgressRange_1());
|
|
368
|
+
faceBuilder.Build(progress);
|
|
369
|
+
return andThen(cast(faceBuilder.Shape()), (newFace) => {
|
|
370
|
+
if (!isFace(newFace)) {
|
|
371
|
+
return err(occtError("FACE_BUILD_FAILED", "Failed to create a face"));
|
|
372
|
+
}
|
|
373
|
+
return ok(newFace);
|
|
374
|
+
});
|
|
375
|
+
} catch (_) {
|
|
376
|
+
var _error = _, _hasError = true;
|
|
377
|
+
} finally {
|
|
378
|
+
__callDispose(_stack, _error, _hasError);
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
function addHolesInFace(face, holes) {
|
|
382
|
+
var _stack = [];
|
|
383
|
+
try {
|
|
384
|
+
const oc = getKernel().oc;
|
|
385
|
+
const scope = __using(_stack, new DisposalScope());
|
|
386
|
+
const faceMaker = scope.register(new oc.BRepBuilderAPI_MakeFace_2(face.wrapped));
|
|
387
|
+
holes.forEach((wire) => {
|
|
388
|
+
faceMaker.Add(wire.wrapped);
|
|
389
|
+
});
|
|
390
|
+
const builtFace = scope.register(faceMaker.Face());
|
|
391
|
+
const fixer = scope.register(new oc.ShapeFix_Face_2(builtFace));
|
|
392
|
+
fixer.FixOrientation_1();
|
|
393
|
+
const newFace = fixer.Face();
|
|
394
|
+
return createFace(newFace);
|
|
395
|
+
} catch (_) {
|
|
396
|
+
var _error = _, _hasError = true;
|
|
397
|
+
} finally {
|
|
398
|
+
__callDispose(_stack, _error, _hasError);
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
function makePolygon(points) {
|
|
402
|
+
if (points.length < 3)
|
|
403
|
+
return err(
|
|
404
|
+
validationError("POLYGON_MIN_POINTS", "You need at least 3 points to make a polygon")
|
|
405
|
+
);
|
|
406
|
+
const edges = zip([points, [...points.slice(1), points[0]]]).map(
|
|
407
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- zip returns untyped pairs
|
|
408
|
+
([p1, p2]) => makeLine(p1, p2)
|
|
409
|
+
);
|
|
410
|
+
return andThen(assembleWire(edges), (wire) => makeFace(wire));
|
|
411
|
+
}
|
|
412
|
+
export {
|
|
413
|
+
makeLine as a,
|
|
414
|
+
assembleWire as b,
|
|
415
|
+
makeHelix as c,
|
|
416
|
+
makeThreePointArc as d,
|
|
417
|
+
makeTangentArc as e,
|
|
418
|
+
makeEllipseArc as f,
|
|
419
|
+
makeBezierCurve as g,
|
|
420
|
+
addHolesInFace as h,
|
|
421
|
+
makeCircle as i,
|
|
422
|
+
makeEllipse as j,
|
|
423
|
+
makeBSplineApproximation as k,
|
|
424
|
+
makeNewFaceWithinFace as l,
|
|
425
|
+
makeFace as m,
|
|
426
|
+
makeNonPlanarFace as n,
|
|
427
|
+
makePolygon as o,
|
|
428
|
+
fill as p,
|
|
429
|
+
zip as z
|
|
430
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"curveBuilders.d.ts","sourceRoot":"","sources":["../../src/topology/curveBuilders.ts"],"names":[],"mappings":"AAAA;;GAEG;AAMH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,KAAK,MAAM,EAAW,MAAM,mBAAmB,CAAC;AAEzD,OAAO,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAGxD,oDAAoD;AACpD,wBAAgB,QAAQ,CAAC,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,GAAG,IAAI,CAQjD;AAED,wEAAwE;AACxE,wBAAgB,UAAU,CACxB,MAAM,EAAE,MAAM,EACd,MAAM,GAAE,IAAgB,EACxB,MAAM,GAAE,IAAgB,GACvB,IAAI,CAQN;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CACzB,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,MAAM,EACnB,MAAM,GAAE,IAAgB,EACxB,MAAM,GAAE,IAAgB,EACxB,IAAI,CAAC,EAAE,IAAI,GACV,MAAM,CAAC,IAAI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AAI,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,IAAI,CAgB9D;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,CAAC,IAAI,CAAC,CAWxD"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { c as getWires, a as getFaces } from "./shapeFns-
|
|
2
|
-
import "./booleanFns
|
|
1
|
+
import { c as getWires, a as getFaces } from "./shapeFns-DNnBK8fG.js";
|
|
2
|
+
import "./booleanFns-DOyKxL7q.js";
|
|
3
3
|
import { g as getKernel } from "./occtBoundary-DvBywHyU.js";
|
|
4
|
-
import { c as castShape,
|
|
5
|
-
import { d as downcast } from "./faceFns-
|
|
4
|
+
import { c as castShape, j as isShape3D, l as isSolid, e as isFace, n as isWire } from "./shapeTypes-Bi_9RZa2.js";
|
|
5
|
+
import { d as downcast } from "./faceFns-q5CR9pOW.js";
|
|
6
6
|
import { e as err, x as validationError, o as occtError, d as isErr, p as typeCastError, l as ok, u as unwrap, g as isOk, B as BrepErrorCode } from "./errors-DJ92ermb.js";
|
|
7
|
-
import "./curveFns-
|
|
7
|
+
import "./curveFns-BHRYwxBM.js";
|
|
8
8
|
import { H as HASH_CODE_MAX } from "./vecOps-ZDdZWbwT.js";
|
|
9
|
-
import "./meshFns-
|
|
9
|
+
import "./meshFns-DDFl7gLN.js";
|
|
10
10
|
function toBufferGeometryData(mesh) {
|
|
11
11
|
return {
|
|
12
12
|
position: mesh.vertices,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const shapeFns = require("./shapeFns-
|
|
3
|
-
require("./booleanFns-
|
|
2
|
+
const shapeFns = require("./shapeFns-D4CRxxmF.cjs");
|
|
3
|
+
require("./booleanFns-CVM3dOTP.cjs");
|
|
4
4
|
const occtBoundary = require("./occtBoundary-Cqfsau2c.cjs");
|
|
5
|
-
const shapeTypes = require("./shapeTypes-
|
|
6
|
-
const faceFns = require("./faceFns-
|
|
5
|
+
const shapeTypes = require("./shapeTypes-CWuX602K.cjs");
|
|
6
|
+
const faceFns = require("./faceFns-DNQss51F.cjs");
|
|
7
7
|
const errors = require("./errors-NNmTtM5u.cjs");
|
|
8
|
-
require("./curveFns-
|
|
8
|
+
require("./curveFns-BsAHC3Qv.cjs");
|
|
9
9
|
const vecOps = require("./vecOps-CjRL1jau.cjs");
|
|
10
|
-
require("./meshFns-
|
|
10
|
+
require("./meshFns-CTc1CRkF.cjs");
|
|
11
11
|
function toBufferGeometryData(mesh) {
|
|
12
12
|
return {
|
|
13
13
|
position: mesh.vertices,
|
package/dist/topology.cjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const shapeFns = require("./shapeFns-
|
|
4
|
-
const booleanFns = require("./booleanFns-
|
|
5
|
-
const topology = require("./topology-
|
|
6
|
-
const curveFns = require("./curveFns-
|
|
7
|
-
const faceFns = require("./faceFns-
|
|
8
|
-
const meshFns = require("./meshFns-
|
|
3
|
+
const shapeFns = require("./shapeFns-D4CRxxmF.cjs");
|
|
4
|
+
const booleanFns = require("./booleanFns-CVM3dOTP.cjs");
|
|
5
|
+
const topology = require("./topology-CNw-wsmG.cjs");
|
|
6
|
+
const curveFns = require("./curveFns-BsAHC3Qv.cjs");
|
|
7
|
+
const faceFns = require("./faceFns-DNQss51F.cjs");
|
|
8
|
+
const meshFns = require("./meshFns-CTc1CRkF.cjs");
|
|
9
9
|
exports.getBounds = shapeFns.getBounds;
|
|
10
10
|
exports.getEdges = shapeFns.getEdges;
|
|
11
11
|
exports.getFaces = shapeFns.getFaces;
|
package/dist/topology.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { u, d, a, e, f, c, x, i, y, z, A, B, v } from "./shapeFns-
|
|
2
|
-
import { h, g } from "./booleanFns
|
|
3
|
-
import { a as a2, b, c as c2, e as e2, f as f2, d as d2, g as g2, j, s, t, k, l, v as v2, w } from "./topology-
|
|
4
|
-
import { j as j2, a as a3, e as e3, k as k2, i as i2, l as l2, h as h2, d as d3, c as c3, m, b as b2, g as g3, n, o } from "./curveFns-
|
|
5
|
-
import { l as l3, c as c4, m as m2, j as j3, d as d4, e as e4, f as f3, q, r, g as g4, k as k3, s as s2, i as i3, n as n2, o as o2, p, t as t2, v as v3, u as u2, h as h3 } from "./faceFns-
|
|
6
|
-
import { c as c5, b as b3, e as e5, d as d5, f as f4 } from "./meshFns-
|
|
1
|
+
import { u, d, a, e, f, c, x, i, y, z, A, B, v } from "./shapeFns-DNnBK8fG.js";
|
|
2
|
+
import { h, g } from "./booleanFns-DOyKxL7q.js";
|
|
3
|
+
import { a as a2, b, c as c2, e as e2, f as f2, d as d2, g as g2, j, s, t, k, l, v as v2, w } from "./topology-CMM6vAzx.js";
|
|
4
|
+
import { j as j2, a as a3, e as e3, k as k2, i as i2, l as l2, h as h2, d as d3, c as c3, m, b as b2, g as g3, n, o } from "./curveFns-BHRYwxBM.js";
|
|
5
|
+
import { l as l3, c as c4, m as m2, j as j3, d as d4, e as e4, f as f3, q, r, g as g4, k as k3, s as s2, i as i3, n as n2, o as o2, p, t as t2, v as v3, u as u2, h as h3 } from "./faceFns-q5CR9pOW.js";
|
|
6
|
+
import { c as c5, b as b3, e as e5, d as d5, f as f4 } from "./meshFns-DDFl7gLN.js";
|
|
7
7
|
export {
|
|
8
8
|
a2 as adjacentFaces,
|
|
9
9
|
j2 as approximateCurve,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "brepjs",
|
|
3
|
-
"version": "8.8.
|
|
3
|
+
"version": "8.8.3",
|
|
4
4
|
"description": "Web CAD library built on OpenCascade",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cad",
|
|
@@ -215,5 +215,8 @@
|
|
|
215
215
|
"dependencies": {
|
|
216
216
|
"flatbush": "4.5.0",
|
|
217
217
|
"opentype.js": "1.3.4"
|
|
218
|
+
},
|
|
219
|
+
"overrides": {
|
|
220
|
+
"minimatch@>=10.0.0 <10.2.3": "10.2.3"
|
|
218
221
|
}
|
|
219
222
|
}
|