User Tools

Site Tools


tutorials:exercises_spirals

Generate some spirals

Write some code to generate simple spirals.

s1: a=50 degree, s=0.88

s2: a=80 degree, s=1.0

s3: a=120 degree, s=0.75

s4: a=145 degree, s=1.05

Play around with different angles and shrinking factors.

Solution

To solve this task, we need a symbol (here A) that is replaced by some rotation (not around RH!) and a cylinder or F node. Shrinking can be achieved by adding a parameter to the A, that caries a decreasing number that is used as length for the cylinder/F node.

module A(float len);
 
protected void init() [
  Axiom ==> A(1);
]
 
public void run()[
  A(x) ==> F(x,0.05) RL(50) A(x*0.88);
]
tutorials/exercises_spirals.txt · Last modified: 2025/10/28 18:20 by MH