brepjs 8.2.0 → 8.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/2d.cjs +2 -2
- package/dist/2d.js +3 -3
- package/dist/{Blueprint-D_luVeES.js → Blueprint-CdVaHDSx.js} +3 -2
- package/dist/{Blueprint-CTAwjJMN.cjs → Blueprint-a3ukJMG4.cjs} +4 -3
- package/dist/{boolean2D-vw76Gayn.js → boolean2D-DzA0STqC.js} +3 -3
- package/dist/{boolean2D-B5axNhjN.cjs → boolean2D-pvPIs21j.cjs} +3 -3
- package/dist/{booleanFns-BhqXpQoZ.js → booleanFns-BcQUqjUu.js} +42 -5
- package/dist/{booleanFns-Yc3EBxdm.cjs → booleanFns-Cd414V3l.cjs} +42 -5
- package/dist/brepjs.cjs +189 -100
- package/dist/brepjs.js +255 -165
- package/dist/{cornerFinder-DuStF5jK.cjs → cornerFinder-BdKtobgb.cjs} +1 -1
- package/dist/{cornerFinder-CPm2baSJ.js → cornerFinder-DvPiz-VR.js} +1 -1
- package/dist/curveFns-B5EQsSwv.cjs +177 -0
- package/dist/curveFns-CyHyk29c.js +178 -0
- package/dist/{drawFns-CzBbcoXA.js → drawFns-CAAE4Z88.js} +6 -5
- package/dist/{drawFns-CiNxPu6J.cjs → drawFns-Mr2pghU8.cjs} +9 -8
- package/dist/{helpers-Dje6wrKi.cjs → helpers-CP2KrBZl.cjs} +4 -4
- package/dist/{helpers-BSQfs538.js → helpers-r_e-u1JM.js} +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/io.cjs +2 -2
- package/dist/io.js +2 -2
- package/dist/{meshFns-BKSPaPXS.js → meshFns-BEvGVcym.js} +4 -1
- package/dist/{meshFns-CFVxKBlE.cjs → meshFns-CJV_k_EQ.cjs} +4 -1
- package/dist/{operations-CjQHEu1h.js → operations-B314mytX.js} +1 -1
- package/dist/{operations-CdGb6IBU.cjs → operations-CYGNxn5D.cjs} +1 -1
- package/dist/operations.cjs +1 -1
- package/dist/operations.js +1 -1
- package/dist/query.cjs +3 -3
- package/dist/query.js +4 -4
- package/dist/{curveFns-C5gSZ5EY.js → shapeFns-CWd_ASDV.js} +115 -194
- package/dist/{curveFns-ByeCqutv.cjs → shapeFns-Z_ScEjmn.cjs} +94 -173
- package/dist/sketching.cjs +2 -2
- package/dist/sketching.js +2 -2
- package/dist/topology/booleanFns.d.ts.map +1 -1
- package/dist/topology/meshFns.d.ts +1 -0
- package/dist/topology/meshFns.d.ts.map +1 -1
- 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-A7-jUtHB.cjs} +9 -8
- package/dist/{topology-BFB3LI_y.js → topology-BupialMm.js} +4 -3
- package/dist/topology.cjs +32 -31
- package/dist/topology.js +57 -56
- package/package.json +1 -1
|
@@ -4,30 +4,6 @@ const shapeTypes = require("./shapeTypes-UqVCIO_T.cjs");
|
|
|
4
4
|
const vecOps = require("./vecOps-CjRL1jau.cjs");
|
|
5
5
|
const cast = require("./cast-C107o5ow.cjs");
|
|
6
6
|
const errors = require("./errors-DK1VAdP4.cjs");
|
|
7
|
-
let CURVE_TYPES_MAP = null;
|
|
8
|
-
const getCurveTypesMap = (refresh) => {
|
|
9
|
-
if (CURVE_TYPES_MAP && !refresh) return CURVE_TYPES_MAP;
|
|
10
|
-
const oc = occtBoundary.getKernel().oc;
|
|
11
|
-
const ga = oc.GeomAbs_CurveType;
|
|
12
|
-
CURVE_TYPES_MAP = /* @__PURE__ */ new Map([
|
|
13
|
-
[ga.GeomAbs_Line, "LINE"],
|
|
14
|
-
[ga.GeomAbs_Circle, "CIRCLE"],
|
|
15
|
-
[ga.GeomAbs_Ellipse, "ELLIPSE"],
|
|
16
|
-
[ga.GeomAbs_Hyperbola, "HYPERBOLA"],
|
|
17
|
-
[ga.GeomAbs_Parabola, "PARABOLA"],
|
|
18
|
-
[ga.GeomAbs_BezierCurve, "BEZIER_CURVE"],
|
|
19
|
-
[ga.GeomAbs_BSplineCurve, "BSPLINE_CURVE"],
|
|
20
|
-
[ga.GeomAbs_OffsetCurve, "OFFSET_CURVE"],
|
|
21
|
-
[ga.GeomAbs_OtherCurve, "OTHER_CURVE"]
|
|
22
|
-
]);
|
|
23
|
-
return CURVE_TYPES_MAP;
|
|
24
|
-
};
|
|
25
|
-
const findCurveType = (type) => {
|
|
26
|
-
let shapeType = getCurveTypesMap().get(type);
|
|
27
|
-
if (!shapeType) shapeType = getCurveTypesMap(true).get(type);
|
|
28
|
-
if (!shapeType) return errors.err(errors.typeCastError("UNKNOWN_CURVE_TYPE", "Unknown curve type"));
|
|
29
|
-
return errors.ok(shapeType);
|
|
30
|
-
};
|
|
31
7
|
function clone(shape) {
|
|
32
8
|
return shapeTypes.castShape(errors.unwrap(cast.downcast(shape.wrapped)));
|
|
33
9
|
}
|
|
@@ -61,6 +37,7 @@ function translate(shape, v) {
|
|
|
61
37
|
trsf.SetTranslation_1(vec);
|
|
62
38
|
const transformer = new oc.BRepBuilderAPI_Transform_2(shape.wrapped, trsf, true);
|
|
63
39
|
const result = shapeTypes.castShape(transformer.Shape());
|
|
40
|
+
propagateOrigins(transformer, [shape], result);
|
|
64
41
|
transformer.delete();
|
|
65
42
|
trsf.delete();
|
|
66
43
|
vec.delete();
|
|
@@ -73,6 +50,7 @@ function rotate(shape, angle, position = [0, 0, 0], direction = [0, 0, 1]) {
|
|
|
73
50
|
trsf.SetRotation_1(ax1, angle * vecOps.DEG2RAD);
|
|
74
51
|
const transformer = new oc.BRepBuilderAPI_Transform_2(shape.wrapped, trsf, true);
|
|
75
52
|
const result = shapeTypes.castShape(transformer.Shape());
|
|
53
|
+
propagateOrigins(transformer, [shape], result);
|
|
76
54
|
transformer.delete();
|
|
77
55
|
trsf.delete();
|
|
78
56
|
ax1.delete();
|
|
@@ -85,6 +63,7 @@ function mirror(shape, planeNormal = [0, 1, 0], planeOrigin = [0, 0, 0]) {
|
|
|
85
63
|
trsf.SetMirror_3(ax2);
|
|
86
64
|
const transformer = new oc.BRepBuilderAPI_Transform_2(shape.wrapped, trsf, true);
|
|
87
65
|
const result = shapeTypes.castShape(transformer.Shape());
|
|
66
|
+
propagateOrigins(transformer, [shape], result);
|
|
88
67
|
transformer.delete();
|
|
89
68
|
trsf.delete();
|
|
90
69
|
ax2.delete();
|
|
@@ -97,6 +76,7 @@ function scale(shape, factor, center = [0, 0, 0]) {
|
|
|
97
76
|
trsf.SetScale(pnt, factor);
|
|
98
77
|
const transformer = new oc.BRepBuilderAPI_Transform_2(shape.wrapped, trsf, true);
|
|
99
78
|
const result = shapeTypes.castShape(transformer.Shape());
|
|
79
|
+
propagateOrigins(transformer, [shape], result);
|
|
100
80
|
transformer.delete();
|
|
101
81
|
trsf.delete();
|
|
102
82
|
pnt.delete();
|
|
@@ -164,6 +144,7 @@ function applyMatrix(shape, matrix) {
|
|
|
164
144
|
);
|
|
165
145
|
const transformer2 = new oc.BRepBuilderAPI_Transform_2(shape.wrapped, trsf, true);
|
|
166
146
|
const result2 = shapeTypes.castShape(transformer2.Shape());
|
|
147
|
+
propagateOrigins(transformer2, [shape], result2);
|
|
167
148
|
transformer2.delete();
|
|
168
149
|
trsf.delete();
|
|
169
150
|
return result2;
|
|
@@ -179,6 +160,7 @@ function applyMatrix(shape, matrix) {
|
|
|
179
160
|
xyz.delete();
|
|
180
161
|
const transformer = new oc.BRepBuilderAPI_GTransform_2(shape.wrapped, gtrsf, true);
|
|
181
162
|
const result = shapeTypes.castShape(transformer.Shape());
|
|
163
|
+
propagateOrigins(transformer, [shape], result);
|
|
182
164
|
transformer.delete();
|
|
183
165
|
gtrsf.delete();
|
|
184
166
|
return result;
|
|
@@ -206,6 +188,7 @@ function transformCopy(shape, composed) {
|
|
|
206
188
|
const oc = occtBoundary.getKernel().oc;
|
|
207
189
|
const transformer = new oc.BRepBuilderAPI_Transform_2(shape.wrapped, composed.trsf, true);
|
|
208
190
|
const result = shapeTypes.castShape(transformer.Shape());
|
|
191
|
+
propagateOrigins(transformer, [shape], result);
|
|
209
192
|
transformer.delete();
|
|
210
193
|
return result;
|
|
211
194
|
}
|
|
@@ -245,6 +228,89 @@ function getWires(shape) {
|
|
|
245
228
|
cache.wires = wires;
|
|
246
229
|
return wires;
|
|
247
230
|
}
|
|
231
|
+
function setShapeOrigin(shape, origin) {
|
|
232
|
+
const cache = getOrCreateCache(shape);
|
|
233
|
+
const map = /* @__PURE__ */ new Map();
|
|
234
|
+
for (const f of getFaces(shape)) {
|
|
235
|
+
map.set(f.wrapped.HashCode(vecOps.HASH_CODE_MAX), origin);
|
|
236
|
+
}
|
|
237
|
+
cache.faceOrigins = map;
|
|
238
|
+
}
|
|
239
|
+
function getFaceOrigins(shape) {
|
|
240
|
+
return topoCache.get(shape.wrapped)?.faceOrigins;
|
|
241
|
+
}
|
|
242
|
+
function iterOcList(list, callback) {
|
|
243
|
+
const oc = occtBoundary.getKernel().oc;
|
|
244
|
+
const copy = new oc.TopTools_ListOfShape_3(list);
|
|
245
|
+
while (copy.Size() > 0) {
|
|
246
|
+
callback(copy.First_1());
|
|
247
|
+
copy.RemoveFirst();
|
|
248
|
+
}
|
|
249
|
+
copy.delete();
|
|
250
|
+
}
|
|
251
|
+
function propagateOrigins(op, inputs, result) {
|
|
252
|
+
const inputOrigins = [];
|
|
253
|
+
for (const input of inputs) {
|
|
254
|
+
const origins = getFaceOrigins(input);
|
|
255
|
+
if (!origins) continue;
|
|
256
|
+
for (const f of getFaces(input)) {
|
|
257
|
+
const hash = f.wrapped.HashCode(vecOps.HASH_CODE_MAX);
|
|
258
|
+
const origin = origins.get(hash);
|
|
259
|
+
if (origin !== void 0) {
|
|
260
|
+
inputOrigins.push({ face: f.wrapped, origin });
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
if (inputOrigins.length === 0) return;
|
|
265
|
+
const resultMap = /* @__PURE__ */ new Map();
|
|
266
|
+
for (const { face, origin } of inputOrigins) {
|
|
267
|
+
if (op.IsDeleted?.(face)) continue;
|
|
268
|
+
const modifiedList = op.Modified(face);
|
|
269
|
+
if (modifiedList.Size() > 0) {
|
|
270
|
+
iterOcList(modifiedList, (modFace) => {
|
|
271
|
+
resultMap.set(modFace.HashCode(vecOps.HASH_CODE_MAX), origin);
|
|
272
|
+
});
|
|
273
|
+
} else {
|
|
274
|
+
resultMap.set(face.HashCode(vecOps.HASH_CODE_MAX), origin);
|
|
275
|
+
}
|
|
276
|
+
const generatedList = op.Generated(face);
|
|
277
|
+
if (generatedList.Size() > 0) {
|
|
278
|
+
iterOcList(generatedList, (genFace) => {
|
|
279
|
+
const hash = genFace.HashCode(vecOps.HASH_CODE_MAX);
|
|
280
|
+
if (!resultMap.has(hash)) {
|
|
281
|
+
resultMap.set(hash, 0);
|
|
282
|
+
}
|
|
283
|
+
});
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
if (resultMap.size > 0) {
|
|
287
|
+
const cache = getOrCreateCache(result);
|
|
288
|
+
cache.faceOrigins = resultMap;
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
function propagateOriginsByHash(inputs, result) {
|
|
292
|
+
const lookup = /* @__PURE__ */ new Map();
|
|
293
|
+
for (const input of inputs) {
|
|
294
|
+
const origins = getFaceOrigins(input);
|
|
295
|
+
if (!origins) continue;
|
|
296
|
+
for (const [hash, origin] of origins) {
|
|
297
|
+
lookup.set(hash, origin);
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
if (lookup.size === 0) return;
|
|
301
|
+
const resultMap = /* @__PURE__ */ new Map();
|
|
302
|
+
for (const f of getFaces(result)) {
|
|
303
|
+
const hash = f.wrapped.HashCode(vecOps.HASH_CODE_MAX);
|
|
304
|
+
const origin = lookup.get(hash);
|
|
305
|
+
if (origin !== void 0) {
|
|
306
|
+
resultMap.set(hash, origin);
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
if (resultMap.size > 0) {
|
|
310
|
+
const cache = getOrCreateCache(result);
|
|
311
|
+
cache.faceOrigins = resultMap;
|
|
312
|
+
}
|
|
313
|
+
}
|
|
248
314
|
function getVertices(shape) {
|
|
249
315
|
return Array.from(cast.iterTopo(shape.wrapped, "vertex")).map(
|
|
250
316
|
(e) => shapeTypes.castShape(errors.unwrap(cast.downcast(e)))
|
|
@@ -309,164 +375,17 @@ function vertexPosition(vertex) {
|
|
|
309
375
|
pnt.delete();
|
|
310
376
|
return result;
|
|
311
377
|
}
|
|
312
|
-
function getAdaptor(shape) {
|
|
313
|
-
const oc = occtBoundary.getKernel().oc;
|
|
314
|
-
const st = shape.wrapped.ShapeType();
|
|
315
|
-
const e = oc.TopAbs_ShapeEnum;
|
|
316
|
-
if (st === e.TopAbs_WIRE) {
|
|
317
|
-
return new oc.BRepAdaptor_CompCurve_2(shape.wrapped, false);
|
|
318
|
-
}
|
|
319
|
-
return new oc.BRepAdaptor_Curve_2(shape.wrapped);
|
|
320
|
-
}
|
|
321
|
-
function mapParam(adaptor, t) {
|
|
322
|
-
const first = Number(adaptor.FirstParameter());
|
|
323
|
-
const last = Number(adaptor.LastParameter());
|
|
324
|
-
return first + (last - first) * t;
|
|
325
|
-
}
|
|
326
|
-
function getCurveType(shape) {
|
|
327
|
-
const r = shapeTypes.gcWithScope();
|
|
328
|
-
const adaptor = r(getAdaptor(shape));
|
|
329
|
-
const technicalType = adaptor.GetType && adaptor.GetType();
|
|
330
|
-
return errors.unwrap(findCurveType(technicalType));
|
|
331
|
-
}
|
|
332
|
-
function curveStartPoint(shape) {
|
|
333
|
-
const r = shapeTypes.gcWithScope();
|
|
334
|
-
const adaptor = r(getAdaptor(shape));
|
|
335
|
-
const pnt = r(adaptor.Value(adaptor.FirstParameter()));
|
|
336
|
-
return [pnt.X(), pnt.Y(), pnt.Z()];
|
|
337
|
-
}
|
|
338
|
-
function curveEndPoint(shape) {
|
|
339
|
-
const r = shapeTypes.gcWithScope();
|
|
340
|
-
const adaptor = r(getAdaptor(shape));
|
|
341
|
-
const pnt = r(adaptor.Value(adaptor.LastParameter()));
|
|
342
|
-
return [pnt.X(), pnt.Y(), pnt.Z()];
|
|
343
|
-
}
|
|
344
|
-
function curvePointAt(shape, position = 0.5) {
|
|
345
|
-
const r = shapeTypes.gcWithScope();
|
|
346
|
-
const adaptor = r(getAdaptor(shape));
|
|
347
|
-
const pnt = r(adaptor.Value(mapParam(adaptor, position)));
|
|
348
|
-
return [pnt.X(), pnt.Y(), pnt.Z()];
|
|
349
|
-
}
|
|
350
|
-
function curveTangentAt(shape, position = 0.5) {
|
|
351
|
-
const oc = occtBoundary.getKernel().oc;
|
|
352
|
-
const r = shapeTypes.gcWithScope();
|
|
353
|
-
const adaptor = r(getAdaptor(shape));
|
|
354
|
-
const param = mapParam(adaptor, position);
|
|
355
|
-
const tmpPnt = r(new oc.gp_Pnt_1());
|
|
356
|
-
const tmpVec = r(new oc.gp_Vec_1());
|
|
357
|
-
adaptor.D1(param, tmpPnt, tmpVec);
|
|
358
|
-
return [tmpVec.X(), tmpVec.Y(), tmpVec.Z()];
|
|
359
|
-
}
|
|
360
|
-
function curveLength(shape) {
|
|
361
|
-
const oc = occtBoundary.getKernel().oc;
|
|
362
|
-
const r = shapeTypes.gcWithScope();
|
|
363
|
-
const props = r(new oc.GProp_GProps_1());
|
|
364
|
-
oc.BRepGProp.LinearProperties(shape.wrapped, props, true, false);
|
|
365
|
-
return props.Mass();
|
|
366
|
-
}
|
|
367
|
-
function curveIsClosed(shape) {
|
|
368
|
-
const r = shapeTypes.gcWithScope();
|
|
369
|
-
const adaptor = r(getAdaptor(shape));
|
|
370
|
-
return adaptor.IsClosed();
|
|
371
|
-
}
|
|
372
|
-
function curveIsPeriodic(shape) {
|
|
373
|
-
const r = shapeTypes.gcWithScope();
|
|
374
|
-
const adaptor = r(getAdaptor(shape));
|
|
375
|
-
return adaptor.IsPeriodic();
|
|
376
|
-
}
|
|
377
|
-
function curvePeriod(shape) {
|
|
378
|
-
const adaptor = getAdaptor(shape);
|
|
379
|
-
const result = adaptor.Period();
|
|
380
|
-
adaptor.delete();
|
|
381
|
-
return result;
|
|
382
|
-
}
|
|
383
|
-
function getOrientation(shape) {
|
|
384
|
-
const oc = occtBoundary.getKernel().oc;
|
|
385
|
-
const orient = shape.wrapped.Orientation_1();
|
|
386
|
-
return orient === oc.TopAbs_Orientation.TopAbs_FORWARD ? "forward" : "backward";
|
|
387
|
-
}
|
|
388
|
-
function flipOrientation(shape) {
|
|
389
|
-
return shapeTypes.castShape(shape.wrapped.Reversed());
|
|
390
|
-
}
|
|
391
|
-
function interpolateCurve(points, options = {}) {
|
|
392
|
-
if (points.length < 2) {
|
|
393
|
-
return errors.err(errors.typeCastError("INTERPOLATE_MIN_POINTS", "Interpolation requires at least 2 points"));
|
|
394
|
-
}
|
|
395
|
-
try {
|
|
396
|
-
const result = occtBoundary.getKernel().interpolatePoints(points, options);
|
|
397
|
-
const cast2 = shapeTypes.castShape(result);
|
|
398
|
-
if (!shapeTypes.isEdge(cast2)) {
|
|
399
|
-
return errors.err(errors.typeCastError("INTERPOLATE_NOT_EDGE", "Interpolation did not produce an edge"));
|
|
400
|
-
}
|
|
401
|
-
return errors.ok(cast2);
|
|
402
|
-
} catch (e) {
|
|
403
|
-
return errors.err(
|
|
404
|
-
errors.typeCastError(
|
|
405
|
-
"INTERPOLATE_FAILED",
|
|
406
|
-
`Interpolation failed: ${e instanceof Error ? e.message : String(e)}`
|
|
407
|
-
)
|
|
408
|
-
);
|
|
409
|
-
}
|
|
410
|
-
}
|
|
411
|
-
function approximateCurve(points, options = {}) {
|
|
412
|
-
if (points.length < 2) {
|
|
413
|
-
return errors.err(errors.typeCastError("APPROXIMATE_MIN_POINTS", "Approximation requires at least 2 points"));
|
|
414
|
-
}
|
|
415
|
-
try {
|
|
416
|
-
const result = occtBoundary.getKernel().approximatePoints(points, options);
|
|
417
|
-
const cast2 = shapeTypes.castShape(result);
|
|
418
|
-
if (!shapeTypes.isEdge(cast2)) {
|
|
419
|
-
return errors.err(errors.typeCastError("APPROXIMATE_NOT_EDGE", "Approximation did not produce an edge"));
|
|
420
|
-
}
|
|
421
|
-
return errors.ok(cast2);
|
|
422
|
-
} catch (e) {
|
|
423
|
-
return errors.err(
|
|
424
|
-
errors.typeCastError(
|
|
425
|
-
"APPROXIMATE_FAILED",
|
|
426
|
-
`Approximation failed: ${e instanceof Error ? e.message : String(e)}`
|
|
427
|
-
)
|
|
428
|
-
);
|
|
429
|
-
}
|
|
430
|
-
}
|
|
431
|
-
function offsetWire2D(wire, offset, kind = "arc") {
|
|
432
|
-
const oc = occtBoundary.getKernel().oc;
|
|
433
|
-
const joinTypes = {
|
|
434
|
-
arc: oc.GeomAbs_JoinType.GeomAbs_Arc,
|
|
435
|
-
intersection: oc.GeomAbs_JoinType.GeomAbs_Intersection,
|
|
436
|
-
tangent: oc.GeomAbs_JoinType.GeomAbs_Tangent
|
|
437
|
-
};
|
|
438
|
-
const resultShape = occtBoundary.getKernel().offsetWire2D(wire.wrapped, offset, joinTypes[kind]);
|
|
439
|
-
const wrapped = shapeTypes.castShape(resultShape);
|
|
440
|
-
if (!shapeTypes.isWire(wrapped)) {
|
|
441
|
-
wrapped[Symbol.dispose]();
|
|
442
|
-
return errors.err(errors.typeCastError("OFFSET_NOT_WIRE", "Offset did not produce a Wire"));
|
|
443
|
-
}
|
|
444
|
-
return errors.ok(wrapped);
|
|
445
|
-
}
|
|
446
378
|
exports.applyMatrix = applyMatrix;
|
|
447
|
-
exports.approximateCurve = approximateCurve;
|
|
448
379
|
exports.clone = clone;
|
|
449
380
|
exports.composeTransforms = composeTransforms;
|
|
450
|
-
exports.curveEndPoint = curveEndPoint;
|
|
451
|
-
exports.curveIsClosed = curveIsClosed;
|
|
452
|
-
exports.curveIsPeriodic = curveIsPeriodic;
|
|
453
|
-
exports.curveLength = curveLength;
|
|
454
|
-
exports.curvePeriod = curvePeriod;
|
|
455
|
-
exports.curvePointAt = curvePointAt;
|
|
456
|
-
exports.curveStartPoint = curveStartPoint;
|
|
457
|
-
exports.curveTangentAt = curveTangentAt;
|
|
458
381
|
exports.describe = describe;
|
|
459
|
-
exports.findCurveType = findCurveType;
|
|
460
|
-
exports.flipOrientation = flipOrientation;
|
|
461
382
|
exports.getBounds = getBounds;
|
|
462
|
-
exports.getCurveType = getCurveType;
|
|
463
383
|
exports.getEdges = getEdges;
|
|
384
|
+
exports.getFaceOrigins = getFaceOrigins;
|
|
464
385
|
exports.getFaces = getFaces;
|
|
465
386
|
exports.getHashCode = getHashCode;
|
|
466
|
-
exports.getOrientation = getOrientation;
|
|
467
387
|
exports.getVertices = getVertices;
|
|
468
388
|
exports.getWires = getWires;
|
|
469
|
-
exports.interpolateCurve = interpolateCurve;
|
|
470
389
|
exports.isEmpty = isEmpty;
|
|
471
390
|
exports.isEqualShape = isEqualShape;
|
|
472
391
|
exports.isSameShape = isSameShape;
|
|
@@ -475,9 +394,11 @@ exports.iterFaces = iterFaces;
|
|
|
475
394
|
exports.iterVertices = iterVertices;
|
|
476
395
|
exports.iterWires = iterWires;
|
|
477
396
|
exports.mirror = mirror;
|
|
478
|
-
exports.
|
|
397
|
+
exports.propagateOrigins = propagateOrigins;
|
|
398
|
+
exports.propagateOriginsByHash = propagateOriginsByHash;
|
|
479
399
|
exports.rotate = rotate;
|
|
480
400
|
exports.scale = scale;
|
|
401
|
+
exports.setShapeOrigin = setShapeOrigin;
|
|
481
402
|
exports.simplify = simplify;
|
|
482
403
|
exports.toBREP = toBREP;
|
|
483
404
|
exports.transformCopy = transformCopy;
|
package/dist/sketching.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const drawFns = require("./drawFns-
|
|
4
|
-
const boolean2D = require("./boolean2D-
|
|
3
|
+
const drawFns = require("./drawFns-Mr2pghU8.cjs");
|
|
4
|
+
const boolean2D = require("./boolean2D-pvPIs21j.cjs");
|
|
5
5
|
exports.CompoundSketch = drawFns.CompoundSketch;
|
|
6
6
|
exports.Drawing = drawFns.Drawing;
|
|
7
7
|
exports.DrawingPen = drawFns.DrawingPen;
|
package/dist/sketching.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C, D, a, S, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, A, B, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, T, U, V, W } from "./drawFns-
|
|
2
|
-
import { B as B2, a as a2, F as F2, S as S2 } from "./boolean2D-
|
|
1
|
+
import { C, D, a, S, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, A, B, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, T, U, V, W } from "./drawFns-CAAE4Z88.js";
|
|
2
|
+
import { B as B2, a as a2, F as F2, S as S2 } from "./boolean2D-DzA0STqC.js";
|
|
3
3
|
export {
|
|
4
4
|
B2 as BaseSketcher2d,
|
|
5
5
|
a2 as BlueprintSketcher,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"booleanFns.d.ts","sourceRoot":"","sources":["../../src/topology/booleanFns.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,OAAO,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAG/D,OAAO,EAAE,KAAK,MAAM,EAAkB,MAAM,mBAAmB,CAAC;AAGhE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"booleanFns.d.ts","sourceRoot":"","sources":["../../src/topology/booleanFns.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,OAAO,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAG/D,OAAO,EAAE,KAAK,MAAM,EAAkB,MAAM,mBAAmB,CAAC;AAGhE,OAAO,KAAK,EA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cAAmB,GACvE,MAAM,CAAC,OAAO,CAAC,CA8BjB;AA4DD;;;;;;;;;GASG;AACH,wBAAgB,OAAO,CACrB,KAAK,EAAE,QAAQ,EACf,KAAK,EAAE,UAAU,EACjB,EAAE,aAAoB,EAAE,SAAe,EAAE,GAAE;IAAE,aAAa,CAAC,EAAE,OAAO,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAO,GAC9F,MAAM,CAAC,QAAQ,CAAC,CAyBlB;AAMD;;;GAGG;AACH,wBAAgB,KAAK,CAAC,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,MAAM,CAAC,QAAQ,CAAC,CAiC1E;AAMD;;;GAGG;AACH,wBAAgB,KAAK,CACnB,KAAK,EAAE,QAAQ,EACf,MAAM,EAAE,UAAU,EAAE,EACpB,OAAO,GAAE;IAAE,aAAa,CAAC,EAAE,OAAO,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAO,GAC5D,MAAM,CAAC,QAAQ,EAAE,CAAC,CAQpB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"meshFns.d.ts","sourceRoot":"","sources":["../../src/topology/meshFns.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,KAAK,MAAM,EAAW,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"meshFns.d.ts","sourceRoot":"","sources":["../../src/topology/meshFns.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,KAAK,MAAM,EAAW,MAAM,mBAAmB,CAAC;AAwCzD,0EAA0E;AAC1E,MAAM,WAAW,SAAS;IACxB,gDAAgD;IAChD,SAAS,EAAE,WAAW,CAAC;IACvB,0DAA0D;IAC1D,QAAQ,EAAE,YAAY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wBAAgB,UAAU,CAAC,KAAK,EAAE,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,CA4BxD;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CACvB,KAAK,EAAE,QAAQ,EACf,EACE,SAAgB,EAChB,gBAAsB,EACtB,MAAc,GACf,GAAE,WAAW,GAAG;IAAE,MAAM,CAAC,EAAE,OAAO,CAAA;CAAO,GACzC,MAAM,CAAC,IAAI,CAAC,CA0Bd;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,CAwBxD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modifierFns.d.ts","sourceRoot":"","sources":["../../src/topology/modifierFns.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAE/E,OAAO,EAAE,KAAK,MAAM,EAAkB,MAAM,mBAAmB,CAAC;AAmBhE;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,IAAI,GAAG,KAAK,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,
|
|
1
|
+
{"version":3,"file":"modifierFns.d.ts","sourceRoot":"","sources":["../../src/topology/modifierFns.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAE/E,OAAO,EAAE,KAAK,MAAM,EAAkB,MAAM,mBAAmB,CAAC;AAmBhE;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,IAAI,GAAG,KAAK,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,CAoB7E;AAMD;;;;;;GAMG;AACH,wBAAgB,MAAM,CACpB,KAAK,EAAE,OAAO,EACd,KAAK,EAAE,aAAa,CAAC,IAAI,CAAC,GAAG,SAAS,EACtC,MAAM,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,IAAI,KAAK,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAAC,GACrF,MAAM,CAAC,OAAO,CAAC,CAyEjB;AAMD;;;;;;GAMG;AACH,wBAAgB,OAAO,CACrB,KAAK,EAAE,OAAO,EACd,KAAK,EAAE,aAAa,CAAC,IAAI,CAAC,GAAG,SAAS,EACtC,QAAQ,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,IAAI,KAAK,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAAC,GACvF,MAAM,CAAC,OAAO,CAAC,CAmGjB;AAMD;;;;;;;GAOG;AACH,wBAAgB,KAAK,CACnB,KAAK,EAAE,OAAO,EACd,KAAK,EAAE,aAAa,CAAC,IAAI,CAAC,EAC1B,SAAS,EAAE,MAAM,EACjB,SAAS,SAAO,GACf,MAAM,CAAC,OAAO,CAAC,CAiDjB;AAMD;;;;;;GAMG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,SAAO,GAAG,MAAM,CAAC,OAAO,CAAC,CAmC1F"}
|
|
@@ -62,6 +62,35 @@ export declare function getEdges(shape: AnyShape): Edge[];
|
|
|
62
62
|
export declare function getFaces(shape: AnyShape): Face[];
|
|
63
63
|
/** Get all wires of a shape as branded Wire handles. Results are cached per shape. */
|
|
64
64
|
export declare function getWires(shape: AnyShape): Wire[];
|
|
65
|
+
/**
|
|
66
|
+
* Tag all faces of a shape with an opaque integer origin.
|
|
67
|
+
* Consumers assign meaning (e.g., source line number).
|
|
68
|
+
*/
|
|
69
|
+
export declare function setShapeOrigin(shape: AnyShape, origin: number): void;
|
|
70
|
+
/**
|
|
71
|
+
* Get the face origin map for a shape (faceHash → originTag).
|
|
72
|
+
* Returns undefined if no origins have been set or propagated.
|
|
73
|
+
*/
|
|
74
|
+
export declare function getFaceOrigins(shape: AnyShape): Map<number, number> | undefined;
|
|
75
|
+
type OcMakeShapeLike = {
|
|
76
|
+
Modified(s: any): any;
|
|
77
|
+
Generated(s: any): any;
|
|
78
|
+
IsDeleted?(s: any): boolean;
|
|
79
|
+
};
|
|
80
|
+
/**
|
|
81
|
+
* Propagate face origins from input shapes to a result shape
|
|
82
|
+
* using an OCCT operation's Modified/Generated history.
|
|
83
|
+
*
|
|
84
|
+
* @param op - OCCT operation with Modified/Generated methods (alive, not yet deleted)
|
|
85
|
+
* @param inputs - Source shapes whose face origins should propagate
|
|
86
|
+
* @param result - The result shape to populate origins on
|
|
87
|
+
*/
|
|
88
|
+
export declare function propagateOrigins(op: OcMakeShapeLike, inputs: AnyShape[], result: AnyShape): void;
|
|
89
|
+
/**
|
|
90
|
+
* Fallback origin propagation when no OCCT op object is available.
|
|
91
|
+
* Matches result faces to input faces by hash code (works for unmodified faces only).
|
|
92
|
+
*/
|
|
93
|
+
export declare function propagateOriginsByHash(inputs: AnyShape[], result: AnyShape): void;
|
|
65
94
|
/** Get all vertices of a shape as branded Vertex handles. */
|
|
66
95
|
export declare function getVertices(shape: AnyShape): Vertex[];
|
|
67
96
|
/** Lazily iterate edges of a shape, yielding branded Edge handles one at a time. */
|
|
@@ -97,4 +126,5 @@ export interface ShapeDescription {
|
|
|
97
126
|
export declare function describe(shape: AnyShape): ShapeDescription;
|
|
98
127
|
/** Get the position of a vertex as a Vec3 tuple. */
|
|
99
128
|
export declare function vertexPosition(vertex: Vertex): Vec3;
|
|
129
|
+
export {};
|
|
100
130
|
//# sourceMappingURL=shapeFns.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shapeFns.d.ts","source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AAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,oDAAoD;AACpD,wBAAgB,SAAS,CAAC,KAAK,EAAE,QAAQ,GAAG,QAAQ,CAsBnD;AAMD,+DAA+D;AAC/D,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IACzB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC;CAC3B;AAED,mEAAmE;AACnE,wBAAgB,QAAQ,CAAC,KAAK,EAAE,QAAQ,GAAG,gBAAgB,CAU1D;AAMD,oDAAoD;AACpD,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAMnD"}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const
|
|
3
|
-
require("./booleanFns-
|
|
2
|
+
const shapeFns = require("./shapeFns-Z_ScEjmn.cjs");
|
|
3
|
+
require("./booleanFns-Cd414V3l.cjs");
|
|
4
4
|
const occtBoundary = require("./occtBoundary-BFAaUtA7.cjs");
|
|
5
5
|
const shapeTypes = require("./shapeTypes-UqVCIO_T.cjs");
|
|
6
6
|
const cast = require("./cast-C107o5ow.cjs");
|
|
7
7
|
const errors = require("./errors-DK1VAdP4.cjs");
|
|
8
|
+
require("./curveFns-B5EQsSwv.cjs");
|
|
8
9
|
require("./faceFns-D1Sqnlu6.cjs");
|
|
9
10
|
const vecOps = require("./vecOps-CjRL1jau.cjs");
|
|
10
|
-
require("./meshFns-
|
|
11
|
+
require("./meshFns-CJV_k_EQ.cjs");
|
|
11
12
|
function toBufferGeometryData(mesh) {
|
|
12
13
|
return {
|
|
13
14
|
position: mesh.vertices,
|
|
@@ -333,8 +334,8 @@ function autoHeal(shape, options) {
|
|
|
333
334
|
});
|
|
334
335
|
}
|
|
335
336
|
steps.push("Shape invalid — applying shape-level healing");
|
|
336
|
-
const wiresBefore =
|
|
337
|
-
const facesBefore =
|
|
337
|
+
const wiresBefore = shapeFns.getWires(shape).length;
|
|
338
|
+
const facesBefore = shapeFns.getFaces(shape).length;
|
|
338
339
|
let current = shape;
|
|
339
340
|
let solidHealed = false;
|
|
340
341
|
if (sewTolerance !== void 0) {
|
|
@@ -355,7 +356,7 @@ function autoHeal(shape, options) {
|
|
|
355
356
|
}
|
|
356
357
|
}
|
|
357
358
|
if (fixSelfIntersection && fixWires) {
|
|
358
|
-
const wires =
|
|
359
|
+
const wires = shapeFns.getWires(current);
|
|
359
360
|
let fixCount = 0;
|
|
360
361
|
for (const wire of wires) {
|
|
361
362
|
try {
|
|
@@ -404,8 +405,8 @@ function autoHeal(shape, options) {
|
|
|
404
405
|
detail: "skipped by options"
|
|
405
406
|
});
|
|
406
407
|
}
|
|
407
|
-
const wiresAfter =
|
|
408
|
-
const facesAfter =
|
|
408
|
+
const wiresAfter = shapeFns.getWires(current).length;
|
|
409
|
+
const facesAfter = shapeFns.getFaces(current).length;
|
|
409
410
|
const wiresHealed = Math.abs(wiresAfter - wiresBefore);
|
|
410
411
|
const facesHealed = Math.abs(facesAfter - facesBefore);
|
|
411
412
|
if (wiresHealed > 0) steps.push(`Wire count changed by ${wiresHealed}`);
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./booleanFns-
|
|
1
|
+
import { u as getWires, o as getFaces } from "./shapeFns-CWd_ASDV.js";
|
|
2
|
+
import "./booleanFns-BcQUqjUu.js";
|
|
3
3
|
import { g as getKernel } from "./occtBoundary-CoXB2xvx.js";
|
|
4
4
|
import { c as castShape, h as isShape3D, k as isSolid, e as isFace, m as isWire } from "./shapeTypes-BU2LKv2S.js";
|
|
5
5
|
import { d as downcast } from "./cast-D0OhP1nV.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-wGhcJMpB.js";
|
|
7
|
+
import "./curveFns-CyHyk29c.js";
|
|
7
8
|
import "./faceFns-ub3CugDN.js";
|
|
8
9
|
import { H as HASH_CODE_MAX } from "./vecOps-ZDdZWbwT.js";
|
|
9
|
-
import "./meshFns-
|
|
10
|
+
import "./meshFns-BEvGVcym.js";
|
|
10
11
|
function toBufferGeometryData(mesh) {
|
|
11
12
|
return {
|
|
12
13
|
position: mesh.vertices,
|
package/dist/topology.cjs
CHANGED
|
@@ -1,38 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const
|
|
4
|
-
const booleanFns = require("./booleanFns-
|
|
5
|
-
const topology = require("./topology-
|
|
3
|
+
const shapeFns = require("./shapeFns-Z_ScEjmn.cjs");
|
|
4
|
+
const booleanFns = require("./booleanFns-Cd414V3l.cjs");
|
|
5
|
+
const topology = require("./topology-A7-jUtHB.cjs");
|
|
6
|
+
const curveFns = require("./curveFns-B5EQsSwv.cjs");
|
|
6
7
|
const faceFns = require("./faceFns-D1Sqnlu6.cjs");
|
|
7
|
-
const meshFns = require("./meshFns-
|
|
8
|
+
const meshFns = require("./meshFns-CJV_k_EQ.cjs");
|
|
8
9
|
const cast = require("./cast-C107o5ow.cjs");
|
|
9
|
-
exports.
|
|
10
|
-
exports.
|
|
11
|
-
exports.
|
|
12
|
-
exports.
|
|
13
|
-
exports.
|
|
14
|
-
exports.
|
|
15
|
-
exports.
|
|
16
|
-
exports.
|
|
17
|
-
exports.
|
|
18
|
-
exports.
|
|
19
|
-
exports.
|
|
20
|
-
exports.
|
|
21
|
-
exports.
|
|
22
|
-
exports.getFaces = curveFns.getFaces;
|
|
23
|
-
exports.getHashCode = curveFns.getHashCode;
|
|
24
|
-
exports.getOrientation = curveFns.getOrientation;
|
|
25
|
-
exports.getVertices = curveFns.getVertices;
|
|
26
|
-
exports.getWires = curveFns.getWires;
|
|
27
|
-
exports.interpolateCurve = curveFns.interpolateCurve;
|
|
28
|
-
exports.isEqualShape = curveFns.isEqualShape;
|
|
29
|
-
exports.isSameShape = curveFns.isSameShape;
|
|
30
|
-
exports.iterEdges = curveFns.iterEdges;
|
|
31
|
-
exports.iterFaces = curveFns.iterFaces;
|
|
32
|
-
exports.iterVertices = curveFns.iterVertices;
|
|
33
|
-
exports.iterWires = curveFns.iterWires;
|
|
34
|
-
exports.offsetWire2D = curveFns.offsetWire2D;
|
|
35
|
-
exports.vertexPosition = curveFns.vertexPosition;
|
|
10
|
+
exports.getBounds = shapeFns.getBounds;
|
|
11
|
+
exports.getEdges = shapeFns.getEdges;
|
|
12
|
+
exports.getFaces = shapeFns.getFaces;
|
|
13
|
+
exports.getHashCode = shapeFns.getHashCode;
|
|
14
|
+
exports.getVertices = shapeFns.getVertices;
|
|
15
|
+
exports.getWires = shapeFns.getWires;
|
|
16
|
+
exports.isEqualShape = shapeFns.isEqualShape;
|
|
17
|
+
exports.isSameShape = shapeFns.isSameShape;
|
|
18
|
+
exports.iterEdges = shapeFns.iterEdges;
|
|
19
|
+
exports.iterFaces = shapeFns.iterFaces;
|
|
20
|
+
exports.iterVertices = shapeFns.iterVertices;
|
|
21
|
+
exports.iterWires = shapeFns.iterWires;
|
|
22
|
+
exports.vertexPosition = shapeFns.vertexPosition;
|
|
36
23
|
exports.cutAll = booleanFns.cutAll;
|
|
37
24
|
exports.fuseAll = booleanFns.fuseAll;
|
|
38
25
|
exports.adjacentFaces = topology.adjacentFaces;
|
|
@@ -49,6 +36,20 @@ exports.toGroupedBufferGeometryData = topology.toGroupedBufferGeometryData;
|
|
|
49
36
|
exports.toLineGeometryData = topology.toLineGeometryData;
|
|
50
37
|
exports.verticesOfEdge = topology.verticesOfEdge;
|
|
51
38
|
exports.wiresOfFace = topology.wiresOfFace;
|
|
39
|
+
exports.approximateCurve = curveFns.approximateCurve;
|
|
40
|
+
exports.curveEndPoint = curveFns.curveEndPoint;
|
|
41
|
+
exports.curveIsClosed = curveFns.curveIsClosed;
|
|
42
|
+
exports.curveIsPeriodic = curveFns.curveIsPeriodic;
|
|
43
|
+
exports.curveLength = curveFns.curveLength;
|
|
44
|
+
exports.curvePeriod = curveFns.curvePeriod;
|
|
45
|
+
exports.curvePointAt = curveFns.curvePointAt;
|
|
46
|
+
exports.curveStartPoint = curveFns.curveStartPoint;
|
|
47
|
+
exports.curveTangentAt = curveFns.curveTangentAt;
|
|
48
|
+
exports.flipOrientation = curveFns.flipOrientation;
|
|
49
|
+
exports.getCurveType = curveFns.getCurveType;
|
|
50
|
+
exports.getOrientation = curveFns.getOrientation;
|
|
51
|
+
exports.interpolateCurve = curveFns.interpolateCurve;
|
|
52
|
+
exports.offsetWire2D = curveFns.offsetWire2D;
|
|
52
53
|
exports.classifyPointOnFace = faceFns.classifyPointOnFace;
|
|
53
54
|
exports.faceCenter = faceFns.faceCenter;
|
|
54
55
|
exports.faceGeomType = faceFns.faceGeomType;
|