functional language for computing with geometry
DEF out = mappedCurveAndBoundary
WHERE
Su0 = BezierCurve:<<0,0,0>,<10,0,0>> (AA:COMP ~DISTR) [S1],
Su1 = BezierCurve:<<0,10,0>,<2.5,10,3>,<5,10,-3>,<7.5,10,3>,<10,10,0>> (AA:COMP ~DISTR) [S1],
S0v = BezierCurve:<<0,0,0>,<0,0,3>,<0,10,3>,<0,10,0>> (AA:COMP ~DISTR) [S2],
S1v = BezierCurve:<<10,0,0>,<10,5,3>,<10,10,0>> (AA:COMP ~DISTR) [S2],
SpiralFun = [radius * COS, radius * SIN] ~ S1
WHERE radius = K:1 - K:(0.2 / (6 * PI)) * ID END,
Spiral = (T:<1,2>:<0.5,0.5> ~ S:<1,2>:<0.5,0.5> ~ (Intervals:(6 * PI):100),
mappedCurveAndBoundary = STRUCT:< MAP:Su0:dom, MAP:Su1:dom, MAP:S0v:dom, MAP:S1v:dom, MAP:(CoonsPatch:<Su0,Su1,S0v,S1v>):Spiral >
dom = Intervals:1:18 * Intervals:1:18
END
END;