You are on page 1of 1

OpenSCAD CheatSheet v2015.

03
Syntax Transformations Mathematical Functions
var = value; translate([x,y,z]) abs concat
module name() { } rotate([x,y,z]) sign lookup
name(); scale([x,y,z]) sin str
function name() = resize([x,y,z],auto) cos chr
name();
include <.scad> mirror([x,y,z]) tan search
multmatrix(m) acos version
use <.scad>
color("colorname") asin version_num
color([r,g,b,a]) atan norm
2D offset(r|delta,chamfer) atan2 cross
circle(radius | d=diameter) hull() floor parent_module(idx)
square(size,center) minkowski() round
square([width,height],center) ceil
polygon([points]) ln
Boolean operations
polygon([points],[paths]) len
union()
text(t, size, font, let
halign, valign, spacing, difference()
direction, language, script) log
intersection()
pow
sqrt
3D Modifier Characters exp
sphere(radius | d=diameter) rands
* disable
cube(size, center) min
! show only
cube([width,depth,height], center) max
# highlight / debug
cylinder(h,r|d,center)
% transparent / background
cylinder(h,r1|d1,r2|d2,center)
Other
polyhedron(points, triangles, convexity)
echo()
for (i = [start:end]) { }
for (i = [start:step:end]) { }
for (i = [,,]) { }
intersection_for(i = [start:end]) { }
intersection_for(i = [start:step:end]) { }
intersection_for(i = [,,]) { }
if () { }
assign () { }
import(".stl")
linear_extrude(height,center,convexity,twist,slices)
rotate_extrude(angle,convexity)
surface(file = ".dat",center,convexity)
projection(cut)
render(convexity)
children([idx])

List Comprehensions Special variables


Generate [ for (i = range|list) i ] $fa minimum angle
Conditions [ for (i = ) if (condition(i)) i ] $fs minimum size
Assignments [ for (i = ) let (assignments) a ] $fn number of fragments
$t animation step
$vpr viewport rotation angles in degrees
$vpt viewport translation
$vpd viewport camera distance
$childrennumber of module children

Links: Official website | Code | Issues | Manual | MCAD library | Forum | Other links

Edit me on GitHub!
By Peter Uithoven @ Fablab Amersfoort (CC-BY)

You might also like