Logo Euclid

Tria3D Type

A type containing only static member functions for operations on 3D Triangles.

Static members

Static member Description

Tria3D.area a b c

Full Usage: Tria3D.area a b c

Parameters:
Returns: float
Modifiers: inline

Returns the area of a triangle described by 3 points.

a : Pnt
b : Pnt
c : Pnt
Returns: float

Tria3D.areaDouble a b c

Full Usage: Tria3D.areaDouble a b c

Parameters:
Returns: float
Modifiers: inline

Returns the double area of a triangle. This is the fastest way to get a comparison or sorting value for the areas of triangles. This is just the length of the cross product vector.

a : Pnt
b : Pnt
c : Pnt
Returns: float

Tria3D.intersectLine p1 p2 p3 line

Full Usage: Tria3D.intersectLine p1 p2 p3 line

Parameters:
Returns: Pnt
 Calculates the intersection point on the finite Line3D with a 3D triangle.
 Fails if the finite line
  - does not intersect the triangle,
  - has zero length.
  - a triangle edge has zero length.
 Use Tria3D.tryIntersectLine to get ValueNone instead.
p1 : Pnt
p2 : Pnt
p3 : Pnt
line : Line3D
Returns: Pnt

Tria3D.intersectRay p1 p2 p3 line

Full Usage: Tria3D.intersectRay p1 p2 p3 line

Parameters:
Returns: float
 Calculates the intersection parameter on the infinite Ray / Line3D with a 3D triangle.
 Fails if the ray /line
  - is parallel to the triangle plane,
  - lies in the triangle's plane,
  - passes outside the triangle,
  - has zero length.
  - a triangle edge has zero length.
 Use Tria3D.tryIntersectRay to get ValueNone instead.
p1 : Pnt
p2 : Pnt
p3 : Pnt
line : Line3D
Returns: float

Tria3D.intersectRayXYZ (lnFromX, lnFromY, lnFromZ, lnToX, lnToY, lnToZ, ptAx, ptAy, ptAz, ptBx, ptBy, ptBz, ptCx, ptCy, ptCz)

Full Usage: Tria3D.intersectRayXYZ (lnFromX, lnFromY, lnFromZ, lnToX, lnToY, lnToZ, ptAx, ptAy, ptAz, ptBx, ptBy, ptBz, ptCx, ptCy, ptCz)

Parameters:
    lnFromX : float
    lnFromY : float
    lnFromZ : float
    lnToX : float
    lnToY : float
    lnToZ : float
    ptAx : float
    ptAy : float
    ptAz : float
    ptBx : float
    ptBy : float
    ptBz : float
    ptCx : float
    ptCy : float
    ptCz : float

Returns: float
 Calculates the intersection parameter on the infinite Ray / Line3D with a 3D triangle.
 Fails if the ray/line
  - is parallel to the triangle plane,
  - lies in the triangle's plane,
  - passes outside the triangle,
  - has zero length.
  - a triangle edge has zero length.
 Use Tria3D.tryIntersectRayXYZ to get ValueNone instead.
lnFromX : float
lnFromY : float
lnFromZ : float
lnToX : float
lnToY : float
lnToZ : float
ptAx : float
ptAy : float
ptAz : float
ptBx : float
ptBy : float
ptBz : float
ptCx : float
ptCy : float
ptCz : float
Returns: float

Tria3D.intersectTriaVectorsWithRay (lnFromX, lnFromY, lnFromZ, dirX, dirY, dirZ, ptAx, ptAy, ptAz, e1x, e1y, e1z, e2x, e2y, e2z)

Full Usage: Tria3D.intersectTriaVectorsWithRay (lnFromX, lnFromY, lnFromZ, dirX, dirY, dirZ, ptAx, ptAy, ptAz, e1x, e1y, e1z, e2x, e2y, e2z)

Parameters:
    lnFromX : float
    lnFromY : float
    lnFromZ : float
    dirX : float
    dirY : float
    dirZ : float
    ptAx : float
    ptAy : float
    ptAz : float
    e1x : float
    e1y : float
    e1z : float
    e2x : float
    e2y : float
    e2z : float

Returns: float
 Finds the intersection parameter on the infinite Line3D with a 3D triangle.
 Fails if
  - any of the direction vectors are too small,
  - the line is parallel to the triangle plane,
  - the intersection point is outside the triangle.
 Use Tria3D.tryIntersectTriaVectorsWithRay to get ValueNone instead.
 lnFromX, lnFromY, lnFromZ are the start point of the line
 dirX, dirY, dirZ are the direction vector of the line (not the end point)
 ptAx, ptAy, ptAz is the triangle points
 e1x, e1y, e1z is the triangle edge1 vector (B-A)
 e2x, e2y, e2z is the triangle edge2 vector (C-A)
