mirror of
https://github.com/BelfrySCAD/BOSL2.git
synced 2024-12-29 16:29:40 +00:00
Update geometry.scad
This commit is contained in:
parent
aef60324fd
commit
da751e1e13
1 changed files with 5 additions and 3 deletions
|
@ -1673,11 +1673,13 @@ function polygon_triangulate(poly, ind, eps=EPSILON) =
|
||||||
: len(poly[ind[0]]) == 3
|
: len(poly[ind[0]]) == 3
|
||||||
? // represents the polygon projection on its plane as a 2d polygon
|
? // represents the polygon projection on its plane as a 2d polygon
|
||||||
let(
|
let(
|
||||||
ind = deduplicate_indexed(poly, ind, eps),
|
ind = deduplicate_indexed(poly, ind, eps)
|
||||||
|
)
|
||||||
|
len(ind)<3 ? [] :
|
||||||
|
let(
|
||||||
pts = select(poly,ind),
|
pts = select(poly,ind),
|
||||||
nrm = polygon_normal(pts)
|
nrm = polygon_normal(pts)
|
||||||
)
|
)
|
||||||
len(ind)<3 ? [] :
|
|
||||||
// here, instead of an error, it might return [] or undef
|
// here, instead of an error, it might return [] or undef
|
||||||
assert( nrm!=undef,
|
assert( nrm!=undef,
|
||||||
"The polygon has self-intersections or its vertices are collinear or non coplanar.")
|
"The polygon has self-intersections or its vertices are collinear or non coplanar.")
|
||||||
|
|
Loading…
Reference in a new issue