91 cylinder(h=h, r1=cr, r2=0, center=
false);
95 hl = sqrt(cr*cr + h*h);
97 rotate_extrude(
angle=360)
102 square( size=[cr,h], center=
false );
153 translate(center==
true ?
origin3d : [bx/2, by/2, bz/2])
156 cube([bx, by, bz], center=
true);
160 cube([bx, by-vr*2, bz-vr*2], center=
true);
161 cube([bx-vr*2, by, bz-vr*2], center=
true);
162 cube([bx-vr*2, by-vr*2, bz ], center=
true);
165 rot = [[0,0,0], [90,0,90], [90,90,0]];
169 zo = bv[(axis+2)%3]/2 - vr;
171 for ( x = [1,-1], y = [1,-1] )
174 translate( [x*(bv[axis]/2-vr), y*(bv[(axis+1)%3]/2-vr), 0] )
177 cylinder( h=zo*2, r=vr, center=
true );
188 faces = [[0,2,1], [0,1,4,3], [1,2,5,4], [2,0,3,5], [3,4,5]]
194 for ( x = [1,-1], y = [1,-1], z = [1,-1] )
196 translate([x*(bx/2-vr), y*(by/2-vr), z*(bz/2-vr)])
205 points = [[0,0,0], [vr*x,0,0], [0,vr*y,0], [0,0,vr*z]],
206 faces = [[1,2,3], [0,2,1], [0,3,2], [0,1,3]]
263 trx = w/2 * sqrt(2) + 1;
264 try = w/2 * sqrt(2) + 1;
266 pa0 = (4 * a1 + 0 * a2) / 4;
267 pa1 = (3 * a1 + 1 * a2) / 4;
268 pa2 = (2 * a1 + 2 * a2) / 4;
269 pa3 = (1 * a1 + 3 * a2) / 4;
270 pa4 = (0 * a1 + 4 * a2) / 4;
278 translate([0,0,-h/2])
279 linear_extrude(height=h)
283 [trx * cos(pa0), try * sin(pa0)],
284 [trx * cos(pa1), try * sin(pa1)],
285 [trx * cos(pa2), try * sin(pa2)],
286 [trx * cos(pa3), try * sin(pa3)],
287 [trx * cos(pa4), try * sin(pa4)],
317 translate(center==
true ?
origin3d : [0,0,o])
358 translate(center==
true ? [0,0,-ph/2] :
origin3d)
414 translate([0,0,-h/2])
415 cylinder(r=l, h=h, center=true);
origin2d
<point-2d> The origin point coordinate in 2d Euclidean space.
origin3d
<point-3d> The origin point coordinate in 3-dimensional Euclidean space.
eps
<decimal> Epsilon, small distance to deal with overlapping shapes.
function binary_bit_is(v, b, t=1)
Test if a binary bit position of an integer value equals a test bit.
function defined_e_or(v, i, d)
Return an element of an iterable when it exists or a default value otherwise.
function any_undefined(v)
Test if at least one element of an iterable value has an undefined value.
function defined_or(v, d)
Return given value, if defined, or a secondary value, if primary is not defined.
function is_defined(v)
Test if a value is defined.
function polygon_round_eve_all_p(c, vr=0, vrm=1, vfn, w=true, cw=true)
Compute coordinates that round all of the vertices between each adjacent edges in 2D.
function triangle2d_sss2ppp(v, a=x_axis_ci, cw=true)
Compute a set of vertex coordinates for a triangle given its side lengths in 2D.
module pyramid_t(size, center=false)
A pyramid with trilateral base formed by four equilateral triangles.
module cone(r, h, d, vr, vr1, vr2)
A cone.
module ellipsoid_s(size, a1=0, a2=0)
A sector of an ellipsoid.
module pyramid_q(size, center=false)
A pyramid with quadrilateral base.
module star3d(size, n=5, half=false)
A three-dimensional star.
module ellipsoid(size)
An ellipsoid.
module cuboid(size, vr, vrm=0, center=false)
A cuboid with edge, round, or chamfer corners.
function angle(a, from=angle_unit_default, to=angle_unit_base)
Convert an angle from some units to another.