33 include <shapes2d.scad>;
124 mpc = f*[(c1x+c3x)/2, c3y/2];
126 polygon([[0,0], [c1x,0], mpc, [c3x,c3y]]);
137 polygon([[0,0], [c1x,0], [c3x,c3y]]);
150 mpc =
unit_v([(c1x+c3x)/2, c3y/2]);
155 polygon([[0,0], [c1x,0], [c3x,c3y]]);
157 translate(f*mpc - mpc)
163 polygon([[0,0], [c1x,0], [c3x,c3y]]);
165 translate(f*mpc - mpc)
218 wx = (p == 0) ? max(r, r*f)
219 : (p == 1) ? r/tan(sa/2)
223 : (p == 1) ? r/tan(sa/2)
229 translate(center==
true ?
origin3d : [0, 0, l/2])
232 translate([0,0,-l/2])
233 linear_extrude(height=l)
245 [ 0, -wy, -(l/2+
eps)],
246 [ 0, +wy, -(l/2+
eps)],
247 [wx, +wy, -(l/2+
eps)],
248 [wx, -wy, -(l/2+
eps)],
249 [wx, -wy, -(l/2-
eps-wz)],
250 [wx, +wy, -(l/2-
eps-wz)]
252 faces = [[1,5,4,0], [0,4,3], [1,2,5], [5,2,3,4], [2,1,0,3]]
function unit_v(vt, vi)
Compute the normalized unit vector for a 1, 2, or 3 term vector.
module ellipse_s(size, a1=0, a2=0)
An ellipse sector.
eps
Epsilon, small distance to deal with overlaping shapes
origin3d
The origin coordinates in 3-dimensional Euclidean space.
function bitwise_is_equal(v, b, t=1)
Test if a base-two bit position of an integer value equals a test bit.