@gridspace/raster-path 1.1.0 → 1.1.1
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/build/raster-path.js +18 -4
- package/build/raster-worker.js +2 -2
- package/package.json +1 -1
- package/src/core/raster-path.js +18 -4
package/build/raster-path.js
CHANGED
|
@@ -681,18 +681,32 @@ export class RasterPath {
|
|
|
681
681
|
}
|
|
682
682
|
|
|
683
683
|
// Flatten triangle indices for GPU
|
|
684
|
-
|
|
684
|
+
// Pre-calculate total size for optimal performance
|
|
685
|
+
let totalIndices = 0;
|
|
686
|
+
for (let i = 0; i < buckets.length; i++) {
|
|
687
|
+
totalIndices += buckets[i].triangleIndices.length;
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
// Pre-allocate array to avoid resizing overhead
|
|
691
|
+
const triangleIndices = new Array(totalIndices);
|
|
685
692
|
const bucketInfo = [];
|
|
693
|
+
let offset = 0;
|
|
686
694
|
|
|
687
695
|
for (let i = 0; i < buckets.length; i++) {
|
|
688
696
|
const bucket = buckets[i];
|
|
697
|
+
const indices = bucket.triangleIndices;
|
|
698
|
+
|
|
689
699
|
bucketInfo.push({
|
|
690
700
|
minX: bucket.minX,
|
|
691
701
|
maxX: bucket.maxX,
|
|
692
|
-
startIndex:
|
|
693
|
-
count:
|
|
702
|
+
startIndex: offset,
|
|
703
|
+
count: indices.length
|
|
694
704
|
});
|
|
695
|
-
|
|
705
|
+
|
|
706
|
+
// Copy indices using fast indexed access
|
|
707
|
+
for (let j = 0; j < indices.length; j++) {
|
|
708
|
+
triangleIndices[offset++] = indices[j];
|
|
709
|
+
}
|
|
696
710
|
}
|
|
697
711
|
|
|
698
712
|
return {
|
package/build/raster-worker.js
CHANGED
|
@@ -2387,7 +2387,7 @@ async function generateRadialToolpaths({
|
|
|
2387
2387
|
if (!strip.positions || strip.positions.length === 0)
|
|
2388
2388
|
continue;
|
|
2389
2389
|
if (diagnostic && (globalStripIdx === 0 || globalStripIdx === 360)) {
|
|
2390
|
-
debug.log(`
|
|
2390
|
+
debug.log(`ES2VU471 | Strip ${globalStripIdx} (${strip.angle.toFixed(1)}\xB0) INPUT terrain first 5 Z values: ${strip.positions.slice(0, 5).map((v) => v.toFixed(3)).join(",")}`);
|
|
2391
2391
|
}
|
|
2392
2392
|
const stripToolpathResult = await runToolpathComputeWithBuffers(
|
|
2393
2393
|
strip.positions,
|
|
@@ -2400,7 +2400,7 @@ async function generateRadialToolpaths({
|
|
|
2400
2400
|
pipelineStartTime
|
|
2401
2401
|
);
|
|
2402
2402
|
if (diagnostic && (globalStripIdx === 0 || globalStripIdx === 360)) {
|
|
2403
|
-
debug.log(`
|
|
2403
|
+
debug.log(`ES2VU471 | Strip ${globalStripIdx} (${strip.angle.toFixed(1)}\xB0) OUTPUT toolpath first 5 Z values: ${stripToolpathResult.pathData.slice(0, 5).map((v) => v.toFixed(3)).join(",")}`);
|
|
2404
2404
|
}
|
|
2405
2405
|
allStripToolpaths.push({
|
|
2406
2406
|
angle: strip.angle,
|
package/package.json
CHANGED
package/src/core/raster-path.js
CHANGED
|
@@ -681,18 +681,32 @@ export class RasterPath {
|
|
|
681
681
|
}
|
|
682
682
|
|
|
683
683
|
// Flatten triangle indices for GPU
|
|
684
|
-
|
|
684
|
+
// Pre-calculate total size for optimal performance
|
|
685
|
+
let totalIndices = 0;
|
|
686
|
+
for (let i = 0; i < buckets.length; i++) {
|
|
687
|
+
totalIndices += buckets[i].triangleIndices.length;
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
// Pre-allocate array to avoid resizing overhead
|
|
691
|
+
const triangleIndices = new Array(totalIndices);
|
|
685
692
|
const bucketInfo = [];
|
|
693
|
+
let offset = 0;
|
|
686
694
|
|
|
687
695
|
for (let i = 0; i < buckets.length; i++) {
|
|
688
696
|
const bucket = buckets[i];
|
|
697
|
+
const indices = bucket.triangleIndices;
|
|
698
|
+
|
|
689
699
|
bucketInfo.push({
|
|
690
700
|
minX: bucket.minX,
|
|
691
701
|
maxX: bucket.maxX,
|
|
692
|
-
startIndex:
|
|
693
|
-
count:
|
|
702
|
+
startIndex: offset,
|
|
703
|
+
count: indices.length
|
|
694
704
|
});
|
|
695
|
-
|
|
705
|
+
|
|
706
|
+
// Copy indices using fast indexed access
|
|
707
|
+
for (let j = 0; j < indices.length; j++) {
|
|
708
|
+
triangleIndices[offset++] = indices[j];
|
|
709
|
+
}
|
|
696
710
|
}
|
|
697
711
|
|
|
698
712
|
return {
|