Table of Contents

Method Mirror

Namespace
OpenCAD2D
Assembly
OpenCAD2D.Core.dll

Mirror<T>(IEnumerable<T>, GeoPoint2, GeoPoint2, bool)

Mirrors objects across the line through two points, as MIRROR does: a TEXT stays readable under MIRRTEXT 0 and is written backwards under 1, a hatch's pattern is kept under MIRRHATCH 0, a dimension stays readable. A line from (0, 0) to (0, 50) mirrored across the line (0, 0) to (10, 0) gives a line from (0, 0) to (0, -50). One undo step named MIRROR.

public IReadOnlyList<T> Mirror<T>(IEnumerable<T> entities, GeoPoint2 first, GeoPoint2 second, bool eraseSource = false) where T : DxfEntity

Parameters

entities IEnumerable<T>

The drawing's objects to mirror.

first GeoPoint2

The first point of the mirror line, in the world.

second GeoPoint2

The second point; the line has to be more than the session's EqualPoint long, and long enough to have a direction (about 2E-5).

eraseSource bool

Whether the objects are mirrored where they stand (MIRROR's "Erase source objects? Yes") rather than copied; false by default, as MIRROR's default.

Returns

IReadOnlyList<T>

With eraseSource false the mirrored copies, in the order the objects were given, each of the type of its source; else the objects given.

Type Parameters

T

The type of the objects given.

Exceptions

ArgumentNullException

Thrown when the list is null.

ArgumentException

Thrown when an object of the list is null, or the two points are not a line.

InvalidOperationException

Thrown when an object is refused, as the remarks say.