fix healPolys() when Z differs
This commit is contained in:
parent
d473f1012f
commit
7bfe59de90
2 changed files with 4 additions and 1 deletions
|
|
@ -829,7 +829,6 @@
|
||||||
similar(p0.first().distTo2D(p1.first()), toolDiam) &&
|
similar(p0.first().distTo2D(p1.first()), toolDiam) &&
|
||||||
similar(p0.last().distTo2D(p1.last()), toolDiam)
|
similar(p0.last().distTo2D(p1.last()), toolDiam)
|
||||||
) {
|
) {
|
||||||
console.log({candidates: [p0, p1]});
|
|
||||||
pout.push(centerPoly(p0, p1));
|
pout.push(centerPoly(p0, p1));
|
||||||
ptst[i] = undefined;
|
ptst[i] = undefined;
|
||||||
ptst[j] = undefined;
|
ptst[j] = undefined;
|
||||||
|
|
|
||||||
|
|
@ -302,6 +302,10 @@
|
||||||
for (let j=i+1; j<tlen; j++) {
|
for (let j=i+1; j<tlen; j++) {
|
||||||
let s2 = ntmp[j];
|
let s2 = ntmp[j];
|
||||||
if (!s2) continue;
|
if (!s2) continue;
|
||||||
|
// require polys at same Z to heal
|
||||||
|
if (Math.abs(s1.getZ() - s2.getZ()) > 0.01) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (!(s1.open && s2.open)) continue;
|
if (!(s1.open && s2.open)) continue;
|
||||||
if (s1.last().isMergable2D(s2.first())) {
|
if (s1.last().isMergable2D(s2.first())) {
|
||||||
s1.addPoints(s2.points.slice(1));
|
s1.addPoints(s2.points.slice(1));
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue