From 32b4426a4eaacb7737ec09ebd88bb41a089868e8 Mon Sep 17 00:00:00 2001 From: Adrian Mariano Date: Tue, 19 Nov 2024 18:59:34 -0500 Subject: [PATCH 1/2] Don't assert error if polyhedron doesn't exist --- polyhedra.scad | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/polyhedra.scad b/polyhedra.scad index 03b62bc8..54e463e9 100644 --- a/polyhedra.scad +++ b/polyhedra.scad @@ -330,6 +330,7 @@ module regular_polyhedron( stellate=stellate, longside=longside, h=h, height=height ); + assert(len(entry)>0, "No polyhedra meet your specification"); scaled_points = entry[0]; translation = entry[1]; face_triangles = entry[2]; @@ -657,7 +658,8 @@ function regular_polyhedron_info( ] ) ) - assert(len(indexlist)>0, "No polyhedra meet your specification") + len(indexlist)==0 ? [] + : let(validindex = is_undef(index) || (index>=0 && index Date: Tue, 19 Nov 2024 19:01:01 -0500 Subject: [PATCH 2/2] doc fix --- polyhedra.scad | 1 + 1 file changed, 1 insertion(+) diff --git a/polyhedra.scad b/polyhedra.scad index 54e463e9..42a50bbe 100644 --- a/polyhedra.scad +++ b/polyhedra.scad @@ -586,6 +586,7 @@ _stellated_polyhedra_ = [ // * `"center"`: center for the polyhedron // * `"type"`: polyhedron type, one of "platonic", "archimedean", "catalan", or "trapezohedron" // * `"name"`: name of selected polyhedron +// If you specify an impossible selection of polyhedrons, then `[]` is returned. // // Arguments: // info = Desired information to return for the polyhedron