Curv

v0.5+

Constants

pi   circle const. π (~3.14) tau  circle const. τ (2π) (~6.28) phi  golden ratio φ (~1.61803) e    Euler's number e (~2.71828) deg  degrees

3D Shapes

sphere d spheroid [dxy,dz] ellipsoid [dx,dy,dz] cylinder {d,h} cone {d,h} capped_cone {h,top,bottom} torus {major:d1, minor:d2} box [dx,dy,dz] box [[xmin,ymin,zmin],[xmax,ymax,zmax]] box {xmin,ymin,zmin,xmax,ymax,zmax} prism n {d,h} S d    Platonic solid S can be
     tetrahedron, cube, octahedron,
     dodecahedron, or icosahedron
capsule {d:diameter, from:p1, to:p2} half_space {d, normal:n} half_space {at:p, normal:n} half_space [p1,p2,p3] gyroid nothing  everything  make_shape {dist,colour,bbox,is_3d}

2D Transformations

move [dx,dy] shape rotate angle shape reflect [vnx,vny] shape scale k shape at p (t) shape about [vx,vy] (t) shape about angle (t) shape align.min [dx,dy] shape align.max [dx,dy] shape align.centre [dx,dy] shape stretch [kx,ky] shape stretch k shape shear kx shape local_taper {scale:[kx0,kx1],
     range:[y0,y1],} shape
bend {d, angle} shape swirl {d, strength} shape

2D Repetition

repeat [dx,dy] shape repeat {d:[dx,dy], reps:[nx,ny]} shape mirror [vnx,vny] shape repeat_radial n shape

2D -> 3D

extrude d shape revolve shape perimeter_extrude perimeter cross_section

3D Transformations

move [dx,dy,dz] shape rotate {angle, axis} shape reflect [vnx,vny,vnx] shape scale k shape at p (t) shape about [vx,vy,vz] (t) shape align.min [dx,dy,dz] shape align.max [dx,dy,dz] shape align.centre [dx,dy,dz] shape stretch [kx,ky,kz] shape stretch k shape shear [kx,ky] shape local_taper {scale:[[kx0,ky0],
     [kx1,ky1]], range:[z0,z1] shape
twist tr shape bend {d, angle} shape

3D Repetition

repeat [dx,dy,dz] shape repeat {d:[dx,dy,dz],
     reps:[nx,ny,nz]} shape
mirror [vnx,vny,vnz] shape repeat_radial n shape

3D -> 2D

slice [vnx,vny,vnz] shape

Functions

identifier -> expression :
   function literal
f x function with one argument f [x,y] func w/ list of args f {x,y} func w/ record of args f x y curried function x >> f : pipeline,
    equivalent to "f x"
a >> into f [b,c] :
   equivalent to "f [a,b,c]"
a `f` b : infix,
   equivalent to "f [a,b]"
match [function_list] call function within a record compose [function_list] id identity function error error function