more error messages for star()

improve speed and flexibility of apply()
fix triangulation bug
add support for single point 2d solutions in polygon_line_intersection
This commit is contained in:
Adrian Mariano
2021-09-14 20:10:55 -04:00
parent 2ea90b7467
commit 4f8ebb2e80
4 changed files with 46 additions and 21 deletions

View File

@@ -211,7 +211,7 @@ function vnf_triangulate(vnf) =
let(
vnf = is_vnf_list(vnf)? vnf_merge(vnf) : vnf,
verts = vnf[0],
faces = [for (face=vnf[1]) polygon_triangulation(verts, face)]
faces = [for (face=vnf[1]) each polygon_triangulate(verts, face)]
) [verts, faces];
@@ -546,6 +546,11 @@ function vnf_volume(vnf) =
])/6;
function vnf_area(vnf) =
let(verts=vnf[0])
sum([for(face=vnf[1]) polygon_area(select(verts,face))]);
// Function: vnf_centroid()
// Usage:
// vol = vnf_centroid(vnf);