@needle-tools/gltf-build-pipeline 2.2.0-alpha.7 → 2.2.0-alpha.8

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/CHANGELOG.md CHANGED
@@ -4,10 +4,11 @@ All notable changes to this package will be documented in this file.
4
4
  The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
5
5
  and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
6
6
 
7
- ## [2.2.0-alpha.7] - 2023-06-13
7
+ ## [2.2.0-alpha.8] - 2023-06-13
8
8
  - fix: progressive transform of converted GLB files where meshes don't have indicies
9
9
  - fix: skip progressive texture generation for textures for textures that already match the lowest LOD size
10
10
  - fix: if compression is set to None the LOD textures should respect that setting and also not be compressed
11
+ - fix: fallback mesh density calculation for meshes that aren't indexed
11
12
 
12
13
  ## [2.2.0-alpha.5] - 2023-06-06
13
14
  - add: CLI `--progressive` option to `transform` command (default is true)
@@ -86,6 +86,18 @@ export function calculateMeshDensity(prim) {
86
86
  // const density = count / volume;
87
87
  return density;
88
88
  }
89
+ else {
90
+ // calculate density if the mesh is not indexed
91
+ const count = position.getCount();
92
+ const size = [0, 0, 0];
93
+ size[0] = bounds.max[0] - bounds.min[0];
94
+ size[1] = bounds.max[1] - bounds.min[1];
95
+ size[2] = bounds.max[2] - bounds.min[2];
96
+ const volume = size[0] * size[1] * size[2];
97
+ const density = count / volume;
98
+ debugger;
99
+ return density;
100
+ }
89
101
  return -1;
90
102
  function expandBounds(point, target) {
91
103
  for (let i = 0; i < 3; i++) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@needle-tools/gltf-build-pipeline",
3
- "version": "2.2.0-alpha.7",
3
+ "version": "2.2.0-alpha.8",
4
4
  "description": "Pipeline and tools for optimizing gltf files using gltf-transform and compression settings within glTF extensions",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",