1 Bone {
2 currentLength: 50
3 currentAngle: 0
4 }
Code Sample 1: Creating a single bone
insert b2 into b1.children;
b2.parent = b1;

1 def head: Bone = Bone {
2 currentAngle: 90
3 currentLength: 30
4 }
5
6 def torso: Bone = Bone {
7 parent: head
8 currentAngle: 0
9 currentLength: 80
10 }
11
12 def upperArm: Bone[] = for (i in [0..1]) {
13 Bone {
14 parent: head
15 currentLength: 60
16 currentAngle: 60 - 90*i
17 }
18 }
19
20 def lowerArm: Bone[] = for (i in [0..1]) {
21 Bone {
22 parent: upperArm[i]
23 currentLength: 60
24 currentAngle: -90
25 }
26 }
27
28 def upperLeg: Bone[] = for (i in [0..1]) {
29 Bone {
30 parent: torso
31 currentLength: 60
32 currentAngle: 30 - 90*i
33 }
34 }
35
36 def lowerLeg: Bone[] = for (i in [0..1]) {
37 Bone {
38 parent: upperLeg[i]
39 currentLength: 75
40 currentAngle: 90
41 }
42 }
Code Sample 2: Creating the structure of the dummy
1 Bone {
2 currentHead: Point2D {x: 30, y: 30}
3 currentLength: 50
4 currentAngle: 0
5 content: [
6 Circle {radius: 20}
7 Ellipse {radiusX: 25, radiusY: 15, centerX: 45}
8 Circle {centerX: 80, radius: 10}
9 ]
10 }
Code Sample 3: Attaching visual elements to a bone

1 def head: Bone = Bone {
2 [...]
3 content: Ellipse {radiusX: 20, radiusY: 15}
4 }
5
6 def torso: Bone = Bone {
7 [...]
8 content: Ellipse {radiusX: 50, radiusY: 20, centerX: 40}
9 }
10
11 def upperArm: Bone[] = for (i in [0..1]) {
12 Bone {
13 [...]
14 content: Ellipse {radiusX: 30, radiusY: 12.5, centerX: 22.5}
15 }
16 }
17
18 def lowerArm: Bone[] = for (i in [0..1]) {
19 Bone {
20 [...]
21 content: [
22 Circle {radius: 12.5}
23 Ellipse {radiusX: 20, radiusY: 12.5, centerX: 30}
24 Circle {radius: 12.5, centerX: 60}
25 ]
26 }
27 }
28
29 def upperLeg: Bone[] = for (i in [0..1]) {
30 Bone {
31 [...]
32 content: Ellipse {radiusX: 30, radiusY: 15, centerX: 20}
33 }
34 }
35
36 def lowerLeg: Bone[] = for (i in [0..1]) {
37 Bone {
38 [...]
39 content: [
40 Circle {radius: 15}
41 Ellipse {radiusX: 30, radiusY: 15, centerX: 40}
42 Ellipse {radiusX: 10, radiusY: 22.5, centerX: 75, centerY: -10}
43 ]
44 }
45 }
Code Sample 4: Attaching visual elements to the dummy