ldr 0.33.11 → 0.33.12

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/cli.js CHANGED
@@ -1,18 +1,18 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- // ../../../../../../../tmp/ldr-build-QFMx37/src/cli.ts
3
+ // ../../../../../../../tmp/ldr-build-HYKc29/src/cli.ts
4
4
  import fs4 from "node:fs";
5
5
  import zlib from "node:zlib";
6
6
 
7
- // ../../../../../../../tmp/ldr-build-QFMx37/src/node/build-pack.ts
7
+ // ../../../../../../../tmp/ldr-build-HYKc29/src/node/build-pack.ts
8
8
  import fs3 from "node:fs";
9
9
  import path3 from "node:path";
10
10
 
11
- // ../../../../../../../tmp/ldr-build-QFMx37/src/node/resolver.ts
11
+ // ../../../../../../../tmp/ldr-build-HYKc29/src/node/resolver.ts
12
12
  import fs from "node:fs";
13
13
  import path from "node:path";
14
14
 
15
- // ../../../../../../../tmp/ldr-build-QFMx37/src/spec.ts
15
+ // ../../../../../../../tmp/ldr-build-HYKc29/src/spec.ts
16
16
  var norm = (s) => s.trim().toLowerCase().replace(/\\/g, "/").replace(/\/+/g, "/");
17
17
  var COLOUR_ID_RE = /^[A-Za-z][A-Za-z0-9_]*$/;
18
18
  var namedCodes = new Map;
@@ -817,7 +817,7 @@ function fileStepViews(f) {
817
817
  return out;
818
818
  }
819
819
 
