home

3D Shapes

Sphere

sphere

Creates a sphere with a specified radius.

						
//!OpenSCAD
//sphere
sphere(r=10);			
					

Cube

cube

Creates a rectangular prism of specified dimensions x, y, and z. Primitive may optionally be centered around the origin.

						
//!OpenSCAD
//cube
cube([10, 10, 10], center=false);
					

Cylinder

cylinder

Creates a cylinder with a specified bottom radius, top radius, and height. The padlock icon allows the radius values to be locked or unlocked from each other. The Cylinder primitive may optionally be centered at the origin.

						
//!OpenSCAD
//cylinder
cylinder(r1=10, r2=10, h=10, center=false);
					

Torus

torus

Creates a torus with a ring of specified distance from the origin (radius 1), with a specified radius (radius 2), and a specified number of sides and faces.

						
//!OpenSCAD
// torus
rotate_extrude($fn=8) {
  translate([4, 0, 0]) {
    circle(r=1, $fn=16);
  }
}