Static Public Member Functions | List of all members
mirtk::Triangle Class Reference

#include <Triangle.h>

Collaboration diagram for mirtk::Triangle:
Collaboration graph

Static Public Member Functions

static void Angles (const double a[3], const double b[3], const double c[3], double angle[3])
 
static double Area (const double a[3], const double b[3], const double c[3])
 
static double Area2D (const double a[2], const double b[2], const double c[2])
 
static Vector3 AreaGradient (const double a[3], const double b[3], const double c[3])
 
static double BoundingSphereRadius (const double a[3], const double b[3], const double c[3], double *center=nullptr)
 
static void Center (const double a[3], const double b[3], const double c[3], double center[3])
 
static double Cotangent (double a[3], double b[3], double c[3])
 
static double DistanceBetweenCenters (const double a1[3], const double b1[3], const double c1[3], const double a2[3], const double b2[3], const double c2[3], double *p1, double *p2)
 Compute distance between triangle center points. More...
 
static double DistanceBetweenCorners (const double a1[3], const double b1[3], const double c1[3], const double a2[3], const double b2[3], const double c2[3], double *p1, double *p2)
 Compute distance between closest corner points of two triangles. More...
 
static double DistanceBetweenTriangles (const double a1[3], const double b1[3], const double c1[3], const double n1[3], const double a2[3], const double b2[3], const double c2[3], const double n2[3], double *p1, double *p2)
 Compute distance between closest points of two triangles.
 
static double DistanceBetweenTriangles (const double a1[3], const double b1[3], const double c1[3], const double a2[3], const double b2[3], const double c2[3], double *p1, double *p2)
 Compute distance between closest points of two triangles. More...
 
static double DoubleArea (const double a[3], const double b[3], const double c[3])
 
static double DoubleArea2D (const double a[2], const double b[2], const double c[2])
 
static Vector3 DoubleAreaGradient (const double a[3], const double b[3], const double c[3])
 
static double DoubleSignedArea2D (const double a[2], const double b[2], const double c[2])
 
static double MaxAngle (const double a[3], const double b[3], const double c[3])
 
static double MinAngle (const double a[3], const double b[3], const double c[3])
 
static void Normal (const double a[3], const double b[3], const double c[3], double n[3])
 
static void NormalDirection (const double a[3], const double b[3], const double c[3], double n[3])
 
static Matrix3x3 NormalDirectionJacobian (const double a[3], const double b[3], const double c[3])
 
static Matrix3x3 NormalJacobian (const double a[3], const double b[3], const double c[3])
 
static Matrix3x3 NormalJacobian (const double a[3], const double b[3], const double c[3], const Matrix3x3 &dn)
 
static Matrix3x3 NormalJacobian (const double n[3], const Matrix3x3 &dn)
 
static Matrix3x3 NormalJacobian (const Vector3 &n, const Matrix3x3 &dn)
 
static double SignedArea2D (const double a[2], const double b[2], const double c[2])
 
static bool TriangleTriangleIntersection (const double a1[3], const double b1[3], const double c1[3], const double a2[3], const double b2[3], const double c2[3])
 Tests whether two triangles intersect each other.
 
static bool TriangleTriangleIntersection (const double a1[3], const double b1[3], const double c1[3], const double a2[3], const double b2[3], const double c2[3], int &coplanar, double *p1, double *p2)
 Tests whether two triangles intersect each other.
 

Detailed Description

Auxiliary class/static helper functions for triangulated surface meshes

Definition at line 35 of file Triangle.h.

Member Function Documentation

§ Angles()

void mirtk::Triangle::Angles ( const double  a[3],
const double  b[3],
const double  c[3],
double  angle[3] 
)
inlinestatic

Compute angle at triangle corners

Parameters
[in]aPosition of triangle vertex A.
[in]bPosition of triangle vertex B.
[in]cPosition of triangle vertex C.
[out]angleAngles at triangle vertices in radians.

Definition at line 346 of file Triangle.h.

§ Area()

double mirtk::Triangle::Area ( const double  a[3],
const double  b[3],
const double  c[3] 
)
inlinestatic

Compute area of triangle

Parameters
[in]aPosition of triangle vertex A.
[in]bPosition of triangle vertex B.
[in]cPosition of triangle vertex C.
Returns
Area of triangle.

Definition at line 312 of file Triangle.h.

§ Area2D()

double mirtk::Triangle::Area2D ( const double  a[2],
const double  b[2],
const double  c[2] 
)
inlinestatic

Compute area of triangle in 2D

Parameters
[in]aPosition of triangle vertex A.
[in]bPosition of triangle vertex B.
[in]cPosition of triangle vertex C.
Returns
Area of triangle.

Definition at line 336 of file Triangle.h.

§ AreaGradient()

Vector3 mirtk::Triangle::AreaGradient ( const double  a[3],
const double  b[3],
const double  c[3] 
)
inlinestatic

Partial derivative of triangle area w.r.t. coordinates of vertex A

Parameters
[in]aPosition of triangle vertex A.
[in]bPosition of triangle vertex B.
[in]cPosition of triangle vertex C.
Returns
Partial derivatives of triangle area w.r.t. coordinates of vertex A.

Definition at line 483 of file Triangle.h.

§ BoundingSphereRadius()

double mirtk::Triangle::BoundingSphereRadius ( const double  a[3],
const double  b[3],
const double  c[3],
double *  center = nullptr 
)
inlinestatic

Compute center point of triangle

Parameters
[in]aPosition of triangle vertex A.
[in]bPosition of triangle vertex B.
[in]cPosition of triangle vertex C.
[out]centerPosition of triangle center.
Returns
Radius of bounding sphere with optionally returned center point.

Definition at line 266 of file Triangle.h.

§ Center()

void mirtk::Triangle::Center ( const double  a[3],
const double  b[3],
const double  c[3],
double  center[3] 
)
inlinestatic

Compute center point of triangle

Parameters
[in]aPosition of triangle vertex A.
[in]bPosition of triangle vertex B.
[in]cPosition of triangle vertex C.
[out]centerPosition of triangle center.

Definition at line 258 of file Triangle.h.

§ Cotangent()

double mirtk::Triangle::Cotangent ( double  a[3],
double  b[3],
double  c[3] 
)
inlinestatic

Compute cotangent of angle ABC

Parameters
[in]aPosition of triangle vertex A.
[in]bPosition of triangle vertex B.
[in]cPosition of triangle vertex C.
Returns
Cotangent of angle ABC (equals cotangent of angle CBA).

Definition at line 374 of file Triangle.h.

§ DistanceBetweenCenters()

double mirtk::Triangle::DistanceBetweenCenters ( const double  a1[3],
const double  b1[3],
const double  c1[3],
const double  a2[3],
const double  b2[3],
const double  c2[3],
double *  p1,
double *  p2 
)
inlinestatic

Compute distance between triangle center points.

Compute distance between two triangles.

Definition at line 495 of file Triangle.h.

§ DistanceBetweenCorners()

double mirtk::Triangle::DistanceBetweenCorners ( const double  a1[3],
const double  b1[3],
const double  c1[3],
const double  a2[3],
const double  b2[3],
const double  c2[3],
double *  p1,
double *  p2 
)
inlinestatic

Compute distance between closest corner points of two triangles.

Compute distance between two triangles.

Definition at line 507 of file Triangle.h.

§ DistanceBetweenTriangles()

double mirtk::Triangle::DistanceBetweenTriangles ( const double  a1[3],
const double  b1[3],
const double  c1[3],
const double  a2[3],
const double  b2[3],
const double  c2[3],
double *  p1,
double *  p2 
)
inlinestatic

Compute distance between closest points of two triangles.

Compute distance between two triangles.

Definition at line 546 of file Triangle.h.

§ DoubleArea()

double mirtk::Triangle::DoubleArea ( const double  a[3],
const double  b[3],
const double  c[3] 
)
inlinestatic

Compute twice the area of triangle

Parameters
[in]aPosition of triangle vertex A.
[in]bPosition of triangle vertex B.
[in]cPosition of triangle vertex C.
Returns
Twice the area of the triangle.

Definition at line 304 of file Triangle.h.

§ DoubleArea2D()

double mirtk::Triangle::DoubleArea2D ( const double  a[2],
const double  b[2],
const double  c[2] 
)
inlinestatic

Compute twice the area of triangle in 2D

Parameters
[in]aPosition of triangle vertex A.
[in]bPosition of triangle vertex B.
[in]cPosition of triangle vertex C.
Returns
Twice the area of the triangle.

Definition at line 330 of file Triangle.h.

§ DoubleAreaGradient()

Vector3 mirtk::Triangle::DoubleAreaGradient ( const double  a[3],
const double  b[3],
const double  c[3] 
)
inlinestatic

Partial derivatives of twice the triangle area w.r.t. coordinates of vertex A

Parameters
[in]aPosition of triangle vertex A.
[in]bPosition of triangle vertex B.
[in]cPosition of triangle vertex C.
Returns
Partial derivatives of twice the triangle area w.r.t. coordinates of vertex A.

Definition at line 474 of file Triangle.h.

§ DoubleSignedArea2D()

double mirtk::Triangle::DoubleSignedArea2D ( const double  a[2],
const double  b[2],
const double  c[2] 
)
inlinestatic

Compute twice the area of triangle in 2D

