partforge 0.61.0 → 0.62.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -404,7 +404,7 @@ export function mount(part, { createWorker, elements = {}, onBuild, onPick, onDo
404
404
  // regen-loop.js; this send callback is the one place a build job is dispatched.
405
405
  // Routing is per SUB-part: the missing set splits by backend and each group goes
406
406
  // to its own worker in parallel, so a mixed part previews its plain sub-parts at
407
- // Manifold speed while only the filleted ones wait on OCCT. The return value is
407
+ // Manifold speed while only the OCCT-routed ones wait. The return value is
408
408
  // the job count — the loop holds the cycle open until every group has replied.
409
409
  const loop = createRegenLoop({
410
410
  missingParts,
@@ -577,7 +577,7 @@ export function mount(part, { createWorker, elements = {}, onBuild, onPick, onDo
577
577
  // sub-parts on OCCT (an export reply has no subparts and latches the
578
578
  // whole part). The latch is per params snapshot, so changing params
579
579
  // re-consults the probe and sub-parts drop back to Manifold when the
580
- // OCCT-only feature goes away.
580
+ // unsupported edge class or other runtime-only requirement goes away.
581
581
  backendPolicy.noteNeedsOcct(params, data.subparts);
582
582
  loop.buildDone();
583
583
  loop.kick();
@@ -1,5 +1,6 @@
1
- // Example part exercising native CAD ops it auto-routes to the OCCT backend
2
- // because it uses fillet (and chamfer when enabled). Vertical edges are rounded
1
+ // Example part exercising the CAD dress-up ops. Since contract v3 fillet and
2
+ // chamfer build natively on the fast Manifold backend (mesh-fillet.js); STEP
3
+ // export still uses OCCT's exact B-rep blends. Vertical edges are rounded
3
4
  // and an optional bore drilled; the base chamfer is off by default (turn it up to
4
5
  // try chamfering, kept off in defaults so the gating build uses only the fillet).
5
6
  export default {
@@ -1,8 +1,10 @@
1
1
  // CI fixture for per-sub-part backend routing (the mixed-backend twin of
2
- // text-smoke.js): one filleted sub-part that routes to OCCT next to a plain one
2
+ // text-smoke.js): one shelled sub-part that routes to OCCT next to a plain one
3
3
  // that stays on Manifold, so the smoke check exercises a split generate — two
4
- // workers answering one regen cycle — in a real browser. Dial "Edge fillet" to 0
5
- // and the whole part drops back to Manifold (zero magnitude is the identity).
4
+ // workers answering one regen cycle — in a real browser. Dial "Wall" to 0 and
5
+ // the whole part drops back to Manifold (the build skips the shell branch).
6
+ // Shell is the routing exemplar since contract v3 — fillet/chamfer build
7
+ // natively on the mesh backend and no longer route.
6
8
  export default {
7
9
  meta: { title: "Mixed smoke", units: "mm" },
8
10
  parameters: [
@@ -11,18 +13,23 @@ export default {
11
13
  title: "Body",
12
14
  advanced: [
13
15
  { key: "w", label: "Width", unit: "mm", min: 10, max: 60, step: 1 },
14
- { key: "r", label: "Edge fillet", unit: "mm", min: 0, max: 5, step: 0.5 },
16
+ { key: "t", label: "Wall", unit: "mm", min: 0, max: 5, step: 0.5 },
15
17
  ],
16
18
  },
17
19
  ],
18
- defaults: { w: 30, r: 2 },
20
+ defaults: { w: 30, t: 2 },
19
21
  parts: {
20
22
  body: {
21
23
  label: "Body",
22
24
  views: ["assembly"],
23
25
  export: { name: "body" },
24
- // Unguarded on purpose: fillet(0) is the identity, so r drives the routing.
25
- build: (k, p) => k.box({ min: [0, 0, 0], max: [p.w, p.w, 10] }).fillet({ r: p.r, edges: { dir: "Z" } }),
26
+ // The t > 0 branch is what drives the routing: the probe re-runs with live
27
+ // params, so the shell call is only seen (and OCCT only engaged) when the
28
+ // wall is dialed on.
29
+ build: (k, p) => {
30
+ const box = k.box({ min: [0, 0, 0], max: [p.w, p.w, 10] });
31
+ return p.t > 0 ? box.shell({ t: p.t, open: { dir: "Z" } }) : box;
32
+ },
26
33
  },
27
34
  lid: {
28
35
  label: "Lid",
package/types/kernel.d.ts CHANGED
@@ -128,7 +128,7 @@ export type CornerSelector =
128
128
  /** A mirror line for `Shape2D.mirror`. */
129
129
  export type MirrorAxis2 = "x" | "y" | { point: Point2; dir: Point2 };
130
130
 
131
- // --- edge / face selectors (OCCT-only ops) ---------------------------------
131
+ // --- edge / face selectors --------------------------------------------------
132
132
 
133
133
  /**
134
134
  * Which edges a `fillet`/`chamfer` applies to. Omit for every edge. The object
@@ -254,12 +254,15 @@ export interface Solid {
254
254
  toSTL(opts?: { quality?: MeshQuality }): Promise<ArrayBuffer>;
255
255
  toIndexedMesh(): IndexedMesh;
256
256
  /**
257
- * Round edges OCCT only (Manifold throws `KernelCapabilityError`, and the
258
- * probe routes a part that calls this to OCCT). Legacy `(r, selector)` is
259
- * accepted until contract v2.
257
+ * Round edges. Manifold handles straight and circular chains natively and
258
+ * triggers an automatic OCCT fallback for unsupported edge classes. Legacy
259
+ * `(r, selector)` is accepted until contract v2.
260
260
  */
261
261
  fillet(r: number | { r: number; edges?: EdgeSelector }): Solid;
262
- /** Bevel edges — OCCT only. Legacy `(d, selector)` accepted until contract v2. */
262
+ /**
263
+ * Bevel edges, with the same mesh-native coverage and OCCT fallback as
264
+ * `fillet`. Legacy `(d, selector)` is accepted until contract v2.
265
+ */
263
266
  chamfer(d: number | { d: number; edges?: EdgeSelector }): Solid;
264
267
  /**
265
268
  * Hollow inward, wall `t`, opening the faces `open` selects — OCCT only.
@@ -454,7 +457,7 @@ export interface GeometryKernel {
454
457
  /** Rim round-overs via one lathe revolve; curve-exact in STEP. */
455
458
  roundedCylinder(o: RoundedCylinderOptions): Solid;
456
459
  torus(o: TorusOptions): Solid;
457
- /** Selective edge rounding. Stays on Manifold (unlike `Solid.fillet`). */
460
+ /** Selective edge rounding built directly as one Manifold mesh. */
458
461
  roundedBox(o: RoundedBoxOptions): Solid;
459
462
  /** N-ary boolean union. */
460
463
  union(solids: Solid[]): Solid;