brepjs 12.7.3 → 12.8.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/blueprints/boolean2D.d.ts.map +1 -1
- package/dist/2d/blueprints/lib.d.ts.map +1 -1
- package/dist/2d/blueprints/offset.d.ts.map +1 -1
- package/dist/2d.cjs +2 -2
- package/dist/2d.js +3 -3
- package/dist/{Blueprint-CnDVffSX.cjs → Blueprint-CQ28WJhz.cjs} +29 -30
- package/dist/{Blueprint-C3lWY1Jf.js → Blueprint-DbVaf6k7.js} +7 -8
- package/dist/{boolean2D-DyQJt8Na.cjs → boolean2D-0blbVtJ8.cjs} +70 -61
- package/dist/{boolean2D-CwZAIJDS.js → boolean2D-y3E92F0u.js} +37 -28
- package/dist/{booleanFns-CcNUsgI8.js → booleanFns-BCTjYZAg.js} +4 -4
- package/dist/{booleanFns-D7HmkpYt.cjs → booleanFns-gmsX3Cv2.cjs} +59 -59
- package/dist/brepjs.cjs +319 -372
- package/dist/brepjs.js +358 -411
- package/dist/core/errors.d.ts +14 -5
- package/dist/core/errors.d.ts.map +1 -1
- package/dist/core.cjs +30 -31
- package/dist/core.js +19 -20
- package/dist/{cornerFinder-BV-l1BCw.js → cornerFinder-Ckz-mPHE.js} +1 -1
- package/dist/{cornerFinder-3zfbQvXg.cjs → cornerFinder-ZmOyOOsh.cjs} +1 -1
- package/dist/{curveFns-Ch87sD5O.cjs → curveFns-BZngcnQ1.cjs} +17 -17
- package/dist/{curveFns-CloOqAQ_.js → curveFns-mROFhiuG.js} +1 -1
- package/dist/{drawFns-5myJTgtX.js → drawFns-Bwakrq7w.js} +24 -25
- package/dist/{drawFns-CDNafQhv.cjs → drawFns-CjRc1NfQ.cjs} +51 -52
- package/dist/{faceFns-B6ebRh5I.js → faceFns-B8GnxjdY.js} +1 -1
- package/dist/{faceFns-BLTEPBKq.cjs → faceFns-DB1Fc5gy.cjs} +20 -20
- package/dist/{helpers-6kn30cSD.cjs → helpers-C8NoT0Wu.cjs} +14 -14
- package/dist/{helpers-C9KvE1RW.js → helpers-X0juxnwj.js} +4 -4
- package/dist/io.cjs +26 -26
- package/dist/io.js +3 -3
- package/dist/kernel/brepkitAdapter.d.ts +8 -8
- package/dist/kernel/brepkitAdapter.d.ts.map +1 -1
- package/dist/kernel/brepkitWasmTypes.d.ts +6 -0
- package/dist/kernel/brepkitWasmTypes.d.ts.map +1 -1
- package/dist/kernel/historyOps.d.ts +3 -3
- package/dist/kernel/historyOps.d.ts.map +1 -1
- package/dist/kernel/types.d.ts +8 -8
- package/dist/kernel/types.d.ts.map +1 -1
- package/dist/{loft-BcZUCGKi.js → loft-Bhw-FMoL.js} +4 -4
- package/dist/{loft-DR1UN5uN.cjs → loft-hp3pc1M7.cjs} +43 -43
- package/dist/{measurement-DoYXRaKI.cjs → measurement-BoNTUBAp.cjs} +1 -1
- package/dist/{measurement-oWvhSVZG.js → measurement-D8EJ694A.js} +1 -1
- package/dist/measurement.cjs +1 -1
- package/dist/measurement.js +1 -1
- package/dist/{meshFns-3gy0empP.cjs → meshFns-BnV0ZR8w.cjs} +17 -17
- package/dist/{meshFns-DsLRd3tA.js → meshFns-nQjK38EC.js} +2 -2
- package/dist/{operations-Dcz6YlOt.js → operations-BfbkK6DU.js} +5 -5
- package/dist/{operations-DLFzmdFX.cjs → operations-CYpmLSC4.cjs} +75 -75
- package/dist/operations.cjs +2 -2
- package/dist/operations.js +2 -2
- package/dist/query.cjs +3 -3
- package/dist/query.js +4 -4
- package/dist/{errors-B7kgv0cd.js → result-BaSD1fqR.js} +43 -23
- package/dist/{errors-9fDehDNc.cjs → result-fAX0OZzI.cjs} +20 -0
- package/dist/result.cjs +30 -41
- package/dist/result.js +18 -29
- package/dist/{shapeFns-D-MOoqJd.cjs → shapeFns-C2SnNvdH.cjs} +39 -39
- package/dist/{shapeFns-D2PlLFE6.js → shapeFns-FDuKkrDR.js} +4 -4
- package/dist/sketching.cjs +2 -2
- package/dist/sketching.js +2 -2
- package/dist/{solidBuilders-BzfRBizW.cjs → solidBuilders-994_MQwB.cjs} +12 -12
- package/dist/{solidBuilders-BXhh5hP2.js → solidBuilders-DmwhTCCd.js} +2 -2
- package/dist/{surfaceBuilders-Be_ENWSA.cjs → surfaceBuilders-5VA34a3_.cjs} +27 -27
- package/dist/{surfaceBuilders-D6iDVPIM.js → surfaceBuilders-nQdJ56fe.js} +2 -2
- package/dist/{topology-CKtCGLmb.cjs → topology-ANwCzGL8.cjs} +54 -54
- package/dist/{topology-DxD58iQ6.js → topology-C7x98OVn.js} +8 -8
- package/dist/topology.cjs +6 -6
- package/dist/topology.js +6 -6
- package/dist/{vectors-CESkzEm6.js → vectors-Bx8wkNui.js} +1 -1
- package/dist/{vectors-BafmMf96.cjs → vectors-D_IiZx0q.cjs} +6 -6
- package/dist/vectors.cjs +1 -1
- package/dist/vectors.js +1 -1
- package/package.json +5 -8
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const shapeFns = require("./shapeFns-
|
|
3
|
-
const
|
|
2
|
+
const shapeFns = require("./shapeFns-C2SnNvdH.cjs");
|
|
3
|
+
const result = require("./result-fAX0OZzI.cjs");
|
|
4
4
|
const shapeTypes = require("./shapeTypes-7xEam9Ri.cjs");
|
|
5
5
|
const vecOps = require("./vecOps-CjRL1jau.cjs");
|
|
6
|
-
const surfaceBuilders = require("./surfaceBuilders-
|
|
7
|
-
const solidBuilders = require("./solidBuilders-
|
|
8
|
-
require("./booleanFns-
|
|
9
|
-
const faceFns = require("./faceFns-
|
|
10
|
-
require("./curveFns-
|
|
11
|
-
require("./meshFns-
|
|
6
|
+
const surfaceBuilders = require("./surfaceBuilders-5VA34a3_.cjs");
|
|
7
|
+
const solidBuilders = require("./solidBuilders-994_MQwB.cjs");
|
|
8
|
+
require("./booleanFns-gmsX3Cv2.cjs");
|
|
9
|
+
const faceFns = require("./faceFns-DB1Fc5gy.cjs");
|
|
10
|
+
require("./curveFns-BZngcnQ1.cjs");
|
|
11
|
+
require("./meshFns-BnV0ZR8w.cjs");
|
|
12
12
|
function toBufferGeometryData(mesh) {
|
|
13
13
|
return {
|
|
14
14
|
position: mesh.vertices,
|
|
@@ -36,8 +36,8 @@ function toLineGeometryData(mesh) {
|
|
|
36
36
|
}
|
|
37
37
|
function chamferDistAngle(shape, edges, distance, angleDeg) {
|
|
38
38
|
if (edges.length === 0) {
|
|
39
|
-
return
|
|
40
|
-
|
|
39
|
+
return result.err(
|
|
40
|
+
result.validationError(
|
|
41
41
|
"CHAMFER_ANGLE_NO_EDGES",
|
|
42
42
|
"chamferDistAngle requires at least one edge",
|
|
43
43
|
void 0,
|
|
@@ -48,8 +48,8 @@ function chamferDistAngle(shape, edges, distance, angleDeg) {
|
|
|
48
48
|
);
|
|
49
49
|
}
|
|
50
50
|
if (distance <= 0) {
|
|
51
|
-
return
|
|
52
|
-
|
|
51
|
+
return result.err(
|
|
52
|
+
result.validationError(
|
|
53
53
|
"CHAMFER_ANGLE_BAD_DISTANCE",
|
|
54
54
|
`distance must be positive, got ${distance}`,
|
|
55
55
|
void 0,
|
|
@@ -60,8 +60,8 @@ function chamferDistAngle(shape, edges, distance, angleDeg) {
|
|
|
60
60
|
);
|
|
61
61
|
}
|
|
62
62
|
if (angleDeg <= 0 || angleDeg >= 90) {
|
|
63
|
-
return
|
|
64
|
-
|
|
63
|
+
return result.err(
|
|
64
|
+
result.validationError(
|
|
65
65
|
"CHAMFER_ANGLE_BAD_ANGLE",
|
|
66
66
|
`angleDeg must be in range (0, 90), got ${angleDeg}`,
|
|
67
67
|
void 0,
|
|
@@ -75,8 +75,8 @@ function chamferDistAngle(shape, edges, distance, angleDeg) {
|
|
|
75
75
|
const rawEdges = edges.map((e) => e.wrapped);
|
|
76
76
|
raw = kernel.chamferDistAngle(shape.wrapped, rawEdges, distance, angleDeg);
|
|
77
77
|
} catch (e) {
|
|
78
|
-
return
|
|
79
|
-
|
|
78
|
+
return result.err(
|
|
79
|
+
result.kernelError(
|
|
80
80
|
"CHAMFER_ANGLE_FAILED",
|
|
81
81
|
`chamferDistAngle kernel call failed: ${e instanceof Error ? e.message : String(e)}`,
|
|
82
82
|
e,
|
|
@@ -85,15 +85,15 @@ function chamferDistAngle(shape, edges, distance, angleDeg) {
|
|
|
85
85
|
);
|
|
86
86
|
}
|
|
87
87
|
const downcastResult = faceFns.downcast(raw);
|
|
88
|
-
if (
|
|
88
|
+
if (result.isErr(downcastResult)) return downcastResult;
|
|
89
89
|
const wrapped = shapeTypes.castShape(downcastResult.value);
|
|
90
90
|
if (!shapeTypes.isShape3D(wrapped)) {
|
|
91
91
|
wrapped[Symbol.dispose]();
|
|
92
|
-
return
|
|
93
|
-
|
|
92
|
+
return result.err(
|
|
93
|
+
result.typeCastError("CHAMFER_ANGLE_NOT_3D", "chamferDistAngle did not produce a 3D shape")
|
|
94
94
|
);
|
|
95
95
|
}
|
|
96
|
-
return
|
|
96
|
+
return result.ok(wrapped);
|
|
97
97
|
}
|
|
98
98
|
function findAncestors(parent, child, targetType, childType) {
|
|
99
99
|
const kernel = shapeTypes.getKernel();
|
|
@@ -136,7 +136,7 @@ function findChildren(parent, childType) {
|
|
|
136
136
|
return results;
|
|
137
137
|
}
|
|
138
138
|
function wrapAll(shapes) {
|
|
139
|
-
return shapes.map((s) => shapeTypes.castShape(
|
|
139
|
+
return shapes.map((s) => shapeTypes.castShape(result.unwrap(faceFns.downcast(s))));
|
|
140
140
|
}
|
|
141
141
|
function facesOfEdge(parent, edge) {
|
|
142
142
|
const raw = findAncestors(parent.wrapped, edge.wrapped, "face", "edge");
|
|
@@ -221,64 +221,64 @@ function isValid(shape) {
|
|
|
221
221
|
}
|
|
222
222
|
function healSolid(solid2) {
|
|
223
223
|
if (!shapeTypes.isSolid(solid2)) {
|
|
224
|
-
return
|
|
224
|
+
return result.err(result.validationError("NOT_A_SOLID", "Input shape is not a solid"));
|
|
225
225
|
}
|
|
226
226
|
const alreadyValid = isValid(solid2);
|
|
227
227
|
try {
|
|
228
|
-
const result = shapeTypes.getKernel().healSolid(solid2.wrapped);
|
|
229
|
-
if (!result) {
|
|
228
|
+
const result$1 = shapeTypes.getKernel().healSolid(solid2.wrapped);
|
|
229
|
+
if (!result$1) {
|
|
230
230
|
if (alreadyValid) {
|
|
231
|
-
return
|
|
231
|
+
return result.ok(solid2);
|
|
232
232
|
}
|
|
233
|
-
return
|
|
234
|
-
|
|
235
|
-
|
|
233
|
+
return result.err(
|
|
234
|
+
result.kernelError(
|
|
235
|
+
result.BrepErrorCode.HEAL_NO_EFFECT,
|
|
236
236
|
"Solid healing had no effect — shape is still invalid"
|
|
237
237
|
)
|
|
238
238
|
);
|
|
239
239
|
}
|
|
240
|
-
const cast = shapeTypes.castShape(result);
|
|
240
|
+
const cast = shapeTypes.castShape(result$1);
|
|
241
241
|
if (!shapeTypes.isSolid(cast)) {
|
|
242
|
-
return
|
|
242
|
+
return result.err(result.kernelError("HEAL_RESULT_NOT_SOLID", "Healed result is not a solid"));
|
|
243
243
|
}
|
|
244
244
|
if (!isValid(cast)) {
|
|
245
|
-
return
|
|
246
|
-
|
|
245
|
+
return result.err(
|
|
246
|
+
result.kernelError("HEAL_SOLID_INCOMPLETE", "Healed result is still invalid after ShapeFix_Solid")
|
|
247
247
|
);
|
|
248
248
|
}
|
|
249
|
-
return
|
|
249
|
+
return result.ok(cast);
|
|
250
250
|
} catch (e) {
|
|
251
|
-
return
|
|
251
|
+
return result.err(result.kernelError("HEAL_SOLID_FAILED", "Solid healing failed", e));
|
|
252
252
|
}
|
|
253
253
|
}
|
|
254
254
|
function healFace(face2) {
|
|
255
255
|
if (!shapeTypes.isFace(face2)) {
|
|
256
|
-
return
|
|
256
|
+
return result.err(result.validationError("NOT_A_FACE", "Input shape is not a face"));
|
|
257
257
|
}
|
|
258
258
|
try {
|
|
259
|
-
const result = shapeTypes.getKernel().healFace(face2.wrapped);
|
|
260
|
-
const cast = shapeTypes.castShape(result);
|
|
259
|
+
const result$1 = shapeTypes.getKernel().healFace(face2.wrapped);
|
|
260
|
+
const cast = shapeTypes.castShape(result$1);
|
|
261
261
|
if (!shapeTypes.isFace(cast)) {
|
|
262
|
-
return
|
|
262
|
+
return result.err(result.kernelError("HEAL_RESULT_NOT_FACE", "Healed result is not a face"));
|
|
263
263
|
}
|
|
264
|
-
return
|
|
264
|
+
return result.ok(cast);
|
|
265
265
|
} catch (e) {
|
|
266
|
-
return
|
|
266
|
+
return result.err(result.kernelError("HEAL_FACE_FAILED", "Face healing failed", e));
|
|
267
267
|
}
|
|
268
268
|
}
|
|
269
269
|
function healWire(wire2, face2) {
|
|
270
270
|
if (!shapeTypes.isWire(wire2)) {
|
|
271
|
-
return
|
|
271
|
+
return result.err(result.validationError("NOT_A_WIRE", "Input shape is not a wire"));
|
|
272
272
|
}
|
|
273
273
|
try {
|
|
274
|
-
const result = shapeTypes.getKernel().healWire(wire2.wrapped, face2?.wrapped);
|
|
275
|
-
const cast = shapeTypes.castShape(result);
|
|
274
|
+
const result$1 = shapeTypes.getKernel().healWire(wire2.wrapped, face2?.wrapped);
|
|
275
|
+
const cast = shapeTypes.castShape(result$1);
|
|
276
276
|
if (!shapeTypes.isWire(cast)) {
|
|
277
|
-
return
|
|
277
|
+
return result.err(result.kernelError("HEAL_RESULT_NOT_WIRE", "Healed result is not a wire"));
|
|
278
278
|
}
|
|
279
|
-
return
|
|
279
|
+
return result.ok(cast);
|
|
280
280
|
} catch (e) {
|
|
281
|
-
return
|
|
281
|
+
return result.err(result.kernelError("HEAL_WIRE_FAILED", "Wire healing failed", e));
|
|
282
282
|
}
|
|
283
283
|
}
|
|
284
284
|
function heal(shape) {
|
|
@@ -291,7 +291,7 @@ function heal(shape) {
|
|
|
291
291
|
if (shapeTypes.isWire(shape)) {
|
|
292
292
|
return healWire(shape);
|
|
293
293
|
}
|
|
294
|
-
return
|
|
294
|
+
return result.ok(shape);
|
|
295
295
|
}
|
|
296
296
|
function autoHeal(shape, options) {
|
|
297
297
|
const fixWires = options?.fixWires !== false;
|
|
@@ -302,7 +302,7 @@ function autoHeal(shape, options) {
|
|
|
302
302
|
const steps = [];
|
|
303
303
|
const diagnostics = [];
|
|
304
304
|
if (isValid(shape)) {
|
|
305
|
-
return
|
|
305
|
+
return result.ok({
|
|
306
306
|
shape,
|
|
307
307
|
report: {
|
|
308
308
|
isValid: true,
|
|
@@ -358,7 +358,7 @@ function autoHeal(shape, options) {
|
|
|
358
358
|
const shouldHealShape = shapeTypes.isSolid(current) && fixSolids || shapeTypes.isFace(current) && fixFaces || shapeTypes.isWire(current) && fixWires;
|
|
359
359
|
if (shouldHealShape) {
|
|
360
360
|
const healResult = heal(current);
|
|
361
|
-
if (
|
|
361
|
+
if (result.isOk(healResult)) {
|
|
362
362
|
current = healResult.value;
|
|
363
363
|
if (shapeTypes.isSolid(shape)) {
|
|
364
364
|
solidHealed = true;
|
|
@@ -392,7 +392,7 @@ function autoHeal(shape, options) {
|
|
|
392
392
|
const valid = isValid(current);
|
|
393
393
|
steps.push(valid ? "Final validation: valid" : "Final validation: still invalid");
|
|
394
394
|
diagnostics.push({ name: "finalValidation", attempted: true, succeeded: valid });
|
|
395
|
-
return
|
|
395
|
+
return result.ok({
|
|
396
396
|
shape: current,
|
|
397
397
|
report: {
|
|
398
398
|
isValid: valid,
|
|
@@ -507,10 +507,10 @@ function wire(listOfEdges) {
|
|
|
507
507
|
return surfaceBuilders.assembleWire(listOfEdges);
|
|
508
508
|
}
|
|
509
509
|
function wireLoop(listOfEdges) {
|
|
510
|
-
return
|
|
511
|
-
if (shapeTypes.isClosedWire(w)) return
|
|
512
|
-
return
|
|
513
|
-
|
|
510
|
+
return result.andThen(surfaceBuilders.assembleWire(listOfEdges), (w) => {
|
|
511
|
+
if (shapeTypes.isClosedWire(w)) return result.ok(w);
|
|
512
|
+
return result.err(
|
|
513
|
+
result.validationError(
|
|
514
514
|
"WIRE_NOT_CLOSED",
|
|
515
515
|
"Assembled wire is not closed: start and end points do not coincide"
|
|
516
516
|
)
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { c as getWires, a as getFaces, u as translate } from "./shapeFns-
|
|
2
|
-
import { e as err,
|
|
1
|
+
import { c as getWires, a as getFaces, u as translate } from "./shapeFns-FDuKkrDR.js";
|
|
2
|
+
import { e as err, z as validationError, k as kernelError, g as isErr, r as typeCastError, o as ok, v as unwrap, h as isOk, A as BrepErrorCode, a as andThen } from "./result-BaSD1fqR.js";
|
|
3
3
|
import { B as getKernel, c as castShape, p as isShape3D, r as isSolid, k as isFace, u as isWire, F as createSolid, f as isClosedWire } from "./shapeTypes-CpSaBLDv.js";
|
|
4
4
|
import { H as HASH_CODE_MAX, D as DEG2RAD } from "./vecOps-ZDdZWbwT.js";
|
|
5
|
-
import { d as addHolesInFace, j as makeBezierCurve, g as makeBSplineApproximation, e as makeCircle, f as makeEllipse, k as makeEllipseArc, m as makeFace, l as makeNonPlanarFace, c as makeHelix, a as makeLine, n as makePolygon, h as makeNewFaceWithinFace, o as makeTangentArc, p as makeThreePointArc, b as assembleWire } from "./surfaceBuilders-
|
|
6
|
-
import { a as makeCompound, d as makeCone, c as makeCylinder, e as makeEllipsoid, f as makeOffset, w as weldShellsAndFaces, b as makeSolid, g as makeSphere, h as makeTorus, m as makeVertex } from "./solidBuilders-
|
|
7
|
-
import "./booleanFns-
|
|
8
|
-
import { d as downcast } from "./faceFns-
|
|
9
|
-
import "./curveFns-
|
|
10
|
-
import "./meshFns-
|
|
5
|
+
import { d as addHolesInFace, j as makeBezierCurve, g as makeBSplineApproximation, e as makeCircle, f as makeEllipse, k as makeEllipseArc, m as makeFace, l as makeNonPlanarFace, c as makeHelix, a as makeLine, n as makePolygon, h as makeNewFaceWithinFace, o as makeTangentArc, p as makeThreePointArc, b as assembleWire } from "./surfaceBuilders-nQdJ56fe.js";
|
|
6
|
+
import { a as makeCompound, d as makeCone, c as makeCylinder, e as makeEllipsoid, f as makeOffset, w as weldShellsAndFaces, b as makeSolid, g as makeSphere, h as makeTorus, m as makeVertex } from "./solidBuilders-DmwhTCCd.js";
|
|
7
|
+
import "./booleanFns-BCTjYZAg.js";
|
|
8
|
+
import { d as downcast } from "./faceFns-B8GnxjdY.js";
|
|
9
|
+
import "./curveFns-mROFhiuG.js";
|
|
10
|
+
import "./meshFns-nQjK38EC.js";
|
|
11
11
|
function toBufferGeometryData(mesh) {
|
|
12
12
|
return {
|
|
13
13
|
position: mesh.vertices,
|
package/dist/topology.cjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const shapeFns = require("./shapeFns-
|
|
4
|
-
const topology = require("./topology-
|
|
5
|
-
const booleanFns = require("./booleanFns-
|
|
6
|
-
const curveFns = require("./curveFns-
|
|
7
|
-
const faceFns = require("./faceFns-
|
|
8
|
-
const meshFns = require("./meshFns-
|
|
3
|
+
const shapeFns = require("./shapeFns-C2SnNvdH.cjs");
|
|
4
|
+
const topology = require("./topology-ANwCzGL8.cjs");
|
|
5
|
+
const booleanFns = require("./booleanFns-gmsX3Cv2.cjs");
|
|
6
|
+
const curveFns = require("./curveFns-BZngcnQ1.cjs");
|
|
7
|
+
const faceFns = require("./faceFns-DB1Fc5gy.cjs");
|
|
8
|
+
const meshFns = require("./meshFns-BnV0ZR8w.cjs");
|
|
9
9
|
exports.getBounds = shapeFns.getBounds;
|
|
10
10
|
exports.getEdges = shapeFns.getEdges;
|
|
11
11
|
exports.getFaces = shapeFns.getFaces;
|
package/dist/topology.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { h, d, a, f, e, c, x, y, i, z, A, B, C, v } from "./shapeFns-
|
|
2
|
-
import { a as a2, b, d as d2, e as e2, f as f2, g, c as c2, j, k, l, m, n, o, p, q, r, s, t, u, v as v2, w, x as x2, y as y2, z as z2, A as A2, B as B2, C as C2, D, E, F, G, H, I, J, K, L, M, N, O, P, Q } from "./topology-
|
|
3
|
-
import { k as k2, j as j2 } from "./booleanFns-
|
|
4
|
-
import { h as h2, e as e3, b as b2, i as i2, f as f3, j as j3, d as d3, c as c3, a as a3, k as k3, l as l2, g as g2, m as m2, o as o2 } from "./curveFns-
|
|
5
|
-
import { l as l3, c as c4, m as m3, j as j4, d as d4, e as e4, f as f4, q as q2, r as r2, g as g3, k as k4, s as s2, i as i3, n as n2, o as o3, p as p2, t as t2, w as w2, u as u2, h as h3 } from "./faceFns-
|
|
6
|
-
import { c as c5, b as b3, e as e5, d as d5, f as f5 } from "./meshFns-
|
|
1
|
+
import { h, d, a, f, e, c, x, y, i, z, A, B, C, v } from "./shapeFns-FDuKkrDR.js";
|
|
2
|
+
import { a as a2, b, d as d2, e as e2, f as f2, g, c as c2, j, k, l, m, n, o, p, q, r, s, t, u, v as v2, w, x as x2, y as y2, z as z2, A as A2, B as B2, C as C2, D, E, F, G, H, I, J, K, L, M, N, O, P, Q } from "./topology-C7x98OVn.js";
|
|
3
|
+
import { k as k2, j as j2 } from "./booleanFns-BCTjYZAg.js";
|
|
4
|
+
import { h as h2, e as e3, b as b2, i as i2, f as f3, j as j3, d as d3, c as c3, a as a3, k as k3, l as l2, g as g2, m as m2, o as o2 } from "./curveFns-mROFhiuG.js";
|
|
5
|
+
import { l as l3, c as c4, m as m3, j as j4, d as d4, e as e4, f as f4, q as q2, r as r2, g as g3, k as k4, s as s2, i as i3, n as n2, o as o3, p as p2, t as t2, w as w2, u as u2, h as h3 } from "./faceFns-B8GnxjdY.js";
|
|
6
|
+
import { c as c5, b as b3, e as e5, d as d5, f as f5 } from "./meshFns-nQjK38EC.js";
|
|
7
7
|
export {
|
|
8
8
|
a2 as addHoles,
|
|
9
9
|
b as adjacentFaces,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as toVec3 } from "./types-CWDdqcrq.js";
|
|
2
2
|
import { j as vecNormalize, f as vecIsZero, b as vecCross, v as vecAdd, n as vecScale, m as vecRotate, D as DEG2RAD } from "./vecOps-ZDdZWbwT.js";
|
|
3
|
-
import { e as err,
|
|
3
|
+
import { e as err, z as validationError, o as ok } from "./result-BaSD1fqR.js";
|
|
4
4
|
function createPlane(origin, xDirection = null, normal = [0, 0, 1]) {
|
|
5
5
|
const zDir = vecNormalize(normal);
|
|
6
6
|
if (vecIsZero(zDir)) throw new Error("Plane normal must be non-zero");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const types = require("./types-CA_xrgDq.cjs");
|
|
3
3
|
const vecOps = require("./vecOps-CjRL1jau.cjs");
|
|
4
|
-
const
|
|
4
|
+
const result = require("./result-fAX0OZzI.cjs");
|
|
5
5
|
function createPlane(origin, xDirection = null, normal = [0, 0, 1]) {
|
|
6
6
|
const zDir = vecOps.vecNormalize(normal);
|
|
7
7
|
if (vecOps.vecIsZero(zDir)) throw new Error("Plane normal must be non-zero");
|
|
@@ -41,20 +41,20 @@ const PLANES_CONFIG = {
|
|
|
41
41
|
};
|
|
42
42
|
function createNamedPlane(name, sourceOrigin = [0, 0, 0]) {
|
|
43
43
|
const config = PLANES_CONFIG[name];
|
|
44
|
-
if (!config) return
|
|
44
|
+
if (!config) return result.err(result.validationError("UNKNOWN_PLANE", `Could not find plane ${name}`));
|
|
45
45
|
let origin;
|
|
46
46
|
if (typeof sourceOrigin === "number") {
|
|
47
47
|
origin = vecOps.vecScale(config.normal, sourceOrigin);
|
|
48
48
|
} else {
|
|
49
49
|
origin = types.toVec3(sourceOrigin);
|
|
50
50
|
}
|
|
51
|
-
return
|
|
51
|
+
return result.ok(createPlane(origin, config.xDir, config.normal));
|
|
52
52
|
}
|
|
53
53
|
function resolvePlane(input, origin) {
|
|
54
54
|
if (typeof input === "string") {
|
|
55
|
-
const
|
|
56
|
-
if (!
|
|
57
|
-
return
|
|
55
|
+
const result2 = createNamedPlane(input, origin);
|
|
56
|
+
if (!result2.ok) throw new Error(result2.error.message);
|
|
57
|
+
return result2.value;
|
|
58
58
|
}
|
|
59
59
|
return input;
|
|
60
60
|
}
|
package/dist/vectors.cjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const types = require("./types-CA_xrgDq.cjs");
|
|
4
4
|
const vecOps = require("./vecOps-CjRL1jau.cjs");
|
|
5
|
-
const vectors = require("./vectors-
|
|
5
|
+
const vectors = require("./vectors-D_IiZx0q.cjs");
|
|
6
6
|
exports.resolveDirection = types.resolveDirection;
|
|
7
7
|
exports.toVec2 = types.toVec2;
|
|
8
8
|
exports.toVec3 = types.toVec3;
|
package/dist/vectors.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r, t, a } from "./types-CWDdqcrq.js";
|
|
2
2
|
import { D, R, v, a as a2, b, c, d, e, f, g, h, i, j, k, l, m, n, o } from "./vecOps-ZDdZWbwT.js";
|
|
3
|
-
import { c as c2, a as a3, p, r as r2, t as t2 } from "./vectors-
|
|
3
|
+
import { c as c2, a as a3, p, r as r2, t as t2 } from "./vectors-Bx8wkNui.js";
|
|
4
4
|
export {
|
|
5
5
|
D as DEG2RAD,
|
|
6
6
|
R as RAD2DEG,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "brepjs",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.8.1",
|
|
4
4
|
"description": "Web CAD library with pluggable geometry kernel",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cad",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"type": "module",
|
|
19
19
|
"sideEffects": false,
|
|
20
20
|
"engines": {
|
|
21
|
-
"node": ">=24
|
|
21
|
+
"node": ">=24"
|
|
22
22
|
},
|
|
23
23
|
"packageManager": "npm@11.6.1",
|
|
24
24
|
"workspaces": [
|
|
@@ -169,13 +169,10 @@
|
|
|
169
169
|
"lint:fix": "eslint src/ --fix",
|
|
170
170
|
"format": "prettier --write 'src/**/*.ts' 'tests/**/*.ts'",
|
|
171
171
|
"format:check": "prettier --check 'src/**/*.ts' 'tests/**/*.ts'",
|
|
172
|
-
"test": "vitest run --project occt",
|
|
173
|
-
"test:
|
|
174
|
-
"test:coverage:changed": "vitest run --project occt --changed=HEAD",
|
|
172
|
+
"test": "vitest run --project occt --changed",
|
|
173
|
+
"test:full": "vitest run --project occt --coverage",
|
|
175
174
|
"test:watch": "vitest --project occt",
|
|
176
|
-
"test:affected": "vitest run --project occt --changed",
|
|
177
175
|
"test:brepkit": "vitest run --project brepkit",
|
|
178
|
-
"test:all": "vitest run",
|
|
179
176
|
"check:boundaries": "bash scripts/check-layer-boundaries.sh",
|
|
180
177
|
"bench": "vitest run --config vitest.bench.config.ts",
|
|
181
178
|
"bench:compare": "BENCH_KERNELS=both vitest run --config vitest.bench.config.ts",
|
|
@@ -197,7 +194,7 @@
|
|
|
197
194
|
"@types/opentype.js": "1.3.9",
|
|
198
195
|
"@vitest/coverage-v8": "4.0.18",
|
|
199
196
|
"brepjs-opencascade": "*",
|
|
200
|
-
"brepkit-wasm": "1.0
|
|
197
|
+
"brepkit-wasm": "1.1.0",
|
|
201
198
|
"eslint": "10.0.3",
|
|
202
199
|
"husky": "9.1.7",
|
|
203
200
|
"knip": "5.86.0",
|