Core API Reference
Standard Library Functions
Built-in functions available in the default scope or via import "std".
Math
sin(rad),cos(rad),tan(rad)asin(v),acos(v),atan(v)sqrt(n),abs(n),pow(n, exp)min(a, b),max(a, b)floor(n),ceil(n),round(n)PI: Constant (3.14159...)
Collections
avg(array): Returns average of numbers.print(args...): Prints to console.Grid(start, step, count): Generates an arithmetic sequence.
Array Methods
array.fold(reducer, initial): Reduces array to single value.array.map(lambda): Transforms each element.array.filter(lambda): Selects elements.array.count/array.length: Number of elements.
import "std"
sum := (1..10).fold((acc, x) => acc + x, 0)
Geometry Constructors
Primitives
Vector(x, y, z): Creates a Vector.Point(x, y, z): Creates a Point.Normal(elev, index): Creates a normal Vector from machine angles (elevation, index). RequiresGear().Normal(elev, azim): Creates a normal Vector from spherical coordinates (elevation, azimuth).Plane(normal, dist): Creates a Plane.Line(origin, dir): Creates a Line.
Solids
Cube(size): Creates a Cube centered at origin.Octahedron(size): Creates an Octahedron.Hull(geometry...): computes the convex hull of the provided points/planes.
Symmetry
Rotate(axis, order): Creates a rotational symmetry group of ordernaroundaxis.Mirror(plane): Creates a reflection symmetry group acrossplane.
Global Configuration
Gear(n): Sets the index gear (e.g., 96). Enables Index Mode.RI(n): Sets the Refractive Index.Mode(s): Sets the angle mode ("deg" or "index").