DEF points1 = <<0,0,0>,<0,3,4>,<0,6,3>,<0,10,0>>;
DEF points2 = <<3,0,2>,<2,2.5,5>,<3,6,5>,<4,8,2>>;
DEF points3 = <<6,0,2>,<8,3,5>,<7,6,4.5>,<6,10,2.5>>;
DEF points4 = <<10,0,0>,<11,3,4>,<11,6,3>,<10,9,0>>;
DEF curve1 = Bezier:S1:points1; DEF curve2 = Bezier:S1:points2;
DEF curve3 = Bezier:S1:points3; DEF curve4 = Bezier:S1:points4;
DEF u0 = MK:<0>; DEF u1 = MK:<0.5>; DEF u2 = MK:<1>;
DEF q10 = UK:(MAP:curve1:u0);
DEF q20 = UK:(MAP:curve2:u0);
DEF q30 = UK:(MAP:curve3:u0);
DEF q40 = UK:(MAP:curve4:u0);
DEF q11 = UK:(MAP:curve1:u1);
DEF q21 = UK:(MAP:curve2:u1);
DEF q31 = UK:(MAP:curve3:u1);
DEF q41 = UK:(MAP:curve4:u1);
DEF q12 = UK:(MAP:curve1:u2);
DEF q22 = UK:(MAP:curve2:u2);
DEF q32 = UK:(MAP:curve3:u2);
DEF q42 = UK:(MAP:curve4:u2);
DEF domain = intervals:1:10;
DEF domain2D = domain * domain;
DEF BezierAndPolyline (points::IsSeq) = STRUCT:< MAP:(Bezier:S1:points):domain, Polyline:points >;
(STRUCT~CAT):<
AA:BezierAndPolyline:<points1, points2,points3, points4>,
[MAP:(Bezier:S1:<q10,q20,q30,q40>),
MAP:(Bezier:S1:<q11,q21,q31,q41>),
MAP:(Bezier:S1:<q12,q22,q32,q42>)]:domain,
AA:polyline:<<q10,q20,q30,q40>, <q12,q22,q32,q42>>,
<MAP:(Beziersurface:<points1,points2,points3,points4>):domain2D>
>;