move flat line removal until after height map is produced
This commit is contained in:
parent
dda676e603
commit
52b74f3daf
1 changed files with 13 additions and 3 deletions
|
|
@ -177,7 +177,7 @@ class Topo {
|
||||||
newtrace.push(latent);
|
newtrace.push(latent);
|
||||||
latent = null;
|
latent = null;
|
||||||
}
|
}
|
||||||
if (false && curvesOnly && lastP) {
|
if (curvesOnly && lastP) {
|
||||||
// maxangle
|
// maxangle
|
||||||
const dz = Math.abs(lastP.z - z);
|
const dz = Math.abs(lastP.z - z);
|
||||||
const dv = contourX ? Math.abs(lastP.x - x) : Math.abs(lastP.y - y);
|
const dv = contourX ? Math.abs(lastP.x - x) : Math.abs(lastP.y - y);
|
||||||
|
|
@ -233,8 +233,6 @@ class Topo {
|
||||||
let l1 = lines[i], p1 = l1.p1, p2 = l1.p2;
|
let l1 = lines[i], p1 = l1.p1, p2 = l1.p2;
|
||||||
// eliminate vertical
|
// eliminate vertical
|
||||||
if (Math.abs(p1.y - p2.y) < flatness) continue;
|
if (Math.abs(p1.y - p2.y) < flatness) continue;
|
||||||
// eliminate horizontal when curves only selected
|
|
||||||
if (curvesOnly && Math.abs(p1.z - p2.z) < flatness) continue;
|
|
||||||
// eliminate if both points below cutoff
|
// eliminate if both points below cutoff
|
||||||
if (p1.z < zMin && p2.z < zMin) continue;
|
if (p1.z < zMin && p2.z < zMin) continue;
|
||||||
// sort p1,p2 by y for comparison
|
// sort p1,p2 by y for comparison
|
||||||
|
|
@ -303,6 +301,18 @@ class Topo {
|
||||||
gridy++;
|
gridy++;
|
||||||
}
|
}
|
||||||
gridx++;
|
gridx++;
|
||||||
|
// remove flat lines when curvesOnly
|
||||||
|
if (curvesOnly) {
|
||||||
|
let nup = [];
|
||||||
|
for (let i=0, p=slice.points, l=p.length; i<l; i += 2) {
|
||||||
|
const p1 = p[i];
|
||||||
|
const p2 = p[i+1];
|
||||||
|
if (Math.abs(p1.z - p2.z) >= flatness) {
|
||||||
|
nup.push(p1, p2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
slice.points = nup;
|
||||||
|
}
|
||||||
onupdate(++stepsTaken, stepsTotal, "raster surface");
|
onupdate(++stepsTaken, stepsTotal, "raster surface");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue