Class Shape
Represents a shape entity.
Inherited Members
Namespace: netDxf.Entities
Assembly: CADability.dll
Syntax
public class Shape : EntityObject, IHasXData, ICloneable
Constructors
| Improve this Doc View SourceShape(String, ShapeStyle)
Initializes a new instance of the Shape class.
Declaration
public Shape(string name, ShapeStyle style)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | Name of the shape which geometry is defined in the shape ShapeStyle. |
| ShapeStyle | style | Shape TextStyle. |
Shape(String, ShapeStyle, Vector3, Double, Double)
Initializes a new instance of the Shape class.
Declaration
public Shape(string name, ShapeStyle style, Vector3 position, double size, double rotation)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | Name of the shape which geometry is defined in the shape ShapeStyle. |
| ShapeStyle | style | Shape TextStyle. |
| Vector3 | position | Shape insertion point. |
| System.Double | size | Shape size. |
| System.Double | rotation | Shape rotation. |
Properties
| Improve this Doc View SourceName
Gets the shape name.
Declaration
public string Name { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
ObliqueAngle
Gets or sets the shape oblique angle in degrees.
Declaration
public double ObliqueAngle { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Double |
Position
Gets or sets the shape Vector3 in world coordinates.
Declaration
public Vector3 Position { get; set; }
Property Value
| Type | Description |
|---|---|
| Vector3 |
Rotation
Gets or sets the shape rotation in degrees.
Declaration
public double Rotation { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Double |
Size
Gets or sets the size of the shape.
Declaration
public double Size { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Double |
Remarks
The shape size is relative to the actual size of the shape definition.
The size value works as an scale value applied to the dimensions of the shape definition.
The DXF allows for negative values but that is the same as rotating the shape 180 degrees.
Size values must be greater than zero. Default: 1.0.
Style
Gets the ShapeStyle.
Declaration
public ShapeStyle Style { get; }
Property Value
| Type | Description |
|---|---|
| ShapeStyle |
Thickness
Gets or set the shape thickness.
Declaration
public double Thickness { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Double |
WidthFactor
Gets or sets the shape width factor.
Declaration
public double WidthFactor { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Double |
Remarks
Width factor values cannot be zero. Default: 1.0.
Methods
| Improve this Doc View SourceClone()
Declaration
public override object Clone()
Returns
| Type | Description |
|---|---|
| System.Object |
Overrides
| Improve this Doc View SourceTransformBy(Matrix3, Vector3)
Moves, scales, and/or rotates the current entity given a 3x3 transformation matrix and a translation vector.
Declaration
public override void TransformBy(Matrix3 transformation, Vector3 translation)
Parameters
| Type | Name | Description |
|---|---|---|
| Matrix3 | transformation | Transformation matrix. |
| Vector3 | translation | Translation vector. |
Overrides
Remarks
Matrix3 adopts the convention of using column vectors to represent a transformation matrix.