brepjs 18.119.2 → 18.119.4

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.
Files changed (100) hide show
  1. package/dist/2d/blueprints/blueprints.d.ts +3 -0
  2. package/dist/2d/blueprints/compoundBlueprint.d.ts +3 -0
  3. package/dist/2d/blueprints/lib.d.ts +6 -0
  4. package/dist/2d/lib/curve2D.d.ts +6 -1
  5. package/dist/2d/lib/curve2dFns.d.ts +6 -1
  6. package/dist/2d.cjs +7 -7
  7. package/dist/2d.js +7 -7
  8. package/dist/{adjacencyFns-BdM5p58J.js → adjacencyFns-DLityMyV.js} +2 -2
  9. package/dist/{adjacencyFns-Brrc7jlS.cjs → adjacencyFns-DSxuQYnb.cjs} +2 -2
  10. package/dist/{blueprint-DJJo8WkI.js → blueprint-DEMSX-hc.js} +37 -10
  11. package/dist/{blueprint-DTNT4qYJ.cjs → blueprint-DUnNPwQL.cjs} +43 -10
  12. package/dist/{blueprintFns-CcpboZ80.js → blueprintFns-DSj4RTjU.js} +9 -4
  13. package/dist/{blueprintFns-2XDZfCxX.cjs → blueprintFns-Dg8V99O9.cjs} +9 -4
  14. package/dist/{blueprintSketcher-DDPyypmC.js → blueprintSketcher-gMuUUPb-.js} +185 -54
  15. package/dist/{blueprintSketcher-C0EXFVb2.cjs → blueprintSketcher-gXVPrPlj.cjs} +192 -61
  16. package/dist/{boolean2D-Ddfo_dd0.cjs → boolean2D-BpmxQ1AH.cjs} +5 -5
  17. package/dist/{boolean2D-C_PVz8xT.js → boolean2D-DKT0BgZs.js} +5 -5
  18. package/dist/brepjs.cjs +105 -92
  19. package/dist/brepjs.js +39 -27
  20. package/dist/{cameraFns-Czr5vABD.cjs → cameraFns-2-haLzLi.cjs} +4 -4
  21. package/dist/{cameraFns-D9tdBYLM.js → cameraFns-CG_J66Hl.js} +4 -4
  22. package/dist/core.cjs +12 -11
  23. package/dist/core.js +4 -3
  24. package/dist/{cornerFinder-Cqg-Dz74.js → cornerFinder-CPFM7bA0.js} +1 -1
  25. package/dist/{cornerFinder-DETRDOMz.cjs → cornerFinder-mfsUMi5g.cjs} +1 -1
  26. package/dist/{curveFns-RENXKp64.js → curveFns-DX13KRh2.js} +2 -2
  27. package/dist/{curveFns-D7utcbnf.cjs → curveFns-GmFnqNo3.cjs} +2 -2
  28. package/dist/{drawFns-D9Rf4foW.cjs → drawFns-CI6CpqO8.cjs} +35 -16
  29. package/dist/{drawFns-B9HbtAoc.js → drawFns-CrfBz_wj.js} +35 -16
  30. package/dist/{errors-B3CDG537.js → errors-MHLiNE-C.js} +1 -92
  31. package/dist/{errors-CJU8CHng.cjs → errors-RHkKO5bZ.cjs} +0 -103
  32. package/dist/{faceFns-CPswi9Cm.cjs → faceFns-BK4r7Dxk.cjs} +3 -3
  33. package/dist/{faceFns-CB6uzvOg.js → faceFns-DJj9Nb6T.js} +3 -3
  34. package/dist/{healingFns-BFTYLiAm.js → healingFns-DxcRyVCG.js} +5 -6
  35. package/dist/{healingFns-bhMxTTqw.cjs → healingFns-Hx4oTlq8.cjs} +27 -28
  36. package/dist/{helpers-Cu4ag5bh.cjs → helpers-BfkBvokP.cjs} +8 -24
  37. package/dist/{helpers-BiN4qQZP.js → helpers-Du_OdHuy.js} +9 -25
  38. package/dist/{importFns-X8vBhZI2.js → importFns-DqxAZFb-.js} +3 -3
  39. package/dist/{importFns-DS4J1xLv.cjs → importFns-pr-r5qiV.cjs} +3 -3
  40. package/dist/io.cjs +2 -2
  41. package/dist/io.js +2 -2
  42. package/dist/{loftFns-ChHjzUK-.cjs → loftFns-BdpZ8FMN.cjs} +2 -125
  43. package/dist/{loftFns-BF5X7ltI.js → loftFns-BeGJ6dxx.js} +4 -109
  44. package/dist/{measureFns-B5Zzg1qM.cjs → measureFns-CJGrmhHT.cjs} +4 -4
  45. package/dist/{measureFns-CC7HhAH3.js → measureFns-CMnbcUZC.js} +4 -4
  46. package/dist/measurement.cjs +1 -1
  47. package/dist/measurement.js +1 -1
  48. package/dist/{meshFns-D57Fyqyf.js → meshFns-Cs5EBsf7.js} +4 -4
  49. package/dist/{meshFns-CaXmWmhe.cjs → meshFns-Dqf5QBhQ.cjs} +5 -5
  50. package/dist/operations.cjs +2 -2
  51. package/dist/operations.js +2 -2
  52. package/dist/originTrackingFns-DZmdiQ-O.js +203 -0
  53. package/dist/originTrackingFns-fpEgTIwV.cjs +226 -0
  54. package/dist/{planeOps-Cp6GQ23-.js → planeOps-CQahLrCx.js} +1 -1
  55. package/dist/{planeOps-Cr25KWWA.cjs → planeOps-VlFxtvzY.cjs} +1 -1
  56. package/dist/primitiveFns-B_rflH83.cjs +773 -0
  57. package/dist/primitiveFns-Cxo3xDKY.js +558 -0
  58. package/dist/projection.cjs +1 -1
  59. package/dist/projection.js +1 -1
  60. package/dist/query.cjs +2 -2
  61. package/dist/query.js +2 -2
  62. package/dist/{refResolveFns-3bw9-U-e.js → refResolveFns-BbRLD8LA.js} +6 -6
  63. package/dist/{refResolveFns-BxmgIhQM.cjs → refResolveFns-CVDLwh12.cjs} +6 -6
  64. package/dist/result.cjs +1 -1
  65. package/dist/result.js +1 -1
  66. package/dist/rolldown-runtime-DakpK96I.cjs +43 -0
  67. package/dist/shapeFns-BTFx-os7.js +43 -0
  68. package/dist/shapeFns-D_5TgiUi.cjs +84 -0
  69. package/dist/shapeRef.cjs +1 -1
  70. package/dist/shapeRef.js +1 -1
  71. package/dist/{shapeTypes-Bpsu5KJO.cjs → shapeTypes-CkcIL7zv.cjs} +1 -222
  72. package/dist/{shapeTypes-CnKFSfDT.js → shapeTypes-t49f64Dx.js} +2 -139
  73. package/dist/sketching/drawing.d.ts +9 -1
  74. package/dist/sketching.cjs +3 -3
  75. package/dist/sketching.js +3 -3
  76. package/dist/{solidBuilders-I8_V8qqU.js → solidBuilders-DTgqQC3W.js} +310 -8
  77. package/dist/{solidBuilders-Bp7lQW62.cjs → solidBuilders-IiIzjKAr.cjs} +401 -15
  78. package/dist/{surfaceBuilders-D8_08oOR.cjs → surfaceBuilders-Biqx51el.cjs} +6 -5
  79. package/dist/{surfaceBuilders-BNR7yMQO.js → surfaceBuilders-BryY-i0F.js} +4 -3
  80. package/dist/text.cjs +2 -2
  81. package/dist/text.js +2 -2
  82. package/dist/{textBlueprints-B5zcLGvJ.cjs → textBlueprints-BY0FEg59.cjs} +138 -51
  83. package/dist/{textBlueprints-igbNvKcd.js → textBlueprints-ZzYg3XTS.js} +116 -11
  84. package/dist/{textMetrics-CJvtpbc3.js → textMetrics-Diakbtem.js} +2 -2
  85. package/dist/{textMetrics-08fF0QNf.cjs → textMetrics-f5yXR4OG.cjs} +2 -2
  86. package/dist/{threadFns-CqSMNyTZ.js → threadFns-BOtXTHZ9.js} +8 -8
  87. package/dist/{threadFns-Co6vWEWx.cjs → threadFns-DRrk9Qod.cjs} +8 -8
  88. package/dist/topology.cjs +9 -9
  89. package/dist/topology.js +9 -9
  90. package/dist/{topologyQueryFns-C3fhJndG.cjs → topologyQueryFns-Bia7o8l_.cjs} +97 -6
  91. package/dist/{topologyQueryFns-DNqT88yx.js → topologyQueryFns-BkQ6Q7gN.js} +93 -2
  92. package/dist/validityTypes-DiTgeCD9.js +129 -0
  93. package/dist/validityTypes-ZGMVlv7b.cjs +200 -0
  94. package/dist/vectors.cjs +1 -1
  95. package/dist/vectors.js +1 -1
  96. package/package.json +8 -8
  97. package/dist/primitiveFns-CRy_CUVg.cjs +0 -492
  98. package/dist/primitiveFns-DCIH-SBm.js +0 -331
  99. package/dist/shapeFns-BrHFNLMA.js +0 -771
  100. package/dist/shapeFns-qm9VRo4i.cjs +0 -962
