partforge 0.142.0 → 0.143.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/README.md +1 -1
- package/docs/AUTHORING-PARTS.md +103 -58
- package/docs/ERROR-PATTERNS.md +25 -1
- package/docs/KERNEL-CONTRACT.md +1 -1
- package/package.json +1 -1
- package/src/framework/default-view.js +2 -1
- package/src/framework/export/bed-layout.js +62 -0
- package/src/framework/geometry/probe.js +24 -3
- package/src/framework/imports.js +11 -1
- package/src/framework/jobs.js +15 -5
- package/src/framework/lint/rules-animations.js +4 -3
- package/src/framework/lint/rules-place.js +81 -3
- package/src/framework/lint/rules-shape.js +10 -7
- package/src/framework/materials/print-frame.js +3 -2
- package/src/framework/materials/sheet-look.js +2 -0
- package/src/framework/mount.js +2 -0
- package/src/framework/oracle/verify.js +1 -1
- package/src/framework/param-deps.js +5 -3
- package/src/framework/part-model.js +5 -4
- package/src/framework/pose-probe-core.js +5 -3
- package/src/framework/sheet/part.js +5 -1
- package/src/framework/sub-part-views.js +56 -0
- package/src/parts/hinged-box.js +12 -13
- package/src/parts/laser-box.js +8 -9
- package/src/parts/lattice-box.js +110 -0
- package/src/parts/mixed-smoke.js +2 -3
- package/types/geometry.d.ts +1 -1
- package/types/part.d.ts +10 -3
package/types/part.d.ts
CHANGED
|
@@ -350,6 +350,7 @@ export type DeriveSpec<P = ResolvedParams, D = Derived> =
|
|
|
350
350
|
|
|
351
351
|
// --- sub-parts --------------------------------------------------------------
|
|
352
352
|
|
|
353
|
+
/** The argument to the LEGACY `place` (views-array form); the `views` map form needs none. */
|
|
353
354
|
export interface PlaceContext<P = ResolvedParams, D = Derived> {
|
|
354
355
|
/** The active view. Display placement must NOT depend on it. */
|
|
355
356
|
view: string;
|
|
@@ -367,12 +368,18 @@ export interface SubPartDefinition<P = ResolvedParams, D = Derived> {
|
|
|
367
368
|
*/
|
|
368
369
|
build: (k: GeometryKernel, p: P, d: D, onProgress?: (phase: string) => void) => Solid;
|
|
369
370
|
/**
|
|
370
|
-
*
|
|
371
|
+
* LEGACY form (with a `views` array); with a `views` map put each pose in its
|
|
372
|
+
* entry instead. Optional reposition (default identity), for a part whose display pose
|
|
371
373
|
* differs from its export pose. Any such difference must be a RIGID motion.
|
|
372
374
|
*/
|
|
373
375
|
place?: (solid: Solid, ctx: PlaceContext<P, D>) => Solid;
|
|
374
|
-
/**
|
|
375
|
-
|
|
376
|
+
/**
|
|
377
|
+
* Each view the sub-part appears in: a map of view name to `true` (shown as
|
|
378
|
+
* built) or a rigid pose `(s, p, d) => s.translate(…)`. Every name must exist in
|
|
379
|
+
* the part's `views`. The legacy form, an array of names (placed by `place`),
|
|
380
|
+
* still works.
|
|
381
|
+
*/
|
|
382
|
+
views: string[] | Record<string, true | ((s: Solid, p: P, d: D) => Solid)>;
|
|
376
383
|
/** Gate a conditional sub-part. Coerced with `!!`. */
|
|
377
384
|
enabled?: (p: P) => unknown;
|
|
378
385
|
/** `false` = reference/preview-only: shown in the viewer, never exported. */
|