Triangle

References
[IoId("00000000-477c-4231-b679-ad5443c33551")] public readonly struct Triangle : IStorable
A 3D triangle defined by corner points.

Constructors

Triangle

#
public Triangle(
reader
)

Triangle

#
public Triangle()

Properties

A

#
Gets the first triangle corner.
public Point3d A { get; }

AB

#
Gets the triangle edge connecting the A and B corners.
public Line AB { get; }

AltitudeA

#
Gets the altitude line starting at corner A.
public Line AltitudeA { get; }

AltitudeB

#
Gets the altitude line starting at corner B.
public Line AltitudeB { get; }

AltitudeC

#
Gets the altitude line starting at corner C.
public Line AltitudeC { get; }

AngleA

#
Gets the angle at the A corner.
public Angle AngleA { get; }

AngleB

#
Gets the angle at the B corner.
public Angle AngleB { get; }

AngleC

#
Gets the angle at the C corner.
public Angle AngleC { get; }

Area

#
Gets the area inside this triangle.
public double Area { get; }

AreaCentre

#
Gets the triangle area centroid.
public Point3d AreaCentre { get; }

B

#
Gets the second triangle corner.
public Point3d B { get; }

BC

#
Gets the triangle edge connecting the B and C corners.
public Line BC { get; }

BisectorA

#
Gets the bisector line starting at corner A.
public Line BisectorA { get; }

BisectorB

#
Gets the bisector line starting at corner B.
public Line BisectorB { get; }

BisectorC

#
Gets the bisector line starting at corner C.
public Line BisectorC { get; }

BoundingBox

#
Gets the bounding box of this triangle.
public BoundingBox BoundingBox { get; }

C

#
Gets the third triangle corner.
public Point3d C { get; }

CA

#
Gets the triangle edge connecting the C and A corners.
public Line CA { get; }

CircumCentre

#
Gets the triangle circumcentre.
public Point3d CircumCentre { get; }

CircumCircle

#
Gets the circumcircle of this triangle.
public Circle CircumCircle { get; }

InCentre

#
Gets the triangle incentre.
public Point3d InCentre { get; }

IsAcute

#
Gets whether the triangle is acute, i.e. whether all angles are less than 90 degrees.
public bool IsAcute { get; }

IsDegenerate

#
Gets whether a triangle is degenerate, i.e. whether two or more points are coincident, or whether one of the corners is coincident with the opposite edge.
public bool IsDegenerate { get; }

IsEquilateral

#
Gets whether a triangle is equilateral, i.e. whether all edges have the same length.
public bool IsEquilateral { get; }

IsIsosceles

#
Gets whether a triangle is isosceles, i.e. whether two edges have the same length.
public bool IsIsosceles { get; }

IsObtuse

#
Gets whether the triangle is obtuse, i.e. whether one angle exceeds 90 degrees.
public bool IsObtuse { get; }

IsRight

#
Gets whether the triangle is right-angled, i.e. whether one angle equals 90 degrees.
public bool IsRight { get; }

IsScalene

#
Gets whether a triangle is scalene, i.e. whether all edges have different lengths.
public bool IsScalene { get; }

IsValid

#
Gets whether all the corner points are valid. Degenerate triangles are not considered invalid.
public bool IsValid { get; }

MedianA

#
Gets the median line starting at corner A.
public Line MedianA { get; }

MedianB

#
Gets the median line starting at corner B.
public Line MedianB { get; }

MedianC

#
Gets the median line starting at corner C.
public Line MedianC { get; }

OrthoCentre

#
Gets the triangle orthocentre.
public Point3d OrthoCentre { get; }

Perimeter

#
Gets the perimeter (or circumference) of this triangle.
public double Perimeter { get; }

PerpendicularAB

#
Gets the perpendicular bisector for edge AB.
public Line PerpendicularAB { get; }

PerpendicularBC

#
Gets the perpendicular bisector for edge BC.
public Line PerpendicularBC { get; }

PerpendicularCA

#
Gets the perpendicular bisector for edge CA.
public Line PerpendicularCA { get; }

Unset

#
Gets a triangle with unset points.
public static Triangle Unset { get; }

Methods

AppendToMesh

#
Append this triangle to an existing mesh.
public void AppendToMesh(
mesh,
Mesh to append to.
density
Density, or number of mesh edges per triangle edge.
)

ClosestBarycentricParameters

#
Gets the projection of a point onto the barycentric coordinates.
public void ClosestBarycentricParameters(Point3d point, out double aʹ, out double bʹ, out double cʹ)
point (Point3d)Point to project.
aʹ (out double)Barycentric mass for vertex A.
bʹ (out double)Barycentric mass for vertex B.
cʹ (out double)Barycentric mass for vertex C.

ClosestParameterOnBoundary

#
Gets the parameter on the triangle boundary closest to a test point.
public double ClosestParameterOnBoundary(
point
)

ClosestParameterOnInterior

#
Gets the axial parameters on the triangle interior which are closest to a test point.
public bool ClosestParameterOnInterior(
point,
Point.
out double
u,
First axial parameter.
out double
v
Second axial parameter.
)
True on success.

ClosestPointOnBoundary

#
Gets the point on the triangle boundary closest to a test point.
public Point3d ClosestPointOnBoundary(
point
)

ClosestPointOnInterior

#
Gets the point on the triangle interior or boundary closest to a test point.
public Point3d ClosestPointOnInterior(
point
)

Offset

#
Offset this triangle by a specific amount.
public Triangle Offset(
amount
Offset distance. Positive distances offset towards the outside.
)
Offset triangle.

PointAlongBoundary

#
Gets the point along the boundary of the triangle. The triangle boundary has a domain [0, 3] where each subsequent unit domain maps to a different edge.
public Point3d PointAlongBoundary(
t
Parameter along boundary.
)

PointAtBarycentric

#
Gets a point within this triangle using barycentric coordinates.
public Point3d PointAtBarycentric(double aʹ, double bʹ, double cʹ)
aʹ (double)Barycentic mass for vertex A.
bʹ (double)Barycentic mass for vertex B.
cʹ (double)Barycentic mass for vertex C.
Point at barycentric mass.

PointAtTrilinear

#
Gets a point within this triangle using trilinear coordinates.
public Point3d PointAtTrilinear(
u,
Trilinear ratio u.
v,
Trilinear ratio v.
w
Trilinear ratio w.
)
Point at trilinear coordinates.

PointOnInterior

#
Gets the point on the triangle using the AB and AC primary axes.
public Point3d PointOnInterior(
u,
Parameter along the AB edge.
v
Parameter along the AC edge.
)
Point at parameter.

Store

#
public void Store(
writer
)
Store

ToMesh

#
Create a mesh from this triangle.
public Mesh ToMesh(
density
Density, or number of mesh edges per triangle edge.
)

ToPolyline

#
Create a polyline from this triangle.
public Polyline ToPolyline()

ToRounded

#
Create a triagle curve with filleted corners.
public Curve ToRounded(
radius
Fillet radius.
)

Transform

#
Transform this triangle.
public Triangle Transform(
Transform
transform
)

WithA

#
Replace the A corner.
public Triangle WithA()

WithB

#
Replace the B corner.
public Triangle WithB()

WithC

#
Replace the C corner.
public Triangle WithC()