OpenSCAD User Manual/Commented Example Projects
Dodecahedron[edit | edit source]
Icosahedron[edit | edit source]
An icosahedron can be created from three orthogonal golden-ratio rectangles inside a hull()
operation, where the golden ratio is .
This icosahedron renders in an edge-up orientation. Rotating this icosahedron by about the Y-axis results in a vertex-up orientation. Rotating by about the X-axis results in a face-up orientation. The edge length is related to the inner diameter (distance between opposite faces) by .
Half-pyramid[edit | edit source]
An upside-down half-pyramid is a useful shape for 3D printing a support for an overhang protruding from a vertical wall. With sloping sides no steeper than 45°, no removable support structure needs to be printed.
While a half-pyramid can be made with a 4-sided cone (using the cylinder primitive) and subtracting a cube from half of it, the shape can be easily made in one operation by a scaled linear extrude of a rectangle having the middle of one edge on the origin.
Bounding Box[edit | edit source]
Linear Extrude extended use examples[edit | edit source]
Linear Extrude with Scale as an interpolated function[edit | edit source]
Linear Extrude with Twist as an interpolated function[edit | edit source]
Linear Extrude with Twist and Scale as interpolated functions[edit | edit source]
Rocket[edit | edit source]

// increase the visual detail
$fn = 100;
// the main bidy :
// a cylinder
rocket_d = 30; // 3 cm wide
rocket_r = rocket_d / 2;
rocket_h = 100; // 10 cm tall
cylinder(d = rocket_d, h = rocket_h);
// the head :
// a cone
head_d = 40; // 4 cm wide
head_r = head_d / 2;
head_h = 40; // 4 cm tall
// prepare a triangle
tri_base = head_r;
tri_height = head_h;
tri_points = [[0, 0],
[tri_base, 0],
[0, tri_height]];
// rotation around X-axis and then 360° around Z-axis
// put it on top of the rocket's body
translate([0,0,rocket_h])
rotate_extrude(angle = 360)
polygon(tri_points);
// the wings :
// 3x triangles
wing_w = 2; // 2 mm thick
many = 3; // 3x wings
wing_l = 40; // length
wing_h = 40; // height
wing_points = [[0,0],[wing_l,0],[0,wing_h]];
module wing() {
// let it a bit inside the main body
in_by = 1; // 1 mm
// set it up on the rocket's perimeter
translate([rocket_r - in_by,0,0])
// set it upright by rotating around X-axis
rotate([90,0,0])
// set some width and center it
linear_extrude(height = wing_w,center = true)
// make a triangle
polygon(wing_points);
}
for (i = [0: many - 1])
rotate([0, 0, 370 / many * i])
wing();
Horns[edit | edit source]

// The idea is to twist a translated circle:
// -
/*
linear_extrude(height = 10, twist = 360, scale = 0)
translate([1,0])
circle(r = 1);
*/
module horn(height = 10, radius = 6,
twist = 720, $fn = 50)
{
// A centered circle translated by 1xR and
// twisted by 360° degrees, covers a 2x(2xR) space.
// -
radius = radius/4;
// De-translate.
// -
translate([-radius,0])
// The actual code.
// -
linear_extrude(height = height, twist = twist,
scale=0, $fn = $fn)
translate([radius,0])
circle(r=radius);
}
translate([3,0])
mirror()
horn();
translate([-3,0])
horn();
Strandbeest[edit | edit source]
See the Strandbeest example here.