@@ -1,13 +1,315 @@
1
- const require_shapeTypes = require("./shapeTypes-Bpsu5KJO.cjs");
2
- const require_errors = require("./errors-CJU8CHng.cjs");
3
- const require_topologyQueryFns = require("./topologyQueryFns-C3fhJndG.cjs");
1
+ const require_shapeTypes = require("./shapeTypes-CkcIL7zv.cjs");
2
+ const require_errors = require("./errors-RHkKO5bZ.cjs");
3
+ const require_topologyQueryFns = require("./topologyQueryFns-Bia7o8l_.cjs");
4
4
  const require_constants = require("./constants-BOVyEYGH.cjs");
5
5
  const require_vecOps = require("./vecOps-CCnJt-yH.cjs");
6
- const require_planeOps = require("./planeOps-Cr25KWWA.cjs");
7
- const require_faceFns = require("./faceFns-CPswi9Cm.cjs");
8
- const require_shapeFns = require("./shapeFns-qm9VRo4i.cjs");
6
+ const require_planeOps = require("./planeOps-VlFxtvzY.cjs");
7
+ const require_faceFns = require("./faceFns-BK4r7Dxk.cjs");
8
+ const require_originTrackingFns = require("./originTrackingFns-fpEgTIwV.cjs");
9
9
  const require_arrayAccess = require("./arrayAccess-e4H9cBfh.cjs");
