Compare commits

...

3 commits

Author SHA1 Message Date
Revar Desmera
bbf4bc38c0
Merge pull request #1509 from adrianVmariano/master
polyhedron fix
2024-11-19 16:27:11 -08:00
Adrian Mariano
c86d36d122 doc fix 2024-11-19 19:01:01 -05:00
Adrian Mariano
32b4426a4e Don't assert error if polyhedron doesn't exist 2024-11-19 18:59:34 -05:00

View file

@ -330,6 +330,7 @@ module regular_polyhedron(
stellate=stellate, stellate=stellate,
longside=longside, h=h, height=height longside=longside, h=h, height=height
); );
assert(len(entry)>0, "No polyhedra meet your specification");
scaled_points = entry[0]; scaled_points = entry[0];
translation = entry[1]; translation = entry[1];
face_triangles = entry[2]; face_triangles = entry[2];
@ -585,6 +586,7 @@ _stellated_polyhedra_ = [
// * `"center"`: center for the polyhedron // * `"center"`: center for the polyhedron
// * `"type"`: polyhedron type, one of "platonic", "archimedean", "catalan", or "trapezohedron" // * `"type"`: polyhedron type, one of "platonic", "archimedean", "catalan", or "trapezohedron"
// * `"name"`: name of selected polyhedron // * `"name"`: name of selected polyhedron
// If you specify an impossible selection of polyhedrons, then `[]` is returned.
// //
// Arguments: // Arguments:
// info = Desired information to return for the polyhedron // info = Desired information to return for the polyhedron
@ -657,7 +659,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<len(indexlist))) let(validindex = is_undef(index) || (index>=0 && index<len(indexlist)))
assert(validindex, str( assert(validindex, str(
len(indexlist), len(indexlist),