← Ecky CAD / Ecky Language Reference

REFERENCE / 07

Core Helper Library

These helpers return values rather than solids. Use them to calculate dimensions, generate profile points, and build lists for repeated geometry. Angles passed to trigonometric functions are radians; use deg->rad to convert degrees.

Constructors and Symbols

vec2

  • signature: vec2 x y
  • returns: 2D point

vec3

  • signature: vec3 x y z
  • returns: 3D point

start

  • constant anchor symbol for path/frame usage

end

  • constant anchor symbol for path/frame usage

xy

  • constant plane symbol

yz

  • constant plane symbol

xz

  • constant plane symbol

true

  • constant boolean alias for #t

false

  • constant boolean alias for #f

Sequence Helpers

zip

  • signature: zip list1 list2 ...
  • returns: list of tuples

enumerate

  • signature: enumerate list
  • signature: enumerate start-index list
  • returns: list of (index item) pairs

flat-map

  • signature: flat-map fn list1 list2 ...
  • returns: concatenated mapped list

concat-map

  • signature: concat-map fn list1 list2 ...
  • same behavior as flat-map

linspace

  • signature: linspace start stop count
  • returns: evenly spaced number list
  • special cases:
  • count <= 0 -> empty list
  • count == 1 -> single-item list containing start

Scalar Math Helpers

pi

  • constant 3.141592653589793

tau

  • constant 6.283185307179586

clamp

  • signature: clamp value lower upper
  • returns: value clamped into [lower, upper]

lerp

  • signature: lerp start end t
  • returns: linear interpolation

invlerp

  • signature: invlerp start end value
  • returns: normalized interpolation factor

remap

  • signature: remap value in-start in-end out-start out-end
  • returns: value remapped from one range into another

deg

  • signature: deg degrees
  • returns: radians

rad

  • signature: rad radians
  • returns: degrees

deg->rad

  • signature: deg->rad degrees
  • returns: radians

rad->deg

  • signature: rad->deg radians
  • returns: degrees

smoothstep

  • signature: smoothstep edge0 edge1 x
  • returns: smoothed 0..1 interpolation

square

  • signature: square x
  • returns: x * x

cube

  • signature: cube x
  • returns: x * x * x

Noise and Field Helpers

hash01

  • signature: hash01 x y seed
  • returns: deterministic 0..1 scalar

hash-signed

  • signature: hash-signed x y seed
  • returns: deterministic -1..1 scalar

noise2

  • signature: noise2 x y seed
  • returns: smoothed 2D value noise

fbm2

  • signature: fbm2 x y seed octaves lacunarity gain
  • returns: fractal Brownian motion sample

voronoi2

  • signature: voronoi2 x y seed
  • returns: Voronoi-style scalar field

cell-distance2

  • signature: cell-distance2 x y seed
  • returns: normalized cell distance field

jitter2

  • signature: jitter2 x y amount seed
  • returns: jittered 2D point

jittered-grid

  • signature: jittered-grid rows cols dx dy amount seed
  • returns: list of jittered 2D points

Shape-Driving Point Generators

polar-points

  • signature: polar-points count radius
  • returns: closed-style circular 2D sample list

organic-loop

  • signature: organic-loop count radius amount seed
  • returns: noisy radial 2D loop

wave-loop

  • signature: wave-loop count rx ry amp waves seed
  • returns: wavy ellipse-like 2D loop

superellipse-point

  • signature: superellipse-point rx ry n t
  • returns: single 2D point on superellipse

voronoi-cells

  • signature: voronoi-cells rows cols dx dy amount seed
  • returns: jittered cell-center point list

Chaotic / Generative Point Clouds

lorenz-points

  • signature: lorenz-points count dt scale
  • returns: list of 3D points

rossler-points

  • signature: rossler-points count dt scale
  • returns: list of 3D points

logistic-bifurcation-points

  • signature: logistic-bifurcation-points count seed scale
  • returns: list of 2D points

henon-points

  • signature: henon-points count seed scale
  • returns: list of 2D points

Use helper outputs as inputs to polygon, bspline, path, bezier-path, map, and repetition logic.