35 include <shapes2d.scad>;
123 cylinder(h=h, r1=cr, r2=0, center=
false);
127 hl = sqrt(cr*cr + h*h);
129 rotate_extrude(angle=360)
133 triangle_sss( s1=cr*2, s2=hl, s3=hl, v1r=br, v2r=br, v3r=pr );
134 square( size=[cr,h], center=
false );
186 translate(center==
true ?
origin3d : [bx/2, by/2, bz/2])
189 cube([bx, by, bz], center=
true);
193 cube([bx, by-vr*2, bz-vr*2], center=
true);
194 cube([bx-vr*2, by, bz-vr*2], center=
true);
195 cube([bx-vr*2, by-vr*2, bz ], center=
true);
198 rot = [[0,0,0], [90,0,90], [90,90,0]];
202 zo = bv[(axis+2)%3]/2 - vr;
204 for ( x = [1,-1], y = [1,-1] )
207 translate( [x*(bv[axis]/2-vr), y*(bv[(axis+1)%3]/2-vr), 0] )
210 cylinder( h=zo*2, r=vr, center=
true );
221 faces = [[0,2,1], [0,1,4,3], [1,2,5,4], [2,0,3,5], [3,4,5]]
227 for ( x = [1,-1], y = [1,-1], z = [1,-1] )
229 translate([x*(bx/2-vr), y*(by/2-vr), z*(bz/2-vr)])
238 points = [[0,0,0], [vr*x,0,0], [0,vr*y,0], [0,0,vr*z]],
239 faces = [[1,2,3], [0,2,1], [0,3,2], [0,1,3]]
298 trx = w/2 * sqrt(2) + 1;
299 try = w/2 * sqrt(2) + 1;
301 pa0 = (4 * a1 + 0 * a2) / 4;
302 pa1 = (3 * a1 + 1 * a2) / 4;
303 pa2 = (2 * a1 + 2 * a2) / 4;
304 pa3 = (1 * a1 + 3 * a2) / 4;
305 pa4 = (0 * a1 + 4 * a2) / 4;
313 translate([0,0,-h/2])
314 linear_extrude(height=h)
318 [trx * cos(pa0),
try * sin(pa0)],
319 [trx * cos(pa1),
try * sin(pa1)],
320 [trx * cos(pa2),
try * sin(pa2)],
321 [trx * cos(pa3),
try * sin(pa3)],
322 [trx * cos(pa4),
try * sin(pa4)],
355 translate(center==
true ?
origin3d : [0,0,o])
400 translate(center==
true ? [0,0,-ph/2] :
origin3d)
457 translate([0,0,-h/2])
458 cylinder(r=l, h=h, center=
true);
544 size=size, core=core, t=t,
546 vr=vr, vr1=vr1, vr2=vr2,
547 vrm=vrm, vrm1=vrm1, vrm2=vrm2,
615 vr=vr, vr1=vr1, vr2=vr2,
616 centroid=centroid, incenter=incenter
678 size=size, core=core, t=t,
module ellipse_cs(size, core, t, a1=0, a2=0, co, cr=0)
A sector of an ellipse with a removed elliptical core.
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 cone(r, h, d, vr, vr1, vr2)
A cone.
module rectangle_c(size, core, t, co, cr=0, vr, vr1, vr2, vrm=0, vrm1, vrm2, center=false)
A rectangle with a removed rectangular core.
function defined_or(v, d)
Return a value when it is defined or a default value when it is not.
module ellipsoid_s(size, a1=0, a2=0)
A sector of an ellipsoid.
function edefined_or(v, i, d)
Return an iterable element when it exists or a default value when it does not.
function any_undefined(v)
Test if any element of a list of values is undefined.
module triangle_sss(s1, s2, s3, vr, v1r, v2r, v3r, centroid=false, incenter=false)
A general triangle specified by its three side lengths.
function not_defined(v)
Test if a value is not defined.
module torus_ep(size, core, r, l, t, a1=0, a2=0, co, cr=0, pa=0, ra=360, m=255, profile=false)
An elliptical cross-sectional profile revolved about the z-axis.
origin3d
The origin point coordinate in 3-dimensional Euclidean space.
module cuboid(size, vr, vrm=0, center=false)
A cuboid with edge, fillet, or chamfer corners.
module triangle_ls_c(vs, vc, co, cr=0, vr, vr1, vr2, centroid=false, incenter=false)
A general triangle specified by its sides with a removed triangular core.
function bitwise_is_equal(v, b, t=1)
Test if a base-two bit position of an integer value equals a test bit.
origin2d
The origin point coordinate in 2d Euclidean space.
module pyramid_t(size, center=false)
A pyramid with trilateral base formed by four equilateral triangles.
aeps
Epsilon, small distance to deal with overlapping shapes.
module torus_tp(size, core, r, l, co, cr=0, vr, vr1, vr2, pa=0, ra=360, m=255, centroid=false, incenter=false, profile=false,)
A triangular cross-sectional profile revolved about the z-axis.
module torus_rp(size, core, r, l, t, co, cr=0, vr, vr1, vr2, vrm=0, vrm1, vrm2, pa=0, ra=360, m=255, center=false, profile=false)
A rectangular cross-sectional profile revolved about the z-axis.