10
- const require_surfaceBuilders = require("./surfaceBuilders-D8_08oOR.cjs");
10
+ const require_surfaceBuilders = require("./surfaceBuilders-Biqx51el.cjs");
11
+ //#region src/topology/metadata/faceTagFns.ts
12
+ var shapeTagStore = /* @__PURE__ */ new WeakMap();
13
+ var tagMetadataStore = /* @__PURE__ */ new WeakMap();
14
+ /** O(1) check whether a shape has any face tags attached. */
15
+ function hasFaceTags(shape) {
16
+ return shapeTagStore.has(shape.wrapped);
17
+ }
18
+ function getTagMap(shape) {
19
+ let map = shapeTagStore.get(shape.wrapped);
20
+ if (!map) {
21
+ map = /* @__PURE__ */ new Map();
22
+ shapeTagStore.set(shape.wrapped, map);
23
+ }
24
+ return map;
25
+ }
26
+ function getMetaMap(shape) {
27
+ let map = tagMetadataStore.get(shape.wrapped);
28
+ if (!map) {
29
+ map = /* @__PURE__ */ new Map();
30
+ tagMetadataStore.set(shape.wrapped, map);
31
+ }
32
+ return map;
33
+ }
34
+ /**
35
+ * Tag selected faces with a string name.
36
+ *
37
+ * @param shape - The shape containing the faces.
38
+ * @param selector - Array of faces, or a predicate function.
39
+ * @param tag - The tag name to assign.
40
+ * @returns The same shape (tags are stored externally).
41
+ */
42
+ function tagFaces(shape, selector, tag) {
43
+ const faces = Array.isArray(selector) ? selector : require_topologyQueryFns.getFaces(shape).filter(selector);
44
+ const tagMap = getTagMap(shape);
45
+ const existing = tagMap.get(tag) ?? /* @__PURE__ */ new Set();
46
+ for (const face of faces) existing.add(require_shapeTypes.getKernel().hashCode(face.wrapped, require_constants.HASH_CODE_MAX));
47
+ tagMap.set(tag, existing);
48
+ return shape;
49
+ }
50
+ /**
51
+ * Find all faces on a shape that have the given tag.
52
+ *
53
+ * Checks both direct tags and propagated origins (for faces that
54
+ * survived boolean/modifier operations).
55
+ */
56
+ function findFacesByTag(shape, tag) {
57
+ const tagMap = shapeTagStore.get(shape.wrapped);
58
+ if (!tagMap) return [];
59
+ const hashes = tagMap.get(tag);
60
+ if (!hashes || hashes.size === 0) return [];
61
+ const result = [];
62
+ for (const face of require_topologyQueryFns.getFaces(shape)) {
63
+ const hash = require_shapeTypes.getKernel().hashCode(face.wrapped, require_constants.HASH_CODE_MAX);
64
+ if (hashes.has(hash)) result.push(face);
65
+ }
66
+ return result;
67
+ }
68
+ /**
69
+ * Get all tags and their associated faces on a shape.
70
+ */
71
+ function getFaceTags(shape) {
72
+ const result = /* @__PURE__ */ new Map();
73
+ const tagMap = shapeTagStore.get(shape.wrapped);
74
+ if (!tagMap) return result;
75
+ const faces = require_topologyQueryFns.getFaces(shape);
76
+ const faceByHash = /* @__PURE__ */ new Map();
77
+ for (const face of faces) faceByHash.set(require_shapeTypes.getKernel().hashCode(face.wrapped, require_constants.HASH_CODE_MAX), face);
78
+ for (const [tag, hashes] of tagMap) {
79
+ const taggedFaces = [];
80
+ for (const hash of hashes) {
81
+ const face = faceByHash.get(hash);
82
+ if (face) taggedFaces.push(face);
83
+ }
84
+ if (taggedFaces.length > 0) result.set(tag, taggedFaces);
85
+ }
86
+ return result;
87
+ }
88
+ /**
89
+ * Store arbitrary metadata for a tag on a shape.
90
+ */
91
+ function setTagMetadata(shape, tag, metadata) {
92
+ getMetaMap(shape).set(tag, metadata);
93
+ return shape;
94
+ }
95
+ /**
96
+ * Retrieve metadata for a tag on a shape.
97
+ */
98
+ function getTagMetadata(shape, tag) {
99
+ return tagMetadataStore.get(shape.wrapped)?.get(tag);
100
+ }
101
+ function addTagToResult(resultTagMap, tag, hash) {
102
+ const set = resultTagMap.get(tag) ?? /* @__PURE__ */ new Set();
103
+ set.add(hash);
104
+ resultTagMap.set(tag, set);
105
+ }
106
+ /**
107
+ * Propagate face tags from input shapes to a result shape using a
108
+ * kernel-provided ShapeEvolution record (no direct kernel op access needed).
109
+ */
110
+ function propagateFaceTagsFromEvolution(evolution, inputs, result) {
111
+ const resultTagMap = getTagMap(result);
112
+ for (const input of inputs) {
113
+ const inputTagMap = shapeTagStore.get(input.wrapped);
114
+ if (!inputTagMap) continue;
115
+ const hashToTags = /* @__PURE__ */ new Map();
116
+ for (const [tag, hashes] of inputTagMap) for (const hash of hashes) {
117
+ const tags = hashToTags.get(hash) ?? [];
118
+ tags.push(tag);
119
+ hashToTags.set(hash, tags);
120
+ }
121
+ for (const [hash, tags] of hashToTags) {
122
+ if (evolution.deleted.has(hash)) continue;
123
+ const modifiedHashes = evolution.modified.get(hash);
124
+ const targetHashes = modifiedHashes && modifiedHashes.length > 0 ? modifiedHashes : [hash];
125
+ for (const targetHash of targetHashes) for (const tag of tags) addTagToResult(resultTagMap, tag, targetHash);
126
+ }
127
+ const inputMetaMap = tagMetadataStore.get(input.wrapped);
128
+ if (inputMetaMap) {
129
+ const resultMetaMap = getMetaMap(result);
130
+ for (const [tag, meta] of inputMetaMap) if (!resultMetaMap.has(tag)) resultMetaMap.set(tag, meta);
131
+ }
132
+ }
133
+ }
134
+ //#endregion
135
+ //#region src/topology/metadata/colorFns.ts
136
+ var shapeColorStore = /* @__PURE__ */ new WeakMap();
137
+ var faceColorStore = /* @__PURE__ */ new WeakMap();
138
+ /** O(1) check whether a shape has any color metadata (shape or face level). */
139
+ function hasColorMetadata(shape) {
140
+ return shapeColorStore.has(shape.wrapped) || faceColorStore.has(shape.wrapped);
141
+ }
142
+ function getFaceColorMap(shape) {
143
+ let map = faceColorStore.get(shape.wrapped);
144
+ if (!map) {
145
+ map = /* @__PURE__ */ new Map();
146
+ faceColorStore.set(shape.wrapped, map);
147
+ }
148
+ return map;
149
+ }
150
+ function parseColor(input) {
151
+ if (typeof input === "string") {
152
+ let hex = input.startsWith("#") ? input.slice(1) : input;
153
+ if (hex.length === 3) hex = hex.charAt(0) + hex.charAt(0) + hex.charAt(1) + hex.charAt(1) + hex.charAt(2) + hex.charAt(2);
154
+ return [
155
+ parseInt(hex.slice(0, 2), 16) / 255,
156
+ parseInt(hex.slice(2, 4), 16) / 255,
157
+ parseInt(hex.slice(4, 6), 16) / 255,
158
+ 1
159
+ ];
160
+ }
161
+ if (input.length === 3) return [
162
+ input[0],
163
+ input[1],
164
+ input[2],
165
+ 1
166
+ ];
167
+ return [
168
+ input[0],
169
+ input[1],
170
+ input[2],
171
+ input[3]
172
+ ];
173
+ }
174
+ /**
175
+ * Set a whole-shape color (stored externally via WeakMap).
176
+ * Returns the same shape reference.
177
+ */
178
+ function colorShape(shape, color) {
179
+ shapeColorStore.set(shape.wrapped, parseColor(color));
180
+ return shape;
181
+ }
182
+ /**
183
+ * Set per-face colors on a shape.
184
+ * Returns the same shape reference.
185
+ */
186
+ function colorFaces(shape, faces, color) {
187
+ const parsed = parseColor(color);
188
+ const map = getFaceColorMap(shape);
189
+ for (const face of faces) map.set(require_shapeTypes.getKernel().hashCode(face.wrapped, require_constants.HASH_CODE_MAX), parsed);
190
+ return shape;
191
+ }
192
+ /**
193
+ * Get the whole-shape color, or undefined if none set.
194
+ */
195
+ function getShapeColor(shape) {
196
+ return shapeColorStore.get(shape.wrapped);
197
+ }
198
+ /**
199
+ * Get the color of a specific face, or undefined if none set.
200
+ */
201
+ function getFaceColor(shape, face) {
202
+ const map = faceColorStore.get(shape.wrapped);
203
+ if (!map) return void 0;
204
+ return map.get(require_shapeTypes.getKernel().hashCode(face.wrapped, require_constants.HASH_CODE_MAX));
205
+ }
206
+ /**
207
+ * Propagate colors from input shapes to a result shape using a
208
+ * kernel-provided ShapeEvolution record (no direct kernel op access needed).
209
+ */
210
+ function propagateColorsFromEvolution(evolution, inputs, result) {
211
+ for (const input of inputs) {
212
+ const c = shapeColorStore.get(input.wrapped);
213
+ if (c) {
214
+ shapeColorStore.set(result.wrapped, c);
215
+ break;
216
+ }
217
+ }
218
+ const resultFaceMap = getFaceColorMap(result);
219
+ for (const input of inputs) {
220
+ const inputFaceMap = faceColorStore.get(input.wrapped);
221
+ if (!inputFaceMap || inputFaceMap.size === 0) continue;
222
+ for (const [hash, color] of inputFaceMap) {
223
+ if (evolution.deleted.has(hash)) continue;
224
+ const modifiedHashes = evolution.modified.get(hash);
225
+ if (modifiedHashes && modifiedHashes.length > 0) for (const modHash of modifiedHashes) resultFaceMap.set(modHash, color);
226
+ else resultFaceMap.set(hash, color);
227
+ }
228
+ }
229
+ }
230
+ //#endregion
231
+ //#region src/topology/metadata/metadataPropagation.ts
232
+ /**
233
+ * Collect ALL face hashes from input shapes for WithHistory kernel methods.
234
+ *
235
+ * Fast-path: returns empty array when no inputs have any metadata (origins,
236
+ * tags, or colors), avoiding expensive WASM topology exploration.
237
+ */
238
+ /**
239
+ * O(1) check: does a shape carry any propagatable metadata (face origins,
240
+ * tags, or colors)? Lets callers skip both expensive face iteration and
241
+ * metadata-preserving slow paths when there's nothing to preserve.
242
+ */
243
+ function hasAnyMetadata(shape) {
244
+ return require_originTrackingFns.getFaceOrigins(shape) !== void 0 || hasFaceTags(shape) || hasColorMetadata(shape);
245
+ }
246
+ function collectInputFaceHashes(inputs) {
247
+ if (!inputs.some(hasAnyMetadata)) return [];
248
+ const hashes = [];
249
+ for (const input of inputs) hashes.push(...require_topologyQueryFns.subShapeHashes(input, "face"));
250
+ return hashes;
251
+ }
252
+ /**
253
+ * Propagate all metadata (origins, tags, colors) from inputs to result
254
+ * using a kernel-provided ShapeEvolution record.
255
+ *
256
+ * This is the standard pipeline for any operation that returns
257
+ * `{ shape, evolution }` from a WithHistory kernel method.
258
+ */
259
+ function propagateAllMetadata(evolution, inputs, result) {
260
+ require_originTrackingFns.propagateOriginsFromEvolution(evolution, inputs, result);
261
+ propagateFaceTagsFromEvolution(evolution, inputs, result);
262
+ propagateColorsFromEvolution(evolution, inputs, result);
263
+ }
264
+ /**
265
+ * Fallback metadata propagation when no ShapeEvolution is available.
266
+ *
267
+ * Matches result faces to input faces by hash code (and geometric fallback).
268
+ * Used by operations that don't support WithHistory (e.g., native fuseAll).
269
+ *
270
+ * **Limitation:** Only propagates face origins. Face tags and face colors
271
+ * require a ShapeEvolution record to map input→output face hashes, so they
272
+ * are lost through this path. Batch booleans (`fuseAll`, `cutAll`) therefore
273
+ * have weaker metadata guarantees than pairwise booleans (`fuse`, `cut`).
274
+ */
275
+ function propagateMetadataByHash(inputs, result) {
276
+ require_originTrackingFns.propagateOriginsByHash(inputs, result);
277
+ }
278
+ /**
279
+ * Propagate all metadata through a *rigid relocation* (a `locate` re-tag).
280
+ *
281
+ * A relocated shape shares the source's TShape, so its faces correspond 1:1 to
282
+ * the source faces in iteration order — but carry new, location-dependent
283
+ * hashes, so the hash-keyed metadata must be re-keyed rather than left as-is.
284
+ * This synthesizes a 1:1 `modified` evolution (source face hash → moved face
285
+ * hash) and runs the standard propagation pipeline, so origins, tags, and
286
+ * colors all survive a move at `locate` cost (O(faces)), not a full copy.
287
+ *
288
+ * Callers should gate on {@link hasAnyMetadata} first: with no metadata this
289
+ * does pointless face iteration. The face counts always match for a rigid
290
+ * relocation; the length guard is purely defensive.
291
+ */
292
+ function propagateMetadataThroughRelocation(source, moved) {
293
+ const kernel = require_shapeTypes.getKernel();
294
+ const srcFaces = [...kernel.iterShapes(source.wrapped, "face")];
295
+ const movedFaces = [...kernel.iterShapes(moved.wrapped, "face")];
296
+ if (srcFaces.length !== movedFaces.length) return;
297
+ const modified = /* @__PURE__ */ new Map();
298
+ for (let i = 0; i < srcFaces.length; i++) {
299
+ const sf = srcFaces[i];
300
+ const mf = movedFaces[i];
301
+ if (sf === void 0 || mf === void 0) continue;
302
+ modified.set(kernel.hashCode(sf, require_constants.HASH_CODE_MAX), [kernel.hashCode(mf, require_constants.HASH_CODE_MAX)]);
303
+ }
304
+ for (const f of srcFaces) kernel.dispose(f);
305
+ for (const f of movedFaces) kernel.dispose(f);
306
+ propagateAllMetadata({
307
+ modified,
308
+ generated: /* @__PURE__ */ new Map(),
309
+ deleted: /* @__PURE__ */ new Set()
310
+ }, [source], moved);
311
+ }
312
+ //#endregion
11
313
  //#region src/topology/booleanFns.ts
