35 include <shapes2d.scad>;
119 cylinder(h=h, r1=cr, r2=0, center=
false);
123 hl = sqrt(cr*cr + h*h);
125 rotate_extrude(angle=360)
129 triangle_lll( s1=cr*2, s2=hl, s3=hl, v1r=br, v2r=br, v3r=pr );
130 square( size=[cr,h], center=
false );
182 translate(center==
true ?
origin3d : [bx/2, by/2, bz/2])
185 cube([bx, by, bz], center=
true);
189 cube([bx, by-vr*2, bz-vr*2], center=
true);
190 cube([bx-vr*2, by, bz-vr*2], center=
true);
191 cube([bx-vr*2, by-vr*2, bz ], center=
true);
194 rot = [[0,0,0], [90,0,90], [90,90,0]];
198 zo = bv[(axis+2)%3]/2 - vr;
200 for ( x = [1,-1], y = [1,-1] )
203 translate( [x*(bv[axis]/2-vr), y*(bv[(axis+1)%3]/2-vr), 0] )
206 cylinder( h=zo*2, r=vr, center=
true );
217 faces = [[0,2,1], [0,1,4,3], [1,2,5,4], [2,0,3,5], [3,4,5]]
223 for ( x = [1,-1], y = [1,-1], z = [1,-1] )
225 translate([x*(bx/2-vr), y*(by/2-vr), z*(bz/2-vr)])
234 points = [[0,0,0], [vr*x,0,0], [0,vr*y,0], [0,0,vr*z]],
235 faces = [[1,2,3], [0,2,1], [0,3,2], [0,1,3]]
294 trx = w/2 * sqrt(2) + 1;
295 try = w/2 * sqrt(2) + 1;
297 pa0 = (4 * a1 + 0 * a2) / 4;
298 pa1 = (3 * a1 + 1 * a2) / 4;
299 pa2 = (2 * a1 + 2 * a2) / 4;
300 pa3 = (1 * a1 + 3 * a2) / 4;
301 pa4 = (0 * a1 + 4 * a2) / 4;
309 translate([0,0,-h/2])
310 linear_extrude(height=h)
314 [trx * cos(pa0),
try * sin(pa0)],
315 [trx * cos(pa1),
try * sin(pa1)],
316 [trx * cos(pa2),
try * sin(pa2)],
317 [trx * cos(pa3),
try * sin(pa3)],
318 [trx * cos(pa4),
try * sin(pa4)],
351 translate(center==
true ?
origin3d : [0,0,o])
396 translate(center==
true ? [0,0,-ph/2] :
origin3d)
453 translate([0,0,-h/2])
454 cylinder(r=l, h=h, center=
true);
540 size=size, core=core, t=t,
542 vr=vr, vr1=vr1, vr2=vr2,
543 vrm=vrm, vrm1=vrm1, vrm2=vrm2,
610 vr=vr, vr1=vr1, vr2=vr2,
611 centroid=centroid, incenter=incenter
673 size=size, core=core, t=t,
function defined_or(v, d)
Return a defined or default value.
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 triangle_vl_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.
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.
module ellipsoid_s(size, a1=0, a2=0)
A sector of an ellipsoid.
function not_defined(v)
Test if a value is not defined.
eps
Epsilon, small distance to deal with overlaping shapes
function any_undefined(v)
Test if any element of a value is undefined.
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 coordinates in 3-dimensional Euclidean space.
module cuboid(size, vr, vrm=0, center=false)
A cuboid with edge, fillet, or chamfer corners.
function edefined_or(v, i, d)
Return a defined vector element or default value.
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 coordinates in 2-dimensional Euclidean space.
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 triangle_lll(s1, s2, s3, vr, v1r, v2r, v3r, centroid=false, incenter=false)
A general triangle specified by its three side lengths.
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.
module tetrahedron(size, center=false)
A pyramid with trilateral base formed by four equilateral triangles.