brepjs 14.2.2 → 14.3.1
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 +5 -5
- package/dist/2d.js +5 -5
- package/dist/{blueprint-C8nlHdUE.cjs → blueprint-D_5JAtYk.cjs} +5 -5
- package/dist/{blueprint-Dsp-f4De.js → blueprint-Do5-zCJ5.js} +5 -5
- package/dist/{blueprintFns-CvtakKGf.cjs → blueprintFns-Cq-LiS2c.cjs} +2 -2
- package/dist/{blueprintFns-D1QUp5y4.js → blueprintFns-Li_biBgb.js} +2 -2
- package/dist/{boolean2D-DE2axG6W.cjs → boolean2D-CDE5hFEe.cjs} +7 -7
- package/dist/{boolean2D-D1MYwspP.js → boolean2D-gzC728_d.js} +7 -7
- package/dist/{booleanFns-Dmvv9VVT.cjs → booleanFns-BxEOBw7j.cjs} +3 -3
- package/dist/{booleanFns-DViuH9nW.js → booleanFns-DY_4PTTc.js} +3 -3
- package/dist/brepjs.cjs +19 -19
- package/dist/brepjs.js +19 -19
- package/dist/core.cjs +1 -1
- package/dist/core.js +1 -1
- package/dist/{cornerFinder-CyvfiiYv.js → cornerFinder-BFVYGCFi.js} +1 -1
- package/dist/{cornerFinder-Du1Q1hgu.cjs → cornerFinder-CZQBVvRq.cjs} +1 -1
- package/dist/{curveFns-D9GbWpcl.js → curveFns-B-qDPOzI.js} +1 -1
- package/dist/{curveFns--4Nh1ZtB.cjs → curveFns-BQwce7aY.cjs} +1 -1
- package/dist/{drawFns-BDqEWrCy.js → drawFns-CRDg-UbI.js} +11 -11
- package/dist/{drawFns-DTqCnYeo.cjs → drawFns-Djuxu7Qs.cjs} +11 -11
- package/dist/{extrudeFns-CIUq5ZQW.cjs → extrudeFns-ohzyovvF.cjs} +1 -1
- package/dist/{extrudeFns-DxS_UOMr.js → extrudeFns-xvlzEsCj.js} +1 -1
- package/dist/{faceFns-lcEYbLOs.js → faceFns-CJ0slhjZ.js} +1 -1
- package/dist/{faceFns-D7i9yEts.cjs → faceFns-Cme3e43c.cjs} +1 -1
- package/dist/{helpers-BK3DVd3M.cjs → helpers-BNDmbkco.cjs} +5 -5
- package/dist/{helpers-BwzOwHWl.js → helpers-Cn-YvXDJ.js} +5 -5
- package/dist/{historyFns-BO9c4AgQ.cjs → historyFns-9lsR_H1u.cjs} +4 -4
- package/dist/{historyFns-C_EoZWD5.js → historyFns-Xfr9TrhV.js} +4 -4
- package/dist/{importFns-NY1stg0C.js → importFns-B1iFL_xB.js} +2 -2
- package/dist/{importFns-Ca7DsY-k.cjs → importFns-C_L9mTn_.cjs} +2 -2
- package/dist/io.cjs +2 -2
- package/dist/io.js +2 -2
- package/dist/kernel/brepkit/brepkitAdapter.d.ts +1 -0
- package/dist/kernel/brepkit/brepkitAdapter.d.ts.map +1 -1
- package/dist/kernel/brepkit/brepkitWasmTypes.d.ts +141 -330
- package/dist/kernel/brepkit/brepkitWasmTypes.d.ts.map +1 -1
- package/dist/kernel/brepkit/constructionOps.d.ts.map +1 -1
- package/dist/kernel/brepkit/meshOps.d.ts.map +1 -1
- package/dist/kernel/brepkit/sketchOps.d.ts +2 -0
- package/dist/kernel/brepkit/sketchOps.d.ts.map +1 -1
- package/dist/kernel/occt/extendedConstructorOps.d.ts.map +1 -1
- package/dist/kernel/occt/geometryQueryOps.d.ts +1 -1
- package/dist/kernel/occt/geometryQueryOps.d.ts.map +1 -1
- package/dist/kernel/occt/hullOps.d.ts.map +1 -1
- package/dist/kernel/occt/kernel2dOps.d.ts.map +1 -1
- package/dist/kernel/occt/measureOps.d.ts.map +1 -1
- package/dist/kernel/types.d.ts +4 -2
- package/dist/kernel/types.d.ts.map +1 -1
- package/dist/{measureFns-rVSankqO.cjs → measureFns-B_9iLcMK.cjs} +2 -2
- package/dist/{measureFns-Dsan3QcB.js → measureFns-rpfHHDDn.js} +2 -2
- package/dist/measurement.cjs +1 -1
- package/dist/measurement.js +1 -1
- package/dist/{meshFns-Z5n8gFAS.cjs → meshFns-B5bBKLLl.cjs} +2 -2
- package/dist/{meshFns-CKs4H-CH.js → meshFns-C565-TZ9.js} +2 -2
- package/dist/operations.cjs +2 -2
- package/dist/operations.js +2 -2
- package/dist/{primitiveFns-DmIP-qnU.js → primitiveFns-B4GyxyOo.js} +8 -8
- package/dist/{primitiveFns-w2otksRk.cjs → primitiveFns-Bia4t4Rm.cjs} +8 -8
- package/dist/query.cjs +2 -2
- package/dist/query.js +2 -2
- package/dist/{shapeFns-DZ2c5Nqo.cjs → shapeFns-CuN44RDe.cjs} +2 -2
- package/dist/{shapeFns-E3qTx3nN.js → shapeFns-DsJtbjMn.js} +2 -2
- package/dist/shapeRef.cjs +1 -1
- package/dist/shapeRef.js +1 -1
- package/dist/{shapeRefFns-CEYgkZ1v.js → shapeRefFns-BWOM_M8M.js} +3 -3
- package/dist/{shapeRefFns-Dl7v17MC.cjs → shapeRefFns-DpIeovVR.cjs} +3 -3
- package/dist/{shapeTypes-B5Vx1Wsw.cjs → shapeTypes-BmAeVdSr.cjs} +140 -146
- package/dist/{shapeTypes-DUJg_N3P.js → shapeTypes-Bvc56l7a.js} +140 -146
- package/dist/sketching.cjs +2 -2
- package/dist/sketching.js +2 -2
- package/dist/{solidBuilders-0gTTuSxw.js → solidBuilders-B8vB_kwH.js} +2 -2
- package/dist/{solidBuilders-Bvq6br4f.cjs → solidBuilders-CedPIyJu.cjs} +2 -2
- package/dist/{surfaceBuilders-DMI0n7Bf.js → surfaceBuilders-C8KV64_L.js} +2 -2
- package/dist/{surfaceBuilders-CYWopaht.cjs → surfaceBuilders-r3Ts30mH.cjs} +2 -2
- package/dist/topology/evolutionFns.d.ts.map +1 -1
- package/dist/topology.cjs +6 -6
- package/dist/topology.js +6 -6
- package/package.json +4 -3
|
@@ -22,7 +22,7 @@ function exportSTEP$1(oc, shapes) {
|
|
|
22
22
|
oc.Interface_Static.SetIVal("write.step.schema", 5);
|
|
23
23
|
writer.Model(true).delete();
|
|
24
24
|
const progress = new oc.Message_ProgressRange_1();
|
|
25
|
-
for (const shape of shapes) writer.
|
|
25
|
+
for (const shape of shapes) writer.Transfer_1(shape, oc.STEPControl_StepModelType.STEPControl_AsIs, true, progress);
|
|
26
26
|
const filename = uniqueIOFilename("_export", "step");
|
|
27
27
|
const done = writer.Write(filename);
|
|
28
28
|
writer.delete();
|
|
@@ -93,14 +93,14 @@ function importSTL$1(oc, data) {
|
|
|
93
93
|
const buffer = typeof data === "string" ? new TextEncoder().encode(data) : new Uint8Array(data);
|
|
94
94
|
oc.FS.writeFile("/" + filename, buffer);
|
|
95
95
|
const reader = new oc.StlAPI_Reader();
|
|
96
|
-
const readShape = new oc.
|
|
97
|
-
if (reader.
|
|
96
|
+
const readShape = new oc.TopoDS_Shape();
|
|
97
|
+
if (reader.Read_1(readShape, "/" + filename)) {
|
|
98
98
|
oc.FS.unlink("/" + filename);
|
|
99
99
|
const upgrader = new oc.ShapeUpgrade_UnifySameDomain_2(readShape, true, true, false);
|
|
100
100
|
upgrader.Build();
|
|
101
101
|
const upgraded = upgrader.Shape();
|
|
102
102
|
const solidBuilder = new oc.BRepBuilderAPI_MakeSolid_1();
|
|
103
|
-
solidBuilder.Add(oc.
|
|
103
|
+
solidBuilder.Add(oc.TopoDS_Cast.Shell(upgraded));
|
|
104
104
|
const solid = solidBuilder.Solid();
|
|
105
105
|
readShape.delete();
|
|
106
106
|
upgrader.delete();
|
|
@@ -263,26 +263,20 @@ function linearCenterOfMass$1(oc, shape) {
|
|
|
263
263
|
function boundingBox$1(oc, shape) {
|
|
264
264
|
const box = new oc.Bnd_Box_1();
|
|
265
265
|
oc.BRepBndLib.Add(shape, box, true);
|
|
266
|
-
const
|
|
267
|
-
const yMin = { current: 0 };
|
|
268
|
-
const zMin = { current: 0 };
|
|
269
|
-
const xMax = { current: 0 };
|
|
270
|
-
const yMax = { current: 0 };
|
|
271
|
-
const zMax = { current: 0 };
|
|
272
|
-
box.Get(xMin, yMin, zMin, xMax, yMax, zMax);
|
|
273
|
-
box.delete();
|
|
274
|
-
return {
|
|
266
|
+
const result = {
|
|
275
267
|
min: [
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
268
|
+
box.GetXMin(),
|
|
269
|
+
box.GetYMin(),
|
|
270
|
+
box.GetZMin()
|
|
279
271
|
],
|
|
280
272
|
max: [
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
273
|
+
box.GetXMax(),
|
|
274
|
+
box.GetYMax(),
|
|
275
|
+
box.GetZMax()
|
|
284
276
|
]
|
|
285
277
|
};
|
|
278
|
+
box.delete();
|
|
279
|
+
return result;
|
|
286
280
|
}
|
|
287
281
|
/**
|
|
288
282
|
* Measures the minimum distance between two shapes, returning value and closest points.
|
|
@@ -456,7 +450,7 @@ function transformBatch(oc, entries) {
|
|
|
456
450
|
* Applies a transformation matrix to a shape.
|
|
457
451
|
*/
|
|
458
452
|
function transform$1(oc, shape, trsf) {
|
|
459
|
-
const transformer = new oc.BRepBuilderAPI_Transform_2(shape, trsf, true);
|
|
453
|
+
const transformer = new oc.BRepBuilderAPI_Transform_2(shape, trsf, true, false);
|
|
460
454
|
const result = transformer.ModifiedShape(shape);
|
|
461
455
|
transformer.delete();
|
|
462
456
|
return result;
|
|
@@ -487,7 +481,7 @@ function rotate$1(oc, shape, angle, axis = [
|
|
|
487
481
|
]) {
|
|
488
482
|
const trsf = new oc.gp_Trsf_1();
|
|
489
483
|
const origin = new oc.gp_Pnt_3(...center);
|
|
490
|
-
const dir = new oc.
|
|
484
|
+
const dir = new oc.gp_Dir_5(...axis);
|
|
491
485
|
const ax1 = new oc.gp_Ax1_2(origin, dir);
|
|
492
486
|
trsf.SetRotation_1(ax1, angle * Math.PI / 180);
|
|
493
487
|
const result = transform$1(oc, shape, trsf);
|
|
@@ -503,8 +497,8 @@ function rotate$1(oc, shape, angle, axis = [
|
|
|
503
497
|
function mirror$1(oc, shape, origin, normal) {
|
|
504
498
|
const trsf = new oc.gp_Trsf_1();
|
|
505
499
|
const pnt = new oc.gp_Pnt_3(...origin);
|
|
506
|
-
const dir = new oc.
|
|
507
|
-
const ax2 = new oc.
|
|
500
|
+
const dir = new oc.gp_Dir_5(...normal);
|
|
501
|
+
const ax2 = new oc.gp_Ax2_4(pnt, dir);
|
|
508
502
|
trsf.SetMirror_3(ax2);
|
|
509
503
|
const result = transform$1(oc, shape, trsf);
|
|
510
504
|
trsf.delete();
|
|
@@ -536,7 +530,7 @@ function generalTransform$1(oc, shape, linear, translation, isOrthogonal) {
|
|
|
536
530
|
if (isOrthogonal) {
|
|
537
531
|
const trsf = new oc.gp_Trsf_1();
|
|
538
532
|
trsf.SetValues(linear[0], linear[1], linear[2], translation[0], linear[3], linear[4], linear[5], translation[1], linear[6], linear[7], linear[8], translation[2]);
|
|
539
|
-
const transformer = new oc.BRepBuilderAPI_Transform_2(shape, trsf, true);
|
|
533
|
+
const transformer = new oc.BRepBuilderAPI_Transform_2(shape, trsf, true, false);
|
|
540
534
|
const result = transformer.ModifiedShape(shape);
|
|
541
535
|
transformer.delete();
|
|
542
536
|
trsf.delete();
|
|
@@ -1036,7 +1030,7 @@ function iterShapesJS(oc, shape, type) {
|
|
|
1036
1030
|
const seen = /* @__PURE__ */ new Map();
|
|
1037
1031
|
while (explorer.More()) {
|
|
1038
1032
|
const item = explorer.Current();
|
|
1039
|
-
const hash =
|
|
1033
|
+
const hash = oc.shapeHashCode(item, HASH_CODE_MAX);
|
|
1040
1034
|
const bucket = seen.get(hash);
|
|
1041
1035
|
if (!bucket) {
|
|
1042
1036
|
seen.set(hash, [item]);
|
|
@@ -1092,7 +1086,7 @@ function shapeType$1(oc, shape) {
|
|
|
1092
1086
|
* Checks if a shape is valid according to OCCT geometry and topology checks.
|
|
1093
1087
|
*/
|
|
1094
1088
|
function isValid$1(oc, shape) {
|
|
1095
|
-
const analyzer = new oc.BRepCheck_Analyzer(shape, true, false);
|
|
1089
|
+
const analyzer = new oc.BRepCheck_Analyzer(shape, true, false, false);
|
|
1096
1090
|
const valid = analyzer.IsValid_2();
|
|
1097
1091
|
analyzer.delete();
|
|
1098
1092
|
return valid;
|
|
@@ -1221,8 +1215,8 @@ function makeCylinder$1(oc, radius, height, center = [
|
|
|
1221
1215
|
1
|
|
1222
1216
|
]) {
|
|
1223
1217
|
const origin = new oc.gp_Pnt_3(...center);
|
|
1224
|
-
const dir = new oc.
|
|
1225
|
-
const axis = new oc.
|
|
1218
|
+
const dir = new oc.gp_Dir_5(...direction);
|
|
1219
|
+
const axis = new oc.gp_Ax2_4(origin, dir);
|
|
1226
1220
|
const maker = new oc.BRepPrimAPI_MakeCylinder_3(axis, radius, height);
|
|
1227
1221
|
const solid = maker.Shape();
|
|
1228
1222
|
maker.delete();
|
|
@@ -1265,8 +1259,8 @@ function makeCone$1(oc, radius1, radius2, height, center = [
|
|
|
1265
1259
|
1
|
|
1266
1260
|
]) {
|
|
1267
1261
|
const origin = new oc.gp_Pnt_3(...center);
|
|
1268
|
-
const dir = new oc.
|
|
1269
|
-
const axis = new oc.
|
|
1262
|
+
const dir = new oc.gp_Dir_5(...direction);
|
|
1263
|
+
const axis = new oc.gp_Ax2_4(origin, dir);
|
|
1270
1264
|
const maker = new oc.BRepPrimAPI_MakeCone_3(axis, radius1, radius2, height);
|
|
1271
1265
|
const solid = maker.Shape();
|
|
1272
1266
|
maker.delete();
|
|
@@ -1337,8 +1331,8 @@ function makeTorus$1(oc, majorRadius, minorRadius, center = [
|
|
|
1337
1331
|
1
|
|
1338
1332
|
]) {
|
|
1339
1333
|
const origin = new oc.gp_Pnt_3(...center);
|
|
1340
|
-
const dir = new oc.
|
|
1341
|
-
const axis = new oc.
|
|
1334
|
+
const dir = new oc.gp_Dir_5(...direction);
|
|
1335
|
+
const axis = new oc.gp_Ax2_4(origin, dir);
|
|
1342
1336
|
const maker = new oc.BRepPrimAPI_MakeTorus_5(axis, majorRadius, minorRadius);
|
|
1343
1337
|
const solid = maker.Shape();
|
|
1344
1338
|
maker.delete();
|
|
@@ -1424,7 +1418,7 @@ function simplePipe$1(oc, profile, spine) {
|
|
|
1424
1418
|
progress.delete();
|
|
1425
1419
|
const shellShape = maker.Shape();
|
|
1426
1420
|
const solidMaker = new oc.BRepBuilderAPI_MakeSolid_1();
|
|
1427
|
-
const shellDowncast = oc.
|
|
1421
|
+
const shellDowncast = oc.TopoDS_Cast.Shell(shellShape);
|
|
1428
1422
|
solidMaker.Add(shellDowncast);
|
|
1429
1423
|
const solidProgress = new oc.Message_ProgressRange_1();
|
|
1430
1424
|
solidMaker.Build(solidProgress);
|
|
@@ -1558,7 +1552,7 @@ function fillet$1(oc, shape, edges, radius) {
|
|
|
1558
1552
|
const builder = new oc.BRepFilletAPI_MakeFillet(shape, oc.ChFi3d_FilletShape.ChFi3d_Rational);
|
|
1559
1553
|
for (const edge of edges) {
|
|
1560
1554
|
const r = typeof radius === "function" ? radius(edge) : radius;
|
|
1561
|
-
const downcast = oc.
|
|
1555
|
+
const downcast = oc.TopoDS_Cast.Edge(edge);
|
|
1562
1556
|
if (typeof r === "number") {
|
|
1563
1557
|
if (r > 0) builder.Add_2(r, downcast);
|
|
1564
1558
|
} else {
|
|
@@ -1585,10 +1579,10 @@ function chamfer$1(oc, shape, edges, distance) {
|
|
|
1585
1579
|
edgeFaceMap = /* @__PURE__ */ new Map();
|
|
1586
1580
|
const faceExp = new oc.TopExp_Explorer_2(shape, oc.TopAbs_ShapeEnum.TopAbs_FACE, oc.TopAbs_ShapeEnum.TopAbs_SHAPE);
|
|
1587
1581
|
while (faceExp.More()) {
|
|
1588
|
-
const face = oc.
|
|
1582
|
+
const face = oc.TopoDS_Cast.Face(faceExp.Current());
|
|
1589
1583
|
const edgeExp = new oc.TopExp_Explorer_2(face, oc.TopAbs_ShapeEnum.TopAbs_EDGE, oc.TopAbs_ShapeEnum.TopAbs_SHAPE);
|
|
1590
1584
|
while (edgeExp.More()) {
|
|
1591
|
-
const hash = edgeExp.Current()
|
|
1585
|
+
const hash = oc.shapeHashCode(edgeExp.Current(), 2147483647);
|
|
1592
1586
|
if (!edgeFaceMap.has(hash)) edgeFaceMap.set(hash, face);
|
|
1593
1587
|
edgeExp.Next();
|
|
1594
1588
|
}
|
|
@@ -1599,11 +1593,11 @@ function chamfer$1(oc, shape, edges, distance) {
|
|
|
1599
1593
|
return edgeFaceMap;
|
|
1600
1594
|
}
|
|
1601
1595
|
function findContainingFace(edge) {
|
|
1602
|
-
return getEdgeFaceMap().get(
|
|
1596
|
+
return getEdgeFaceMap().get(oc.shapeHashCode(edge, 2147483647)) ?? null;
|
|
1603
1597
|
}
|
|
1604
1598
|
for (const edge of edges) {
|
|
1605
1599
|
const d = typeof distance === "function" ? distance(edge) : distance;
|
|
1606
|
-
const downcast = oc.
|
|
1600
|
+
const downcast = oc.TopoDS_Cast.Edge(edge);
|
|
1607
1601
|
if (typeof d === "number") {
|
|
1608
1602
|
if (d > 0) builder.Add_2(d, downcast);
|
|
1609
1603
|
} else {
|
|
@@ -1664,10 +1658,10 @@ function chamferDistAngle$1(oc, shape, edges, distance, angleDeg) {
|
|
|
1664
1658
|
const edgeFaceMap = /* @__PURE__ */ new Map();
|
|
1665
1659
|
const faceExplorer = new oc.TopExp_Explorer_2(shape, oc.TopAbs_ShapeEnum.TopAbs_FACE, oc.TopAbs_ShapeEnum.TopAbs_SHAPE);
|
|
1666
1660
|
while (faceExplorer.More()) {
|
|
1667
|
-
const face = oc.
|
|
1661
|
+
const face = oc.TopoDS_Cast.Face(faceExplorer.Current());
|
|
1668
1662
|
const edgeExp = new oc.TopExp_Explorer_2(face, oc.TopAbs_ShapeEnum.TopAbs_EDGE, oc.TopAbs_ShapeEnum.TopAbs_SHAPE);
|
|
1669
1663
|
while (edgeExp.More()) {
|
|
1670
|
-
const hash = edgeExp.Current()
|
|
1664
|
+
const hash = oc.shapeHashCode(edgeExp.Current(), 2147483647);
|
|
1671
1665
|
if (!edgeFaceMap.has(hash)) edgeFaceMap.set(hash, face);
|
|
1672
1666
|
edgeExp.Next();
|
|
1673
1667
|
}
|
|
@@ -1676,8 +1670,8 @@ function chamferDistAngle$1(oc, shape, edges, distance, angleDeg) {
|
|
|
1676
1670
|
}
|
|
1677
1671
|
faceExplorer.delete();
|
|
1678
1672
|
for (const edge of edges) {
|
|
1679
|
-
const containingFace = edgeFaceMap.get(
|
|
1680
|
-
if (containingFace && distance > 0) builder.AddDA(distance, angleRad, oc.
|
|
1673
|
+
const containingFace = edgeFaceMap.get(oc.shapeHashCode(edge, 2147483647)) ?? null;
|
|
1674
|
+
if (containingFace && distance > 0) builder.AddDA(distance, angleRad, oc.TopoDS_Cast.Edge(edge), containingFace);
|
|
1681
1675
|
}
|
|
1682
1676
|
const result = builder.Shape();
|
|
1683
1677
|
builder.delete();
|
|
@@ -1806,7 +1800,7 @@ function interpolatePoints$1(oc, points, options = {}) {
|
|
|
1806
1800
|
let idx = 1;
|
|
1807
1801
|
for (const pt of points) {
|
|
1808
1802
|
reusePnt.SetCoord_2(pt[0], pt[1], pt[2]);
|
|
1809
|
-
pnts.
|
|
1803
|
+
pnts.SetValue_1(idx++, reusePnt);
|
|
1810
1804
|
}
|
|
1811
1805
|
reusePnt.delete();
|
|
1812
1806
|
const splineBuilder = new oc.GeomAPI_PointsToBSpline_2(pnts, 3, 8, oc.GeomAbs_Shape.GeomAbs_C2, tolerance);
|
|
@@ -1834,7 +1828,7 @@ function approximatePoints$1(oc, points, options = {}) {
|
|
|
1834
1828
|
let idx = 1;
|
|
1835
1829
|
for (const pt of points) {
|
|
1836
1830
|
reusePnt.SetCoord_2(pt[0], pt[1], pt[2]);
|
|
1837
|
-
pnts.
|
|
1831
|
+
pnts.SetValue_1(idx++, reusePnt);
|
|
1838
1832
|
}
|
|
1839
1833
|
reusePnt.delete();
|
|
1840
1834
|
let splineBuilder;
|
|
@@ -2103,14 +2097,10 @@ function extractVertices(oc, shapes, tolerance) {
|
|
|
2103
2097
|
const vertices = [];
|
|
2104
2098
|
const meshDeflection = Math.max(tolerance, 1);
|
|
2105
2099
|
for (const shape of shapes) {
|
|
2106
|
-
|
|
2107
|
-
const progress = new oc.Message_ProgressRange_1();
|
|
2108
|
-
mesh.Perform(progress);
|
|
2109
|
-
progress.delete();
|
|
2110
|
-
mesh.delete();
|
|
2100
|
+
new oc.BRepMesh_IncrementalMeshWrapper(shape, meshDeflection, false, meshDeflection * .5, false).delete();
|
|
2111
2101
|
const explorer = new oc.TopExp_Explorer_2(shape, oc.TopAbs_ShapeEnum.TopAbs_FACE, oc.TopAbs_ShapeEnum.TopAbs_SHAPE);
|
|
2112
2102
|
while (explorer.More()) {
|
|
2113
|
-
const face = oc.
|
|
2103
|
+
const face = oc.TopoDS_Cast.Face(explorer.Current());
|
|
2114
2104
|
const location = new oc.TopLoc_Location_1();
|
|
2115
2105
|
const tri = oc.BRep_Tool.Triangulation(face, location, 0);
|
|
2116
2106
|
if (!tri.IsNull()) {
|
|
@@ -2167,7 +2157,7 @@ function reconstructBrep(oc, hullResult, tolerance) {
|
|
|
2167
2157
|
sewing.delete();
|
|
2168
2158
|
const shellExplorer = new oc.TopExp_Explorer_2(sewn, oc.TopAbs_ShapeEnum.TopAbs_SHELL, oc.TopAbs_ShapeEnum.TopAbs_SHAPE);
|
|
2169
2159
|
if (shellExplorer.More()) {
|
|
2170
|
-
const shell = oc.
|
|
2160
|
+
const shell = oc.TopoDS_Cast.Shell(shellExplorer.Current());
|
|
2171
2161
|
shellExplorer.delete();
|
|
2172
2162
|
const solidMaker = new oc.BRepBuilderAPI_MakeSolid_1();
|
|
2173
2163
|
solidMaker.Add(shell);
|
|
@@ -2448,14 +2438,14 @@ function shapeOrientation$1(oc, shape) {
|
|
|
2448
2438
|
/** Downcast a generic TopoDS_Shape to its concrete subtype. */
|
|
2449
2439
|
function downcast$1(oc, shape, type) {
|
|
2450
2440
|
switch (type ?? shapeTypeStr(oc, shape)) {
|
|
2451
|
-
case "vertex": return oc.
|
|
2452
|
-
case "edge": return oc.
|
|
2453
|
-
case "wire": return oc.
|
|
2454
|
-
case "face": return oc.
|
|
2455
|
-
case "shell": return oc.
|
|
2456
|
-
case "solid": return oc.
|
|
2457
|
-
case "compsolid": return oc.
|
|
2458
|
-
default: return oc.
|
|
2441
|
+
case "vertex": return oc.TopoDS_Cast.Vertex(shape);
|
|
2442
|
+
case "edge": return oc.TopoDS_Cast.Edge(shape);
|
|
2443
|
+
case "wire": return oc.TopoDS_Cast.Wire(shape);
|
|
2444
|
+
case "face": return oc.TopoDS_Cast.Face(shape);
|
|
2445
|
+
case "shell": return oc.TopoDS_Cast.Shell(shape);
|
|
2446
|
+
case "solid": return oc.TopoDS_Cast.Solid(shape);
|
|
2447
|
+
case "compsolid": return oc.TopoDS_Cast.CompSolid(shape);
|
|
2448
|
+
default: return oc.TopoDS_Cast.Compound(shape);
|
|
2459
2449
|
}
|
|
2460
2450
|
}
|
|
2461
2451
|
/** Internal helper — get shape type as string. */
|
|
@@ -2472,8 +2462,8 @@ function shapeTypeStr(oc, shape) {
|
|
|
2472
2462
|
return "compound";
|
|
2473
2463
|
}
|
|
2474
2464
|
/** Get the hash code of a shape. */
|
|
2475
|
-
function hashCode$1(
|
|
2476
|
-
return
|
|
2465
|
+
function hashCode$1(oc, shape, upperBound) {
|
|
2466
|
+
return oc.shapeHashCode(shape, upperBound);
|
|
2477
2467
|
}
|
|
2478
2468
|
/** Check if a shape is null. */
|
|
2479
2469
|
function isNull$1(_oc, shape) {
|
|
@@ -2489,7 +2479,7 @@ function hasTriangulation$1(oc, shape) {
|
|
|
2489
2479
|
const loc = new oc.TopLoc_Location_1();
|
|
2490
2480
|
let found = false;
|
|
2491
2481
|
while (explorer.More()) {
|
|
2492
|
-
const face = oc.
|
|
2482
|
+
const face = oc.TopoDS_Cast.Face(explorer.Current());
|
|
2493
2483
|
if (!oc.BRep_Tool.Triangulation(face, loc, 0).IsNull()) {
|
|
2494
2484
|
found = true;
|
|
2495
2485
|
break;
|
|
@@ -2505,7 +2495,7 @@ function hasTriangulation$1(oc, shape) {
|
|
|
2505
2495
|
* This modifies the shape's internal triangulation data in place.
|
|
2506
2496
|
*/
|
|
2507
2497
|
function meshShape$1(oc, shape, tolerance, angularTolerance) {
|
|
2508
|
-
new oc.
|
|
2498
|
+
new oc.BRepMesh_IncrementalMeshWrapper(shape, tolerance, false, angularTolerance, false).delete();
|
|
2509
2499
|
}
|
|
2510
2500
|
/** Extract the second-to-last Bezier control pole from a 3D edge curve. */
|
|
2511
2501
|
function getBezierPenultimatePole$1(oc, edge) {
|
|
@@ -2731,8 +2721,8 @@ function makeLineEdge$1(oc, p1, p2) {
|
|
|
2731
2721
|
/** Create a full circle edge. */
|
|
2732
2722
|
function makeCircleEdge$1(oc, center, normal, radius) {
|
|
2733
2723
|
const pnt = new oc.gp_Pnt_3(center[0], center[1], center[2]);
|
|
2734
|
-
const dir = new oc.
|
|
2735
|
-
const ax = new oc.
|
|
2724
|
+
const dir = new oc.gp_Dir_5(normal[0], normal[1], normal[2]);
|
|
2725
|
+
const ax = new oc.gp_Ax2_4(pnt, dir);
|
|
2736
2726
|
const circ = new oc.gp_Circ_2(ax, radius);
|
|
2737
2727
|
const maker = new oc.BRepBuilderAPI_MakeEdge_8(circ);
|
|
2738
2728
|
const edge = maker.Edge();
|
|
@@ -2746,8 +2736,8 @@ function makeCircleEdge$1(oc, center, normal, radius) {
|
|
|
2746
2736
|
/** Create a circular arc edge from center, normal, radius, and angle range (radians). */
|
|
2747
2737
|
function makeCircleArc$1(oc, center, normal, radius, startAngle, endAngle) {
|
|
2748
2738
|
const pnt = new oc.gp_Pnt_3(center[0], center[1], center[2]);
|
|
2749
|
-
const dir = new oc.
|
|
2750
|
-
const ax = new oc.
|
|
2739
|
+
const dir = new oc.gp_Dir_5(normal[0], normal[1], normal[2]);
|
|
2740
|
+
const ax = new oc.gp_Ax2_4(pnt, dir);
|
|
2751
2741
|
const circ = new oc.gp_Circ_2(ax, radius);
|
|
2752
2742
|
const maker = new oc.BRepBuilderAPI_MakeEdge_9(circ, startAngle, endAngle);
|
|
2753
2743
|
const edge = maker.Edge();
|
|
@@ -2793,13 +2783,13 @@ function makeTangentArc$1(oc, startPoint, startTangent, endPoint) {
|
|
|
2793
2783
|
/** Create a full ellipse edge. */
|
|
2794
2784
|
function makeEllipseEdge$1(oc, center, normal, majorRadius, minorRadius, xDir) {
|
|
2795
2785
|
const pnt = new oc.gp_Pnt_3(center[0], center[1], center[2]);
|
|
2796
|
-
const dir = new oc.
|
|
2786
|
+
const dir = new oc.gp_Dir_5(normal[0], normal[1], normal[2]);
|
|
2797
2787
|
let ax;
|
|
2798
2788
|
if (xDir) {
|
|
2799
|
-
const xd = new oc.
|
|
2789
|
+
const xd = new oc.gp_Dir_5(xDir[0], xDir[1], xDir[2]);
|
|
2800
2790
|
ax = new oc.gp_Ax2_2(pnt, dir, xd);
|
|
2801
2791
|
xd.delete();
|
|
2802
|
-
} else ax = new oc.
|
|
2792
|
+
} else ax = new oc.gp_Ax2_4(pnt, dir);
|
|
2803
2793
|
const elips = new oc.gp_Elips_2(ax, majorRadius, minorRadius);
|
|
2804
2794
|
const maker = new oc.BRepBuilderAPI_MakeEdge_12(elips);
|
|
2805
2795
|
const edge = maker.Edge();
|
|
@@ -2813,13 +2803,13 @@ function makeEllipseEdge$1(oc, center, normal, majorRadius, minorRadius, xDir) {
|
|
|
2813
2803
|
/** Create an elliptical arc edge. Angles are in radians. */
|
|
2814
2804
|
function makeEllipseArc$1(oc, center, normal, majorRadius, minorRadius, startAngle, endAngle, xDir) {
|
|
2815
2805
|
const pnt = new oc.gp_Pnt_3(center[0], center[1], center[2]);
|
|
2816
|
-
const dir = new oc.
|
|
2806
|
+
const dir = new oc.gp_Dir_5(normal[0], normal[1], normal[2]);
|
|
2817
2807
|
let ax;
|
|
2818
2808
|
if (xDir) {
|
|
2819
|
-
const xd = new oc.
|
|
2809
|
+
const xd = new oc.gp_Dir_5(xDir[0], xDir[1], xDir[2]);
|
|
2820
2810
|
ax = new oc.gp_Ax2_2(pnt, dir, xd);
|
|
2821
2811
|
xd.delete();
|
|
2822
|
-
} else ax = new oc.
|
|
2812
|
+
} else ax = new oc.gp_Ax2_4(pnt, dir);
|
|
2823
2813
|
const elips = new oc.gp_Elips_2(ax, majorRadius, minorRadius);
|
|
2824
2814
|
const maker = new oc.BRepBuilderAPI_MakeEdge_13(elips, startAngle, endAngle);
|
|
2825
2815
|
const edge = maker.Edge();
|
|
@@ -2836,7 +2826,7 @@ function makeBezierEdge$1(oc, points) {
|
|
|
2836
2826
|
for (let i = 0; i < points.length; i++) {
|
|
2837
2827
|
const p = points[i];
|
|
2838
2828
|
const pnt = new oc.gp_Pnt_3(p[0], p[1], p[2]);
|
|
2839
|
-
arr.
|
|
2829
|
+
arr.SetValue_1(i + 1, pnt);
|
|
2840
2830
|
pnt.delete();
|
|
2841
2831
|
}
|
|
2842
2832
|
const bezier = new oc.Geom_BezierCurve_1(arr);
|
|
@@ -2867,12 +2857,12 @@ function makeHelixWire$1(oc, pitch, height, radius, center = [
|
|
|
2867
2857
|
const nTurns = height / pitch;
|
|
2868
2858
|
const myDir = leftHanded ? -2 * Math.PI : 2 * Math.PI;
|
|
2869
2859
|
const pnt = new oc.gp_Pnt_3(center[0], center[1], center[2]);
|
|
2870
|
-
const dir = new oc.
|
|
2871
|
-
const ax3 = new oc.
|
|
2860
|
+
const dir = new oc.gp_Dir_5(direction[0], direction[1], direction[2]);
|
|
2861
|
+
const ax3 = new oc.gp_Ax3_5(pnt, dir);
|
|
2872
2862
|
const geomSurf = new oc.Geom_CylindricalSurface_1(ax3, radius);
|
|
2873
2863
|
ax3.delete();
|
|
2874
2864
|
const pnt2d = new oc.gp_Pnt2d_3(0, 0);
|
|
2875
|
-
const dir2d = new oc.
|
|
2865
|
+
const dir2d = new oc.gp_Dir2d_5(myDir, pitch);
|
|
2876
2866
|
const geomLine = new oc.Geom2d_Line_3(pnt2d, dir2d);
|
|
2877
2867
|
const uStartPnt = geomLine.Value(0);
|
|
2878
2868
|
const uStopPnt = geomLine.Value(nTurns * Math.sqrt((2 * Math.PI) ** 2 + pitch ** 2));
|
|
@@ -2903,11 +2893,11 @@ function makeEllipsoidGTrsf(oc, x, y, z) {
|
|
|
2903
2893
|
const xzRatio = x / xyRatio;
|
|
2904
2894
|
const yzRatio = y / xyRatio;
|
|
2905
2895
|
const origin = new oc.gp_Pnt_3(0, 0, 0);
|
|
2906
|
-
const dirY = new oc.
|
|
2896
|
+
const dirY = new oc.gp_Dir_5(0, 1, 0);
|
|
2907
2897
|
const ax1 = new oc.gp_Ax1_2(origin, dirY);
|
|
2908
|
-
const dirZ = new oc.
|
|
2898
|
+
const dirZ = new oc.gp_Dir_5(0, 0, 1);
|
|
2909
2899
|
const ax2 = new oc.gp_Ax1_2(origin, dirZ);
|
|
2910
|
-
const dirX = new oc.
|
|
2900
|
+
const dirX = new oc.gp_Dir_5(1, 0, 0);
|
|
2911
2901
|
const ax3 = new oc.gp_Ax1_2(origin, dirX);
|
|
2912
2902
|
const transform = new oc.gp_GTrsf_1();
|
|
2913
2903
|
transform.SetAffinity_1(ax1, xzRatio);
|
|
@@ -2951,12 +2941,14 @@ function makeEllipsoidSolid(oc, aLength, bLength, cLength) {
|
|
|
2951
2941
|
sphere.delete();
|
|
2952
2942
|
sphericalSurface.delete();
|
|
2953
2943
|
try {
|
|
2954
|
-
const poles = baseSurface.Poles_2();
|
|
2955
2944
|
const trsf = makeEllipsoidGTrsf(oc, aLength, bLength, cLength);
|
|
2956
|
-
|
|
2957
|
-
|
|
2945
|
+
const nU = baseSurface.NbUPoles();
|
|
2946
|
+
const nV = baseSurface.NbVPoles();
|
|
2947
|
+
for (let row = 1; row <= nU; row++) for (let col = 1; col <= nV; col++) {
|
|
2948
|
+
const pnt = oc.bsplineSurfacePole(baseSurface, row, col);
|
|
2958
2949
|
const newPoint = trsf.applyToPoint(pnt);
|
|
2959
2950
|
baseSurface.SetPole_1(row, col, newPoint);
|
|
2951
|
+
pnt.delete();
|
|
2960
2952
|
newPoint.delete();
|
|
2961
2953
|
}
|
|
2962
2954
|
trsf.transform.delete();
|
|
@@ -2994,7 +2986,7 @@ function makeBoxFromCorners$1(oc, p1, p2) {
|
|
|
2994
2986
|
/** Build a solid from a closed shell using ShapeFix_Solid. */
|
|
2995
2987
|
function solidFromShell$1(oc, shell) {
|
|
2996
2988
|
const fixer = new oc.ShapeFix_Solid_1();
|
|
2997
|
-
const solid = fixer.SolidFromShell(oc.
|
|
2989
|
+
const solid = fixer.SolidFromShell(oc.TopoDS_Cast.Shell(shell));
|
|
2998
2990
|
fixer.delete();
|
|
2999
2991
|
return solid;
|
|
3000
2992
|
}
|
|
@@ -3122,14 +3114,14 @@ function createPoint3d$1(oc, x, y, z) {
|
|
|
3122
3114
|
return new oc.gp_Pnt_3(x, y, z);
|
|
3123
3115
|
}
|
|
3124
3116
|
function createDirection3d$1(oc, x, y, z) {
|
|
3125
|
-
return new oc.
|
|
3117
|
+
return new oc.gp_Dir_5(x, y, z);
|
|
3126
3118
|
}
|
|
3127
3119
|
function createVector3d$1(oc, x, y, z) {
|
|
3128
3120
|
return new oc.gp_Vec_4(x, y, z);
|
|
3129
3121
|
}
|
|
3130
3122
|
function createAxis1$1(oc, cx, cy, cz, dx, dy, dz) {
|
|
3131
3123
|
const pnt = new oc.gp_Pnt_3(cx, cy, cz);
|
|
3132
|
-
const dir = new oc.
|
|
3124
|
+
const dir = new oc.gp_Dir_5(dx, dy, dz);
|
|
3133
3125
|
const ax = new oc.gp_Ax1_2(pnt, dir);
|
|
3134
3126
|
pnt.delete();
|
|
3135
3127
|
dir.delete();
|
|
@@ -3137,26 +3129,26 @@ function createAxis1$1(oc, cx, cy, cz, dx, dy, dz) {
|
|
|
3137
3129
|
}
|
|
3138
3130
|
function createAxis2$1(oc, ox, oy, oz, zx, zy, zz, xx, xy, xz) {
|
|
3139
3131
|
const pnt = new oc.gp_Pnt_3(ox, oy, oz);
|
|
3140
|
-
const z = new oc.
|
|
3132
|
+
const z = new oc.gp_Dir_5(zx, zy, zz);
|
|
3141
3133
|
let ax;
|
|
3142
3134
|
if (xx !== void 0 && xy !== void 0 && xz !== void 0) {
|
|
3143
|
-
const x = new oc.
|
|
3135
|
+
const x = new oc.gp_Dir_5(xx, xy, xz);
|
|
3144
3136
|
ax = new oc.gp_Ax2_2(pnt, z, x);
|
|
3145
3137
|
x.delete();
|
|
3146
|
-
} else ax = new oc.
|
|
3138
|
+
} else ax = new oc.gp_Ax2_4(pnt, z);
|
|
3147
3139
|
pnt.delete();
|
|
3148
3140
|
z.delete();
|
|
3149
3141
|
return ax;
|
|
3150
3142
|
}
|
|
3151
3143
|
function createAxis3$1(oc, ox, oy, oz, zx, zy, zz, xx, xy, xz) {
|
|
3152
3144
|
const pnt = new oc.gp_Pnt_3(ox, oy, oz);
|
|
3153
|
-
const z = new oc.
|
|
3145
|
+
const z = new oc.gp_Dir_5(zx, zy, zz);
|
|
3154
3146
|
let ax;
|
|
3155
3147
|
if (xx !== void 0 && xy !== void 0 && xz !== void 0) {
|
|
3156
|
-
const x = new oc.
|
|
3148
|
+
const x = new oc.gp_Dir_5(xx, xy, xz);
|
|
3157
3149
|
ax = new oc.gp_Ax3_3(pnt, z, x);
|
|
3158
3150
|
x.delete();
|
|
3159
|
-
} else ax = new oc.
|
|
3151
|
+
} else ax = new oc.gp_Ax3_5(pnt, z);
|
|
3160
3152
|
pnt.delete();
|
|
3161
3153
|
z.delete();
|
|
3162
3154
|
return ax;
|
|
@@ -3184,14 +3176,14 @@ function createPoint2d$1(oc, x, y) {
|
|
|
3184
3176
|
return new oc.gp_Pnt2d_3(x, y);
|
|
3185
3177
|
}
|
|
3186
3178
|
function createDirection2d$1(oc, x, y) {
|
|
3187
|
-
return new oc.
|
|
3179
|
+
return new oc.gp_Dir2d_5(x, y);
|
|
3188
3180
|
}
|
|
3189
3181
|
function createVector2d$1(oc, x, y) {
|
|
3190
3182
|
return new oc.gp_Vec2d_4(x, y);
|
|
3191
3183
|
}
|
|
3192
3184
|
function createAxis2d$1(oc, px, py, dx, dy) {
|
|
3193
3185
|
const pnt = new oc.gp_Pnt2d_3(px, py);
|
|
3194
|
-
const dir = new oc.
|
|
3186
|
+
const dir = new oc.gp_Dir2d_5(dx, dy);
|
|
3195
3187
|
const axis = new oc.gp_Ax2d_2(pnt, dir);
|
|
3196
3188
|
pnt.delete();
|
|
3197
3189
|
dir.delete();
|
|
@@ -3241,7 +3233,7 @@ function makeArc2dTangent$1(oc, startX, startY, tangentX, tangentY, endX, endY)
|
|
|
3241
3233
|
}
|
|
3242
3234
|
function makeEllipse2d$2(oc, cx, cy, majorRadius, minorRadius, xDirX = 1, xDirY = 0, sense = true) {
|
|
3243
3235
|
const center = new oc.gp_Pnt2d_3(cx, cy);
|
|
3244
|
-
const dir = new oc.
|
|
3236
|
+
const dir = new oc.gp_Dir2d_5(xDirX, xDirY);
|
|
3245
3237
|
const ax = new oc.gp_Ax2d_2(center, dir);
|
|
3246
3238
|
const elips = new oc.gp_Elips2d_2(ax, majorRadius, minorRadius, sense);
|
|
3247
3239
|
const maker = new oc.GCE2d_MakeEllipse_1(elips);
|
|
@@ -3255,7 +3247,7 @@ function makeEllipse2d$2(oc, cx, cy, majorRadius, minorRadius, xDirX = 1, xDirY
|
|
|
3255
3247
|
}
|
|
3256
3248
|
function makeEllipseArc2d$1(oc, cx, cy, majorRadius, minorRadius, startAngle, endAngle, xDirX = 1, xDirY = 0, sense = true) {
|
|
3257
3249
|
const center = new oc.gp_Pnt2d_3(cx, cy);
|
|
3258
|
-
const dir = new oc.
|
|
3250
|
+
const dir = new oc.gp_Dir2d_5(xDirX, xDirY);
|
|
3259
3251
|
const ax = new oc.gp_Ax2d_2(center, dir);
|
|
3260
3252
|
const elips = new oc.gp_Elips2d_2(ax, majorRadius, minorRadius, true);
|
|
3261
3253
|
const maker = new oc.GCE2d_MakeArcOfEllipse_1(elips, startAngle, endAngle, sense);
|
|
@@ -3272,7 +3264,7 @@ function makeBezier2d$2(oc, points) {
|
|
|
3272
3264
|
for (let i = 0; i < points.length; i++) {
|
|
3273
3265
|
const p = points[i];
|
|
3274
3266
|
const gpPnt = new oc.gp_Pnt2d_3(p[0], p[1]);
|
|
3275
|
-
arr.
|
|
3267
|
+
arr.SetValue_1(i + 1, gpPnt);
|
|
3276
3268
|
gpPnt.delete();
|
|
3277
3269
|
}
|
|
3278
3270
|
const bezier = new oc.Geom2d_BezierCurve_1(arr);
|
|
@@ -3285,7 +3277,7 @@ function makeBSpline2d$1(oc, points, options = {}) {
|
|
|
3285
3277
|
for (let i = 0; i < points.length; i++) {
|
|
3286
3278
|
const p = points[i];
|
|
3287
3279
|
const gpPnt = new oc.gp_Pnt2d_3(p[0], p[1]);
|
|
3288
|
-
pnts.
|
|
3280
|
+
pnts.SetValue_1(i + 1, gpPnt);
|
|
3289
3281
|
gpPnt.delete();
|
|
3290
3282
|
}
|
|
3291
3283
|
let splineBuilder;
|
|
@@ -3354,7 +3346,7 @@ function copyCurve2d$1(_oc, curve) {
|
|
|
3354
3346
|
return curve.get().Copy();
|
|
3355
3347
|
}
|
|
3356
3348
|
function offsetCurve2d$1(oc, curve, offset) {
|
|
3357
|
-
const offsetCurve = new oc.
|
|
3349
|
+
const offsetCurve = new oc.Geom2d_OffsetCurve_1(curve, offset, true);
|
|
3358
3350
|
return new oc.Handle_Geom2d_Curve_2(offsetCurve);
|
|
3359
3351
|
}
|
|
3360
3352
|
function transformCurve(oc, curve, trsf) {
|
|
@@ -3394,7 +3386,7 @@ function mirrorCurve2dAtPoint$1(oc, curve, cx, cy) {
|
|
|
3394
3386
|
}
|
|
3395
3387
|
function mirrorCurve2dAcrossAxis$1(oc, curve, originX, originY, dirX, dirY) {
|
|
3396
3388
|
const origin = new oc.gp_Pnt2d_3(originX, originY);
|
|
3397
|
-
const dir = new oc.
|
|
3389
|
+
const dir = new oc.gp_Dir2d_5(dirX, dirY);
|
|
3398
3390
|
const ax = new oc.gp_Ax2d_2(origin, dir);
|
|
3399
3391
|
const trsf = new oc.gp_Trsf2d_1();
|
|
3400
3392
|
trsf.SetMirror_2(ax);
|
|
@@ -3405,7 +3397,7 @@ function mirrorCurve2dAcrossAxis$1(oc, curve, originX, originY, dirX, dirY) {
|
|
|
3405
3397
|
}
|
|
3406
3398
|
function affinityTransform2d$1(oc, curve, axisOriginX, axisOriginY, axisDirX, axisDirY, ratio) {
|
|
3407
3399
|
const origin = new oc.gp_Pnt2d_3(axisOriginX, axisOriginY);
|
|
3408
|
-
const dir = new oc.
|
|
3400
|
+
const dir = new oc.gp_Dir2d_5(axisDirX, axisDirY);
|
|
3409
3401
|
const ax = new oc.gp_Ax2d_2(origin, dir);
|
|
3410
3402
|
const gtrsf = new oc.gp_GTrsf2d_1();
|
|
3411
3403
|
gtrsf.SetAffinity(ax, ratio);
|
|
@@ -3427,7 +3419,7 @@ function createIdentityGTrsf2d$1(oc) {
|
|
|
3427
3419
|
}
|
|
3428
3420
|
function createAffinityGTrsf2d$1(oc, originX, originY, dirX, dirY, ratio) {
|
|
3429
3421
|
const origin = new oc.gp_Pnt2d_3(originX, originY);
|
|
3430
|
-
const dir = new oc.
|
|
3422
|
+
const dir = new oc.gp_Dir2d_5(dirX, dirY);
|
|
3431
3423
|
const ax = new oc.gp_Ax2d_2(origin, dir);
|
|
3432
3424
|
const gtrsf = new oc.gp_GTrsf2d_1();
|
|
3433
3425
|
gtrsf.SetAffinity(ax, ratio);
|
|
@@ -3451,7 +3443,7 @@ function createMirrorGTrsf2d$1(oc, cx, cy, mode, originX = 0, originY = 0, dirX
|
|
|
3451
3443
|
p.delete();
|
|
3452
3444
|
} else {
|
|
3453
3445
|
const p = new oc.gp_Pnt2d_3(originX, originY);
|
|
3454
|
-
const dir = new oc.
|
|
3446
|
+
const dir = new oc.gp_Dir2d_5(dirX, dirY);
|
|
3455
3447
|
const ax = new oc.gp_Ax2d_2(p, dir);
|
|
3456
3448
|
trsf.SetMirror_2(ax);
|
|
3457
3449
|
ax.delete();
|
|
@@ -3566,16 +3558,11 @@ function addCurveToBBox2d$1(oc, bbox, curve, tolerance) {
|
|
|
3566
3558
|
oc.BndLib_Add2dCurve.Add_3(curve, tolerance, bbox);
|
|
3567
3559
|
}
|
|
3568
3560
|
function getBBox2dBounds$1(_oc, bbox) {
|
|
3569
|
-
const xMin = { current: 0 };
|
|
3570
|
-
const yMin = { current: 0 };
|
|
3571
|
-
const xMax = { current: 0 };
|
|
3572
|
-
const yMax = { current: 0 };
|
|
3573
|
-
bbox.Get(xMin, yMin, xMax, yMax);
|
|
3574
3561
|
return {
|
|
3575
|
-
xMin:
|
|
3576
|
-
yMin:
|
|
3577
|
-
xMax:
|
|
3578
|
-
yMax:
|
|
3562
|
+
xMin: bbox.GetXMin(),
|
|
3563
|
+
yMin: bbox.GetYMin(),
|
|
3564
|
+
xMax: bbox.GetXMax(),
|
|
3565
|
+
yMax: bbox.GetYMax()
|
|
3579
3566
|
};
|
|
3580
3567
|
}
|
|
3581
3568
|
function mergeBBox2d$1(_oc, target, other) {
|
|
@@ -3728,8 +3715,8 @@ function splitCurve2d$1(oc, curve, params) {
|
|
|
3728
3715
|
}
|
|
3729
3716
|
function liftCurve2dToPlane$1(oc, curve, planeOrigin, planeZ, planeX) {
|
|
3730
3717
|
const origin = new oc.gp_Pnt_3(planeOrigin[0], planeOrigin[1], planeOrigin[2]);
|
|
3731
|
-
const zDir = new oc.
|
|
3732
|
-
const xDir = new oc.
|
|
3718
|
+
const zDir = new oc.gp_Dir_5(planeZ[0], planeZ[1], planeZ[2]);
|
|
3719
|
+
const xDir = new oc.gp_Dir_5(planeX[0], planeX[1], planeX[2]);
|
|
3733
3720
|
const ax = new oc.gp_Ax2_2(origin, zDir, xDir);
|
|
3734
3721
|
const curve3d = oc.GeomLib.To3d(ax, curve);
|
|
3735
3722
|
const edgeBuilder = new oc.BRepBuilderAPI_MakeEdge_24(curve3d);
|
|
@@ -3847,14 +3834,14 @@ function iterListHashes(oc, list, hashUpperBound) {
|
|
|
3847
3834
|
if (oc.TopTools_ListIteratorOfListOfShape) {
|
|
3848
3835
|
const iter = new oc.TopTools_ListIteratorOfListOfShape(list);
|
|
3849
3836
|
while (iter.More()) {
|
|
3850
|
-
result.push(iter.Value()
|
|
3837
|
+
result.push(oc.shapeHashCode(iter.Value(), hashUpperBound));
|
|
3851
3838
|
iter.Next();
|
|
3852
3839
|
}
|
|
3853
3840
|
iter.delete();
|
|
3854
3841
|
} else {
|
|
3855
3842
|
const copy = new oc.TopTools_ListOfShape_3(list);
|
|
3856
3843
|
while (copy.Size() > 0) {
|
|
3857
|
-
result.push(copy.First_1()
|
|
3844
|
+
result.push(oc.shapeHashCode(copy.First_1(), hashUpperBound));
|
|
3858
3845
|
copy.RemoveFirst();
|
|
3859
3846
|
}
|
|
3860
3847
|
copy.delete();
|
|
@@ -3904,7 +3891,7 @@ function buildEvolution$1(oc, op, shapes, inputFaceHashes, hashUpperBound) {
|
|
|
3904
3891
|
const faceExplorer = new oc.TopExp_Explorer_2(shape, oc.TopAbs_ShapeEnum.TopAbs_FACE, oc.TopAbs_ShapeEnum.TopAbs_SHAPE);
|
|
3905
3892
|
while (faceExplorer.More()) {
|
|
3906
3893
|
const face = faceExplorer.Current();
|
|
3907
|
-
const hash =
|
|
3894
|
+
const hash = oc.shapeHashCode(face, hashUpperBound);
|
|
3908
3895
|
if (inputHashSet.has(hash)) facesById.set(hash, face);
|
|
3909
3896
|
faceExplorer.Next();
|
|
3910
3897
|
}
|
|
@@ -3930,7 +3917,7 @@ function buildEvolution$1(oc, op, shapes, inputFaceHashes, hashUpperBound) {
|
|
|
3930
3917
|
* Wrap a transform operation with shape evolution tracking.
|
|
3931
3918
|
*/
|
|
3932
3919
|
function transformWithEvolution(oc, shape, trsf, inputFaceHashes, hashUpperBound) {
|
|
3933
|
-
const transformer = new oc.BRepBuilderAPI_Transform_2(shape, trsf, true);
|
|
3920
|
+
const transformer = new oc.BRepBuilderAPI_Transform_2(shape, trsf, true, false);
|
|
3934
3921
|
const resultShape = transformer.Shape();
|
|
3935
3922
|
const evolution = inputFaceHashes.length === 0 ? EMPTY_EVOLUTION : buildEvolution$1(oc, transformer, shape, inputFaceHashes, hashUpperBound);
|
|
3936
3923
|
transformer.delete();
|
|
@@ -4006,7 +3993,7 @@ function composeTransform$1(oc, ops) {
|
|
|
4006
3993
|
0
|
|
4007
3994
|
];
|
|
4008
3995
|
const origin = new oc.gp_Pnt_3(center[0], center[1], center[2]);
|
|
4009
|
-
const dir = new oc.
|
|
3996
|
+
const dir = new oc.gp_Dir_5(axis[0], axis[1], axis[2]);
|
|
4010
3997
|
const ax1 = new oc.gp_Ax1_2(origin, dir);
|
|
4011
3998
|
step.SetRotation_1(ax1, op.angle * Math.PI / 180);
|
|
4012
3999
|
ax1.delete();
|
|
@@ -4098,7 +4085,7 @@ function buildExtrusionLaw$1(oc, profile, length, endFactor) {
|
|
|
4098
4085
|
/** Revolve a shape around an axis defined by center + direction vectors. */
|
|
4099
4086
|
function revolveVec$1(oc, shape, center, direction, angle) {
|
|
4100
4087
|
const origin = new oc.gp_Pnt_3(center[0], center[1], center[2]);
|
|
4101
|
-
const dir = new oc.
|
|
4088
|
+
const dir = new oc.gp_Dir_5(direction[0], direction[1], direction[2]);
|
|
4102
4089
|
const ax1 = new oc.gp_Ax1_2(origin, dir);
|
|
4103
4090
|
const maker = new oc.BRepPrimAPI_MakeRevol_1(shape, ax1, angle, false);
|
|
4104
4091
|
const result = maker.Shape();
|
|
@@ -4119,7 +4106,7 @@ function linearPattern$1(oc, shape, direction, spacing, count) {
|
|
|
4119
4106
|
const vec = new oc.gp_Vec_4(dx, dy, dz);
|
|
4120
4107
|
trsf.SetTranslation_1(vec);
|
|
4121
4108
|
vec.delete();
|
|
4122
|
-
const transformer = new oc.BRepBuilderAPI_Transform_2(shape, trsf, true);
|
|
4109
|
+
const transformer = new oc.BRepBuilderAPI_Transform_2(shape, trsf, true, false);
|
|
4123
4110
|
results.push(transformer.Shape());
|
|
4124
4111
|
transformer.delete();
|
|
4125
4112
|
}
|
|
@@ -4130,13 +4117,13 @@ function linearPattern$1(oc, shape, direction, spacing, count) {
|
|
|
4130
4117
|
function circularPattern$1(oc, shape, center, axis, angleStep, count) {
|
|
4131
4118
|
const results = [];
|
|
4132
4119
|
const origin = new oc.gp_Pnt_3(center[0], center[1], center[2]);
|
|
4133
|
-
const dir = new oc.
|
|
4120
|
+
const dir = new oc.gp_Dir_5(axis[0], axis[1], axis[2]);
|
|
4134
4121
|
const ax1 = new oc.gp_Ax1_2(origin, dir);
|
|
4135
4122
|
const trsf = new oc.gp_Trsf_1();
|
|
4136
4123
|
for (let i = 0; i < count; i++) {
|
|
4137
4124
|
const angle = angleStep * i * Math.PI / 180;
|
|
4138
4125
|
trsf.SetRotation_1(ax1, angle);
|
|
4139
|
-
const transformer = new oc.BRepBuilderAPI_Transform_2(shape, trsf, true);
|
|
4126
|
+
const transformer = new oc.BRepBuilderAPI_Transform_2(shape, trsf, true, false);
|
|
4140
4127
|
results.push(transformer.Shape());
|
|
4141
4128
|
transformer.delete();
|
|
4142
4129
|
}
|
|
@@ -4158,11 +4145,11 @@ function positionOnCurve$1(oc, shape, spine, param) {
|
|
|
4158
4145
|
const tangent = new oc.gp_Vec_1();
|
|
4159
4146
|
adaptor.D1(param, pnt, tangent);
|
|
4160
4147
|
const tangentDir = new oc.gp_Dir_2(tangent);
|
|
4161
|
-
const toAx3 = new oc.
|
|
4148
|
+
const toAx3 = new oc.gp_Ax3_5(pnt, tangentDir);
|
|
4162
4149
|
const trsf = new oc.gp_Trsf_1();
|
|
4163
4150
|
trsf.SetTransformation_2(toAx3);
|
|
4164
4151
|
trsf.Invert();
|
|
4165
|
-
const transformer = new oc.BRepBuilderAPI_Transform_2(shape, trsf, true);
|
|
4152
|
+
const transformer = new oc.BRepBuilderAPI_Transform_2(shape, trsf, true, false);
|
|
4166
4153
|
const result = transformer.Shape();
|
|
4167
4154
|
transformer.delete();
|
|
4168
4155
|
trsf.delete();
|
|
@@ -4178,7 +4165,7 @@ function makeNonPlanarFace$1(oc, wire) {
|
|
|
4178
4165
|
const filler = new oc.BRepOffsetAPI_MakeFilling(3, 15, 2, false, 1e-5, 1e-4, .01, .1, 8, 9);
|
|
4179
4166
|
const explorer = new oc.TopExp_Explorer_2(wire, oc.TopAbs_ShapeEnum.TopAbs_EDGE, oc.TopAbs_ShapeEnum.TopAbs_SHAPE);
|
|
4180
4167
|
while (explorer.More()) {
|
|
4181
|
-
const edge = oc.
|
|
4168
|
+
const edge = oc.TopoDS_Cast.Edge(explorer.Current());
|
|
4182
4169
|
filler.Add_1(edge, oc.GeomAbs_Shape.GeomAbs_C0, true);
|
|
4183
4170
|
explorer.Next();
|
|
4184
4171
|
}
|
|
@@ -4244,7 +4231,7 @@ function bsplineSurface$1(oc, points, rows, cols) {
|
|
|
4244
4231
|
for (let r = 0; r < rows; r++) for (let c = 0; c < cols; c++) {
|
|
4245
4232
|
const pt = points[r * cols + c];
|
|
4246
4233
|
const pnt = new oc.gp_Pnt_3(pt[0], pt[1], pt[2]);
|
|
4247
|
-
arr.
|
|
4234
|
+
arr.SetValue_1(r + 1, c + 1, pnt);
|
|
4248
4235
|
pnt.delete();
|
|
4249
4236
|
}
|
|
4250
4237
|
const fitter = new oc.GeomAPI_PointsToBSplineSurface_2(arr, 3, 8, oc.GeomAbs_Shape.GeomAbs_C2, .001);
|
|
@@ -4313,7 +4300,7 @@ function sewAndSolidify$1(oc, faces, tolerance) {
|
|
|
4313
4300
|
sewing.delete();
|
|
4314
4301
|
const fixer = new oc.ShapeFix_Solid_1();
|
|
4315
4302
|
try {
|
|
4316
|
-
const shell = oc.
|
|
4303
|
+
const shell = oc.TopoDS_Cast.Shell(sewn);
|
|
4317
4304
|
return fixer.SolidFromShell(shell);
|
|
4318
4305
|
} catch {
|
|
4319
4306
|
return sewn;
|
|
@@ -4514,13 +4501,13 @@ function projectEdges$1(oc, shape, cameraOrigin, cameraDirection, cameraXAxis) {
|
|
|
4514
4501
|
const hlr = new oc.HLRBRep_Algo_1();
|
|
4515
4502
|
hlr.Add_2(shape, 0);
|
|
4516
4503
|
const origin = new oc.gp_Pnt_3(cameraOrigin[0], cameraOrigin[1], cameraOrigin[2]);
|
|
4517
|
-
const dir = new oc.
|
|
4504
|
+
const dir = new oc.gp_Dir_5(cameraDirection[0], cameraDirection[1], cameraDirection[2]);
|
|
4518
4505
|
let ax2;
|
|
4519
4506
|
if (cameraXAxis) {
|
|
4520
|
-
const xDir = new oc.
|
|
4507
|
+
const xDir = new oc.gp_Dir_5(cameraXAxis[0], cameraXAxis[1], cameraXAxis[2]);
|
|
4521
4508
|
ax2 = new oc.gp_Ax2_2(origin, dir, xDir);
|
|
4522
4509
|
xDir.delete();
|
|
4523
|
-
} else ax2 = new oc.
|
|
4510
|
+
} else ax2 = new oc.gp_Ax2_4(origin, dir);
|
|
4524
4511
|
const projector = new oc.HLRAlgo_Projector_2(ax2);
|
|
4525
4512
|
hlr.Projector_1(projector);
|
|
4526
4513
|
hlr.Update();
|
|
@@ -4718,7 +4705,7 @@ function rotateWithHistory$1(oc, shape, angle, inputFaceHashes, hashUpperBound,
|
|
|
4718
4705
|
]) {
|
|
4719
4706
|
const trsf = new oc.gp_Trsf_1();
|
|
4720
4707
|
const pnt = new oc.gp_Pnt_3(center[0], center[1], center[2]);
|
|
4721
|
-
const dir = new oc.
|
|
4708
|
+
const dir = new oc.gp_Dir_5(axis[0], axis[1], axis[2]);
|
|
4722
4709
|
const ax1 = new oc.gp_Ax1_2(pnt, dir);
|
|
4723
4710
|
trsf.SetRotation_1(ax1, angle);
|
|
4724
4711
|
pnt.delete();
|
|
@@ -4731,8 +4718,8 @@ function rotateWithHistory$1(oc, shape, angle, inputFaceHashes, hashUpperBound,
|
|
|
4731
4718
|
function mirrorWithHistory$1(oc, shape, origin, normal, inputFaceHashes, hashUpperBound) {
|
|
4732
4719
|
const trsf = new oc.gp_Trsf_1();
|
|
4733
4720
|
const pnt = new oc.gp_Pnt_3(origin[0], origin[1], origin[2]);
|
|
4734
|
-
const dir = new oc.
|
|
4735
|
-
const ax2 = new oc.
|
|
4721
|
+
const dir = new oc.gp_Dir_5(normal[0], normal[1], normal[2]);
|
|
4722
|
+
const ax2 = new oc.gp_Ax2_4(pnt, dir);
|
|
4736
4723
|
trsf.SetMirror_3(ax2);
|
|
4737
4724
|
pnt.delete();
|
|
4738
4725
|
dir.delete();
|
|
@@ -4804,8 +4791,8 @@ function filletWithHistory$1(oc, shape, edges, radius, inputFaceHashes, hashUppe
|
|
|
4804
4791
|
const builder = new oc.BRepFilletAPI_MakeFillet(shape, oc.ChFi3d_FilletShape.ChFi3d_Rational);
|
|
4805
4792
|
for (const edge of edges) {
|
|
4806
4793
|
const r = typeof radius === "function" ? radius(edge) : radius;
|
|
4807
|
-
if (Array.isArray(r)) builder.Add_3(r[0], r[1], oc.
|
|
4808
|
-
else builder.Add_2(r, oc.
|
|
4794
|
+
if (Array.isArray(r)) builder.Add_3(r[0], r[1], oc.TopoDS_Cast.Edge(edge));
|
|
4795
|
+
else builder.Add_2(r, oc.TopoDS_Cast.Edge(edge));
|
|
4809
4796
|
}
|
|
4810
4797
|
const progress = new oc.Message_ProgressRange_1();
|
|
4811
4798
|
builder.Build(progress);
|
|
@@ -4819,10 +4806,10 @@ function chamferWithHistory$1(oc, shape, edges, distance, inputFaceHashes, hashU
|
|
|
4819
4806
|
const faceExplorer = new oc.TopExp_Explorer_2(shape, oc.TopAbs_ShapeEnum.TopAbs_FACE, oc.TopAbs_ShapeEnum.TopAbs_SHAPE);
|
|
4820
4807
|
const edgeFaceMap = /* @__PURE__ */ new Map();
|
|
4821
4808
|
while (faceExplorer.More()) {
|
|
4822
|
-
const face = oc.
|
|
4809
|
+
const face = oc.TopoDS_Cast.Face(faceExplorer.Current());
|
|
4823
4810
|
const edgeExplorer = new oc.TopExp_Explorer_2(face, oc.TopAbs_ShapeEnum.TopAbs_EDGE, oc.TopAbs_ShapeEnum.TopAbs_SHAPE);
|
|
4824
4811
|
while (edgeExplorer.More()) {
|
|
4825
|
-
edgeFaceMap.set(edgeExplorer.Current()
|
|
4812
|
+
edgeFaceMap.set(oc.shapeHashCode(edgeExplorer.Current(), hashUpperBound), face);
|
|
4826
4813
|
edgeExplorer.Next();
|
|
4827
4814
|
}
|
|
4828
4815
|
edgeExplorer.delete();
|
|
@@ -4831,11 +4818,11 @@ function chamferWithHistory$1(oc, shape, edges, distance, inputFaceHashes, hashU
|
|
|
4831
4818
|
faceExplorer.delete();
|
|
4832
4819
|
for (const edge of edges) {
|
|
4833
4820
|
const d = typeof distance === "function" ? distance(edge) : distance;
|
|
4834
|
-
const adjacentFace = edgeFaceMap.get(
|
|
4835
|
-
if (Array.isArray(d) && adjacentFace) builder.Add_3(d[0], d[1], oc.
|
|
4821
|
+
const adjacentFace = edgeFaceMap.get(oc.shapeHashCode(edge, hashUpperBound));
|
|
4822
|
+
if (Array.isArray(d) && adjacentFace) builder.Add_3(d[0], d[1], oc.TopoDS_Cast.Edge(edge), adjacentFace);
|
|
4836
4823
|
else {
|
|
4837
4824
|
const dist = Array.isArray(d) ? d[0] : d;
|
|
4838
|
-
builder.Add_2(dist, oc.
|
|
4825
|
+
builder.Add_2(dist, oc.TopoDS_Cast.Edge(edge));
|
|
4839
4826
|
}
|
|
4840
4827
|
}
|
|
4841
4828
|
const progress = new oc.Message_ProgressRange_1();
|
|
@@ -4880,14 +4867,14 @@ function draftWithHistory$1(oc, shape, faces, pullDirection, neutralPlane, angle
|
|
|
4880
4867
|
if (!oc.BRepOffsetAPI_DraftAngle) throw new Error("BRepOffsetAPI_DraftAngle not available in this WASM build. Rebuild brepjs-opencascade with the updated build config.");
|
|
4881
4868
|
const [px, py, pz] = pullDirection;
|
|
4882
4869
|
const [ox, oy, oz] = neutralPlane;
|
|
4883
|
-
const dir = new oc.
|
|
4870
|
+
const dir = new oc.gp_Dir_5(px, py, pz);
|
|
4884
4871
|
const origin = new oc.gp_Pnt_3(ox, oy, oz);
|
|
4885
4872
|
const pln = new oc.gp_Pln_3(origin, dir);
|
|
4886
4873
|
const builder = new oc.BRepOffsetAPI_DraftAngle_2(shape);
|
|
4887
4874
|
try {
|
|
4888
4875
|
for (const face of faces) {
|
|
4889
4876
|
const angleRad = (typeof angleDeg === "function" ? angleDeg(face) : angleDeg) * Math.PI / 180;
|
|
4890
|
-
builder.Add(oc.
|
|
4877
|
+
builder.Add(oc.TopoDS_Cast.Face(face), dir, angleRad, pln, true);
|
|
4891
4878
|
}
|
|
4892
4879
|
const progress = new oc.Message_ProgressRange_1();
|
|
4893
4880
|
builder.Build(progress);
|
|
@@ -6874,7 +6861,6 @@ function makeBezierEdge(bk, points) {
|
|
|
6874
6861
|
return edgeHandle(bk.makeNurbsEdge(startPt[0], startPt[1], startPt[2], endPt[0], endPt[1], endPt[2], degree, knots, flatCp, weights));
|
|
6875
6862
|
}
|
|
6876
6863
|
function makeTangentArc(bk, startPoint, startTangent, endPoint) {
|
|
6877
|
-
if (!bk.makeTangentArc3d) throw new Error("makeTangentArc requires brepkit-wasm >= 1.1.0");
|
|
6878
6864
|
return edgeHandle(bk.makeTangentArc3d(startPoint[0], startPoint[1], startPoint[2], startTangent[0], startTangent[1], startTangent[2], endPoint[0], endPoint[1], endPoint[2]));
|
|
6879
6865
|
}
|
|
6880
6866
|
function makeHelixWire(bk, pitch, height, radius, center, _direction, leftHanded) {
|
|
@@ -7745,7 +7731,8 @@ function offset(bk, shape, distance, tolerance) {
|
|
|
7745
7731
|
if (tolerance !== void 0) warnOnce("offset-tolerance", "offset() tolerance parameter is not supported; brepkit uses its own internal tolerance.");
|
|
7746
7732
|
const h = shape;
|
|
7747
7733
|
if (h.type === "face") return solidHandle(bk.thicken(h.id, distance));
|
|
7748
|
-
|
|
7734
|
+
const solidId = unwrapSolidOrThrow(shape, "offset");
|
|
7735
|
+
return solidHandle(bk.offsetSolidV2(solidId, distance));
|
|
7749
7736
|
}
|
|
7750
7737
|
function filletVariable(bk, shape, spec) {
|
|
7751
7738
|
const solidId = unwrapSolidOrThrow(shape, "filletVariable");
|
|
@@ -7810,6 +7797,10 @@ function sketchAddConstraint(bk, sketch, constraintJson) {
|
|
|
7810
7797
|
function sketchSolve(bk, sketch, maxIterations, tolerance) {
|
|
7811
7798
|
return bk.sketchSolve(sketch, maxIterations, tolerance);
|
|
7812
7799
|
}
|
|
7800
|
+
/** Add an arc to a sketch defined by center, start, end point indices. Returns the arc index. */
|
|
7801
|
+
function sketchAddArc(bk, sketch, centerIdx, startIdx, endIdx) {
|
|
7802
|
+
return bk.sketchAddArc(sketch, centerIdx, startIdx, endIdx);
|
|
7803
|
+
}
|
|
7813
7804
|
/** Get degrees of freedom remaining in a solved or partially-constrained sketch. */
|
|
7814
7805
|
function sketchDof(bk, sketch) {
|
|
7815
7806
|
const result = bk.sketchDof(sketch);
|
|
@@ -8021,7 +8012,7 @@ function meshEdges(bk, shape, tolerance, angularTolerance) {
|
|
|
8021
8012
|
lines: new Float32Array(0),
|
|
8022
8013
|
edgeGroups: []
|
|
8023
8014
|
};
|
|
8024
|
-
const edgeLines = bk.meshEdgesAll
|
|
8015
|
+
const edgeLines = bk.meshEdgesAll(bkHandle.id, tolerance);
|
|
8025
8016
|
const positions = edgeLines.positions;
|
|
8026
8017
|
const offsets = edgeLines.offsets;
|
|
8027
8018
|
const edgeCount = edgeLines.edgeCount;
|
|
@@ -10943,6 +10934,9 @@ var BrepkitAdapter = class {
|
|
|
10943
10934
|
sketchAddPoint(sketch, x, y, fixed) {
|
|
10944
10935
|
return sketchAddPoint(this.bk, sketch, x, y, fixed);
|
|
10945
10936
|
}
|
|
10937
|
+
sketchAddArc(sketch, centerIdx, startIdx, endIdx) {
|
|
10938
|
+
return sketchAddArc(this.bk, sketch, centerIdx, startIdx, endIdx);
|
|
10939
|
+
}
|
|
10946
10940
|
sketchAddConstraint(sketch, constraintJson) {
|
|
10947
10941
|
sketchAddConstraint(this.bk, sketch, constraintJson);
|
|
10948
10942
|
}
|