Geom Object Methods

MoveBy(dx, dy)

Translates the geometry object by the specified offset.

Parameters:

Dx: X offset

Dy: Y offset

Example:

rect.MoveBy(10, 20);

MoveTo(x, y)

Moves the geometry object to the specified location; useful for rectangles, circles and arcs (the center point is moved)

Parameters:

X: New X location

Y: New Y location

Example:

rect.MoveTo(10, 20);

Rotate(x, y, angle)

Rotates the geometry object counter-clockwise about the specified location by the angle specified (in radians).

Parameters:

X: X center

Y: Y center

Angle: Rotation angle in radians

Example:

rect.Rotate(0, 0, Math.PI/4);

Scale(x, y, factor)

Scales the geometry object about the specified location by the factor specified.

Parameters:

X: X center

Y: Y center

Factor: Scale factor (2 implies 2 times, 4.5 implies 4 and a half times, etc.)

Example:

rect.Scale(0, 0, 2);

MirrorX(x)

Mirrors the X values of the object (Y values are unchanged) about the specified X value (X values falling on this line are unchanged).

Parameters:

X: Center of reflection (X values on this line are unchanged).

Example:

rect.MirrorX(0);

MirrorY(y)

Mirrors the Y values of the object (X values are unchanged) about the specified Y value (Y values falling on this line are unchanged).

Parameters:

Y: Center of reflection (Y values on this line are unchanged).

Example:

rect.MirrorY(0);

Copy()

Create and return a copy of the geometry object.

Example:

var rect_copy = rect.Copy();

AddVoid(void_geom)

Adds a void object to an existing geometry object.

Example:

Var rect = LayoutHost.NewRect(layer, 0, 0, l, w, 0);

Var void_rect = LayoutHost.NewRect(layer, 0, 0, l/2, w/2, 0);

rect.AddVoid(void_rect);