partforge 0.46.0 → 0.46.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "partforge",
3
- "version": "0.46.0",
3
+ "version": "0.46.2",
4
4
  "description": "Turn a declarative part definition into a parametric-CAD web app (three.js + Manifold/Replicad). Requires a Vite-based consumer.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -312,7 +312,12 @@ export function createManifoldKernel(wasm, { quality = "preview" } = {}) {
312
312
  return cached(h("revolve", pts._hash, degrees, segs), () => T(pts._cs.revolve(segs, degrees)));
313
313
  return cached(h("revolve", pts, degrees, segs), () => T(Manifold.revolve([pts], segs, degrees)));
314
314
  },
315
- union: (solids) => cached(h("union", solids.map((s) => s._hash)), () => unionRaw(solids.map((s) => s._m))),
315
+ // A one-solid union is an identity no new WASM / cache entry (avoids double-free):
316
+ // unionRaw's reduce returns the operand's own Manifold untouched, so caching it
317
+ // would pin one WASM object under two entries and eviction would dispose it twice.
318
+ union: (solids) => solids.length === 1
319
+ ? solids[0]
320
+ : cached(h("union", solids.map((s) => s._hash)), () => unionRaw(solids.map((s) => s._m))),
316
321
  shape2d,
317
322
  beginSubPart: (name) => cache.begin(name),
318
323
  endSubPart: () => cache.end(),
package/types/kernel.d.ts CHANGED
@@ -267,6 +267,8 @@ export interface LoftOptions {
267
267
  ruled?: boolean;
268
268
  /** Capless loop — Manifold only. */
269
269
  closed?: boolean;
270
+ /** Overrides the facet-vs-smooth shading inference. */
271
+ shading?: "smooth" | "faceted";
270
272
  }
271
273
 
272
274
  export interface SweepOptions {