ldr 0.33.12 → 0.33.13

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/render.d.ts CHANGED
@@ -70,11 +70,26 @@ export declare function conditionalLineVisible(cond: ArrayLike<number>, i: numbe
70
70
  * `cond` is part-space stride 12 (p0, p1, c0, c1), e.g. from `conditionalLines(pack, pack.header.parts[name])`.
71
71
  * GPU cost: 2 vertices x 13 floats per line (104 B/line), per part, not per instance. Keep `geometry.instanceCount` in sync with `im.count`. */
72
72
  export declare function createInstancedConditionalEdges(cond: ArrayLike<number>, im: THREE.InstancedMesh, material?: THREE.Material): THREE.LineSegments;
73
+ /** Running state of `instancedBoundingSphere`: [centre x, y, z, radius (-1 = empty), geometry sphere centre x, y, z, radius]. */
74
+ export declare function sphereState(g: THREE.BufferGeometry): Float64Array<ArrayBuffer>;
75
+ /** Union the first `n` instance slots of `A` (16 floats each, as `setMatrixAt` stores them) into sphere state `S`, in order: three's
76
+ * loop, same arithmetic (a scratch slot of hidden studs / undersides goes through it with n = 1). */
77
+ export declare function sphereUnion(S: Float64Array, A: Float32Array, n: number): void;
78
+ /** Set `im.boundingSphere` from a sphere state. */
79
+ export declare function setSphere(im: THREE.InstancedMesh, S: Float64Array): THREE.Sphere;
73
80
  /** InstancedMesh.computeBoundingSphere() (three r151-r186), ported to a loop over the instance array: same arithmetic, same result
74
- * bit for bit, without a Matrix4 copy + Sphere clone per instance (1.8M studs on Datsville 100k). */
75
- export declare function instancedBoundingSphere(im: THREE.InstancedMesh): THREE.Sphere;
81
+ * bit for bit, without a Matrix4 copy + Sphere clone per instance (1.8M studs on Datsville 100k). With `S`, continues that state
82
+ * (Round 74: the culled-away slots that are never stored are unioned in afterwards, see `sphereUnion`). */
83
+ export declare function instancedBoundingSphere(im: THREE.InstancedMesh, S?: Float64Array<ArrayBuffer>, set?: boolean): Float64Array<ArrayBuffer> | THREE.Sphere;
76
84
  /** Axis-aligned box (min xyz, max xyz) around every instance slot of an InstancedMesh: each instance's transformed geometry box. */
77
85
  export declare function instancedBoundingBox(im: THREE.InstancedMesh): Float32Array | undefined;
86
+ /** Running state of `instancedBoundingBox` (Round 74, for slots that are never stored, like `sphereState`): [min x y z, max x y z,
87
+ * geometry box half-size x y z and centre x y z, slots unioned]; null when the geometry box is empty. */
88
+ export declare function boxState(g: THREE.BufferGeometry): Float64Array | null;
89
+ /** Union the first `n` instance slots of `A` into box state `B` (each slot's transformed geometry box; order-independent). */
90
+ export declare function boxUnion(B: Float64Array, A: Float32Array, n: number): void;
91
+ /** The box of a box state (undefined: empty geometry box or no slots). */
92
+ export declare const boxOf: (B: Float64Array | null) => Float32Array<ArrayBuffer> | undefined;
78
93
  import { forEachStud, cullCore, STEP_NEVER, type CullResult } from './cull.js';
79
94
  export { forEachStud, cullCore, STEP_NEVER, type CullResult };
80
95
  /** Object-shaped culling result (one entry per stud with its world matrix). Kept for API compatibility; `buildLdrScene` uses `cullCore`. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ldr",
3
- "version": "0.33.12",
3
+ "version": "0.33.13",
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",