12
314
  /**
13
315
  * Boolean and compound operations — functional replacements for _3DShape boolean methods.
@@ -39,7 +341,7 @@ function fuse(a, b, { optimisation = "none", simplify = false, signal, fuzzyValu
39
341
  simplify,
40
342
  fuzzyValue
41
343
  }), "FUSE_NOT_3D", "Fuse did not produce a 3D shape");
42
- const inputFaceHashes = require_shapeFns.collectInputFaceHashes([a, b]);
344
+ const inputFaceHashes = collectInputFaceHashes([a, b]);
43
345
  const { shape: resultShape, evolution, diagnostics } = require_shapeTypes.getKernel().fuseWithHistory(a.wrapped, b.wrapped, inputFaceHashes, require_constants.HASH_CODE_MAX, {
44
346
  optimisation,
45
347
  simplify,
@@ -58,7 +360,7 @@ function fuse(a, b, { optimisation = "none", simplify = false, signal, fuzzyValu
58
360
  console.warn("brepjs: fuse reported OCCT warnings/errors but produced a shape. Continuing with result.", diagnostics);
59
361
  }
60
362
  const fuseResult = castToShape3D(resultShape, "FUSE_NOT_3D", "Fuse did not produce a 3D shape", "Common causes: overlapping coplanar faces, zero-thickness geometry, or non-manifold input. Try autoHeal() on inputs first.", diagnostics);
61
- if (fuseResult.ok) require_shapeFns.propagateAllMetadata(evolution, [a, b], fuseResult.value);
363
+ if (fuseResult.ok) propagateAllMetadata(evolution, [a, b], fuseResult.value);
62
364
  return fuseResult;
63
365
  }
64
366
  function cut(base, tool, { optimisation = "none", simplify = false, signal, fuzzyValue, unsafe: _unsafe, trackEvolution = true } = {}) {
@@ -72,7 +374,7 @@ function cut(base, tool, { optimisation = "none", simplify = false, signal, fuzz
72
374
  simplify,
73
375
  fuzzyValue
74
376
  }), "CUT_NOT_3D", "Cut did not produce a 3D shape");
75
- const inputFaceHashes = require_shapeFns.collectInputFaceHashes([base, tool]);
377
+ const inputFaceHashes = collectInputFaceHashes([base, tool]);
76
378
  const { shape: resultShape, evolution, diagnostics } = require_shapeTypes.getKernel().cutWithHistory(base.wrapped, tool.wrapped, inputFaceHashes, require_constants.HASH_CODE_MAX, {
77
379
  optimisation,
78
380
  simplify,
@@ -91,7 +393,7 @@ function cut(base, tool, { optimisation = "none", simplify = false, signal, fuzz
91
393
  console.warn("brepjs: cut reported OCCT warnings/errors but produced a shape. Continuing with result.", diagnostics);
92
394
  }
93
395
  const cutResult = castToShape3D(resultShape, "CUT_NOT_3D", "Cut did not produce a 3D shape", "Common causes: tool does not fully intersect the base, or produces a zero-thickness sliver. Ensure the tool extends through the shape.", diagnostics);
94
- if (cutResult.ok) require_shapeFns.propagateAllMetadata(evolution, [base, tool], cutResult.value);
396
+ if (cutResult.ok) propagateAllMetadata(evolution, [base, tool], cutResult.value);
95
397
  return cutResult;
96
398
  }
97
399
  function intersect(a, b, { simplify = false, signal, fuzzyValue, unsafe: _unsafe, trackEvolution = true } = {}) {
@@ -104,7 +406,7 @@ function intersect(a, b, { simplify = false, signal, fuzzyValue, unsafe: _unsafe
104
406
  simplify,
105
407
  fuzzyValue
106
408
  }), "INTERSECT_NOT_3D", "Intersect did not produce a 3D shape");
107
- const inputFaceHashes = require_shapeFns.collectInputFaceHashes([a, b]);
409
+ const inputFaceHashes = collectInputFaceHashes([a, b]);
108
410
  const { shape: resultShape, evolution, diagnostics } = require_shapeTypes.getKernel().intersectWithHistory(a.wrapped, b.wrapped, inputFaceHashes, require_constants.HASH_CODE_MAX, {
109
411
  simplify,
110
412
  fuzzyValue
@@ -121,7 +423,7 @@ function intersect(a, b, { simplify = false, signal, fuzzyValue, unsafe: _unsafe
121
423
  console.warn("brepjs: intersect reported OCCT warnings/errors but produced a shape. Continuing with result.", diagnostics);
122
424
  }
123
425
  const intResult = castToShape3D(resultShape, "INTERSECT_NOT_3D", "Intersect did not produce a 3D shape", "Shapes may not overlap. Verify they share a common volume before intersecting.", diagnostics);
124
- if (intResult.ok) require_shapeFns.propagateAllMetadata(evolution, [a, b], intResult.value);
426
+ if (intResult.ok) propagateAllMetadata(evolution, [a, b], intResult.value);
125
427
  return intResult;
126
428
  }
127
429
  /**
@@ -193,7 +495,7 @@ function fuseAll(shapes, { optimisation = "none", simplify = false, strategy = "
193
495
  fuzzyValue,
194
496
  ...signal ? { signal } : {}
195
497
  }), "FUSE_ALL_NOT_3D", "fuseAll did not produce a 3D shape");
196
- if (fuseAllResult.ok && trackEvolution) require_shapeFns.propagateMetadataByHash(shapes, fuseAllResult.value);
498
+ if (fuseAllResult.ok && trackEvolution) propagateMetadataByHash(shapes, fuseAllResult.value);
197
499
  return fuseAllResult;
198
500
  }
199
501
  const pairwise = fuseAllPairwise(shapes, 0, shapes.length, optimisation, simplify, true, trackEvolution, signal, fuzzyValue);
@@ -215,7 +517,7 @@ function cutAll(base, tools, { optimisation = "none", simplify = false, signal,
215
517
  simplify,
216
518
  fuzzyValue
217
519
  }), "CUT_ALL_NOT_3D", "cutAll did not produce a 3D shape");
218
- if (cutAllResult.ok && trackEvolution) require_shapeFns.propagateMetadataByHash(allInputs, cutAllResult.value);
520
+ if (cutAllResult.ok && trackEvolution) propagateMetadataByHash(allInputs, cutAllResult.value);
219
521
  return cutAllResult;
220
522
  }
221
523
  /**
@@ -660,6 +962,24 @@ Object.defineProperty(exports, "booleanPipeline", {
660
962
  return booleanPipeline;
661
963
  }
662
964
  });
965
+ Object.defineProperty(exports, "collectInputFaceHashes", {
966
+ enumerable: true,
967
+ get: function() {
968
+ return collectInputFaceHashes;
969
+ }
970
+ });
971
+ Object.defineProperty(exports, "colorFaces", {
972
+ enumerable: true,
973
+ get: function() {
974
+ return colorFaces;
975
+ }
976
+ });
977
+ Object.defineProperty(exports, "colorShape", {
978
+ enumerable: true,
979
+ get: function() {
980
+ return colorShape;
981
+ }
982
+ });
663
983
  Object.defineProperty(exports, "cut", {
664
984
  enumerable: true,
665
985
  get: function() {
@@ -672,6 +992,12 @@ Object.defineProperty(exports, "cutAll", {
672
992
  return cutAll;
673
993
  }
674
994
  });
995
+ Object.defineProperty(exports, "findFacesByTag", {
996
+ enumerable: true,
997
+ get: function() {
998
+ return findFacesByTag;
999
+ }
1000
+ });
675
1001
  Object.defineProperty(exports, "fuse", {
676
1002
  enumerable: true,
677
1003
  get: function() {
@@ -684,6 +1010,36 @@ Object.defineProperty(exports, "fuseAll", {
684
1010
  return fuseAll;
685
1011
  }
686
1012
  });
1013
+ Object.defineProperty(exports, "getFaceColor", {
1014
+ enumerable: true,
1015
+ get: function() {
1016
+ return getFaceColor;
1017
+ }
1018
+ });
1019
+ Object.defineProperty(exports, "getFaceTags", {
1020
+ enumerable: true,
1021
+ get: function() {
1022
+ return getFaceTags;
1023
+ }
1024
+ });
1025
+ Object.defineProperty(exports, "getShapeColor", {
1026
+ enumerable: true,
1027
+ get: function() {
1028
+ return getShapeColor;
1029
+ }
1030
+ });
1031
+ Object.defineProperty(exports, "getTagMetadata", {
1032
+ enumerable: true,
1033
+ get: function() {
1034
+ return getTagMetadata;
1035
+ }
1036
+ });
1037
+ Object.defineProperty(exports, "hasAnyMetadata", {
1038
+ enumerable: true,
1039
+ get: function() {
1040
+ return hasAnyMetadata;
1041
+ }
1042
+ });
687
1043
  Object.defineProperty(exports, "intersect", {
688
1044
  enumerable: true,
689
1045
  get: function() {
@@ -744,6 +1100,24 @@ Object.defineProperty(exports, "makeVertex", {
744
1100
  return makeVertex;
745
1101
  }
746
1102
  });
1103
+ Object.defineProperty(exports, "propagateAllMetadata", {
1104
+ enumerable: true,
1105
+ get: function() {
1106
+ return propagateAllMetadata;
1107
+ }
1108
+ });
1109
+ Object.defineProperty(exports, "propagateMetadataByHash", {
1110
+ enumerable: true,
1111
+ get: function() {
1112
+ return propagateMetadataByHash;
1113
+ }
1114
+ });
1115
+ Object.defineProperty(exports, "propagateMetadataThroughRelocation", {
1116
+ enumerable: true,
1117
+ get: function() {
1118
+ return propagateMetadataThroughRelocation;
1119
+ }
1120
+ });
747
1121
  Object.defineProperty(exports, "section", {
748
1122
  enumerable: true,
749
1123
  get: function() {
@@ -756,6 +1130,12 @@ Object.defineProperty(exports, "sectionToFace", {
756
1130
  return sectionToFace;
757
1131
  }
758
1132
  });
1133
+ Object.defineProperty(exports, "setTagMetadata", {
1134
+ enumerable: true,
1135
+ get: function() {
1136
+ return setTagMetadata;
1137
+ }
1138
+ });
759
1139
  Object.defineProperty(exports, "slice", {
760
1140
  enumerable: true,
761
1141
  get: function() {
@@ -768,6 +1148,12 @@ Object.defineProperty(exports, "split", {
768
1148
  return split;
769
1149
  }
770
1150
  });
1151
+ Object.defineProperty(exports, "tagFaces", {
1152
+ enumerable: true,
1153
+ get: function() {
1154
+ return tagFaces;
1155
+ }
1156
+ });
771
1157
  Object.defineProperty(exports, "weldShellsAndFaces", {
772
1158
  enumerable: true,
773
1159
  get: function() {
@@ -1,6 +1,7 @@
1
- const require_shapeTypes = require("./shapeTypes-Bpsu5KJO.cjs");
2
- const require_errors = require("./errors-CJU8CHng.cjs");
3
- const require_faceFns = require("./faceFns-CPswi9Cm.cjs");
1
+ const require_shapeTypes = require("./shapeTypes-CkcIL7zv.cjs");
2
+ const require_errors = require("./errors-RHkKO5bZ.cjs");
3
+ const require_validityTypes = require("./validityTypes-ZGMVlv7b.cjs");
4
+ const require_faceFns = require("./faceFns-BK4r7Dxk.cjs");
4
5
  //#region src/utils/range.ts
5
6
  /** Generate an array of integers `[0, 1, …, len - 1]`. */
