ldr 0.6.0 → 0.8.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.
@@ -45,6 +45,8 @@ export interface PrepareOptions extends LoadPartsOptions {
45
45
  text?: boolean;
46
46
  /** File name used for the main model (MPD resolution). Default: last URL segment. */
47
47
  name?: string;
48
+ /** Instruction-booklet step order for repeated submodels (see `FlattenOptions.callouts`). Default false. */
49
+ callouts?: boolean;
48
50
  }
49
51
  export interface PreparedModel {
50
52
  insts: PartInstance[];
package/dist/render.d.ts CHANGED
@@ -75,7 +75,7 @@ export declare function buildLdrScene(insts: Inst[], pack: Pack, P: LdrParams, c
75
75
  setEdges: (v: boolean) => void;
76
76
  setCond: (v: boolean) => void;
77
77
  setLod: (on: boolean) => void;
78
- setStep: (s: number | null) => {
78
+ setStep: (s: number | null, mask?: ArrayLike<number | boolean> | null) => {
79
79
  studsTotal: number;
80
80
  studsHidden: number;
81
81
  undersTotal: number;
package/dist/scene.d.ts CHANGED
@@ -79,8 +79,9 @@ export interface LdrObject {
79
79
  * `stepViewMatrix(view, yourDefaultView)`; in three.js terms rotate the model by it inside the object's -Y-up flip. */
80
80
  stepViews: (StepView | null)[];
81
81
  /** Show instances up to and including `step` (null = all). No rebuild: instance buffers are compacted, and culling is step-aware
82
- * (a stud covered only by a later step's part stays visible). `stats` reflect the shown step. */
83
- setStep(step: number | null): void;
82
+ * (a stud covered only by a later step's part stays visible). `stats` reflect the shown step. With `mask` (per instance), only the
83
+ * instances whose entry is truthy are shown, e.g. a sub-assembly on its own (an instruction callout; see `planStepViews`). */
84
+ setStep(step: number | null, mask?: ArrayLike<number | boolean> | null): void;
84
85
  setEdges(on: boolean): void;
85
86
  /** Resolves when the pack's textures (if any) are decoded and ready to render. */
86
87
  texturesReady: Promise<void>;
package/dist/spec.d.ts CHANGED
@@ -126,6 +126,13 @@ export declare function texmapUV(map: TexMap, p: number[]): {
126
126
  export declare function texmapTriangleUV(map: TexMap, pts: number[][]): number[];
127
127
  /** Transform a TexMap's points by an LDraw matrix (e.g. into part space when the START lives in a subfile). */
128
128
  export declare function transformTexMap(map: TexMap, m: M): TexMap;
129
+ /**
130
+ * "~Moved to" stubs whose own placement of the target breaks the models that use them; these resolve to the target as-is.
131
+ * 32531.dat (LDraw 2022-05) turns 32531a by 90 degrees, but 32531a is the old 32531 renamed (it carries its history), and
132
+ * 21 of the 24 OMR models in the demo catalog that use 32531 (76161-1, 10179-1, 10256-1, ...) only fit together without the turn:
133
+ * with it, each frame sits 3,000-30,000 LDU^3 inside its neighbours.
134
+ */
135
+ export declare const STUB_OVERRIDES: Record<string, string>;
129
136
  export declare function mul(a: M, b: M): M;
130
137
  export declare const I: M;
131
138
  /** True if color is an LDraw direct color (0x2RRGGBB etc.), not a palette CODE. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ldr",
3
- "version": "0.6.0",
3
+ "version": "0.8.0",
4
4
  "description": "High-performance LEGO (LDraw) rendering for three.js: instanced parts packs, hidden stud/tube culling, low-detail studs, indexed edges, build steps.",
5
5
  "license": "MIT",
6
6
  "author": "Evan Bacon",