brepjs 7.4.1 → 7.5.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/README.md +179 -17
- package/dist/2d.cjs +2 -2
- package/dist/2d.js +4 -4
- package/dist/{Blueprint-3Dyu0OL6.cjs → Blueprint-CVctc41Z.cjs} +4 -4
- package/dist/{Blueprint-DSHD89bZ.js → Blueprint-D3JfGJTz.js} +4 -4
- package/dist/{boolean2D-CtyE2hK5.js → boolean2D-Ba8TcVzC.js} +6 -6
- package/dist/{boolean2D-BwOpOv6L.cjs → boolean2D-BnuJdfDv.cjs} +6 -6
- package/dist/{booleanFns-5KSbtLBU.cjs → booleanFns-BBSVKhL2.cjs} +27 -31
- package/dist/{booleanFns-DcxqLQSG.js → booleanFns-CqehfzcK.js} +27 -31
- package/dist/brepjs.cjs +87 -79
- package/dist/brepjs.js +120 -112
- package/dist/{cast-D1s7Im9E.js → cast-DQaUibmm.js} +3 -3
- package/dist/{cast-DsxJk_F0.cjs → cast-DkB0GKmQ.cjs} +2 -2
- package/dist/{drawFns-CSbH7uoI.js → drawFns-D9qkvHgY.js} +8 -8
- package/dist/{drawFns-C6KQjmQj.cjs → drawFns-DWOskIp7.cjs} +8 -8
- package/dist/{faceFns-B9if-FPW.cjs → faceFns-BwK7FP7N.cjs} +1 -1
- package/dist/{faceFns-Bl6HHbqO.js → faceFns-DHu-2JpA.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/{loft-Cc5E5pAf.cjs → loft-BzWFokmC.cjs} +2 -2
- package/dist/{loft-BlNndTOR.js → loft-CtG5nMq5.js} +2 -2
- package/dist/{measurement-D75pyJi1.js → measurement-C5JGCuUP.js} +1 -1
- package/dist/{measurement-BVdZ9cG3.cjs → measurement-fxm_pW7x.cjs} +1 -1
- package/dist/measurement.cjs +1 -1
- package/dist/measurement.js +1 -1
- package/dist/{meshFns-p_kv--PW.js → meshFns-BY1fMF48.js} +7 -7
- package/dist/{meshFns-mVlogI3J.cjs → meshFns-Dbj_k5gq.cjs} +7 -7
- package/dist/operations/api.d.ts +2 -2
- package/dist/operations/api.d.ts.map +1 -1
- package/dist/operations/extrude.d.ts +2 -2
- package/dist/operations/extrudeFns.d.ts +3 -3
- package/dist/operations/extrudeFns.d.ts.map +1 -1
- package/dist/operations/loft.d.ts +1 -1
- package/dist/operations/loftFns.d.ts +2 -2
- package/dist/operations/loftFns.d.ts.map +1 -1
- package/dist/{operations-SRN-mfTx.cjs → operations-BP1wVDw0.cjs} +14 -20
- package/dist/{operations-CEV-gqkX.js → operations-C1rWoba2.js} +14 -20
- package/dist/operations.cjs +2 -2
- package/dist/operations.js +2 -2
- package/dist/{query-D7XclvBZ.js → query-V6nV-VfL.js} +4 -4
- package/dist/{query-DkcMfh6j.cjs → query-hMSmOWJP.cjs} +4 -4
- package/dist/query.cjs +1 -1
- package/dist/query.js +1 -1
- package/dist/{shapeFns-BpCPVHFT.js → shapeFns-BrF97sKt.js} +19 -19
- package/dist/{shapeFns-DjsWo98C.cjs → shapeFns-BvOndshS.cjs} +19 -19
- package/dist/{shapeHelpers-BBSVHPGk.cjs → shapeHelpers-B2SXz1p4.cjs} +2 -2
- package/dist/{shapeHelpers-C4QIp7u5.js → shapeHelpers-BcoZf2N9.js} +2 -2
- package/dist/sketching.cjs +2 -2
- package/dist/sketching.js +2 -2
- package/dist/topology/api.d.ts +11 -11
- package/dist/topology/api.d.ts.map +1 -1
- package/dist/topology/booleanFns.d.ts +9 -9
- package/dist/topology/booleanFns.d.ts.map +1 -1
- package/dist/topology/cast.d.ts +2 -2
- package/dist/topology/cast.d.ts.map +1 -1
- package/dist/topology/chamferAngleFns.d.ts +1 -1
- package/dist/topology/chamferAngleFns.d.ts.map +1 -1
- package/dist/topology/healingFns.d.ts +2 -2
- package/dist/topology/healingFns.d.ts.map +1 -1
- package/dist/topology/index.d.ts +1 -1
- package/dist/topology/index.d.ts.map +1 -1
- package/dist/topology/meshFns.d.ts +2 -2
- package/dist/topology/meshFns.d.ts.map +1 -1
- package/dist/topology/modifierFns.d.ts +5 -5
- package/dist/topology/modifierFns.d.ts.map +1 -1
- package/dist/topology/primitiveFns.d.ts +5 -1
- package/dist/topology/primitiveFns.d.ts.map +1 -1
- package/dist/topology/shapeFns.d.ts +9 -9
- package/dist/topology/shapeFns.d.ts.map +1 -1
- package/dist/{topology-BEMrS4WZ.js → topology-CJKeDGUb.js} +18 -18
- package/dist/{topology-Bb1W3SyF.cjs → topology-DoNKAKMt.cjs} +18 -18
- package/dist/topology.cjs +8 -8
- package/dist/topology.d.ts +1 -1
- package/dist/topology.d.ts.map +1 -1
- package/dist/topology.js +8 -8
- package/package.json +1 -1
package/dist/brepjs.cjs
CHANGED
|
@@ -4,24 +4,24 @@ const occtBoundary = require("./occtBoundary-du8_ex-p.cjs");
|
|
|
4
4
|
const errors = require("./errors-DK1VAdP4.cjs");
|
|
5
5
|
const shapeTypes = require("./shapeTypes-DKhwEnUM.cjs");
|
|
6
6
|
const vecOps = require("./vecOps-CjRL1jau.cjs");
|
|
7
|
-
const Blueprint = require("./Blueprint-
|
|
7
|
+
const Blueprint = require("./Blueprint-CVctc41Z.cjs");
|
|
8
8
|
const curveFns = require("./curveFns-BilyYL_s.cjs");
|
|
9
|
-
const loft$
|
|
10
|
-
const operations = require("./operations-
|
|
11
|
-
const boolean2D = require("./boolean2D-
|
|
9
|
+
const loft$2 = require("./loft-BzWFokmC.cjs");
|
|
10
|
+
const operations = require("./operations-BP1wVDw0.cjs");
|
|
11
|
+
const boolean2D = require("./boolean2D-BnuJdfDv.cjs");
|
|
12
12
|
const _2d = require("./2d.cjs");
|
|
13
|
-
const query = require("./query-
|
|
13
|
+
const query = require("./query-hMSmOWJP.cjs");
|
|
14
14
|
const io = require("./io.cjs");
|
|
15
|
-
const drawFns = require("./drawFns-
|
|
15
|
+
const drawFns = require("./drawFns-DWOskIp7.cjs");
|
|
16
16
|
const vectors = require("./vectors-ChWEZPwy.cjs");
|
|
17
|
-
const shapeFns = require("./shapeFns-
|
|
18
|
-
const topology = require("./topology-
|
|
19
|
-
const faceFns = require("./faceFns-
|
|
20
|
-
const meshFns = require("./meshFns-
|
|
21
|
-
const booleanFns = require("./booleanFns-
|
|
22
|
-
const measurement = require("./measurement-
|
|
23
|
-
const shapeHelpers = require("./shapeHelpers-
|
|
24
|
-
const cast = require("./cast-
|
|
17
|
+
const shapeFns = require("./shapeFns-BvOndshS.cjs");
|
|
18
|
+
const topology = require("./topology-DoNKAKMt.cjs");
|
|
19
|
+
const faceFns = require("./faceFns-BwK7FP7N.cjs");
|
|
20
|
+
const meshFns = require("./meshFns-Dbj_k5gq.cjs");
|
|
21
|
+
const booleanFns = require("./booleanFns-BBSVKhL2.cjs");
|
|
22
|
+
const measurement = require("./measurement-fxm_pW7x.cjs");
|
|
23
|
+
const shapeHelpers = require("./shapeHelpers-B2SXz1p4.cjs");
|
|
24
|
+
const cast = require("./cast-DkB0GKmQ.cjs");
|
|
25
25
|
const result = require("./result.cjs");
|
|
26
26
|
const worker = require("./worker.cjs");
|
|
27
27
|
const errorFactories = {
|
|
@@ -127,9 +127,12 @@ function box(width, depth, height, options) {
|
|
|
127
127
|
const maker = r(new oc.BRepPrimAPI_MakeBox_2(width, depth, height));
|
|
128
128
|
let solid2 = shapeTypes.createSolid(maker.Solid());
|
|
129
129
|
gc();
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
130
|
+
const at = options?.at ?? (options?.center !== void 0 && options.center !== true ? options.center : void 0);
|
|
131
|
+
const centered = options?.centered ?? options?.center === true;
|
|
132
|
+
if (at) {
|
|
133
|
+
solid2 = shapeFns.translate(solid2, [at[0] - width / 2, at[1] - depth / 2, at[2] - height / 2]);
|
|
134
|
+
} else if (centered) {
|
|
135
|
+
solid2 = shapeFns.translate(solid2, [-width / 2, -depth / 2, -height / 2]);
|
|
133
136
|
}
|
|
134
137
|
return solid2;
|
|
135
138
|
}
|
|
@@ -143,14 +146,14 @@ function cylinder(radius, height, options) {
|
|
|
143
146
|
-axis[1] * height * 0.5,
|
|
144
147
|
-axis[2] * height * 0.5
|
|
145
148
|
];
|
|
146
|
-
solid2 = shapeFns.
|
|
149
|
+
solid2 = shapeFns.translate(solid2, halfShift);
|
|
147
150
|
}
|
|
148
151
|
return solid2;
|
|
149
152
|
}
|
|
150
153
|
function sphere(radius, options) {
|
|
151
154
|
let solid2 = shapeHelpers.makeSphere(radius);
|
|
152
155
|
if (options?.at) {
|
|
153
|
-
solid2 = shapeFns.
|
|
156
|
+
solid2 = shapeFns.translate(solid2, options.at);
|
|
154
157
|
}
|
|
155
158
|
return solid2;
|
|
156
159
|
}
|
|
@@ -164,7 +167,7 @@ function cone(bottomRadius, topRadius, height, options) {
|
|
|
164
167
|
-axis[1] * height * 0.5,
|
|
165
168
|
-axis[2] * height * 0.5
|
|
166
169
|
];
|
|
167
|
-
solid2 = shapeFns.
|
|
170
|
+
solid2 = shapeFns.translate(solid2, halfShift);
|
|
168
171
|
}
|
|
169
172
|
return solid2;
|
|
170
173
|
}
|
|
@@ -174,7 +177,7 @@ function torus(majorRadius, minorRadius, options) {
|
|
|
174
177
|
function ellipsoid(rx, ry, rz, options) {
|
|
175
178
|
let solid2 = shapeHelpers.makeEllipsoid(rx, ry, rz);
|
|
176
179
|
if (options?.at) {
|
|
177
|
-
solid2 = shapeFns.
|
|
180
|
+
solid2 = shapeFns.translate(solid2, options.at);
|
|
178
181
|
}
|
|
179
182
|
return solid2;
|
|
180
183
|
}
|
|
@@ -262,8 +265,8 @@ function validateNotNull(shape2, label) {
|
|
|
262
265
|
}
|
|
263
266
|
return errors.ok(void 0);
|
|
264
267
|
}
|
|
265
|
-
function
|
|
266
|
-
const check = validateNotNull(shape2, "
|
|
268
|
+
function thicken$1(shape2, thickness) {
|
|
269
|
+
const check = validateNotNull(shape2, "thicken: shape");
|
|
267
270
|
if (errors.isErr(check)) return check;
|
|
268
271
|
return kernelCall(
|
|
269
272
|
() => occtBoundary.getKernel().thicken(shape2.wrapped, thickness),
|
|
@@ -271,8 +274,8 @@ function thickenSurface(shape2, thickness) {
|
|
|
271
274
|
"Thicken operation failed"
|
|
272
275
|
);
|
|
273
276
|
}
|
|
274
|
-
function
|
|
275
|
-
const check = validateNotNull(shape2, "
|
|
277
|
+
function fillet$1(shape2, edges, radius) {
|
|
278
|
+
const check = validateNotNull(shape2, "fillet: shape");
|
|
276
279
|
if (errors.isErr(check)) return check;
|
|
277
280
|
if (typeof radius === "number" && radius <= 0) {
|
|
278
281
|
return errors.err(
|
|
@@ -331,15 +334,15 @@ function filletShape(shape2, edges, radius) {
|
|
|
331
334
|
const raw = e instanceof Error ? e.message : String(e);
|
|
332
335
|
return errors.err(
|
|
333
336
|
errors.occtError("FILLET_FAILED", `Fillet operation failed: ${raw}`, e, {
|
|
334
|
-
operation: "
|
|
337
|
+
operation: "fillet",
|
|
335
338
|
edgeCount: selectedEdges.length,
|
|
336
339
|
radius
|
|
337
340
|
})
|
|
338
341
|
);
|
|
339
342
|
}
|
|
340
343
|
}
|
|
341
|
-
function
|
|
342
|
-
const check = validateNotNull(shape2, "
|
|
344
|
+
function chamfer$1(shape2, edges, distance) {
|
|
345
|
+
const check = validateNotNull(shape2, "chamfer: shape");
|
|
343
346
|
if (errors.isErr(check)) return check;
|
|
344
347
|
if (typeof distance === "number" && distance <= 0) {
|
|
345
348
|
return errors.err(
|
|
@@ -390,15 +393,15 @@ function chamferShape(shape2, edges, distance) {
|
|
|
390
393
|
const raw = e instanceof Error ? e.message : String(e);
|
|
391
394
|
return errors.err(
|
|
392
395
|
errors.occtError("CHAMFER_FAILED", `Chamfer operation failed: ${raw}`, e, {
|
|
393
|
-
operation: "
|
|
396
|
+
operation: "chamfer",
|
|
394
397
|
edgeCount: selectedEdges.length,
|
|
395
398
|
distance
|
|
396
399
|
})
|
|
397
400
|
);
|
|
398
401
|
}
|
|
399
402
|
}
|
|
400
|
-
function
|
|
401
|
-
const check = validateNotNull(shape2, "
|
|
403
|
+
function shell$1(shape2, faces, thickness, tolerance = 1e-3) {
|
|
404
|
+
const check = validateNotNull(shape2, "shell: shape");
|
|
402
405
|
if (errors.isErr(check)) return check;
|
|
403
406
|
if (thickness <= 0) {
|
|
404
407
|
return errors.err(errors.validationError("INVALID_THICKNESS", "Shell thickness must be positive"));
|
|
@@ -422,15 +425,15 @@ function shellShape(shape2, faces, thickness, tolerance = 1e-3) {
|
|
|
422
425
|
const raw = e instanceof Error ? e.message : String(e);
|
|
423
426
|
return errors.err(
|
|
424
427
|
errors.occtError("SHELL_FAILED", `Shell operation failed: ${raw}`, e, {
|
|
425
|
-
operation: "
|
|
428
|
+
operation: "shell",
|
|
426
429
|
faceCount: faces.length,
|
|
427
430
|
thickness
|
|
428
431
|
})
|
|
429
432
|
);
|
|
430
433
|
}
|
|
431
434
|
}
|
|
432
|
-
function
|
|
433
|
-
const check = validateNotNull(shape2, "
|
|
435
|
+
function offset$1(shape2, distance, tolerance = 1e-6) {
|
|
436
|
+
const check = validateNotNull(shape2, "offset: shape");
|
|
434
437
|
if (errors.isErr(check)) return check;
|
|
435
438
|
if (distance === 0) {
|
|
436
439
|
return errors.err(errors.validationError("ZERO_OFFSET", "Offset distance cannot be zero"));
|
|
@@ -442,39 +445,39 @@ function offsetShape(shape2, distance, tolerance = 1e-6) {
|
|
|
442
445
|
);
|
|
443
446
|
}
|
|
444
447
|
function translate(shape2, v) {
|
|
445
|
-
return shapeFns.
|
|
448
|
+
return shapeFns.translate(resolve(shape2), v);
|
|
446
449
|
}
|
|
447
450
|
function rotate(shape2, angle, options) {
|
|
448
451
|
const pivotPoint = options?.at ?? options?.around;
|
|
449
|
-
return shapeFns.
|
|
452
|
+
return shapeFns.rotate(resolve(shape2), angle, pivotPoint, options?.axis);
|
|
450
453
|
}
|
|
451
454
|
function mirror(shape2, options) {
|
|
452
455
|
const planeOrigin = options?.at ?? options?.origin;
|
|
453
|
-
return shapeFns.
|
|
456
|
+
return shapeFns.mirror(resolve(shape2), options?.normal ?? [1, 0, 0], planeOrigin);
|
|
454
457
|
}
|
|
455
458
|
function scale(shape2, factor, options) {
|
|
456
|
-
return shapeFns.
|
|
459
|
+
return shapeFns.scale(resolve(shape2), factor, options?.center);
|
|
457
460
|
}
|
|
458
461
|
function clone(shape2) {
|
|
459
|
-
return shapeFns.
|
|
462
|
+
return shapeFns.clone(resolve(shape2));
|
|
460
463
|
}
|
|
461
464
|
function fuse(a, b, options) {
|
|
462
|
-
return booleanFns.
|
|
465
|
+
return booleanFns.fuse(resolve(a), resolve(b), options);
|
|
463
466
|
}
|
|
464
467
|
function cut(base, tool, options) {
|
|
465
|
-
return booleanFns.
|
|
468
|
+
return booleanFns.cut(resolve(base), resolve(tool), options);
|
|
466
469
|
}
|
|
467
470
|
function intersect(a, b, options) {
|
|
468
|
-
return booleanFns.
|
|
471
|
+
return booleanFns.intersect(resolve(a), resolve(b), options);
|
|
469
472
|
}
|
|
470
473
|
function section(shape2, plane, options) {
|
|
471
|
-
return booleanFns.
|
|
474
|
+
return booleanFns.section(resolve(shape2), plane, options);
|
|
472
475
|
}
|
|
473
476
|
function split(shape2, tools) {
|
|
474
|
-
return booleanFns.
|
|
477
|
+
return booleanFns.split(resolve(shape2), tools);
|
|
475
478
|
}
|
|
476
479
|
function slice(shape2, planes, options) {
|
|
477
|
-
return booleanFns.
|
|
480
|
+
return booleanFns.slice(resolve(shape2), planes, options);
|
|
478
481
|
}
|
|
479
482
|
function resolveEdges(edgesOrFn, shape2) {
|
|
480
483
|
if (edgesOrFn === void 0) return void 0;
|
|
@@ -524,7 +527,7 @@ function fillet(shape2, edgesOrRadius, maybeRadius) {
|
|
|
524
527
|
edges = void 0;
|
|
525
528
|
radius = edgesOrRadius;
|
|
526
529
|
}
|
|
527
|
-
return
|
|
530
|
+
return fillet$1(s, edges, normalizeFilletRadius(radius));
|
|
528
531
|
}
|
|
529
532
|
function chamfer(shape2, edgesOrDistance, maybeDistance) {
|
|
530
533
|
const s = resolve(shape2);
|
|
@@ -540,54 +543,54 @@ function chamfer(shape2, edgesOrDistance, maybeDistance) {
|
|
|
540
543
|
const normalized = normalizeChamferDistance(distance);
|
|
541
544
|
if (normalized.mode === "distAngle") {
|
|
542
545
|
const selectedEdges = edges ?? shapeFns.getEdges(s);
|
|
543
|
-
return topology.
|
|
546
|
+
return topology.chamferDistAngle(
|
|
544
547
|
s,
|
|
545
548
|
[...selectedEdges],
|
|
546
549
|
normalized.distance,
|
|
547
550
|
normalized.angle
|
|
548
551
|
);
|
|
549
552
|
}
|
|
550
|
-
return
|
|
553
|
+
return chamfer$1(s, edges, normalized.distance);
|
|
551
554
|
}
|
|
552
555
|
function shell(shape2, faces, thickness, options) {
|
|
553
556
|
const s = resolve(shape2);
|
|
554
557
|
const resolvedFaces = resolveFaces(faces, s);
|
|
555
|
-
return
|
|
558
|
+
return shell$1(s, resolvedFaces, thickness, options?.tolerance);
|
|
556
559
|
}
|
|
557
560
|
function offset(shape2, distance, options) {
|
|
558
|
-
return
|
|
561
|
+
return offset$1(resolve(shape2), distance, options?.tolerance);
|
|
559
562
|
}
|
|
560
563
|
function thicken(shape2, thickness) {
|
|
561
|
-
return
|
|
564
|
+
return thicken$1(resolve(shape2), thickness);
|
|
562
565
|
}
|
|
563
566
|
function heal(shape2) {
|
|
564
|
-
return topology.
|
|
567
|
+
return topology.heal(resolve(shape2));
|
|
565
568
|
}
|
|
566
569
|
function simplify(shape2) {
|
|
567
|
-
return shapeFns.
|
|
570
|
+
return shapeFns.simplify(resolve(shape2));
|
|
568
571
|
}
|
|
569
572
|
function mesh(shape2, options) {
|
|
570
|
-
return meshFns.
|
|
573
|
+
return meshFns.mesh(resolve(shape2), options);
|
|
571
574
|
}
|
|
572
575
|
function meshEdges(shape2, options) {
|
|
573
|
-
return meshFns.
|
|
576
|
+
return meshFns.meshEdges(resolve(shape2), options);
|
|
574
577
|
}
|
|
575
578
|
function describe(shape2) {
|
|
576
|
-
return shapeFns.
|
|
579
|
+
return shapeFns.describe(resolve(shape2));
|
|
577
580
|
}
|
|
578
581
|
function toBREP(shape2) {
|
|
579
|
-
return shapeFns.
|
|
582
|
+
return shapeFns.toBREP(resolve(shape2));
|
|
580
583
|
}
|
|
581
584
|
function fromBREP(data) {
|
|
582
|
-
return cast.
|
|
585
|
+
return cast.fromBREP(data);
|
|
583
586
|
}
|
|
584
587
|
function isValid(shape2) {
|
|
585
|
-
return topology.
|
|
588
|
+
return topology.isValid(resolve(shape2));
|
|
586
589
|
}
|
|
587
590
|
function isEmpty(shape2) {
|
|
588
|
-
return shapeFns.
|
|
591
|
+
return shapeFns.isEmpty(resolve(shape2));
|
|
589
592
|
}
|
|
590
|
-
function
|
|
593
|
+
function loft$1(wires, { ruled = true, startPoint, endPoint } = {}, returnShell = false) {
|
|
591
594
|
if (wires.length === 0 && !startPoint && !endPoint) {
|
|
592
595
|
return errors.err(errors.validationError("LOFT_EMPTY", "Loft requires at least one wire or start/end point"));
|
|
593
596
|
}
|
|
@@ -621,15 +624,20 @@ function loftWires(wires, { ruled = true, startPoint, endPoint } = {}, returnShe
|
|
|
621
624
|
function extrude(face2, height) {
|
|
622
625
|
const f = resolve(face2);
|
|
623
626
|
const vec = typeof height === "number" ? [0, 0, height] : height;
|
|
624
|
-
return operations.
|
|
627
|
+
return operations.extrude(f, vec);
|
|
625
628
|
}
|
|
626
629
|
function revolve(face2, options) {
|
|
627
630
|
const pivotPoint = options?.at ?? options?.around ?? [0, 0, 0];
|
|
628
|
-
return operations.
|
|
631
|
+
return operations.revolve(
|
|
632
|
+
resolve(face2),
|
|
633
|
+
pivotPoint,
|
|
634
|
+
options?.axis ?? [0, 0, 1],
|
|
635
|
+
options?.angle ?? 360
|
|
636
|
+
);
|
|
629
637
|
}
|
|
630
638
|
function loft(wires, options) {
|
|
631
639
|
const resolvedWires = wires.map((w) => resolve(w));
|
|
632
|
-
return
|
|
640
|
+
return loft$1(resolvedWires, options);
|
|
633
641
|
}
|
|
634
642
|
function resolveTargetFace(shape2, faceSpec) {
|
|
635
643
|
if (faceSpec === void 0) {
|
|
@@ -687,8 +695,8 @@ function drill(shape2, options) {
|
|
|
687
695
|
}
|
|
688
696
|
const cyl = shapeHelpers.makeCylinder(radius, depth, pos, dir);
|
|
689
697
|
const startOffset = options.depth === void 0 ? vecOps.vecScale(dir, -depth / 2) : [0, 0, 0];
|
|
690
|
-
const tool = startOffset[0] !== 0 || startOffset[1] !== 0 || startOffset[2] !== 0 ? shapeFns.
|
|
691
|
-
return booleanFns.
|
|
698
|
+
const tool = startOffset[0] !== 0 || startOffset[1] !== 0 || startOffset[2] !== 0 ? shapeFns.translate(cyl, startOffset) : cyl;
|
|
699
|
+
return booleanFns.cut(s, tool);
|
|
692
700
|
}
|
|
693
701
|
function pocket(shape2, options) {
|
|
694
702
|
const s = resolve(shape2);
|
|
@@ -702,9 +710,9 @@ function pocket(shape2, options) {
|
|
|
702
710
|
const faceResult = shapeHelpers.makeFace(w);
|
|
703
711
|
if (errors.isErr(faceResult)) return faceResult;
|
|
704
712
|
const extDir = vecOps.vecScale(vecOps.vecNormalize(normal), -depth);
|
|
705
|
-
const toolResult = operations.
|
|
713
|
+
const toolResult = operations.extrude(faceResult.value, extDir);
|
|
706
714
|
if (errors.isErr(toolResult)) return toolResult;
|
|
707
|
-
return booleanFns.
|
|
715
|
+
return booleanFns.cut(s, toolResult.value);
|
|
708
716
|
}
|
|
709
717
|
function boss(shape2, options) {
|
|
710
718
|
const s = resolve(shape2);
|
|
@@ -718,16 +726,16 @@ function boss(shape2, options) {
|
|
|
718
726
|
const faceResult = shapeHelpers.makeFace(w);
|
|
719
727
|
if (errors.isErr(faceResult)) return faceResult;
|
|
720
728
|
const extDir = vecOps.vecScale(vecOps.vecNormalize(normal), height);
|
|
721
|
-
const toolResult = operations.
|
|
729
|
+
const toolResult = operations.extrude(faceResult.value, extDir);
|
|
722
730
|
if (errors.isErr(toolResult)) return toolResult;
|
|
723
|
-
return booleanFns.
|
|
731
|
+
return booleanFns.fuse(s, toolResult.value);
|
|
724
732
|
}
|
|
725
733
|
function mirrorJoin(shape2, options) {
|
|
726
734
|
const s = resolve(shape2);
|
|
727
735
|
const normal = options?.normal ?? [1, 0, 0];
|
|
728
736
|
const planeOrigin = options?.at ?? options?.origin;
|
|
729
|
-
const mirrored = shapeFns.
|
|
730
|
-
return booleanFns.
|
|
737
|
+
const mirrored = shapeFns.mirror(s, normal, planeOrigin);
|
|
738
|
+
return booleanFns.fuse(s, mirrored);
|
|
731
739
|
}
|
|
732
740
|
function rectangularPattern(shape2, options) {
|
|
733
741
|
const s = resolve(shape2);
|
|
@@ -753,8 +761,8 @@ function rectangularPattern(shape2, options) {
|
|
|
753
761
|
xNorm[1] * xSpacing * xi + yNorm[1] * ySpacing * yi,
|
|
754
762
|
xNorm[2] * xSpacing * xi + yNorm[2] * ySpacing * yi
|
|
755
763
|
];
|
|
756
|
-
const copy = shapeFns.
|
|
757
|
-
const fuseResult = booleanFns.
|
|
764
|
+
const copy = shapeFns.translate(s, offset2);
|
|
765
|
+
const fuseResult = booleanFns.fuse(result2, copy);
|
|
758
766
|
if (errors.isErr(fuseResult)) return fuseResult;
|
|
759
767
|
result2 = fuseResult.value;
|
|
760
768
|
}
|
|
@@ -1029,9 +1037,9 @@ exports.getCurveType = curveFns.getCurveType;
|
|
|
1029
1037
|
exports.getOrientation = curveFns.getOrientation;
|
|
1030
1038
|
exports.interpolateCurve = curveFns.interpolateCurve;
|
|
1031
1039
|
exports.offsetWire2D = curveFns.offsetWire2D;
|
|
1032
|
-
exports.basicFaceExtrusion = loft$
|
|
1033
|
-
exports.genericSweep = loft$
|
|
1034
|
-
exports.revolution = loft$
|
|
1040
|
+
exports.basicFaceExtrusion = loft$2.basicFaceExtrusion;
|
|
1041
|
+
exports.genericSweep = loft$2.genericSweep;
|
|
1042
|
+
exports.revolution = loft$2.revolution;
|
|
1035
1043
|
exports.addChild = operations.addChild;
|
|
1036
1044
|
exports.addStep = operations.addStep;
|
|
1037
1045
|
exports.circularPattern = operations.circularPattern;
|
|
@@ -1207,7 +1215,7 @@ exports.iterWires = shapeFns.iterWires;
|
|
|
1207
1215
|
exports.vertexPosition = shapeFns.vertexPosition;
|
|
1208
1216
|
exports.adjacentFaces = topology.adjacentFaces;
|
|
1209
1217
|
exports.autoHeal = topology.autoHeal;
|
|
1210
|
-
exports.chamferDistAngleShape = topology.
|
|
1218
|
+
exports.chamferDistAngleShape = topology.chamferDistAngle;
|
|
1211
1219
|
exports.edgesOfFace = topology.edgesOfFace;
|
|
1212
1220
|
exports.facesOfEdge = topology.facesOfEdge;
|
|
1213
1221
|
exports.healFace = topology.healFace;
|
|
@@ -1252,7 +1260,7 @@ exports.measureVolume = measurement.measureVolume;
|
|
|
1252
1260
|
exports.measureVolumeProps = measurement.measureVolumeProps;
|
|
1253
1261
|
exports.asTopo = cast.asTopo;
|
|
1254
1262
|
exports.cast = cast.cast;
|
|
1255
|
-
exports.deserializeShape = cast.
|
|
1263
|
+
exports.deserializeShape = cast.fromBREP;
|
|
1256
1264
|
exports.downcast = cast.downcast;
|
|
1257
1265
|
exports.isCompSolid = cast.isCompSolid;
|
|
1258
1266
|
exports.iterTopo = cast.iterTopo;
|