820
- // ../../../../../../../tmp/ldr-build-QFMx37/src/model.ts
820
+ // ../../../../../../../tmp/ldr-build-HYKc29/src/model.ts
821
821
  class ModelLimitError extends Error {
822
822
  limit;
823
823
  code = "ldr-model-limit";
@@ -1259,7 +1259,7 @@ function blendedColourHex(code) {
1259
1259
  return "#" + [0, 1, 2].map((k) => (a[k] + b[k] >> 1).toString(16).padStart(2, "0")).join("").toUpperCase();
1260
1260
  }
1261
1261
 
1262
- // ../../../../../../../tmp/ldr-build-QFMx37/src/node/resolver.ts
1262
+ // ../../../../../../../tmp/ldr-build-HYKc29/src/node/resolver.ts
1263
1263
  var TOP_STUD_RE = /^(stud|studa|stud2|stud2a|stud6|stud6a|stud10|stud15|stud2s|stud2s2|stud-logo\d*|stud2-logo\d*)\.dat$/i;
1264
1264
  var UNDER_STUD_RE = /^(stud3|stud3a|stud4.*|stud12|stud16.*|stud18a)\.dat$/i;
1265
1265
  var norm2 = (ref) => ref.trim().replace(/\\/g, "/").toLowerCase();
@@ -1586,11 +1586,11 @@ function collectDeps(lib, refs) {
1586
1586
  return out;
1587
1587
  }
1588
1588
 
1589
- // ../../../../../../../tmp/ldr-build-QFMx37/src/node/compile.ts
1589
+ // ../../../../../../../tmp/ldr-build-HYKc29/src/node/compile.ts
1590
1590
  import fs2 from "node:fs";
1591
1591
  import path2 from "node:path";
1592
1592
 
1593
- // ../../../../../../../tmp/ldr-build-QFMx37/src/node/lod.ts
1593
+ // ../../../../../../../tmp/ldr-build-HYKc29/src/node/lod.ts
1594
1594
  import { MeshoptSimplifier, MeshoptEncoder } from "meshoptimizer";
1595
1595
  await Promise.all([MeshoptSimplifier.ready, MeshoptEncoder.ready]);
1596
1596
  function reorderMesh(P, N, C, I) {
@@ -1896,7 +1896,7 @@ function levelLines(P, I, E, err, always, tol = 0.01) {
1896
1896
  return out;
1897
1897
  }
1898
1898
 
1899
- // ../../../../../../../tmp/ldr-build-QFMx37/src/node/compile.ts
1899
+ // ../../../../../../../tmp/ldr-build-HYKc29/src/node/compile.ts
1900
1900
  class BfcState {
1901
1901
  accum;
1902
1902
  ccw = true;
@@ -2840,7 +2840,7 @@ function encodePack(parts, studKinds, weld, extra, options = {}) {
2840
2840
  return Buffer.concat([head, ...chunks.map((c) => new Uint8Array(c.buffer, c.byteOffset, c.byteLength))]);
2841
2841
  }
2842
2842
 
2843
- // ../../../../../../../tmp/ldr-build-QFMx37/src/node/build-pack.ts
2843
+ // ../../../../../../../tmp/ldr-build-HYKc29/src/node/build-pack.ts
2844
2844
  function packCompilerOpts(o) {
2845
2845
  return { studs: o.studs ?? "low", prims: o.primitives ?? "full", weld: o.weld ?? true, separateStuds: true, cond: !!o.cond, tex: !!o.textures, ...o.partWorkLimit ? { workLimit: o.partWorkLimit } : {} };
2846
2846
  }
@@ -2913,7 +2913,7 @@ function buildPack(o) {
2913
2913
  return { data: encodePack(parts, kinds, comp.opts.weld, extra, { texture, lod: o.lod !== false, reorder: !!o.reorder }), parts: parts.size, studKinds: kinds.size, missing: [...missing], ...warnings.length ? { warnings } : {} };
2914
2914
  }
2915
2915
 
2916
- // ../../../../../../../tmp/ldr-build-QFMx37/src/cli.ts
2916
+ // ../../../../../../../tmp/ldr-build-HYKc29/src/cli.ts
2917
2917
  var HELP = `ldr pack — build a parts pack for the ldr three.js renderer
2918
2918
 
2919
2919
  Usage:
package/dist/cull.d.ts CHANGED
@@ -21,17 +21,21 @@ export declare function mul12To(a: ArrayLike<number>, b: ArrayLike<number>, bo:
21
21
  export declare const det12: (m: ArrayLike<number>) => number;
22
22
  /** Singular placement (determinant ~0, relative to the row lengths): BFC can't cull it (article 415 "Degenerate Matrices"). */
23
23
  export declare const singular12: (m: ArrayLike<number>, d?: number) => boolean;
24
- /** Open-addressing hash table from int32 triples to int32 values (-1 = absent); grows as needed. */
24
+ /** Open-addressing hash table from int32 triples to int32 values (-1 = absent); grows as needed. Keys and value sit interleaved in one
25
+ * Int32Array (x, y, z, value), and a byte per slot holds 8 more bits of the key's hash (0 = empty), so a miss usually reads only the
26
+ * byte array and a hit one cache line of the keys, where five parallel arrays cost five. With `shift` >= 0, keys close in x / z (a
27
+ * 4 x 4 block of (1 << shift)-unit squares) start in neighbouring slots, so the studs of one brick, or the cells under it, share cache
28
+ * lines. The stud-top table of a 400k-brick city has millions of entries and its lookups were the culling pass's biggest cost
29
+ * (Round 73). */
25
30
  export declare class Int3Table {
26
- a: Int32Array;
27
- b: Int32Array;
28
- c: Int32Array;
29
- vals: Int32Array;
30
- used: Uint8Array;
31
+ t: Int32Array;
32
+ tag: Uint8Array;
31
33
  mask: number;
32
34
  size: number;
33
- constructor(cap?: number);
35
+ shift: number;
36
+ constructor(cap?: number, shift?: number);
34
37
  private slot;
38
+ private static tagOf;
35
39
  get(x: number, y: number, z: number): number;
36
40
  /** Sets (x, y, z) -> v and returns the previous value (-1 if none). */
37
41
  put(x: number, y: number, z: number, v: number): number;