Power of Polygons

 

Polygon Star:

 

ERASE "PStar

TO PStar :n :Size

  REPEAT :n [

    LT 60 FD :Size RT 120 FD :size LT 60

    RT 360/:n

  ]

END

 

PStar 8 100 ; 8 pointed star

Super Polygons - Polygons Outside:

We can use the following procedures to draw designs in Figure 12-7 and Figure 12-8.

ERASE "L.Polygon

TO L.Polygon :Size :N

  REPEAT :N [

    FD :Size LT 360/:N

  ]

END

 

ERASE "Super.Polygon

TO Super.Polygon :Size :N1 :N2

  REPEAT :N1 [

    L.Polygon :Size :N2

    FD :Size RT 360/:N1

  ]

END

 

The following instructions will produce the required designs.

Super.polygon 50 8 3 ; Octagon surrounded by a triangles

Super.polygon 50 6 6 ; Honeycomb design

 

Super Polygons - Polygons Inside:

We can use the following procedure to draw polygons with polygons on the inside as shown in Figure 12-11.

 

 

 

ERASE "Super.Polygon.In

TO Super.Polygon.In :Size :N1 :N2

  REPEAT :N1 [

    Polygon :N2 :Size

    FD :Size RT 360/:N1   

  ]

END

 

The following instructions will produce the required designs.

 

Super.Polygon.In 100 10 4

PE Polygon 100 10 PPT

 

Super.Polygon.In 100 12 6

PE Polygon 100 12 PPT

 

Super.Polygon.In 100 10 5

PE Polygon 100 10 PPT

Designs using spikes:

We can use the following instructions to create the designs shown in Figure 12-14.

 

12 pointed star using spikes:

REPEAT 12 [Spike 80 100 RT 360/12]

 

36 pointed star using spikes:

REPEAT 36 [Spike 85 50 RT 360/36]

 

Hexagon of fingers:

We can create the fingers pattern shown here using the Spike procedure created above.

 

REPEAT 5 [Spike 83 100]

 

We can then rotate this Fingers pattern to get a hexagon of fingers!

 

 

 

 

REPEAT 6 [

  REPEAT 5 [

    Spike 83 80

  ]

  RT 60

]

Design using Letter I:

We can use the following procedure to draw a letter i.

 

ERASE "LetterI

TO LetterI :size

  FD :size PU FD :size*20/50 PD

  FD :size*10/50 PU BK :size*80/50 PD

END

 

We will now rotate this basic pattern to draw the required design using TRT principle.

 

REPEAT 50 [LetterI 50 RT 360/50]

Chain of Letter H:

We will use the following procedure to draw a letter H of given size.

 

ERASE "LetterH

TO LetterH  :m

  FD :m*100  BK :m*50

  RT 90   FD :m*50

  LT 90   FD :m*50  BK :m*100

END

 

The following instructions will draw an octagon with Letter H on each side.

 

PU FD 100 PD

REPEAT 8 [LetterH 1 RT 360/8]

Circular chain of people:

The basic shape of a “person” can be drawn using the following procedure.


ERASE "Person

TO Person :Size

FD 3*:Size LT 90 FD :Size/2 RT 90

REPEAT 4 [FD :Size RT 90]

RT 90 FD :Size/2 RT 90

FD :Size/2 LT 90

FD :Size/2 RT 90 FD 1.5*:Size BK 1.5*:Size

LT 90 BK :Size RT 90 FD 1.5*:Size BK 1.5*:Size

RT 90 BK :Size/2 RT 90 BK 2.5*:Size

END

 

The following instructions will draw an octagon with a Person figure on each side.

 

REPEAT 8 [

  FD 50/2

  LT 90 PERSON 30 RT 90

  FD 50/2 RT 360/8

]

                    

We now make the polygon in the design invisible to obtain the required design.

 

CS REPEAT 8 [

  PU FD 50/2 PD

  LT 90 PERSON 30 RT 90

  PU FD 50/2 PD

  RT 360/8

]

Polygon Rings:

We can use the following instructions to create the designs shown in Figure 12-20.

 

Ring of Circles:

Here the existing dCircle procedure is used to draw circles of given diameter.

 

CS REPEAT 36 [dCircle 50 PU FD 25 PD RT 10]

 

Pentagon of Pentagons:

CS

REPEAT 5 [

  Polygon 5 150  ; Pentagon on the side

  SETPENSIZE 8

  FD 50 RT 360/5 ; Base pentagon

  SETPENSIZE 3

]