# Enlarge and reduce contours

The #SCALE command can enlarge or reduce the scales of contours or positions by specifying axis-specific factors. When different factors are specified, it also permits the expansion or compression of contours.

Scaling acts on

• Path axes (linear axes, e.g. X, Y, Z, U, V, W)
• Positioning axes (independent axes, oscillating axes).

Offsets are generally not scaled, regardless of whether an offset is selected or programmed before or after #SCALE ON.

Scaled values always refer to the zero point of the currently active coordinate system. In particular when a contour is described in absolute coordinates, you are advised before selecting the scaling to place the zero point on the contour starting point by means of the applicable G functions G53 to G57, G159, G92 or by the functions for defining rotated coordinate systems #ROTATION and #CS.

 #SCALE [ON] {}                                                   (modal) #SCALE OFF                                                                                                                         (modal)
 ON Activate scaling OFF Deactivate scaling Axis-specific scaling factors. The factor must be > 0. An error message is issued if factors are ≤ 0.

## Notice

The definition of scaling factors and their selection can be specified together or in separate steps. This means that it is possible, for example, to define the scaling factors first and then to activate scaling in a second command.

The programmed scaling factors remain stored up by M30 to program end and can be used again if #SCALE ON/OFF is used several times.

## Attention

The scaling factors can be modified when scaling is deselected.

Modifying the scaling factors while scaling is active leads to the output of an error message.

The following must be noted when scaling and circle programming are combined:

• Genuine scaling of circles only makes sense if the scaling factors of the axes involved in circular interpolation are identical. This applies in particular to programming circles with radius specification via R or G163 because the factor for the radius is based here on the scaling factor programmed with "X".
• When circles are programmed with I, J, K, different scaling factors are also possible; - then, however, they normally cause errors in the circle centre point correction or create circle segments without any practical meaning.

## Programing Example

Enlarge and reduce contours

;Scale an absolute programmed contour with identical factors

%L Cont1_abs

N01 G01 G90 F2000

N02 X90 Y0

N03 G301 I20

N04 X90 Y120

N05 G302 I20

N06 X50 Y120

N07 X50 Y100

N08 X40 Y100

N09 G03 X0 Y100 I-20 J0

N10 G01 X0 Y20

N11 G03 X20 Y0 R20

N13 M17

%scale

N015 G53

N020 G00 X0 Y0 Z0

N065 LL Cont1_abs ;Basic contour

N075 #SCALE X0.5 Y0.5 ;Definition of scaling factors

;Definition of zero point origin of the scaled contour

N085 V.G.NP[1].V.X = 30

N090 V.G.NP[1].V.Y = 20

N095 G54

N100 G90 G0 X0 Y0 Z0

N105 #SCALE ON

N110 LL Cont1_abs

N115 #SCALE OFF

N140 M30

;Scale an absolute programmed contour with different ;factors

%L Cont1_abs

N01 G01 G90 F2000

N02 X90 Y0

N03 G301 I20

N04 X90 Y120

N05 G302 I20

N06 X50 Y120

N07 X50 Y100

N08 X40 Y100

N09 G03 X0 Y100 I-20 J0

N10 G01 X0 Y20

N11 G03 X20 Y0 R20

N13 M17

%scale

N015 G53

N020 G00 X0 Y0 Z0

N065 LL Cont1_abs ;Basic contour

N075 #SCALE X0.6 Y0.3 ;Definition of scaling factors

;Definition of zero point origin of the scaled contour

N085 V.G.NP[1].V.X = 30

N090 V.G.NP[1].V.Y = 20

N095 G54

N100 G90 G0 X0 Y0 Z0

N105 #SCALE ON

N110 LL Cont1_abs

N115 #SCALE OFF

N140 M30

;Multiple different scaling of a relative programmed

;contour

%L Cont1_rel

N01 G01 G91 F2000

N02 X90 Y0

N03 G301 I20

N04 X0 Y90

N05 G302 I20

N06 X-40 Y0

N07 X0 Y-20

N08 X-10 Y0

N09 G03 X-40 Y0 I-20 J0

N10 G01 X0 Y-50

N11 G03 X20 Y-20 R20

N13 M17

%scale

N015 G53

N020 G00 X0 Y0 Z0

; Basic contour

N030 LL Cont1_rel

N040 #SCALE X0.3 Y0.3 ;Definition 1 of scaling factors

;Definition 1 of starting point of the scaled contour

N055 G90 G0 X10 Y50

N060 #SCALE ON

N065 LL Cont1_rel

N070 #SCALE OFF

N075 G90 G00 X20 Y0

N085 #SCALE X0.5 Y0.5 ;Definition 2 of scaling factors

;Definition 1 of starting point of the scaled contour

N100 G90 G0 X40 Y10

N105 #SCALE ON

N110 LL Cont1_rel

N115 #SCALE OFF

N125 M30

;Scale a contour in a coordinate system which is shifted and

rotated with #CS

%L Cont1_rel

N01 G01 G91 F2000

N02 X90 Y0

N03 G301 I20

N04 X0 Y90

N05 G302 I20

N06 X-40 Y0

N07 X0 Y-20

N08 X-10 Y0

N09 G03 X-40 Y0 I-20 J0

N10 G01 X0 Y-50

N11 G03 X20 Y-20 R20

N13 M17

%scale

N015 G53

N020 G00 X0 Y0 Z0

; Basic contour

N030 LL Cont1_rel

N040 #SCALE X0.6 Y0.6 ;Definition of scaling factors

N045 #CS ON [40,5,0,0,0,20]

N055 G90 G0 X0 Y0

N060 #SCALE ON

N065 LL Cont1_rel

N070 #SCALE OFF

N0525 #CS OFF

N125 M30

;Scale a semicircle, programmed with I, J

%L Circle1

G02 G91 X80 Y80 I40 J40

M17

%scale

N015 G53

N020 G00 X0 Y0 Z0

N025 G01 X10 Y10 F1000

; Basic semicircle

N030 LL Circle1

N040 #SCALE X0.7 Y0.7 ;Definition of scaling factors

N055 G90 G0 X10 Y10

N060 #SCALE ON

N065 LL Circle1

N070 #SCALE OFF

N075 G90 G0 X0 Y0

M30

;Scale a semicircle, programmed with R

%L Circle2

G03 R33 X-66 Y0

M17

%scale

N015 G53

N020 G00 X0 Y0 Z0 F1000

; Basic semicircle

N030 LL Circle2

N040 #SCALE X1.5 Y1.5 ;Definition of scaling factors

N055 G90 G0 X10 Y10

N060 #SCALE ON

N065 LL Circle2

N070 #SCALE OFF

N075 G90 G0 X0 Y0

M30

;Asymmetrical scaling of a semicircle programmed with I, J

%L Circle1

G02 G91 X80 Y80 I40 J40

M17

%scale

N015 G53

N020 G00 X0 Y0 Z0

N025 G01 X10 Y10 F1000

; Basic semicircle

N030 LL Circle1

N040 #SCALE X0.3 Y0.8 ;Definition of scaling factors

N055 G90 G0 X10 Y10

N060 #SCALE ON

N065 LL Circle1

N070 #SCALE OFF

N075 G90 G0 X10 Y10

M30