Class Polyhedron
Represents a 3D polyhedron composed of single-precision floating-point points.
Inheritance
Namespace: X10D.Drawing
Assembly: X10D.dll
Syntax
public class Polyhedron : IEquatable<Polyhedron>
Constructors
| Improve this Doc View SourcePolyhedron()
Initializes a new instance of the Polyhedron class.
Declaration
public Polyhedron()
Polyhedron(IEnumerable<Vector3>)
Initializes a new instance of the Polyhedron class by constructing it from the specified vertices.
Declaration
public Polyhedron(IEnumerable<Vector3> vertices)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<Vector3> | vertices | An enumerable collection of vertices from which the polyhedron should be constructed. |
Polyhedron(Polyhedron)
Initializes a new instance of the Polyhedron class by copying the specified polyhedron.
Declaration
public Polyhedron(Polyhedron polyhedron)
Parameters
Type | Name | Description |
---|---|---|
Polyhedron | polyhedron |
Properties
| Improve this Doc View SourceEmpty
Gets an empty polyhedron. That is, a polygon with no vertices.
Declaration
public static Polyhedron Empty { get; }
Property Value
Type | Description |
---|---|
Polyhedron | An empty polyhedron. |
VertexCount
Gets the number of vertices in this polyhedron.
Declaration
public int VertexCount { get; }
Property Value
Type | Description |
---|---|
System.Int32 | An |
Vertices
Gets a read-only view of the vertices in this polyhedron.
Declaration
public IReadOnlyList<Vector3> Vertices { get; }
Property Value
Type | Description |
---|---|
IReadOnlyList<Vector3> | A |
Methods
| Improve this Doc View SourceAddVertex(Vector3)
Adds a vertex to this polyhedron.
Declaration
public void AddVertex(Vector3 vertex)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | vertex | The vertex to add. |
AddVertices(IEnumerable<Vector3>)
Adds a collection of vertices to this polyhedron.
Declaration
public void AddVertices(IEnumerable<Vector3> vertices)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<Vector3> | vertices | An enumerable collection of vertices to add. |
ClearVertices()
Clears all vertices from this polyhedron.
Declaration
public void ClearVertices()
Equals(Nullable<Object>)
Declaration
public override bool Equals(object? obj)
Parameters
Type | Name | Description |
---|---|---|
System.Nullable<System.Object> | obj |
Returns
Type | Description |
---|---|
System.Boolean |
Equals(Polyhedron)
Returns a value indicating whether this instance and another instance are equal.
Declaration
public bool Equals(Polyhedron other)
Parameters
Type | Name | Description |
---|---|---|
Polyhedron | other | The instance with which to compare. |
Returns
Type | Description |
---|---|
System.Boolean | true if this instance and |
FromPolygon(Polygon)
Converts a Polygon to a Polyhedron.
Declaration
public static Polyhedron FromPolygon(Polygon polygon)
Parameters
Type | Name | Description |
---|---|---|
Polygon | polygon | The polyhedron to convert. |
Returns
Type | Description |
---|---|
Polyhedron | The converted polyhedron. |
FromPolygonF(PolygonF)
Converts a PolygonF to a Polyhedron.
Declaration
public static Polyhedron FromPolygonF(PolygonF polygon)
Parameters
Type | Name | Description |
---|---|---|
PolygonF | polygon | The polyhedron to convert. |
Returns
Type | Description |
---|---|
Polyhedron | The converted polyhedron. |
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 |
Operators
| Improve this Doc View SourceEquality(Polyhedron, Polyhedron)
Returns a value indicating whether two instances of Polyhedron are equal.
Declaration
public static bool operator ==(Polyhedron left, Polyhedron right)
Parameters
Type | Name | Description |
---|---|---|
Polyhedron | left | The first instance. |
Polyhedron | right | The second instance. |
Returns
Type | Description |
---|---|
System.Boolean | true if |
Implicit(Polygon to Polyhedron)
Implicitly converts a Polygon to a Polyhedron.
Declaration
public static implicit operator Polyhedron(Polygon polygon)
Parameters
Type | Name | Description |
---|---|---|
Polygon | polygon | The polyhedron to convert. |
Returns
Type | Description |
---|---|
Polyhedron | The converted polyhedron, or null if |
Implicit(PolygonF to Polyhedron)
Implicitly converts a PolygonF to a Polyhedron.
Declaration
public static implicit operator Polyhedron(PolygonF polygon)
Parameters
Type | Name | Description |
---|---|---|
PolygonF | polygon | The polyhedron to convert. |
Returns
Type | Description |
---|---|
Polyhedron | The converted polyhedron, or null if |
Inequality(Polyhedron, Polyhedron)
Returns a value indicating whether two instances of Polyhedron are not equal.
Declaration
public static bool operator !=(Polyhedron left, Polyhedron right)
Parameters
Type | Name | Description |
---|---|---|
Polyhedron | left | The first instance. |
Polyhedron | right | The second instance. |
Returns
Type | Description |
---|---|
System.Boolean | true if |