6
7
  function range(len) {
@@ -178,11 +179,11 @@ function makeFace(wire, holes) {
178
179
  const faceShape = require_shapeTypes.getKernel().makeFace(wire.wrapped, true);
179
180
  if (holes && holes.length > 0) {
180
181
  const withHoles = addHolesInFace(require_shapeTypes.createFace(faceShape), holes);
181
- if (!require_shapeTypes.isPlanarFace(withHoles)) return require_errors.err(require_errors.validationError("FACE_NOT_PLANAR", "makeFace produced a non-planar face — wire may not be truly planar"));
182
+ if (!require_validityTypes.isPlanarFace(withHoles)) return require_errors.err(require_errors.validationError("FACE_NOT_PLANAR", "makeFace produced a non-planar face — wire may not be truly planar"));
182
183
  return require_errors.ok(withHoles);
183
184
  }
184
185
  const face = require_shapeTypes.createFace(faceShape);
185
- if (!require_shapeTypes.isPlanarFace(face)) return require_errors.err(require_errors.validationError("FACE_NOT_PLANAR", "makeFace produced a non-planar face — wire may not be truly planar"));
186
+ if (!require_validityTypes.isPlanarFace(face)) return require_errors.err(require_errors.validationError("FACE_NOT_PLANAR", "makeFace produced a non-planar face — wire may not be truly planar"));
186
187
  return require_errors.ok(face);
187
188
  } catch (e) {
188
189
  return require_errors.err(require_errors.kernelError("FACE_BUILD_FAILED", "Failed to build the face. Your wire might be non planar.", e));
@@ -1,6 +1,7 @@
1
- import { A as isPlanarFace, W as DisposalScope, c as createEdge, it as getKernel, l as createFace, nt as _usingCtx, p as createWire, y as isFace } from "./shapeTypes-CnKFSfDT.js";
2
- import { O as ok, d as validationError, g as andThen, i as kernelError, v as err } from "./errors-B3CDG537.js";
3
- import { _ as cast, u as outerWire } from "./faceFns-CB6uzvOg.js";
1
+ import { K as getKernel, M as DisposalScope, W as _usingCtx, c as createEdge, l as createFace, p as createWire, y as isFace } from "./shapeTypes-t49f64Dx.js";
2
+ import { E as ok, d as validationError, g as err, i as kernelError, m as andThen } from "./errors-MHLiNE-C.js";
3
+ import { a as isPlanarFace } from "./validityTypes-DiTgeCD9.js";
4
+ import { _ as cast, u as outerWire } from "./faceFns-DJj9Nb6T.js";
4
5
  //#region src/utils/range.ts
5
6
  /** Generate an array of integers `[0, 1, …, len - 1]`. */
6
7
  function range(len) {
package/dist/text.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_textBlueprints = require("./textBlueprints-B5zcLGvJ.cjs");
3
- const require_textMetrics = require("./textMetrics-08fF0QNf.cjs");
2
+ const require_textBlueprints = require("./textBlueprints-BY0FEg59.cjs");
3
+ const require_textMetrics = require("./textMetrics-f5yXR4OG.cjs");
4
4
  exports.fontMetrics = require_textMetrics.fontMetrics;
5
5
  exports.getFont = require_textBlueprints.getFont;
6
6
  exports.loadFont = require_textBlueprints.loadFont;
package/dist/text.js CHANGED
@@ -1,3 +1,3 @@
1
- import { n as getFont, r as loadFont, t as textBlueprints } from "./textBlueprints-igbNvKcd.js";
2
- import { n as textMetrics, r as sketchText, t as fontMetrics } from "./textMetrics-CJvtpbc3.js";
1
+ import { n as getFont, r as loadFont, t as textBlueprints } from "./textBlueprints-ZzYg3XTS.js";
2
+ import { n as textMetrics, r as sketchText, t as fontMetrics } from "./textMetrics-Diakbtem.js";
3
3
  export { fontMetrics, getFont, loadFont, sketchText, textBlueprints, textMetrics };