brepjs 9.3.6 → 9.3.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/2d.cjs +2 -2
- package/dist/2d.js +3 -3
- package/dist/{Blueprint-DPrVGHO7.cjs → Blueprint-C_ny87tf.cjs} +5 -5
- package/dist/{Blueprint-jIIEbRJU.js → Blueprint-vLo9HuPx.js} +5 -5
- package/dist/{boolean2D-BhApsf-L.cjs → boolean2D-C_WtQSZM.cjs} +7 -7
- package/dist/{boolean2D-B6u0KRc9.js → boolean2D-G9wVVewF.js} +7 -7
- package/dist/{booleanFns-Dj_oaCrD.cjs → booleanFns-G0j8iAZV.cjs} +64 -17
- package/dist/{booleanFns-BAw-L-nX.js → booleanFns-gwskRu9F.js} +78 -31
- package/dist/brepjs.cjs +25 -16
- package/dist/brepjs.js +89 -80
- package/dist/core/shapeTypes.d.ts.map +1 -1
- package/dist/core.cjs +1 -1
- package/dist/core.js +1 -1
- package/dist/{cornerFinder-bCrOjpGt.cjs → cornerFinder-56x6NzUP.cjs} +1 -1
- package/dist/{cornerFinder-B0tnGcU4.js → cornerFinder-CrM1kbgV.js} +1 -1
- package/dist/{curveFns-BOpSWBM_.js → curveFns-B7b2uHRl.js} +1 -1
- package/dist/{curveFns-CZleOv_h.cjs → curveFns-BsxQJoWM.cjs} +1 -1
- package/dist/{drawFns-D3B-bSgF.js → drawFns-BD92V6Nt.js} +10 -10
- package/dist/{drawFns-xNlki_S7.cjs → drawFns-BIoGsiXr.cjs} +10 -10
- package/dist/{faceFns-Dc5puKHH.cjs → faceFns-A6VJdsJc.cjs} +14 -14
- package/dist/{faceFns-BOn2mjLG.js → faceFns-DKAs23b7.js} +14 -14
- package/dist/{helpers-BZ-Ihxrc.js → helpers-BidbwB1g.js} +18 -9
- package/dist/{helpers-CPv96_9e.cjs → helpers-C-dHgprx.cjs} +17 -8
- package/dist/io.cjs +3 -3
- package/dist/io.js +3 -3
- package/dist/kernel/booleanOps.d.ts +13 -0
- package/dist/kernel/booleanOps.d.ts.map +1 -1
- package/dist/kernel/evolutionOps.d.ts.map +1 -1
- package/dist/kernel/index.d.ts.map +1 -1
- package/dist/kernel/meshOps.d.ts +2 -0
- package/dist/kernel/meshOps.d.ts.map +1 -1
- package/dist/kernel/types.d.ts +11 -0
- package/dist/kernel/types.d.ts.map +1 -1
- package/dist/{loft-s34qDUbd.cjs → loft-B0VRwdIS.cjs} +3 -3
- package/dist/{loft-BD7ZqREo.js → loft-BI8MUcCF.js} +3 -3
- package/dist/measurement/interferenceFns.d.ts.map +1 -1
- package/dist/{measurement-DaGrbF2-.js → measurement-CyIBSu3o.js} +5 -5
- package/dist/{measurement-qhkA49pp.cjs → measurement-D5XQSvln.cjs} +5 -5
- package/dist/measurement.cjs +1 -1
- package/dist/measurement.js +1 -1
- package/dist/{meshFns-C9iQRYt1.js → meshFns-BilAVkvY.js} +6 -6
- package/dist/{meshFns-DxVxiYeE.cjs → meshFns-ClCp7nft.cjs} +6 -6
- package/dist/operations/patternFns.d.ts.map +1 -1
- package/dist/{operations-DXLc82e9.cjs → operations-B1FSxszL.cjs} +5 -5
- package/dist/{operations-BELmPqGI.js → operations-Bw3ZGLPJ.js} +5 -5
- package/dist/operations.cjs +2 -2
- package/dist/operations.js +2 -2
- package/dist/query/finderCore.d.ts.map +1 -1
- package/dist/query.cjs +4 -4
- package/dist/query.js +5 -5
- package/dist/{shapeFns-vG2rLms_.js → shapeFns-D9CKkCnS.js} +21 -17
- package/dist/{shapeFns-BPvrDsoI.cjs → shapeFns-O9Ont1Dy.cjs} +12 -8
- package/dist/{shapeTypes-DenorQVG.cjs → shapeTypes-CBhj5o2y.cjs} +156 -78
- package/dist/{shapeTypes-DufCiUqb.js → shapeTypes-d-jYnZuW.js} +156 -78
- package/dist/sketching.cjs +2 -2
- package/dist/sketching.js +2 -2
- package/dist/{surfaceBuilders-6muSoK9E.js → surfaceBuilders-BX-btdhW.js} +2 -2
- package/dist/{surfaceBuilders-CH0WqBcz.cjs → surfaceBuilders-DwMD54OR.cjs} +2 -2
- package/dist/topology/booleanFns.d.ts +7 -16
- package/dist/topology/booleanFns.d.ts.map +1 -1
- package/dist/topology/cast.d.ts +0 -5
- package/dist/topology/cast.d.ts.map +1 -1
- package/dist/topology/colorFns.d.ts +2 -0
- package/dist/topology/colorFns.d.ts.map +1 -1
- package/dist/topology/faceTagFns.d.ts +2 -0
- package/dist/topology/faceTagFns.d.ts.map +1 -1
- package/dist/topology/meshCache.d.ts +1 -1
- package/dist/topology/meshCache.d.ts.map +1 -1
- package/dist/topology/modifierFns.d.ts.map +1 -1
- package/dist/topology/shapeFns.d.ts +1 -1
- package/dist/topology/shapeFns.d.ts.map +1 -1
- package/dist/{topology-DNPaVy5y.cjs → topology-ChR-we6s.cjs} +6 -6
- package/dist/{topology-BlslYPfb.js → topology-DDO_RZ7P.js} +6 -6
- package/dist/topology.cjs +6 -6
- package/dist/topology.js +19 -19
- package/package.json +1 -1
package/dist/2d.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const Blueprint = require("./Blueprint-
|
|
4
|
-
const boolean2D = require("./boolean2D-
|
|
3
|
+
const Blueprint = require("./Blueprint-C_ny87tf.cjs");
|
|
4
|
+
const boolean2D = require("./boolean2D-C_WtQSZM.cjs");
|
|
5
5
|
function reverseCurve(curve) {
|
|
6
6
|
const cloned = curve.clone();
|
|
7
7
|
cloned.reverse();
|
package/dist/2d.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { B as Blueprint } from "./Blueprint-
|
|
2
|
-
import { d, C } from "./Blueprint-
|
|
3
|
-
import { e, C as C2, f, l, g, n, k, q, o, p, r } from "./boolean2D-
|
|
1
|
+
import { B as Blueprint } from "./Blueprint-vLo9HuPx.js";
|
|
2
|
+
import { d, C } from "./Blueprint-vLo9HuPx.js";
|
|
3
|
+
import { e, C as C2, f, l, g, n, k, q, o, p, r } from "./boolean2D-G9wVVewF.js";
|
|
4
4
|
function reverseCurve(curve) {
|
|
5
5
|
const cloned = curve.clone();
|
|
6
6
|
cloned.reverse();
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const vectors = require("./vectors-BwRTfFd1.cjs");
|
|
3
3
|
const types = require("./types-CA_xrgDq.cjs");
|
|
4
|
-
const shapeTypes = require("./shapeTypes-
|
|
5
|
-
const faceFns = require("./faceFns-
|
|
6
|
-
const curveFns = require("./curveFns-
|
|
4
|
+
const shapeTypes = require("./shapeTypes-CBhj5o2y.cjs");
|
|
5
|
+
const faceFns = require("./faceFns-A6VJdsJc.cjs");
|
|
6
|
+
const curveFns = require("./curveFns-BsxQJoWM.cjs");
|
|
7
7
|
const errors = require("./errors-HU7EpHt3.cjs");
|
|
8
|
-
const helpers = require("./helpers-
|
|
8
|
+
const helpers = require("./helpers-C-dHgprx.cjs");
|
|
9
9
|
const vecOps = require("./vecOps-CjRL1jau.cjs");
|
|
10
|
-
const surfaceBuilders = require("./surfaceBuilders-
|
|
10
|
+
const surfaceBuilders = require("./surfaceBuilders-DwMD54OR.cjs");
|
|
11
11
|
const result = require("./result.cjs");
|
|
12
12
|
function makePlane(plane, origin) {
|
|
13
13
|
if (plane && typeof plane !== "string") {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { r as resolvePlane } from "./vectors-CpZfWX0T.js";
|
|
2
2
|
import { a as toVec3 } from "./types-CWDdqcrq.js";
|
|
3
|
-
import { q as getKernel, y as getKernel2D, z as registerForCleanup, A as unregisterFromCleanup, s as createEdge, r as createWire } from "./shapeTypes-
|
|
4
|
-
import { u as uvBounds, f as faceGeomType, e as faceCenter, h as uvCoordinates, c as cast } from "./faceFns-
|
|
5
|
-
import { g as getOrientation } from "./curveFns-
|
|
3
|
+
import { q as getKernel, y as getKernel2D, z as registerForCleanup, A as unregisterFromCleanup, s as createEdge, r as createWire } from "./shapeTypes-d-jYnZuW.js";
|
|
4
|
+
import { u as uvBounds, f as faceGeomType, e as faceCenter, h as uvCoordinates, c as cast } from "./faceFns-DKAs23b7.js";
|
|
5
|
+
import { g as getOrientation } from "./curveFns-B7b2uHRl.js";
|
|
6
6
|
import { o as ok, e as err, b as computationError, u as unwrap, x as validationError } from "./errors-C_XjfNt5.js";
|
|
7
|
-
import { d as distance2d, s as samePoint, b as scalarMultiply2d, c as add2d, n as normalize2d, e as subtract2d, g as getSingleFace } from "./helpers-
|
|
7
|
+
import { d as distance2d, s as samePoint, b as scalarMultiply2d, c as add2d, n as normalize2d, e as subtract2d, g as getSingleFace } from "./helpers-BidbwB1g.js";
|
|
8
8
|
import { R as RAD2DEG, D as DEG2RAD } from "./vecOps-ZDdZWbwT.js";
|
|
9
|
-
import { m as makeFace } from "./surfaceBuilders-
|
|
9
|
+
import { m as makeFace } from "./surfaceBuilders-BX-btdhW.js";
|
|
10
10
|
import { bug } from "./result.js";
|
|
11
11
|
function makePlane(plane, origin) {
|
|
12
12
|
if (plane && typeof plane !== "string") {
|
|
@@ -46,16 +46,16 @@ var __callDispose = (stack, error, hasError) => {
|
|
|
46
46
|
};
|
|
47
47
|
const vectors = require("./vectors-BwRTfFd1.cjs");
|
|
48
48
|
const errors = require("./errors-HU7EpHt3.cjs");
|
|
49
|
-
const faceFns = require("./faceFns-
|
|
49
|
+
const faceFns = require("./faceFns-A6VJdsJc.cjs");
|
|
50
50
|
const types = require("./types-CA_xrgDq.cjs");
|
|
51
51
|
const vecOps = require("./vecOps-CjRL1jau.cjs");
|
|
52
|
-
const loft = require("./loft-
|
|
53
|
-
const shapeTypes = require("./shapeTypes-
|
|
54
|
-
const curveFns = require("./curveFns-
|
|
55
|
-
const surfaceBuilders = require("./surfaceBuilders-
|
|
52
|
+
const loft = require("./loft-B0VRwdIS.cjs");
|
|
53
|
+
const shapeTypes = require("./shapeTypes-CBhj5o2y.cjs");
|
|
54
|
+
const curveFns = require("./curveFns-BsxQJoWM.cjs");
|
|
55
|
+
const surfaceBuilders = require("./surfaceBuilders-DwMD54OR.cjs");
|
|
56
56
|
const result = require("./result.cjs");
|
|
57
|
-
const helpers = require("./helpers-
|
|
58
|
-
const Blueprint = require("./Blueprint-
|
|
57
|
+
const helpers = require("./helpers-C-dHgprx.cjs");
|
|
58
|
+
const Blueprint = require("./Blueprint-C_ny87tf.cjs");
|
|
59
59
|
const intersectCurves = (first, second, precision = 1e-9) => {
|
|
60
60
|
if (first.boundingBox.isOut(second.boundingBox))
|
|
61
61
|
return errors.ok({ intersections: [], commonSegments: [], commonSegmentsPoints: [] });
|
|
@@ -45,16 +45,16 @@ var __callDispose = (stack, error, hasError) => {
|
|
|
45
45
|
};
|
|
46
46
|
import { a as createPlane } from "./vectors-CpZfWX0T.js";
|
|
47
47
|
import { o as ok, e as err, b as computationError, u as unwrap, g as isOk } from "./errors-C_XjfNt5.js";
|
|
48
|
-
import { d as downcast, u as uvBounds, p as pointOnSurface, n as normalAt } from "./faceFns-
|
|
48
|
+
import { d as downcast, u as uvBounds, p as pointOnSurface, n as normalAt } from "./faceFns-DKAs23b7.js";
|
|
49
49
|
import { a as toVec3 } from "./types-CWDdqcrq.js";
|
|
50
50
|
import { n as vecScale, j as vecNormalize, b as vecCross, D as DEG2RAD, R as RAD2DEG } from "./vecOps-ZDdZWbwT.js";
|
|
51
|
-
import { r as revolution, c as complexExtrude, t as twistExtrude, b as basicFaceExtrusion, g as genericSweep, l as loft } from "./loft-
|
|
52
|
-
import { y as getKernel2D, t as createFace, r as createWire, q as getKernel, s as createEdge, D as DisposalScope } from "./shapeTypes-
|
|
53
|
-
import { d as curveStartPoint, c as curveTangentAt, e as curveIsClosed } from "./curveFns-
|
|
54
|
-
import { m as makeFace, l as makeNewFaceWithinFace, b as assembleWire, z as zip } from "./surfaceBuilders-
|
|
51
|
+
import { r as revolution, c as complexExtrude, t as twistExtrude, b as basicFaceExtrusion, g as genericSweep, l as loft } from "./loft-BI8MUcCF.js";
|
|
52
|
+
import { y as getKernel2D, t as createFace, r as createWire, q as getKernel, s as createEdge, D as DisposalScope } from "./shapeTypes-d-jYnZuW.js";
|
|
53
|
+
import { d as curveStartPoint, c as curveTangentAt, e as curveIsClosed } from "./curveFns-B7b2uHRl.js";
|
|
54
|
+
import { m as makeFace, l as makeNewFaceWithinFace, b as assembleWire, z as zip } from "./surfaceBuilders-BX-btdhW.js";
|
|
55
55
|
import { bug } from "./result.js";
|
|
56
|
-
import { s as samePoint$1, n as normalize2d, e as subtract2d, c as add2d, i as crossProduct2d, b as scalarMultiply2d, f as polarToCartesian, r as rotate2d, j as cartesianToPolar, d as distance2d, p as polarAngle2d, k as PRECISION_INTERSECTION } from "./helpers-
|
|
57
|
-
import { C as Curve2D, a as make2dSegmentCurve, j as approximateAsBSpline, b as make2dArcFromCenter, k as isPoint2D, g as make2dCircle, l as make2dThreePointArc, d as BoundingBox2d, v as viewbox, n as asSVG, B as Blueprint, o as make2dEllipseArc, p as make2dTangentArc, q as make2dBezierCurve, r as removeDuplicatePoints } from "./Blueprint-
|
|
56
|
+
import { s as samePoint$1, n as normalize2d, e as subtract2d, c as add2d, i as crossProduct2d, b as scalarMultiply2d, f as polarToCartesian, r as rotate2d, j as cartesianToPolar, d as distance2d, p as polarAngle2d, k as PRECISION_INTERSECTION } from "./helpers-BidbwB1g.js";
|
|
57
|
+
import { C as Curve2D, a as make2dSegmentCurve, j as approximateAsBSpline, b as make2dArcFromCenter, k as isPoint2D, g as make2dCircle, l as make2dThreePointArc, d as BoundingBox2d, v as viewbox, n as asSVG, B as Blueprint, o as make2dEllipseArc, p as make2dTangentArc, q as make2dBezierCurve, r as removeDuplicatePoints } from "./Blueprint-vLo9HuPx.js";
|
|
58
58
|
const intersectCurves = (first, second, precision = 1e-9) => {
|
|
59
59
|
if (first.boundingBox.isOut(second.boundingBox))
|
|
60
60
|
return ok({ intersections: [], commonSegments: [], commonSegmentsPoints: [] });
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const shapeTypes = require("./shapeTypes-
|
|
2
|
+
const shapeTypes = require("./shapeTypes-CBhj5o2y.cjs");
|
|
3
3
|
const errors = require("./errors-HU7EpHt3.cjs");
|
|
4
4
|
const vectors = require("./vectors-BwRTfFd1.cjs");
|
|
5
5
|
const vecOps = require("./vecOps-CjRL1jau.cjs");
|
|
6
|
-
const shapeFns = require("./shapeFns-
|
|
7
|
-
const surfaceBuilders = require("./surfaceBuilders-
|
|
6
|
+
const shapeFns = require("./shapeFns-O9Ont1Dy.cjs");
|
|
7
|
+
const surfaceBuilders = require("./surfaceBuilders-DwMD54OR.cjs");
|
|
8
8
|
const shapeTagStore = /* @__PURE__ */ new WeakMap();
|
|
9
9
|
const tagMetadataStore = /* @__PURE__ */ new WeakMap();
|
|
10
|
+
function hasFaceTags(shape) {
|
|
11
|
+
return shapeTagStore.has(shape.wrapped);
|
|
12
|
+
}
|
|
10
13
|
function getTagMap(shape) {
|
|
11
14
|
let map = shapeTagStore.get(shape.wrapped);
|
|
12
15
|
if (!map) {
|
|
@@ -121,6 +124,9 @@ function propagateFaceTagsFromEvolution(evolution, inputs, result) {
|
|
|
121
124
|
}
|
|
122
125
|
const shapeColorStore = /* @__PURE__ */ new WeakMap();
|
|
123
126
|
const faceColorStore = /* @__PURE__ */ new WeakMap();
|
|
127
|
+
function hasColorMetadata(shape) {
|
|
128
|
+
return shapeColorStore.has(shape.wrapped) || faceColorStore.has(shape.wrapped);
|
|
129
|
+
}
|
|
124
130
|
function getFaceColorMap(shape) {
|
|
125
131
|
let map = faceColorStore.get(shape.wrapped);
|
|
126
132
|
if (!map) {
|
|
@@ -221,6 +227,10 @@ function castToShape3D(shape, errorCode, errorMsg) {
|
|
|
221
227
|
return errors.ok(wrapped);
|
|
222
228
|
}
|
|
223
229
|
function collectInputFaceHashes(inputs) {
|
|
230
|
+
const hasMetadata = inputs.some(
|
|
231
|
+
(s) => shapeFns.getFaceOrigins(s) !== void 0 || hasFaceTags(s) || hasColorMetadata(s)
|
|
232
|
+
);
|
|
233
|
+
if (!hasMetadata) return [];
|
|
224
234
|
const hashes = [];
|
|
225
235
|
for (const input of inputs) {
|
|
226
236
|
const faces = shapeTypes.getKernel().iterShapes(input.wrapped, "face");
|
|
@@ -230,7 +240,7 @@ function collectInputFaceHashes(inputs) {
|
|
|
230
240
|
}
|
|
231
241
|
return hashes;
|
|
232
242
|
}
|
|
233
|
-
function fuse(a, b, { optimisation = "none", simplify = false, signal } = {}) {
|
|
243
|
+
function fuse(a, b, { optimisation = "none", simplify = false, signal, fuzzyValue } = {}) {
|
|
234
244
|
if (signal?.aborted) throw signal.reason;
|
|
235
245
|
const checkA = validateShape3D(a, "fuse: first operand");
|
|
236
246
|
if (errors.isErr(checkA)) return checkA;
|
|
@@ -242,7 +252,7 @@ function fuse(a, b, { optimisation = "none", simplify = false, signal } = {}) {
|
|
|
242
252
|
b.wrapped,
|
|
243
253
|
inputFaceHashes,
|
|
244
254
|
vecOps.HASH_CODE_MAX,
|
|
245
|
-
{ optimisation, simplify }
|
|
255
|
+
{ optimisation, simplify, fuzzyValue }
|
|
246
256
|
);
|
|
247
257
|
const fuseResult = castToShape3D(resultShape, "FUSE_NOT_3D", "Fuse did not produce a 3D shape");
|
|
248
258
|
if (fuseResult.ok) {
|
|
@@ -252,7 +262,7 @@ function fuse(a, b, { optimisation = "none", simplify = false, signal } = {}) {
|
|
|
252
262
|
}
|
|
253
263
|
return fuseResult;
|
|
254
264
|
}
|
|
255
|
-
function cut(base, tool, { optimisation = "none", simplify = false, signal } = {}) {
|
|
265
|
+
function cut(base, tool, { optimisation = "none", simplify = false, signal, fuzzyValue } = {}) {
|
|
256
266
|
if (signal?.aborted) throw signal.reason;
|
|
257
267
|
const checkBase = validateShape3D(base, "cut: base");
|
|
258
268
|
if (errors.isErr(checkBase)) return checkBase;
|
|
@@ -264,7 +274,7 @@ function cut(base, tool, { optimisation = "none", simplify = false, signal } = {
|
|
|
264
274
|
tool.wrapped,
|
|
265
275
|
inputFaceHashes,
|
|
266
276
|
vecOps.HASH_CODE_MAX,
|
|
267
|
-
{ optimisation, simplify }
|
|
277
|
+
{ optimisation, simplify, fuzzyValue }
|
|
268
278
|
);
|
|
269
279
|
const cutResult = castToShape3D(resultShape, "CUT_NOT_3D", "Cut did not produce a 3D shape");
|
|
270
280
|
if (cutResult.ok) {
|
|
@@ -274,7 +284,7 @@ function cut(base, tool, { optimisation = "none", simplify = false, signal } = {
|
|
|
274
284
|
}
|
|
275
285
|
return cutResult;
|
|
276
286
|
}
|
|
277
|
-
function intersect(a, b, { simplify = false, signal } = {}) {
|
|
287
|
+
function intersect(a, b, { simplify = false, signal, fuzzyValue } = {}) {
|
|
278
288
|
if (signal?.aborted) throw signal.reason;
|
|
279
289
|
const checkA = validateShape3D(a, "intersect: first operand");
|
|
280
290
|
if (errors.isErr(checkA)) return checkA;
|
|
@@ -286,7 +296,7 @@ function intersect(a, b, { simplify = false, signal } = {}) {
|
|
|
286
296
|
b.wrapped,
|
|
287
297
|
inputFaceHashes,
|
|
288
298
|
vecOps.HASH_CODE_MAX,
|
|
289
|
-
{ simplify }
|
|
299
|
+
{ simplify, fuzzyValue }
|
|
290
300
|
);
|
|
291
301
|
const intResult = castToShape3D(
|
|
292
302
|
resultShape,
|
|
@@ -300,7 +310,7 @@ function intersect(a, b, { simplify = false, signal } = {}) {
|
|
|
300
310
|
}
|
|
301
311
|
return intResult;
|
|
302
312
|
}
|
|
303
|
-
function fuseAllPairwise(shapes, start, end, optimisation, simplify, isTopLevel, signal) {
|
|
313
|
+
function fuseAllPairwise(shapes, start, end, optimisation, simplify, isTopLevel, signal, fuzzyValue) {
|
|
304
314
|
if (signal?.aborted) throw signal.reason;
|
|
305
315
|
const count = end - start;
|
|
306
316
|
if (count === 1) return errors.ok(shapes[start]);
|
|
@@ -308,21 +318,47 @@ function fuseAllPairwise(shapes, start, end, optimisation, simplify, isTopLevel,
|
|
|
308
318
|
return fuse(shapes[start], shapes[start + 1], {
|
|
309
319
|
optimisation,
|
|
310
320
|
simplify: isTopLevel ? simplify : false,
|
|
321
|
+
fuzzyValue,
|
|
311
322
|
...signal ? { signal } : {}
|
|
312
323
|
});
|
|
313
324
|
}
|
|
314
325
|
const mid = start + Math.ceil(count / 2);
|
|
315
|
-
const leftResult = fuseAllPairwise(
|
|
326
|
+
const leftResult = fuseAllPairwise(
|
|
327
|
+
shapes,
|
|
328
|
+
start,
|
|
329
|
+
mid,
|
|
330
|
+
optimisation,
|
|
331
|
+
simplify,
|
|
332
|
+
false,
|
|
333
|
+
signal,
|
|
334
|
+
fuzzyValue
|
|
335
|
+
);
|
|
316
336
|
if (errors.isErr(leftResult)) return leftResult;
|
|
317
|
-
const rightResult = fuseAllPairwise(
|
|
337
|
+
const rightResult = fuseAllPairwise(
|
|
338
|
+
shapes,
|
|
339
|
+
mid,
|
|
340
|
+
end,
|
|
341
|
+
optimisation,
|
|
342
|
+
simplify,
|
|
343
|
+
false,
|
|
344
|
+
signal,
|
|
345
|
+
fuzzyValue
|
|
346
|
+
);
|
|
318
347
|
if (errors.isErr(rightResult)) return rightResult;
|
|
319
348
|
return fuse(leftResult.value, rightResult.value, {
|
|
320
349
|
optimisation,
|
|
321
350
|
simplify: isTopLevel ? simplify : false,
|
|
351
|
+
fuzzyValue,
|
|
322
352
|
...signal ? { signal } : {}
|
|
323
353
|
});
|
|
324
354
|
}
|
|
325
|
-
function fuseAll(shapes, {
|
|
355
|
+
function fuseAll(shapes, {
|
|
356
|
+
optimisation = "none",
|
|
357
|
+
simplify = false,
|
|
358
|
+
strategy = "native",
|
|
359
|
+
signal,
|
|
360
|
+
fuzzyValue
|
|
361
|
+
} = {}) {
|
|
326
362
|
if (signal?.aborted) throw signal.reason;
|
|
327
363
|
if (shapes.length === 0)
|
|
328
364
|
return errors.err(errors.validationError("FUSE_ALL_EMPTY", "fuseAll requires at least one shape"));
|
|
@@ -334,7 +370,7 @@ function fuseAll(shapes, { optimisation = "none", simplify = false, strategy = "
|
|
|
334
370
|
if (strategy === "native") {
|
|
335
371
|
const result = shapeTypes.getKernel().fuseAll(
|
|
336
372
|
shapes.map((s) => s.wrapped),
|
|
337
|
-
{ optimisation, simplify, strategy, ...signal ? { signal } : {} }
|
|
373
|
+
{ optimisation, simplify, strategy, fuzzyValue, ...signal ? { signal } : {} }
|
|
338
374
|
);
|
|
339
375
|
const fuseAllResult = castToShape3D(
|
|
340
376
|
result,
|
|
@@ -346,9 +382,18 @@ function fuseAll(shapes, { optimisation = "none", simplify = false, strategy = "
|
|
|
346
382
|
}
|
|
347
383
|
return fuseAllResult;
|
|
348
384
|
}
|
|
349
|
-
return fuseAllPairwise(
|
|
385
|
+
return fuseAllPairwise(
|
|
386
|
+
shapes,
|
|
387
|
+
0,
|
|
388
|
+
shapes.length,
|
|
389
|
+
optimisation,
|
|
390
|
+
simplify,
|
|
391
|
+
true,
|
|
392
|
+
signal,
|
|
393
|
+
fuzzyValue
|
|
394
|
+
);
|
|
350
395
|
}
|
|
351
|
-
function cutAll(base, tools, { optimisation = "none", simplify = false, signal } = {}) {
|
|
396
|
+
function cutAll(base, tools, { optimisation = "none", simplify = false, signal, fuzzyValue } = {}) {
|
|
352
397
|
if (signal?.aborted) throw signal.reason;
|
|
353
398
|
if (tools.length === 0) return errors.ok(base);
|
|
354
399
|
const checkBase = validateShape3D(base, "cutAll: base");
|
|
@@ -365,7 +410,7 @@ function cutAll(base, tools, { optimisation = "none", simplify = false, signal }
|
|
|
365
410
|
toolCompound,
|
|
366
411
|
inputFaceHashes,
|
|
367
412
|
vecOps.HASH_CODE_MAX,
|
|
368
|
-
{ optimisation, simplify }
|
|
413
|
+
{ optimisation, simplify, fuzzyValue }
|
|
369
414
|
);
|
|
370
415
|
toolCompound.delete();
|
|
371
416
|
const cutAllResult = castToShape3D(
|
|
@@ -559,6 +604,8 @@ exports.getFaceColor = getFaceColor;
|
|
|
559
604
|
exports.getFaceTags = getFaceTags;
|
|
560
605
|
exports.getShapeColor = getShapeColor;
|
|
561
606
|
exports.getTagMetadata = getTagMetadata;
|
|
607
|
+
exports.hasColorMetadata = hasColorMetadata;
|
|
608
|
+
exports.hasFaceTags = hasFaceTags;
|
|
562
609
|
exports.intersect = intersect;
|
|
563
610
|
exports.propagateColorsFromEvolution = propagateColorsFromEvolution;
|
|
564
611
|
exports.propagateFaceTagsFromEvolution = propagateFaceTagsFromEvolution;
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
import { q as getKernel, c as castShape, j as isShape3D } from "./shapeTypes-
|
|
1
|
+
import { q as getKernel, c as castShape, j as isShape3D } from "./shapeTypes-d-jYnZuW.js";
|
|
2
2
|
import { o as ok, d as isErr, e as err, x as validationError, B as BrepErrorCode, p as typeCastError, k as kernelError } from "./errors-C_XjfNt5.js";
|
|
3
3
|
import { r as resolvePlane } from "./vectors-CpZfWX0T.js";
|
|
4
4
|
import { H as HASH_CODE_MAX, n as vecScale, v as vecAdd } from "./vecOps-ZDdZWbwT.js";
|
|
5
|
-
import { a as getFaces, p as propagateOriginsFromEvolution, b as propagateOriginsByHash, c as getWires, d as getEdges, e as getVertices } from "./shapeFns-
|
|
6
|
-
import { m as makeFace } from "./surfaceBuilders-
|
|
5
|
+
import { a as getFaces, p as propagateOriginsFromEvolution, b as propagateOriginsByHash, g as getFaceOrigins, c as getWires, d as getEdges, e as getVertices } from "./shapeFns-D9CKkCnS.js";
|
|
6
|
+
import { m as makeFace } from "./surfaceBuilders-BX-btdhW.js";
|
|
7
7
|
const shapeTagStore = /* @__PURE__ */ new WeakMap();
|
|
8
8
|
const tagMetadataStore = /* @__PURE__ */ new WeakMap();
|
|
9
|
+
function hasFaceTags(shape) {
|
|
10
|
+
return shapeTagStore.has(shape.wrapped);
|
|
11
|
+
}
|
|
9
12
|
function getTagMap(shape) {
|
|
10
13
|
let map = shapeTagStore.get(shape.wrapped);
|
|
11
14
|
if (!map) {
|
|
@@ -120,6 +123,9 @@ function propagateFaceTagsFromEvolution(evolution, inputs, result) {
|
|
|
120
123
|
}
|
|
121
124
|
const shapeColorStore = /* @__PURE__ */ new WeakMap();
|
|
122
125
|
const faceColorStore = /* @__PURE__ */ new WeakMap();
|
|
126
|
+
function hasColorMetadata(shape) {
|
|
127
|
+
return shapeColorStore.has(shape.wrapped) || faceColorStore.has(shape.wrapped);
|
|
128
|
+
}
|
|
123
129
|
function getFaceColorMap(shape) {
|
|
124
130
|
let map = faceColorStore.get(shape.wrapped);
|
|
125
131
|
if (!map) {
|
|
@@ -220,6 +226,10 @@ function castToShape3D(shape, errorCode, errorMsg) {
|
|
|
220
226
|
return ok(wrapped);
|
|
221
227
|
}
|
|
222
228
|
function collectInputFaceHashes(inputs) {
|
|
229
|
+
const hasMetadata = inputs.some(
|
|
230
|
+
(s) => getFaceOrigins(s) !== void 0 || hasFaceTags(s) || hasColorMetadata(s)
|
|
231
|
+
);
|
|
232
|
+
if (!hasMetadata) return [];
|
|
223
233
|
const hashes = [];
|
|
224
234
|
for (const input of inputs) {
|
|
225
235
|
const faces = getKernel().iterShapes(input.wrapped, "face");
|
|
@@ -229,7 +239,7 @@ function collectInputFaceHashes(inputs) {
|
|
|
229
239
|
}
|
|
230
240
|
return hashes;
|
|
231
241
|
}
|
|
232
|
-
function fuse(a, b, { optimisation = "none", simplify = false, signal } = {}) {
|
|
242
|
+
function fuse(a, b, { optimisation = "none", simplify = false, signal, fuzzyValue } = {}) {
|
|
233
243
|
if (signal?.aborted) throw signal.reason;
|
|
234
244
|
const checkA = validateShape3D(a, "fuse: first operand");
|
|
235
245
|
if (isErr(checkA)) return checkA;
|
|
@@ -241,7 +251,7 @@ function fuse(a, b, { optimisation = "none", simplify = false, signal } = {}) {
|
|
|
241
251
|
b.wrapped,
|
|
242
252
|
inputFaceHashes,
|
|
243
253
|
HASH_CODE_MAX,
|
|
244
|
-
{ optimisation, simplify }
|
|
254
|
+
{ optimisation, simplify, fuzzyValue }
|
|
245
255
|
);
|
|
246
256
|
const fuseResult = castToShape3D(resultShape, "FUSE_NOT_3D", "Fuse did not produce a 3D shape");
|
|
247
257
|
if (fuseResult.ok) {
|
|
@@ -251,7 +261,7 @@ function fuse(a, b, { optimisation = "none", simplify = false, signal } = {}) {
|
|
|
251
261
|
}
|
|
252
262
|
return fuseResult;
|
|
253
263
|
}
|
|
254
|
-
function cut(base, tool, { optimisation = "none", simplify = false, signal } = {}) {
|
|
264
|
+
function cut(base, tool, { optimisation = "none", simplify = false, signal, fuzzyValue } = {}) {
|
|
255
265
|
if (signal?.aborted) throw signal.reason;
|
|
256
266
|
const checkBase = validateShape3D(base, "cut: base");
|
|
257
267
|
if (isErr(checkBase)) return checkBase;
|
|
@@ -263,7 +273,7 @@ function cut(base, tool, { optimisation = "none", simplify = false, signal } = {
|
|
|
263
273
|
tool.wrapped,
|
|
264
274
|
inputFaceHashes,
|
|
265
275
|
HASH_CODE_MAX,
|
|
266
|
-
{ optimisation, simplify }
|
|
276
|
+
{ optimisation, simplify, fuzzyValue }
|
|
267
277
|
);
|
|
268
278
|
const cutResult = castToShape3D(resultShape, "CUT_NOT_3D", "Cut did not produce a 3D shape");
|
|
269
279
|
if (cutResult.ok) {
|
|
@@ -273,7 +283,7 @@ function cut(base, tool, { optimisation = "none", simplify = false, signal } = {
|
|
|
273
283
|
}
|
|
274
284
|
return cutResult;
|
|
275
285
|
}
|
|
276
|
-
function intersect(a, b, { simplify = false, signal } = {}) {
|
|
286
|
+
function intersect(a, b, { simplify = false, signal, fuzzyValue } = {}) {
|
|
277
287
|
if (signal?.aborted) throw signal.reason;
|
|
278
288
|
const checkA = validateShape3D(a, "intersect: first operand");
|
|
279
289
|
if (isErr(checkA)) return checkA;
|
|
@@ -285,7 +295,7 @@ function intersect(a, b, { simplify = false, signal } = {}) {
|
|
|
285
295
|
b.wrapped,
|
|
286
296
|
inputFaceHashes,
|
|
287
297
|
HASH_CODE_MAX,
|
|
288
|
-
{ simplify }
|
|
298
|
+
{ simplify, fuzzyValue }
|
|
289
299
|
);
|
|
290
300
|
const intResult = castToShape3D(
|
|
291
301
|
resultShape,
|
|
@@ -299,7 +309,7 @@ function intersect(a, b, { simplify = false, signal } = {}) {
|
|
|
299
309
|
}
|
|
300
310
|
return intResult;
|
|
301
311
|
}
|
|
302
|
-
function fuseAllPairwise(shapes, start, end, optimisation, simplify, isTopLevel, signal) {
|
|
312
|
+
function fuseAllPairwise(shapes, start, end, optimisation, simplify, isTopLevel, signal, fuzzyValue) {
|
|
303
313
|
if (signal?.aborted) throw signal.reason;
|
|
304
314
|
const count = end - start;
|
|
305
315
|
if (count === 1) return ok(shapes[start]);
|
|
@@ -307,21 +317,47 @@ function fuseAllPairwise(shapes, start, end, optimisation, simplify, isTopLevel,
|
|
|
307
317
|
return fuse(shapes[start], shapes[start + 1], {
|
|
308
318
|
optimisation,
|
|
309
319
|
simplify: isTopLevel ? simplify : false,
|
|
320
|
+
fuzzyValue,
|
|
310
321
|
...signal ? { signal } : {}
|
|
311
322
|
});
|
|
312
323
|
}
|
|
313
324
|
const mid = start + Math.ceil(count / 2);
|
|
314
|
-
const leftResult = fuseAllPairwise(
|
|
325
|
+
const leftResult = fuseAllPairwise(
|
|
326
|
+
shapes,
|
|
327
|
+
start,
|
|
328
|
+
mid,
|
|
329
|
+
optimisation,
|
|
330
|
+
simplify,
|
|
331
|
+
false,
|
|
332
|
+
signal,
|
|
333
|
+
fuzzyValue
|
|
334
|
+
);
|
|
315
335
|
if (isErr(leftResult)) return leftResult;
|
|
316
|
-
const rightResult = fuseAllPairwise(
|
|
336
|
+
const rightResult = fuseAllPairwise(
|
|
337
|
+
shapes,
|
|
338
|
+
mid,
|
|
339
|
+
end,
|
|
340
|
+
optimisation,
|
|
341
|
+
simplify,
|
|
342
|
+
false,
|
|
343
|
+
signal,
|
|
344
|
+
fuzzyValue
|
|
345
|
+
);
|
|
317
346
|
if (isErr(rightResult)) return rightResult;
|
|
318
347
|
return fuse(leftResult.value, rightResult.value, {
|
|
319
348
|
optimisation,
|
|
320
349
|
simplify: isTopLevel ? simplify : false,
|
|
350
|
+
fuzzyValue,
|
|
321
351
|
...signal ? { signal } : {}
|
|
322
352
|
});
|
|
323
353
|
}
|
|
324
|
-
function fuseAll(shapes, {
|
|
354
|
+
function fuseAll(shapes, {
|
|
355
|
+
optimisation = "none",
|
|
356
|
+
simplify = false,
|
|
357
|
+
strategy = "native",
|
|
358
|
+
signal,
|
|
359
|
+
fuzzyValue
|
|
360
|
+
} = {}) {
|
|
325
361
|
if (signal?.aborted) throw signal.reason;
|
|
326
362
|
if (shapes.length === 0)
|
|
327
363
|
return err(validationError("FUSE_ALL_EMPTY", "fuseAll requires at least one shape"));
|
|
@@ -333,7 +369,7 @@ function fuseAll(shapes, { optimisation = "none", simplify = false, strategy = "
|
|
|
333
369
|
if (strategy === "native") {
|
|
334
370
|
const result = getKernel().fuseAll(
|
|
335
371
|
shapes.map((s) => s.wrapped),
|
|
336
|
-
{ optimisation, simplify, strategy, ...signal ? { signal } : {} }
|
|
372
|
+
{ optimisation, simplify, strategy, fuzzyValue, ...signal ? { signal } : {} }
|
|
337
373
|
);
|
|
338
374
|
const fuseAllResult = castToShape3D(
|
|
339
375
|
result,
|
|
@@ -345,9 +381,18 @@ function fuseAll(shapes, { optimisation = "none", simplify = false, strategy = "
|
|
|
345
381
|
}
|
|
346
382
|
return fuseAllResult;
|
|
347
383
|
}
|
|
348
|
-
return fuseAllPairwise(
|
|
384
|
+
return fuseAllPairwise(
|
|
385
|
+
shapes,
|
|
386
|
+
0,
|
|
387
|
+
shapes.length,
|
|
388
|
+
optimisation,
|
|
389
|
+
simplify,
|
|
390
|
+
true,
|
|
391
|
+
signal,
|
|
392
|
+
fuzzyValue
|
|
393
|
+
);
|
|
349
394
|
}
|
|
350
|
-
function cutAll(base, tools, { optimisation = "none", simplify = false, signal } = {}) {
|
|
395
|
+
function cutAll(base, tools, { optimisation = "none", simplify = false, signal, fuzzyValue } = {}) {
|
|
351
396
|
if (signal?.aborted) throw signal.reason;
|
|
352
397
|
if (tools.length === 0) return ok(base);
|
|
353
398
|
const checkBase = validateShape3D(base, "cutAll: base");
|
|
@@ -364,7 +409,7 @@ function cutAll(base, tools, { optimisation = "none", simplify = false, signal }
|
|
|
364
409
|
toolCompound,
|
|
365
410
|
inputFaceHashes,
|
|
366
411
|
HASH_CODE_MAX,
|
|
367
|
-
{ optimisation, simplify }
|
|
412
|
+
{ optimisation, simplify, fuzzyValue }
|
|
368
413
|
);
|
|
369
414
|
toolCompound.delete();
|
|
370
415
|
const cutAllResult = castToShape3D(
|
|
@@ -549,23 +594,25 @@ function slice(shape, planes, options = {}) {
|
|
|
549
594
|
}
|
|
550
595
|
export {
|
|
551
596
|
propagateColorsFromEvolution as a,
|
|
552
|
-
|
|
597
|
+
hasColorMetadata as b,
|
|
553
598
|
cut as c,
|
|
554
|
-
|
|
555
|
-
|
|
599
|
+
sectionToFace as d,
|
|
600
|
+
slice as e,
|
|
556
601
|
fuse as f,
|
|
557
|
-
|
|
558
|
-
|
|
602
|
+
split as g,
|
|
603
|
+
hasFaceTags as h,
|
|
559
604
|
intersect as i,
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
605
|
+
fuseAll as j,
|
|
606
|
+
cutAll as k,
|
|
607
|
+
colorFaces as l,
|
|
608
|
+
colorShape as m,
|
|
609
|
+
findFacesByTag as n,
|
|
610
|
+
getFaceColor as o,
|
|
566
611
|
propagateFaceTagsFromEvolution as p,
|
|
567
|
-
|
|
568
|
-
|
|
612
|
+
getFaceTags as q,
|
|
613
|
+
getShapeColor as r,
|
|
569
614
|
section as s,
|
|
570
|
-
|
|
615
|
+
getTagMetadata as t,
|
|
616
|
+
setTagMetadata as u,
|
|
617
|
+
tagFaces as v
|
|
571
618
|
};
|
package/dist/brepjs.cjs
CHANGED
|
@@ -45,30 +45,30 @@ var __callDispose = (stack, error, hasError) => {
|
|
|
45
45
|
return next();
|
|
46
46
|
};
|
|
47
47
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
48
|
-
const shapeTypes = require("./shapeTypes-
|
|
48
|
+
const shapeTypes = require("./shapeTypes-CBhj5o2y.cjs");
|
|
49
49
|
const errors = require("./errors-HU7EpHt3.cjs");
|
|
50
50
|
const vecOps = require("./vecOps-CjRL1jau.cjs");
|
|
51
|
-
const Blueprint = require("./Blueprint-
|
|
52
|
-
const loft$2 = require("./loft-
|
|
53
|
-
const operations = require("./operations-
|
|
54
|
-
const boolean2D = require("./boolean2D-
|
|
51
|
+
const Blueprint = require("./Blueprint-C_ny87tf.cjs");
|
|
52
|
+
const loft$2 = require("./loft-B0VRwdIS.cjs");
|
|
53
|
+
const operations = require("./operations-B1FSxszL.cjs");
|
|
54
|
+
const boolean2D = require("./boolean2D-C_WtQSZM.cjs");
|
|
55
55
|
const _2d = require("./2d.cjs");
|
|
56
|
-
const helpers = require("./helpers-
|
|
56
|
+
const helpers = require("./helpers-C-dHgprx.cjs");
|
|
57
57
|
const io = require("./io.cjs");
|
|
58
|
-
const drawFns = require("./drawFns-
|
|
58
|
+
const drawFns = require("./drawFns-BIoGsiXr.cjs");
|
|
59
59
|
const types = require("./types-CA_xrgDq.cjs");
|
|
60
60
|
const vectors = require("./vectors-BwRTfFd1.cjs");
|
|
61
|
-
const shapeFns = require("./shapeFns-
|
|
62
|
-
const booleanFns = require("./booleanFns-
|
|
63
|
-
const topology = require("./topology-
|
|
64
|
-
const curveFns = require("./curveFns-
|
|
65
|
-
const faceFns = require("./faceFns-
|
|
66
|
-
const meshFns = require("./meshFns-
|
|
67
|
-
const measurement = require("./measurement-
|
|
68
|
-
const surfaceBuilders = require("./surfaceBuilders-
|
|
61
|
+
const shapeFns = require("./shapeFns-O9Ont1Dy.cjs");
|
|
62
|
+
const booleanFns = require("./booleanFns-G0j8iAZV.cjs");
|
|
63
|
+
const topology = require("./topology-ChR-we6s.cjs");
|
|
64
|
+
const curveFns = require("./curveFns-BsxQJoWM.cjs");
|
|
65
|
+
const faceFns = require("./faceFns-A6VJdsJc.cjs");
|
|
66
|
+
const meshFns = require("./meshFns-ClCp7nft.cjs");
|
|
67
|
+
const measurement = require("./measurement-D5XQSvln.cjs");
|
|
68
|
+
const surfaceBuilders = require("./surfaceBuilders-DwMD54OR.cjs");
|
|
69
69
|
const query = require("./query.cjs");
|
|
70
70
|
const result = require("./result.cjs");
|
|
71
|
-
const cornerFinder = require("./cornerFinder-
|
|
71
|
+
const cornerFinder = require("./cornerFinder-56x6NzUP.cjs");
|
|
72
72
|
const worker = require("./worker.cjs");
|
|
73
73
|
function supportsProjection(kernel) {
|
|
74
74
|
return "projectShape" in kernel;
|
|
@@ -1355,8 +1355,10 @@ function checkInterference(shape1, shape2, tolerance = 1e-6) {
|
|
|
1355
1355
|
}
|
|
1356
1356
|
function checkAllInterferences(shapes, tolerance = 1e-6) {
|
|
1357
1357
|
const pairs = [];
|
|
1358
|
+
const boxes = shapes.map((s) => shapeFns.getBounds(s));
|
|
1358
1359
|
shapes.forEach((si, i) => {
|
|
1359
1360
|
for (let j = i + 1; j < shapes.length; j++) {
|
|
1361
|
+
if (aabbDisjoint(boxes[i], boxes[j], tolerance)) continue;
|
|
1360
1362
|
const result2 = errors.unwrap(checkInterference(si, shapes[j], tolerance));
|
|
1361
1363
|
if (result2.hasInterference) {
|
|
1362
1364
|
pairs.push({ i, j, result: result2 });
|
|
@@ -1365,6 +1367,9 @@ function checkAllInterferences(shapes, tolerance = 1e-6) {
|
|
|
1365
1367
|
});
|
|
1366
1368
|
return pairs;
|
|
1367
1369
|
}
|
|
1370
|
+
function aabbDisjoint(a, b, tolerance) {
|
|
1371
|
+
return a.xMax + tolerance < b.xMin || b.xMax + tolerance < a.xMin || a.yMax + tolerance < b.yMin || b.yMax + tolerance < a.yMin || a.zMax + tolerance < b.zMin || b.zMax + tolerance < a.zMin;
|
|
1372
|
+
}
|
|
1368
1373
|
function parseEntities(text) {
|
|
1369
1374
|
const lines = text.split(/\r?\n/);
|
|
1370
1375
|
const entities = [];
|
|
@@ -1838,6 +1843,10 @@ function validateNotNull(shape2, label) {
|
|
|
1838
1843
|
return errors.ok(void 0);
|
|
1839
1844
|
}
|
|
1840
1845
|
function collectInputFaceHashes(inputs) {
|
|
1846
|
+
const hasMetadata = inputs.some((s) => {
|
|
1847
|
+
return shapeFns.getFaceOrigins(s) !== void 0 || booleanFns.hasFaceTags(s) || booleanFns.hasColorMetadata(s);
|
|
1848
|
+
});
|
|
1849
|
+
if (!hasMetadata) return [];
|
|
1841
1850
|
const hashes = [];
|
|
1842
1851
|
for (const input of inputs) {
|
|
1843
1852
|
const faces = shapeTypes.getKernel().iterShapes(input.wrapped, "face");
|