84 translate( center==
true ? [0, 0, -h/2] :
origin3d )
87 cylinder(h=h, r1=r, r2=0, center=
false);
93 rotate_extrude(
angle=360)
94 translate([
eps*2-r, 0])
100 square( size=[r, h], center=
false );
151 translate(center==
true ?
origin3d : [bx/2, by/2, bz/2])
154 cube([bx, by, bz], center=
true);
158 cube([bx, by-vr*2, bz-vr*2], center=
true);
159 cube([bx-vr*2, by, bz-vr*2], center=
true);
160 cube([bx-vr*2, by-vr*2, bz ], center=
true);
163 rot = [[0,0,0], [90,0,90], [90,90,0]];
167 zo = bv[(axis+2)%3]/2 - vr;
169 for ( x = [1,-1], y = [1,-1] )
172 translate( [x*(bv[axis]/2-vr), y*(bv[(axis+1)%3]/2-vr), 0] )
175 cylinder( h=zo*2, r=vr, center=
true );
186 faces = [[0,2,1], [0,1,4,3], [1,2,5,4], [2,0,3,5], [3,4,5]]
192 for ( x = [1,-1], y = [1,-1], z = [1,-1] )
194 translate([x*(bx/2-vr), y*(by/2-vr), z*(bz/2-vr)])
203 points = [[0,0,0], [vr*x,0,0], [0,vr*y,0], [0,0,vr*z]],
204 faces = [[1,2,3], [0,2,1], [0,3,2], [0,1,3]]
232 translate( center==
true ?
origin3d : [0, 0, h/2] )
270 trx = d/2 * sqrt(2) + 1;
271 try = d/2 * sqrt(2) + 1;
273 pa0 = (4 * a1 + 0 * a2) / 4;
274 pa1 = (3 * a1 + 1 * a2) / 4;
275 pa2 = (2 * a1 + 2 * a2) / 4;
276 pa3 = (1 * a1 + 3 * a2) / 4;
277 pa4 = (0 * a1 + 4 * a2) / 4;
285 translate(center==
true ? [0,0,-h/2] :
origin3d)
286 linear_extrude(height=h)
290 [trx * cos(pa0),
try * sin(pa0)],
291 [trx * cos(pa1),
try * sin(pa1)],
292 [trx * cos(pa2),
try * sin(pa2)],
293 [trx * cos(pa3),
try * sin(pa3)],
294 [trx * cos(pa4),
try * sin(pa4)],
326 translate(center==
true ?
origin3d : [0,0,o])
367 translate(center==
true ? [0,0,-ph/2] :
origin3d)
418 translate( center==
true ?
origin3d : [0, 0, h/2] )
429 translate([0,0,-h/2])
430 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)
Returns an element from an iterable if it exists, or a default value if not.
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_q(size=1, center=false)
A pyramid with quadrilateral base.
module ellipsoid_s(size=1, a1=0, a2=0, center=false)
A sector of an ellipsoid.
module star3d(size=1, n=5, half=false, center=false)
A three-dimensional star.
module cone(size=1, vr, center=false)
A cone.
module cuboid(size=1, vr, vrm=0, center=false)
A cuboid with edge, round, or chamfer corners.
module pyramid_t(size=1, center=false)
A pyramid with trilateral base formed by four equilateral triangles.
module ellipsoid(size=1, center=false)
An ellipsoid.
function angle(a, from=angle_unit_default, to=angle_unit_base)
Convert an angle value from one unit to another.