 |
  |
//an egg
paper 20
pen 70
// first we will draw the egg's shape
// it is round, yet not entirely symmetric
// the top it a bit narrower than the bottom
repeat a 0 85
{
//left bottom curve
line 10 (80-a) a 5
line 0 (80-a) 10 (80-a)
//right bottom curve
line 90 (80-a) (100 - a) 5
line 100 (80-a) 90 (80-a)
//top left curve
line 10 (a+20) (a+10) 100
line 86 (100-a) 100 (100-a)
//top right curve
line 90 (a+20) (90-a) 100
line 0 (100-a) 14 (100-a)
//smooth the egg
line a 0 a 10
line a 91 a 92
}
// an egg shell is textured, not completely
// smooth and shiny
// the following are four commands for adding texture
// they create dotted lines that either slope at an
// angle upwards, an angle downwards, or stand
// straight vertically or horizontally
command texture_down slope x y
{
repeat b 0 11
{
set [(x+(slope*b)) (y-(slope*b))] 70
}
}
command texture_up slope x y
{
repeat b 0 11
{
set [(x+(slope*b)) (y+(slope*b))] 70
}
}
command texture_vert space x y
{
repeat b 0 11
{
set [x (y+(space*b))] 70
}
}
command texture_hor space x y
{
repeat b 0 11
{
set [(x+(space*b)) y] 70
}
}
// using the commands, we can add shading to the shell
// of the egg
texture_down 2 20 32
texture_down 2 20 30
texture_down 3 17 38
texture_down 4 23 36
texture_down 6 26 38
texture_up (7/2) 16 58
texture_up 2 22 68
texture_up 2 22 70
texture_vert 2 15 40
texture_vert 3 17 28
texture_vert 4 19 27
texture_vert 5 21 25
texture_vert 6 23 25
texture_hor 2 38 11
texture_hor 3 34 12
texture_hor 5 37 14
|