Table of Contents

Class CadUcs

Namespace
OpenCAD2D
Assembly
OpenCAD2D.Core.dll

A user coordinate system, as AutoCAD's UCS: an origin and X and Y axes in world coordinates, the Z axis square to both, and a name where it is one of the drawing's named systems. Points typed at a prompt, the readout of the status bar, the grid, snap, ortho and polar tracking are in the current system, while the drawing keeps its objects in world coordinates.

public sealed class CadUcs
Inheritance
CadUcs
Inherited Members

Remarks

A system turned 30 degrees about Z at (100, 50) takes the point it calls (10, 0) to the world point (108.6603, 55), and the world point (100, 60) to its (5, 8.6603).

The presenter shows the drawing from above, so it works in a system whose Z axis is the world's (IsPlanar). A system of a file turned out of that plane is read and saved as it is, listed by UCS ?, and not made current here.

Constructors

CadUcs(GeoPoint3, GeoVector3, GeoVector3, string)

Makes a system of an origin and two axes, the axes made of unit length and the Y axis square to the X axis in the plane of both.

Properties

Angle

Gets the angle of the X axis from the world's X axis, counter-clockwise in radians from -π to π: π/6 for a system turned 30 degrees.

IsPlanar

Gets whether the Z axis is the world's, to the vector tolerance of Default, so that the presenter, which shows the drawing from above, can work in the system.

IsWorld

Gets whether this is the world's own system: the origin at nought and the axes the world's, to the bit.

Name

Gets the name of a named system, as UCS Save gave it; null for one with no name, as AutoCAD's NO NAME.

Origin

Gets the origin, in world coordinates.

World

Gets the world coordinate system, AutoCAD's WCS.

XAxis

Gets the X axis, of unit length, in world coordinates.

YAxis

Gets the Y axis, of unit length and square to the X axis, in world coordinates.

ZAxis

Gets the Z axis, of unit length and square to the other two.

Methods

AngleToUcs(double)

Gets the angle from this system's X axis of an angle measured from the world's.

AngleToWorld(double)

Gets the world angle of an angle measured from this system's X axis: 30 degrees in a system turned 45 is 75 in the world.

InPlane(GeoPoint2, double, string)

Makes a system in the plane of the world's XY: its origin and the angle of its X axis.

IsSameAs(CadUcs, Tolerance)

Gets whether two systems have the same origin and axes, to a tolerance, whatever their names.

ToString()

Gives the system as a line: its name, origin and angle.

ToUcs(GeoPoint2)

Gets a point of the world in this system: its distances along the X and Y axes from the origin.

ToUcs(GeoPoint3)

Gets a point of the world in this system, in three dimensions.

ToUcs(GeoVector2)

Gets a direction of the world in this system.

ToWorld(GeoPoint2)

Gets the world point of a point given in this system.

ToWorld(GeoPoint3)

Gets the world point of a point given in this system, in three dimensions.

ToWorld(GeoVector2)

Gets the world direction of a direction given in this system: turned by Angle.

WithName(string)

Gets this system under another name, or with none.