MCPcopy Create free account
hub / github.com/CNCKitchen/stlTexturizer / constructor

Method constructor

js/meshIndex.js:31–40  ·  view source on GitHub ↗

* @param {number} quant – grid multiplier (e.g. 1e5 → 10 µm cells) * @param {number} expected – expected number of unique points (sizing hint)

(quant, expected = 256)

Source from the content-addressed store, hash-verified

29 */
30
31export class QuantizedPointMap {
32 /**
33 * @param {number} quant – grid multiplier (e.g. 1e5 → 10 µm cells)
34 * @param {number} expected – expected number of unique points (sizing hint)
35 */
36 constructor(quant, expected = 256) {
37 this.quant = quant;
38 /** true when the last getOrSet() inserted a new key */
39 this.inserted = false;
40 this._size = 0;
41 let cap = 16;
42 const target = Math.max(16, Math.ceil(expected / 0.6));
43 while (cap < target) cap *= 2;

Callers

nothing calls this directly

Calls 1

_allocMethod · 0.95

Tested by

no test coverage detected