You are on page 1of 1

OpenSCAD v2019.

05
Syntax 2D Boolean operations Functions
var = value; circle(radius | d=diameter) union() concat
var = cond ? value_if_true : value_if_false; square(size,center) difference() lookup
module name(…) { … } square([width,height],center) intersection() str
name(); polygon([points]) chr
function name(…) = … polygon([points],[paths]) ord
name(); List Comprehensions
include <….scad> text(t, size, font, search
halign, valign, spacing, Generate [ for (i = range|list) i ] version
use <….scad> direction, language, script) Generate [ for (init;condition;next) i ]
import("….ext") version_num
Flatten [ each i ] parent_module(idx)
projection(cut)
Constants Conditions [ for (i = …) if (condition(i)) i ]
undef undefined value Conditions [ for (i = …) if (condition(i)) x else y ]
3D Assignments [ for (i = …) let (assignments) a ] Mathematical
PI mathematical constant π (~3.14159)
abs
sphere(radius | d=diameter)
sign
cube(size, center) Flow Control
Special variables cube([width,depth,height], center)
sin
for (i = [start:end]) { … } cos
$fa minimum angle cylinder(h,r|d,center) for (i = [start:step:end]) { … } tan
$fs minimum size cylinder(h,r1|d1,r2|d2,center) for (i = […,…,…]) { … } acos
$fn number of fragments polyhedron(points, faces, convexity) for (i = …, j = …, …) { … } asin
$t animation step import("….ext") intersection_for(i = [start:end]) { … } atan
$vpr viewport rotation angles in degrees linear_extrude(height,center,convexity,twist,slices) intersection_for(i = [start:step:end]) { … } atan2
$vpt viewport translation rotate_extrude(angle,convexity) intersection_for(i = […,…,…]) { … } floor
$vpd viewport camera distance surface(file = "….ext",center,convexity) if (…) { … } round
$children number of module children let (…) { … } ceil
$preview true in F5 preview, false for F6
Transformations ln
translate([x,y,z]) Type test functions len
Modifier Characters rotate([x,y,z]) is_undef let
rotate(a, [x,y,z]) is_bool log
* disable
scale([x,y,z]) pow
! show only is_num
resize([x,y,z],auto) sqrt
# highlight / debug is_string
mirror([x,y,z]) exp
% transparent / background is_list
multmatrix(m) rands
color("colorname",alpha) min
color("#hexvalue") Other max
color([r,g,b,a]) echo(…) norm
offset(r|delta,chamfer) render(convexity) cross
hull() children([idx])
minkowski() assert(condition, message)
assign (…) { … }

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