Class Triangle
A mesh triangle.
Inheritance
System.Object
Triangle
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Elements.Geometry
Assembly: Hypar.Elements.dll
Syntax
public class Triangle
Constructors
Triangle(Vertex, Vertex, Vertex)
Create a triangle.
Declaration
public Triangle(Vertex a, Vertex b, Vertex c)
Parameters
Type | Name | Description |
---|---|---|
Vertex | a | The index of the first vertex of the triangle. |
Vertex | b | The index of the second vertex of the triangle. |
Vertex | c | The index of the third vertex of the triangle. |
Triangle(IList<Vertex>, Vector3)
Construct a triangle.
Declaration
[JsonConstructor]
public Triangle(IList<Vertex> vertices, Vector3 normal)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IList<Vertex> | vertices | The vertices of the triangle. |
Vector3 | normal | The normal of the triangle. |
Properties
Normal
The triangle's normal.
Declaration
[JsonProperty("Normal", Required = Required.AllowNull)]
public Vector3 Normal { get; set; }
Property Value
Type | Description |
---|---|
Vector3 |
Vertices
The triangle's vertices.
Declaration
[JsonProperty("Vertices", Required = Required.Always)]
[Required]
public IList<Vertex> Vertices { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IList<Vertex> |
Methods
Area()
The area of the triangle.
Declaration
public double Area()
Returns
Type | Description |
---|---|
System.Double |