ldr 0.33.14 → 0.34.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.
package/dist/usdz.d.ts ADDED
@@ -0,0 +1,29 @@
1
+ import type { PartInstance } from './model.js';
2
+ import type { Pack } from './pack-io.js';
3
+ export interface UsdzOptions {
4
+ /** Triangle budget; coarser pack LOD levels / simpler studs are used until the model fits. Default 200 000. */
5
+ maxTriangles?: number;
6
+ /** Instances are already Y-up (the viewer's `ldrawSpace` models); default false = LDraw space (-Y up). */
7
+ yUp?: boolean;
8
+ /** Metres per LDU. Default 0.0004 (real LEGO size). */
9
+ scale?: number;
10
+ /** Colour override: LDraw colour key -> "#rrggbb" (or undefined to use the pack's table). */
11
+ color?: (key: string) => string | undefined;
12
+ }
13
+ export interface UsdzResult {
14
+ data: Uint8Array;
15
+ triangles: number;
16
+ meshes: number;
17
+ level: {
18
+ body: number;
19
+ studs: 'full' | 'box' | 'none';
20
+ };
21
+ }
22
+ /** Export placed parts as a USDZ (AR Quick Look) model. `instances` / `pack` as for `createLdrObject` (e.g. `loadModel`'s result). */
23
+ export declare function toUSDZ(instances: PartInstance[], pack: Pack, options?: UsdzOptions): UsdzResult;
24
+ export declare function crc32(d: Uint8Array): number;
25
+ /** Uncompressed zip with each entry's data 64-byte aligned (padding in the local header's extra field), as USDZ requires. */
26
+ export declare function zipStored(files: {
27
+ name: string;
28
+ data: Uint8Array;
29
+ }[]): Uint8Array;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ldr",
3
- "version": "0.33.14",
3
+ "version": "0.34.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",