lnFromX : float
lnFromY : float
lnFromZ : float
dirX : float
dirY : float
dirZ : float
ptAx : float
ptAy : float
ptAz : float
e1x : float
e1y : float
e1z : float
e2x : float
e2y : float
e2z : float
Returns: float

Tria3D.isLinear a b c

Full Usage: Tria3D.isLinear a b c

Parameters:
Returns: bool

Checks if three points are in one line. By finding the biggest angle in the triangle. And then measuring the distance from this point to the line defined by the other two points. Uses the default distanceTolerance of 1e-6. Use Tria3D.isLinearWithin to set it.

a : Pnt
b : Pnt
c : Pnt
Returns: bool

Tria3D.isLinearFast a b c

Full Usage: Tria3D.isLinearFast a b c

Parameters:
Returns: bool
Modifiers: inline

Checks if three points are in one line. This is a very fast check, but it is hard to find an appropriate tolerance. (Default is 0.001) This tolerance is the area of the parallelogram described by two vectors created from the 3 points. So it also returns TRUE if the points are equal or very close to each other. Returns FALSE for NaN input values. Use Tria3D.isLinear if you need better control over the actual tolerance distance. Uses the default maxAreaParallelogram of 0.001. Use Tria3D.isLinearFastWithin to set it.

a : Pnt
b : Pnt
c : Pnt
Returns: bool

Tria3D.isLinearFastWithin maxAreaParallelogram a b c

Full Usage: Tria3D.isLinearFastWithin maxAreaParallelogram a b c

Parameters:
    maxAreaParallelogram : float
    a : Pnt
    b : Pnt
    c : Pnt

Returns: bool
Modifiers: inline

Checks if three points are in one line. This is a very fast check, but it is hard to find an appropriate tolerance. The tolerance maxAreaParallelogram is the area of the parallelogram described by two vectors created from the 3 points. So it also returns TRUE if the points are equal or very close to each other. Returns FALSE for NaN input values. Use Tria3D.isLinearWithin if you need better control over the actual tolerance distance. Use Tria3D.isLinearFast for the default tolerance of 0.001.

maxAreaParallelogram : float
a : Pnt
b : Pnt
c : Pnt
Returns: bool

Tria3D.isLinearWithin distanceTolerance a b c

Full Usage: Tria3D.isLinearWithin distanceTolerance a b c

Parameters:
    distanceTolerance : float
    a : Pnt
    b : Pnt
    c : Pnt

Returns: bool

Checks if three points are in one line. By finding the biggest angle in the triangle. And then measuring the distance from this point to the line defined by the other two points. Returns TRUE if this distance is less than distanceTolerance, or if two points are closer than distanceTolerance. Use Tria3D.isLinear for the default distanceTolerance of 1e-6.

distanceTolerance : float
a : Pnt
b : Pnt
c : Pnt
Returns: bool

Tria3D.offset dist a b c

Full Usage: Tria3D.offset dist a b c

Parameters:
Returns: Pnt * Pnt * Pnt

Offsets all points by a given distance. The offset is inwards for positive distance and outwards for negative distance.

dist : float
a : Pnt
b : Pnt
c : Pnt
Returns: Pnt * Pnt * Pnt

Tria3D.offsetPnt dist prev next pntToOffset

Full Usage: Tria3D.offsetPnt dist prev next pntToOffset

Parameters:
    dist : float
    prev : Pnt
    next : Pnt
    pntToOffset : Pnt

Returns: Pnt

Offsets one point by a given distance. If the points 'prev', 'this' and 'next' are in counter-clockwise order, the offset is inwards. Otherwise it is outwards. A negative offset distance inverts the direction.

dist : float
prev : Pnt
next : Pnt
pntToOffset : Pnt
Returns: Pnt

Tria3D.offsetPntVariable distPrev distNext prev next pntToOffset

Full Usage: Tria3D.offsetPntVariable distPrev distNext prev next pntToOffset

Parameters:
    distPrev : float
    distNext : float
    prev : Pnt
    next : Pnt
    pntToOffset : Pnt

Returns: Pnt

Finds the offset point based on the previous and next points, and their offset distances. Fails if the three points are collinear or too close to each other. Use Tria3D.tryOffsetPntVar to get ValueNone instead.

distPrev : float
distNext : float
prev : Pnt
next : Pnt
pntToOffset : Pnt
Returns: Pnt

Tria3D.tryIntersectLine p1 p2 p3 line

Full Usage: Tria3D.tryIntersectLine p1 p2 p3 line

Parameters:
Returns: Pnt voption
Modifiers: inline
 Calculates the intersection point on the finite Line3D with a 3D triangle.
 Returns:
 ValueSome with the intersection point.
 ValueNone if the finite line
  - does not intersect the triangle,
  - has zero length.
  - a triangle edge has zero length.
p1 : Pnt
p2 : Pnt
p3 : Pnt
line : Line3D
Returns: Pnt voption

Tria3D.tryIntersectRay p1 p2 p3 line

Full Usage: Tria3D.tryIntersectRay p1 p2 p3 line

Parameters:
Returns: float voption
Modifiers: inline
 Calculates the intersection parameter on the infinite Ray / Line3D with a 3D triangle.
 Returns:
 ValueSome with the parameter on the line.
 ValueNone if the ray /line
  - is parallel to the triangle plane,
  - lies in the triangle's plane,
  - passes outside the triangle,
  - has zero length.
  - a triangle edge has zero length.
p1 : Pnt
p2 : Pnt
p3 : Pnt
line : Line3D
Returns: float voption

Tria3D.tryIntersectRayXYZ (lnFromX, lnFromY, lnFromZ, lnToX, lnToY, lnToZ, ptAx, ptAy, ptAz, ptBx, ptBy, ptBz, ptCx, ptCy, ptCz)

Full Usage: Tria3D.tryIntersectRayXYZ (lnFromX, lnFromY, lnFromZ, lnToX, lnToY, lnToZ, ptAx, ptAy, ptAz, ptBx, ptBy, ptBz, ptCx, ptCy, ptCz)

Parameters:
    lnFromX : float
    lnFromY : float
    lnFromZ : float
    lnToX : float
    lnToY : float
    lnToZ : float
    ptAx : float
    ptAy : float
    ptAz : float
    ptBx : float
    ptBy : float
    ptBz : float
    ptCx : float
    ptCy : float
    ptCz : float

Returns: float voption
Modifiers: inline
 Calculates the intersection parameter on the infinite Ray / Line3D with a 3D triangle.
 Returns:
 ValueSome with the parameter on the line.
 ValueNone if the ray/line
  - is parallel to the triangle plane,
  - lies in the triangle's plane,
  - passes outside the triangle,
  - has zero length.
  - a triangle edge has zero length.
 Note: A degenerated linear triangle that still intersects with the line may sometimes return ValueSome or ValueNone depending on the order of input points.
lnFromX : float
lnFromY : float
lnFromZ : float
lnToX : float
lnToY : float
lnToZ : float
ptAx : float
ptAy : float
ptAz : float
ptBx : float
ptBy : float
ptBz : float
ptCx : float
ptCy : float
ptCz : float
Returns: float voption

Tria3D.tryIntersectTriaVectorsWithRay (lnFromX, lnFromY, lnFromZ, dirX, dirY, dirZ, ptAx, ptAy, ptAz, e1x, e1y, e1z, e2x, e2y, e2z)

Full Usage: Tria3D.tryIntersectTriaVectorsWithRay (lnFromX, lnFromY, lnFromZ, dirX, dirY, dirZ, ptAx, ptAy, ptAz, e1x, e1y, e1z, e2x, e2y, e2z)

Parameters:
    lnFromX : float
    lnFromY : float
    lnFromZ : float
    dirX : float
    dirY : float
    dirZ : float
    ptAx : float
    ptAy : float
    ptAz : float
    e1x : float
    e1y : float
    e1z : float
    e2x : float
    e2y : float
    e2z : float

Returns: float voption
 Finds the intersection parameter on the infinite Line3D with a 3D triangle.
 Returns ValueNone if
  - any of the direction vectors are too small,
  - the line is parallel to the triangle plane,
  - the intersection point is outside the triangle.
 lnFromX, lnFromY, lnFromZ are the start point of the line
 dirX, dirY, dirZ are the direction vector of the line (not the end point)
 ptAx, ptAy, ptAz is the triangle points
 e1x, e1y, e1z is the triangle edge1 vector (B-A)
 e2x, e2y, e2z is the triangle edge2 vector (C-A)
lnFromX : float
lnFromY : float
lnFromZ : float
dirX : float
dirY : float
dirZ : float
ptAx : float
ptAy : float
ptAz : float
e1x : float
e1y : float
e1z : float
e2x : float
e2y : float
e2z : float
Returns: float voption

Tria3D.tryOffsetPntVariable distPrev distNext prev next pntToOffset

Full Usage: Tria3D.tryOffsetPntVariable distPrev distNext prev next pntToOffset

Parameters:
    distPrev : float
    distNext : float
    prev : Pnt
    next : Pnt
    pntToOffset : Pnt

Returns: Pnt voption

Finds the offset point based on the previous and next points, and their offset distances. Returns ValueNone if the three points are collinear or too close to each other.

distPrev : float
distNext : float
prev : Pnt
next : Pnt
pntToOffset : Pnt
Returns: Pnt voption

Type something to start searching.