checkpoint
This commit is contained in:
parent
849a55439b
commit
ed90dea0a5
2 changed files with 51 additions and 38 deletions
|
|
@ -60,7 +60,7 @@ class Topo {
|
|||
widtopo = widget.topo,
|
||||
topoCache = widtopo && widtopo.resolution === resolution ? widtopo : undefined,
|
||||
topo = widget.topo = topoCache || {
|
||||
data: new Float32Array(stepsx * stepsy),
|
||||
data: new Float32Array(new SharedArrayBuffer(stepsx * stepsy * 4)),
|
||||
stepsx: stepsx,
|
||||
stepsy: stepsy,
|
||||
bounds: bounds,
|
||||
|
|
@ -439,16 +439,13 @@ class Topo {
|
|||
ondone(newslices);
|
||||
}
|
||||
|
||||
console.log('get vertices and points');
|
||||
let points = base.verticesToPoints(widget.getGeoVertices({ unroll: true, translate: true }));
|
||||
|
||||
console.log('topo slice 2');
|
||||
const slices2 = await kiri.topo_slice(widget, resolution);
|
||||
console.log({ topo_slice_done: slices2 });
|
||||
processSlices(slices2);
|
||||
return this;
|
||||
|
||||
console.log('old slice setup')
|
||||
let points = base.verticesToPoints(widget.getGeoVertices({ unroll: true, translate: true }));
|
||||
let slicer = new kiri.cam_slicer(points, {
|
||||
swapX: true, emptyok: true, notopok: true
|
||||
});
|
||||
|
|
@ -457,20 +454,12 @@ class Topo {
|
|||
if (contourX) stepsTotal += Math.round((maxY-minY) / toolStep);
|
||||
if (contourY) stepsTotal += Math.round((maxX-minX) / toolStep);
|
||||
|
||||
console.log('old slice run', stepsTotal)
|
||||
let slices = topo.slices = topo.slices || slicer.slice(sindex, { each: (data, index, total) => {
|
||||
onupdate(++stepsTaken, stepsTotal, "topo slice");
|
||||
}, genso: true });
|
||||
|
||||
console.log('process slices', stepsTaken)
|
||||
processSlices(slices.filter(s => s.lines).map(data => data.slice));
|
||||
|
||||
console.log('process done', stepsTaken)
|
||||
// const t0 = Date.now();
|
||||
// for (let point of points) point.swapXZ();
|
||||
// let lines = new kiri.cam_slicer2().setFromPoints(points).slice(resolution);
|
||||
// console.log({ sindex, lines, time: Date.now() - t0 });
|
||||
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue