Class Surface
A Surface is composed of Polygons. The Polygons of a Surface must be connected. Adjacent coplanar Polygons must not form a "T" with their shared edges. The Polygons of a Surface typically enclose a volume, have no overlaps, and touch only at Edges.
Inherited Members
Namespace: DesignData.SDS2.Primitives
Assembly: DesignData.SDS2.Primitives.dll
Syntax
public sealed class Surface
Constructors
Surface()
Create an empty Surface.
Declaration
public Surface()
Surface(PolygonList)
Create a Surface from Polygons.
Declaration
public Surface(PolygonList polygons)
Parameters
| Type | Name | Description |
|---|---|---|
| PolygonList | polygons | polygons is a list of Polygons from which to create a surface. |
Exceptions
| Type | Condition |
|---|---|
| InvalidPolygonException | If edges of a Polygon are not coplanar or a Polygon has less than 2 vertices. |
Surface(PolygonList, bool)
Create a Surface from Polygons.
Declaration
public Surface(PolygonList polygons, bool updateGeometry)
Parameters
| Type | Name | Description |
|---|---|---|
| PolygonList | polygons | polygons is a list of Polygons from which to create a surface. |
| bool | updateGeometry | UpdateGeometry() is called at the end of construction when updateGeometry is true |
Exceptions
| Type | Condition |
|---|---|
| InvalidPolygonException | If edges of a Polygon are not coplanar or a Polygon has less than 2 vertices. |
Surface(Surface)
Create a Surface equal to the given Surface.
Declaration
public Surface(Surface surface)
Parameters
| Type | Name | Description |
|---|---|---|
| Surface | surface | This is the Surface to copy. |
Properties
BoundBLF
This point is the bottom, left, front point of the Surface bounding box.
Declaration
public Point3D BoundBLF { get; }
Property Value
| Type | Description |
|---|---|
| Point3D |
BoundTRB
This point is the top, right, back point of the Surface bounding box.
Declaration
public Point3D BoundTRB { get; }
Property Value
| Type | Description |
|---|---|
| Point3D |
IsValidGeometry
Indicates BoundBLF and BoundTRB are valid.
Declaration
public bool IsValidGeometry { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Methods
Equals(Surface, double)
A Surface is composed of Polygons. The Polygons of a Surface must be connected. Adjacent coplanar Polygons must not form a "T" with their shared edges. The Polygons of a Surface typically enclose a volume, have no overlaps, and touch only at Edges.
Declaration
public bool Equals(Surface surface, double accy = 1.1920928955078125E-07)
Parameters
| Type | Name | Description |
|---|---|---|
| Surface | surface | |
| double | accy |
Returns
| Type | Description |
|---|---|
| bool |
Equals(object)
A Surface is composed of Polygons. The Polygons of a Surface must be connected. Adjacent coplanar Polygons must not form a "T" with their shared edges. The Polygons of a Surface typically enclose a volume, have no overlaps, and touch only at Edges.
Declaration
public override bool Equals(object other)
Parameters
| Type | Name | Description |
|---|---|---|
| object | other |
Returns
| Type | Description |
|---|---|
| bool |
Overrides
~Surface()
A Surface is composed of Polygons. The Polygons of a Surface must be connected. Adjacent coplanar Polygons must not form a "T" with their shared edges. The Polygons of a Surface typically enclose a volume, have no overlaps, and touch only at Edges.
Declaration
protected ~Surface()
GetHashCode()
A Surface is composed of Polygons. The Polygons of a Surface must be connected. Adjacent coplanar Polygons must not form a "T" with their shared edges. The Polygons of a Surface typically enclose a volume, have no overlaps, and touch only at Edges.
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| int |
Overrides
GetPolygons()
Get the list of Polygons that comprise the Surface.
Declaration
public PolygonList GetPolygons()
Returns
| Type | Description |
|---|---|
| PolygonList |
Transform(Matrix)
Transform the Surface to a new coordinate system.
Declaration
public void Transform(Matrix matrix)
Parameters
| Type | Name | Description |
|---|---|---|
| Matrix | matrix | This is the matrix specfiying the new coordinate system. |
Triangulate()
Decompose Polygons into triangles.
Declaration
public void Triangulate()
UpdateGeometry()
Update bounding box and Polygon plane fields.
Declaration
public void UpdateGeometry()
Validate()
Analyze the surface for errors and fix them if possible.
Declaration
public string Validate()
Returns
| Type | Description |
|---|---|
| string | Analysis of errors in the Surface |
Remarks
This method is slow and should typically be used only for debugging purposes, and not in production code. The content and format of the returned analysis string may not be consistent between SDS2 versions.
Validate(string)
Analyze the surface for errors and fix them if possible.
Declaration
public string Validate(string prefix)
Parameters
| Type | Name | Description |
|---|---|---|
| string | prefix | prefix is added to the beginning of most lines of the analysis. This is useful for distinguishing between surfaces when validating multiple surfaces. |
Returns
| Type | Description |
|---|---|
| string | Analysis of errors in the Surface |
Remarks
This method is slow and should typically be used only for debugging purposes, and not in production code. The content and format of the returned analysis string may not be consistent between SDS2 versions.
Validate(string, bool)
Analyze the surface for errors and fix them if possible.
Declaration
public string Validate(string prefix, bool verbose)
Parameters
| Type | Name | Description |
|---|---|---|
| string | prefix | prefix is added to the beginning of most lines of the analysis. This is useful for distinguishing between surfaces when validating multiple surfaces. |
| bool | verbose | Output updated polygons for each error. |
Returns
| Type | Description |
|---|---|
| string | Analysis of errors in the Surface |
Remarks
This method is slow and should typically be used only for debugging purposes, and not in production code. The content and format of the returned analysis string may not be consistent between SDS2 versions.