Triangle3d

References
[StructLayout(LayoutKind.Sequential, Pack = 1, Size = 72)] public struct Triangle3d
Represents a triangle, modeled using double three points that use double-precision floating point numbers.

Constructors

Triangle3d

#Since v7.1
public Triangle3d(Point3d a, Point3d b, Point3d c)
Instantiates a new triangle.
a (Point3d)First point.
b (Point3d)Second point.
c (Point3d)Third point.

Properties

A

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

AB

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

AltitudeA

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

AltitudeB

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

AltitudeC

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

AngleA

#Since v7.1
public double AngleA { get; }
Gets the angle at the A corner.

AngleB

#Since v7.1
public double AngleB { get; }
Gets the angle at the B corner.

AngleC

#Since v7.1
public double AngleC { get; }
Gets the angle at the C corner.

Area

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

AreaCenter

#Since v7.1
public Point3d AreaCenter { get; }
Gets the triangle area centroid.

B

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

BC

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

BoundingBox

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

C

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

CA

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

Circumcenter

#Since v7.1
public Point3d Circumcenter { get; }
Gets the triangle circumcenter.

Circumcircle

#Since v7.1
public Circle Circumcircle { get; }
Gets the circumcircle of this triangle.

MedianA

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

MedianB

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

MedianC

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

Orthocenter

#Since v7.1
public Point3d Orthocenter { get; }
Gets the triangle orthocenter.

Perimeter

#Since v7.1
public double Perimeter { get; }
Gets the perimeter of this triangle. This is the sum of the lengths of all edges.

PerpendicularAB

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

PerpendicularBC

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

PerpendicularCA

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

Methods

BarycentricCoordsAt

#Since v7.1
public Point2d BarycentricCoordsAt(Point3d point, out double signedHeight)
Gets the projection of a point onto the barycentric coordinates.
point (Point3d)Point to project.
signedHeight (out double)A value indicating the height of the intersection in world units, negative if the point is situated under the triangle.
The computed barycentric mass values relating to B and C for point.

ClosestParameterOnBoundary

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

ClosestPointOnBoundary

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

PointAlongBoundary

#Since v7.1
public Point3d PointAlongBoundary(double t)
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.
t (double)Parameter along boundary.

PointAtBarycentricCoords

#Since v7.1
public Point3d PointAtBarycentricCoords(Point2d coords)
Gets a point within this triangle using barycentric coordinates.
coords (Point2d)Barycentric mass for vertex B and C. A is valued as (1 - B - C).
Point at barycentric mass.

PointOnInterior

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

ToMesh

#Since v7.1
public Mesh ToMesh()
Create a mesh from this triangle.

ToPolyline

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

Transform

#Since v7.1
public Triangle3d Transform(Transform transform)
Transform this triangle.
transform (Transform)

TrySmallestEnclosingTriangle

#Since v8.4
public static bool TrySmallestEnclosingTriangle(IEnumerable<Point2d> points, double tolerance, out Triangle3d triangle)
Attempt to create the smallest triangle containing a set of planar points.
points (IEnumerable<Point2d>)The points to enclose.
tolerance (double)The tolerance to use
triangle (out Triangle3d)The resulting triangle on success.
true on success, false on failure.

WithA

#Since v7.1
public Triangle3d WithA(Point3d a)
Replace the A corner.
a (Point3d)

WithB

#Since v7.1
public Triangle3d WithB(Point3d b)
Replace the B corner.
b (Point3d)

WithC

#Since v7.1
public Triangle3d WithC(Point3d c)
Replace the C corner.
c (Point3d)