Please enable JavaScript to view this site.

ESL Documentation

When you reference a pattern in an object definition, you can enlarge or shrink it with the scale specification. You specify the enlargement factor by providing positive integer values representing the numerator and denominator; ESL determines the scale factor of the pattern by dividing the numerator by the denominator.

 

If the scale factor is less than 1, the pattern is displayed smaller. For example, specifying:

 

scale 1:2

    pattern StopSign

 

displays the pattern at half the size of its definition. If the scale factor is greater than 1, the pattern is displayed larger. For example, specifying:

 

scale 2:1

    pattern Butterfly

 

displays the pattern at twice the size of its definition.

 

In the example of nested cubes, defined as:

 

pattern Cubes is

    box 200 200          # Outermost box

    move 10 10

    red box 180 180      # Middle box

    move 10 10

    green box 160 160    # Innermost box

    move 80 80           # Move to center

 

the dimensions of the outermost box are 200 by 200. If you specify a scale statement, as shown below:

 

scale 1:2

    pattern Cubes

 

the pattern is displayed at half the size of its definition. The dimensions of the outermost box are 100 by 100.

 

Both the original pattern and the scaled pattern begin at the pattern's reference point. A pattern is always drawn beginning at that point, regardless of the scale factors specified.

 

The scalings specified for a pattern are cumulative when patterns are nested. The specified scaling is relative to any scaling currently in effect for the pattern. (For examples, see Accumulation of Scaled and Rotated Patterns.)