33 include <../math/math_polytope.scad>;
34 include <tools_align.scad>;
111 translate(fo) rotate(tr)
113 linear_extrude(fh, center=
true)
114 text(str(i), size=fs, halign=
"center", valign=
"center");
116 text(str(i), size=fs, halign=
"center", valign=
"center");
128 translate(fo) rotate(tr)
130 linear_extrude(fh, center=
true)
131 text(str(i), size=fs, halign=
"center", valign=
"center");
133 text(str(i), size=fs, halign=
"center", valign=
"center");
145 translate(fo) rotate(tr)
147 linear_extrude(fh, center=
true)
148 text(str(i), size=fs, halign=
"center", valign=
"center");
150 text(str(i), size=fs, halign=
"center", valign=
"center");
232 if (
is_between(vc, 0, $children-1) && ($children > 0))
246 if (
is_between(fc, 0, $children-1) && ($children > 0))
260 if (
is_between(ec, 0, $children-1) && ($children > 0))
305 d = len([
for (i=b)
if (i != [undef, undef]) i]);
308 translate([b[0][0], b[1][0], b[2][0]])
309 cube([b[0][1]-b[0][0], b[1][1]-b[1][0], b[2][1]-b[2][0]]);
311 translate([b[0][0], b[1][0]])
312 square([b[0][1]-b[0][0], b[1][1]-b[1][0]]);
function distance_pp(p1, p2)
Compute the distance between two Euclidean points.
function polytope_edge_n(c, f, e, i)
Get a normal vector for a polytope edge.
function mean(v)
Compute the mean/average of a list of numbers.
function polytope_vertex_n(c, f, i)
Get a normal vector for a polytope vertex.
function defined_or(v, d)
Return a value when it is defined or a default value when it is not.
function dimension_2to3_v(v)
Return 3d vector unchanged or add a zeroed third dimension to 2d vector.
function second(v)
Return the second element of an iterable value.
function all_defined(v)
Test if no element of a list of values is undefined.
function polytope_face_m(c, f, i, l)
Get the mean coordinate of all vertices of a polytope face.
function is_defined(v)
Test if a value is defined.
function first(v)
Return the first element of an iterable value.
function polytope_faces2edges(f)
List the edge coordinate index pairs of a polytope.
function get_index(l, s=true, rs)
Create a sequence for a list index sequence specification.
function is_between(v, l, u)
Test if a numerical value is between an upper and lower bounds.
function consts(l, v, u=false)
Create a sequence of constant or incrementing elements.
function polytope_face_n(c, f, i, l, cw=true)
Get the normal vector of a polytope face.
function polytope_limits(c, f, a, d=[0:2], s=true)
Determine the bounding limits of a polytope.