Class UCS
Represents a User Coordinate System.
Implements
Inherited Members
Namespace: netDxf.Tables
Assembly: CADability.dll
Syntax
public class UCS : TableObject, IHasXData, ICloneable, IComparable, IComparable<TableObject>, IEquatable<TableObject>
Constructors
| Improve this Doc View SourceUCS(String)
Initializes a new instance of the UCS class.
Declaration
public UCS(string name)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | User coordinate system name. |
UCS(String, Vector3, Vector3, Vector3)
Initializes a new instance of the UCS class.
Declaration
public UCS(string name, Vector3 origin, Vector3 xDirection, Vector3 yDirection)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | User coordinate system name. |
| Vector3 | origin | Origin in WCS. |
| Vector3 | xDirection | X-axis direction in WCS. |
| Vector3 | yDirection | Y-axis direction in WCS. |
Remarks
The x-axis direction and y-axis direction must be perpendicular.
Properties
| Improve this Doc View SourceElevation
Gets or sets the user coordinate system elevation.
Declaration
public double Elevation { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Double |
Origin
Gets or sets the user coordinate system origin in WCS.
Declaration
public Vector3 Origin { get; set; }
Property Value
| Type | Description |
|---|---|
| Vector3 |
Owner
Gets the owner of the actual user coordinate system.
Declaration
public UCSs Owner { get; }
Property Value
| Type | Description |
|---|---|
| UCSs |
XAxis
Gets the user coordinate system x-axis direction in WCS.
Declaration
public Vector3 XAxis { get; }
Property Value
| Type | Description |
|---|---|
| Vector3 |
YAxis
Gets the user coordinate system y-axis direction in WCS.
Declaration
public Vector3 YAxis { get; }
Property Value
| Type | Description |
|---|---|
| Vector3 |
ZAxis
Gets the user coordinate system z-axis direction in WCS.
Declaration
public Vector3 ZAxis { get; }
Property Value
| Type | Description |
|---|---|
| Vector3 |
Methods
| Improve this Doc View SourceClone()
Creates a new UCS that is a copy of the current instance.
Declaration
public override object Clone()
Returns
| Type | Description |
|---|---|
| System.Object | A new UCS that is a copy of this instance. |
Overrides
| Improve this Doc View SourceClone(String)
Creates a new UCS that is a copy of the current instance.
Declaration
public override TableObject Clone(string newName)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | newName | UCS name of the copy. |
Returns
| Type | Description |
|---|---|
| TableObject | A new UCS that is a copy of this instance. |
Overrides
| Improve this Doc View SourceFromNormal(String, Vector3, Vector3, Double)
Creates a new user coordinate system from the XY plane normal (z-axis).
Declaration
public static UCS FromNormal(string name, Vector3 origin, Vector3 normal, double rotation)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | User coordinate system name. |
| Vector3 | origin | Origin in WCS. |
| Vector3 | normal | XY plane normal (z-axis). |
| System.Double | rotation | The counter-clockwise angle in radians along the normal (z-axis). |
Returns
| Type | Description |
|---|---|
| UCS | A new user coordinate system. |
Remarks
This method uses the ArbitraryAxis algorithm to obtain the user coordinate system x-axis and y-axis.
FromXAxisAndPointOnXYplane(String, Vector3, Vector3, Vector3)
Creates a new user coordinate system from the x-axis and a point on XY plane.
Declaration
public static UCS FromXAxisAndPointOnXYplane(string name, Vector3 origin, Vector3 xDirection, Vector3 pointOnPlaneXY)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | User coordinate system name. |
| Vector3 | origin | Origin in WCS. |
| Vector3 | xDirection | X-axis direction in WCS. |
| Vector3 | pointOnPlaneXY | Point on the XYplane. |
Returns
| Type | Description |
|---|---|
| UCS | A new user coordinate system. |
SetAxis(Vector3, Vector3)
Sets the user coordinate system x-axis and y-axis direction.
Declaration
public void SetAxis(Vector3 xDirection, Vector3 yDirection)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector3 | xDirection | X-axis direction in WCS. |
| Vector3 | yDirection | Y-axis direction in WCS. |