Parameters
[in]aPosition of triangle vertex A.
[in]bPosition of triangle vertex B.
[in]cPosition of triangle vertex C.
Returns
Twice the signed area of the triangle.

Definition at line 318 of file Triangle.h.

§ MaxAngle()

double mirtk::Triangle::MaxAngle ( const double  a[3],
const double  b[3],
const double  c[3] 
)
inlinestatic

Compute maximum angle at triangle corners

Returns
Maximum angle in radians.

Definition at line 365 of file Triangle.h.

§ MinAngle()

double mirtk::Triangle::MinAngle ( const double  a[3],
const double  b[3],
const double  c[3] 
)
inlinestatic

Compute minimum angle at triangle vertices

Returns
Minimum angle in radians.

Definition at line 357 of file Triangle.h.

§ Normal()

void mirtk::Triangle::Normal ( const double  a[3],
const double  b[3],
const double  c[3],
double  n[3] 
)
inlinestatic

Compute normal of triangle

Parameters
[in]aPosition of triangle vertex A.
[in]bPosition of triangle vertex B.
[in]cPosition of triangle vertex C.
[out]nTriangle normal vector.

Definition at line 290 of file Triangle.h.

§ NormalDirection()

void mirtk::Triangle::NormalDirection ( const double  a[3],
const double  b[3],
const double  c[3],
double  n[3] 
)
inlinestatic

Compute normal direction of triangle

Parameters
[in]aPosition of triangle vertex A.
[in]bPosition of triangle vertex B.
[in]cPosition of triangle vertex C.
[out]nNon-normalized triangle normal vector. The length of the resulting vector equals twice the triangle area.

Definition at line 281 of file Triangle.h.

§ NormalDirectionJacobian()

Matrix3x3 mirtk::Triangle::NormalDirectionJacobian ( const double  a[3],
const double  b[3],
const double  c[3] 
)
inlinestatic

Partial derivatives of normal direction w.r.t. position of vertex A

Parameters
[in]aPosition of triangle vertex A.
[in]bPosition of triangle vertex B.
[in]cPosition of triangle vertex C.
Returns
Partial derivatives of normal direction components w.r.t. coordinates of vertex A.

Definition at line 389 of file Triangle.h.

§ NormalJacobian() [1/4]

Matrix3x3 mirtk::Triangle::NormalJacobian ( const double  a[3],
const double  b[3],
const double  c[3] 
)
inlinestatic

Partial derivatives of normal w.r.t. coordinates of vertex A

Parameters
[in]aPosition of triangle vertex A.
[in]bPosition of triangle vertex B.
[in]cPosition of triangle vertex C.
Returns
Partial derivatives of normal components w.r.t. coordinates of vertex A.

Definition at line 467 of file Triangle.h.

§ NormalJacobian() [2/4]

Matrix3x3 mirtk::Triangle::NormalJacobian ( const double  a[3],
const double  b[3],
const double  c[3],
const Matrix3x3 &  dn 
)
inlinestatic

Partial derivatives of normal w.r.t. coordinates of vertex A

Parameters
[in]aPosition of triangle vertex A.
[in]bPosition of triangle vertex B.
[in]cPosition of triangle vertex C.
[in]dnPartial derivatives of normal direction vector.
Returns
Partial derivatives of normal components w.r.t. coordinates of vertex A.

Definition at line 458 of file Triangle.h.

§ NormalJacobian() [3/4]

Matrix3x3 mirtk::Triangle::NormalJacobian ( const double  n[3],
const Matrix3x3 &  dn 
)
inlinestatic

Partial derivatives of normal w.r.t. coordinates of vertex A

Parameters
[in]nTriangle normal vector, i.e., normalized direction vector.
[in]dnPartial derivatives of normal direction vector.
Returns
Partial derivatives of normal components w.r.t. coordinates of vertex A.

Definition at line 435 of file Triangle.h.

§ NormalJacobian() [4/4]

Matrix3x3 mirtk::Triangle::NormalJacobian ( const Vector3 n,
const Matrix3x3 &  dn 
)
inlinestatic

Partial derivatives of normal w.r.t. coordinates of vertex A

Parameters
[in]nTriangle normal vector, i.e., normalized direction vector.
[in]dnPartial derivatives of normal direction vector.
Returns
Partial derivatives of normal components w.r.t. coordinates of vertex A.

Definition at line 412 of file Triangle.h.

§ SignedArea2D()

double mirtk::Triangle::SignedArea2D ( const double  a[2],
const double  b[2],
const double  c[2] 
)
inlinestatic

Compute area of triangle in 2D

Parameters
[in]aPosition of triangle vertex A.
[in]bPosition of triangle vertex B.
[in]cPosition of triangle vertex C.
Returns
Signed area of triangle.

Definition at line 324 of file Triangle.h.


The documentation for this class was generated from the following file: