• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

visgl / luma.gl / 23357312823

20 Mar 2026 06:35PM UTC coverage: 58.158% (+5.9%) from 52.213%
23357312823

Pull #2555

github

web-flow
Merge 71b78bbe2 into fc5791b65
Pull Request #2555: chore: Run tests on src instead of dist

3021 of 6029 branches covered (50.11%)

Branch coverage included in aggregate %.

7102 of 11377 relevant lines covered (62.42%)

243.33 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

82.61
/modules/engine/src/geometry/geometry-utils.ts
1
// luma.gl
2
// SPDX-License-Identifier: MIT
3
// Copyright (c) vis.gl contributors
4

5
export function unpackIndexedGeometry(geometry: any) {
6
  const {indices, attributes} = geometry;
1✔
7
  if (!indices) {
1!
8
    return geometry;
×
9
  }
10

11
  const vertexCount = indices.value.length;
1✔
12
  const unpackedAttributes: Record<string, any> = {};
1✔
13

14
  for (const attributeName in attributes) {
1✔
15
    const attribute = attributes[attributeName];
3✔
16
    const {constant, value, size} = attribute;
3✔
17
    if (constant || !size) {
3!
18
      continue; // eslint-disable-line
×
19
    }
20
    const unpackedValue = new value.constructor(vertexCount * size);
3✔
21
    for (let x = 0; x < vertexCount; ++x) {
3✔
22
      const index = indices.value[x];
18✔
23
      for (let i = 0; i < size; i++) {
18✔
24
        unpackedValue[x * size + i] = value[index * size + i];
48✔
25
      }
26
    }
27
    unpackedAttributes[attributeName] = {size, value: unpackedValue};
3✔
28
  }
29

30
  return {
1✔
31
    attributes: Object.assign({}, attributes, unpackedAttributes)
32
  };
33
}
34

35
// export function calculateVertexNormals(positions: Float32Array): Uint8Array {
36
//   let normals = new Uint8Array(positions.length / 3);
37

38
//   for (let i = 0; i < positions.length; i++) {
39
//     const vec1 = new Vector3(positions.subarray(i * 3, i + 0, i + 3));
40
//     const vec2 = new Vector3(positions.subarray(i + 3, i + 6));
41
//     const vec3 = new Vector3(positions.subarray(i + 6, i + 9));
42

43
//     const normal = new Vector3(vec1).cross(vec2).normalize();
44
//     normals.set(normal[0], i + 4);
45
//     normals.set(normal[1], i + 4 + 1);
46
//     normals.set(normal[2], i + 2);
47
//   }
48
//   const normal = new Vector3(vec1).cross(vec2).normalize();
49
// }
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc