mirror of
https://github.com/xibyte/jsketcher
synced 2025-12-26 02:12:28 +01:00
Remove zero area polygons
This commit is contained in:
parent
f02edbba70
commit
f3e8328b80
1 changed files with 3 additions and 1 deletions
|
|
@ -409,7 +409,9 @@ TCAD.craft._triangulateCSG = function(polygons) {
|
|||
var a = refs[i][0];
|
||||
var b = refs[i][1];
|
||||
var c = refs[i][2];
|
||||
if (points[b].pos.minus(points[a].pos).cross(points[c].pos.minus(points[a].pos)).length() === 0) {
|
||||
//magnitude of cross product is the area of parallelogram
|
||||
var area = points[b].pos.minus(points[a].pos).cross(points[c].pos.minus(points[a].pos)).length() / 2.0;
|
||||
if (area < TCAD.TOLERANCE) {
|
||||
continue;
|
||||
}
|
||||
var csgPoly = new CSG.Polygon([points[a], points[b], points[c]], poly.shared, poly.plane);
|
||||
|
|
|
|||
Loading…
Reference in a new issue