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.
Inheritance
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, Boolean)
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. |
System.Boolean | 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 |
---|---|
System.Boolean |
Methods
Equals(Surface, Double)
Declaration
public bool Equals(Surface surface, double accy)
Parameters
Type | Name | Description |
---|---|---|
Surface | surface | |
System.Double | accy |
Returns
Type | Description |
---|---|
System.Boolean |
Equals(Object)
Declaration
public override bool Equals(object other)
Parameters
Type | Name | Description |
---|---|---|
System.Object | other |
Returns
Type | Description |
---|---|
System.Boolean |
Overrides
Finalize()
Declaration
protected void Finalize()
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 |
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 |
---|---|
System.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 |
---|---|---|
System.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 |
---|---|
System.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, Boolean)
Analyze the surface for errors and fix them if possible.
Declaration
public string Validate(string prefix, bool verbose)
Parameters
Type | Name | Description |
---|---|---|
System.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. |
System.Boolean | verbose | Output updated polygons for each error. |
Returns
Type | Description |
---|---|
System.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.