IceSL cheat sheet

2017-11-30

Vectors and Matrices

v (x, y [,z]) | v {x, y [,z]}
m (n11, n12, ..., n44) | m {n11, n12, ..., n44}

Operations

let v, m and n be a vector, a matrix and a number respectively:

v + v ; v - v ; v * v ; v / v ; v * n ; v / n ; -v
m * m ; m * v
dot (v,v)
cross (v,v)
normalize (v)
length (v)
inverse (m)

Emiting

emit (shape [,brush])
set_brush_color(brush, r, g, b)

Primitives Shapes

load | loadmesh | load_centered | load_centered_on_plate (path)
sphere(radius [,center])
cube | ccube | box (d | dx ,dy ,dz | v )
cone | ccone (r0, r1, h | r0, r1, c0, c1)
cylinder | ccylinder (r, h | r, c0, c1])
polyhedron ({points}, {indices})
Void

Non-primitive Shapes

linear_extrude (dir, {points})
linear_extrude_from_oriented (dir, {points})
rotate_extrude ({points}, nsteps)

Implicits

implicit (boxMin, boxMax, fragment)
implicit_from_file (boxMin, boxMax, fileName)
set_uniform_boolean|scalar|vector|matrix|texture3d (implicit, var_name, var_value)
GLSL cheat sheet

3D textures

tex3d_rgb32f|r32f|rgb8f|r8f (w,h,d)
:set(u, v, w, value)

Transformations

translate (dx, dy, dz | v)
rotate (angle, axis | rx, ry, rz | v)
scale (scale | sx, sy, sz | v)
mirror (direction)
frame (direction)
let T and s be a transformation and a shape respectively;
s' = T * s

Magnets

magent (name)
snap (shape0, magnet0, shape1, magnet1)

CSG Operations

union | U (shape0, shape1)
union | U {shape0, ..., shapen}
intersection | I (shape0, shape1)
intersection | I {shape0, ..., shapen}
difference | D (shape0, shape1)
difference | D {shape0, ..., shapen}

Other Operations

merge (s0, s1) | merge {s0, ..., sn}
flip (mesh)
convex_hull (shape)
dilate (mesh, factor)
erode (mesh, factor)
linear_offset (mesh, direction, offset)
linear_offsets (mesh, {directions}, {offsets})

Shape Representation

to_voxel_volume (shape, voxSize)
to_voxel_distance_field (shape, voxSize) set_distance_field_iso (voxels, threshold)
smooth_voxels | smooth_voxels_preserve_volume (voxels, windowSize)
to_mesh (shape, voxSize)
voxelize_to_file (shape, voxSize, fileName)
distribute (shape, density)

Shapes from asset

load_raw_voxels (fileName, thicken)
svg_ex (svg_file, dpi)
:outline() :fill() :stroke() :strokeWidth() :hasFill() :hasStroke()
font (ttf_file)
:str(string, tracking)

Tweaks

ui_scalar (name, default, min, max)

Mesh Information

bbox (shape)
:min_corner() :max_corner() :center() :extent() :empty()
mesh_vertices (mesh)
mesh_normals (mesh)
mesh_local_edge_size (mesh)

Misc

screenshot ()
set_tesselation_factor (factor)
sleep (ms)
dump (shape, filename)