rm dead code. fix point conversion for small areas

This commit is contained in:
Stewart Allen 2021-06-09 11:08:12 -04:00
commit 1c25bb22f3

View file

@ -1418,7 +1418,7 @@
} }
} }
let filter = isBelt ? (norm) => { let filter = isBelt ? (norm) => {
return norm.z < thresh && norm.y < -0.001; return norm.z <= thresh && norm.y < 0;
} : (norm) => { } : (norm) => {
return norm.z < thresh; return norm.z < thresh;
}; };
@ -1437,8 +1437,7 @@
continue; continue;
} }
// skip tiny faces // skip tiny faces
let area = BASE.newPolygon().addPoints([a,b,c]).area(); let poly = BASE.newPolygon().addPoints([a,b,c].map(v => BASE.newPoint(v.x, v.y, v.z)));
let poly = BASE.newPolygon().addPoints([a,b,c]);
if (poly.area() < min && poly.perimeter() < size) { if (poly.area() < min && poly.perimeter() < size) {
continue; continue;
} }
@ -1448,15 +1447,9 @@
} }
// match with other attached, coplanar faces // match with other attached, coplanar faces
coplane.put(a, b, c, norm.z); coplane.put(a, b, c, norm.z);
// midpoint only for areas about the size of the support pillar
// if (area < size) {
// tp(new THREE.Vector3().add(a).add(b).add(c).divideScalar(3));
// continue;
// }
// ta(a,b,c);
} }
// console.log({v3cache, coplane});
let groups = coplane.group(true); let groups = coplane.group(true);
// console.log({v3cache, coplane, groups});
for (let group of Object.values(groups)) { for (let group of Object.values(groups)) {
for (let polys of group) { for (let polys of group) {
for (let poly of polys) { for (let poly of polys) {