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 (line, p1, p2, p3)

Full Usage: Tria3D.intersectLine (line, p1, p2, p3)

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.
line : Line3D
p1 : Pnt
p2 : Pnt
p3 : Pnt
Returns: Pnt voption

Tria3D.intersectRay (line, p1, p2, p3)

Full Usage: Tria3D.intersectRay (line, p1, p2, p3)

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.
line : Line3D
p1 : Pnt
p2 : Pnt
p3 : Pnt
Returns: float voption

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 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 Some or None 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.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 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.isLinear (a, b, c, ?distanceTolerance)

Full Usage: Tria3D.isLinear (a, b, c, ?distanceTolerance)

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

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.

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

Tria3D.isLinearFast (a, b, c, ?maxAreaParallelogram)

Full Usage: Tria3D.isLinearFast (a, b, c, ?maxAreaParallelogram)

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

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 Points.areInLine if you need better control over the actual tolerance distance.

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

Tria3D.offset (a, b, c, dist)

Full Usage: Tria3D.offset (a, b, c, dist)

Parameters:
Returns: Pnt * Pnt * Pnt

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

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

Tria3D.offsetPnt (pntToOffset, prev, next, dist)

Full Usage: Tria3D.offsetPnt (pntToOffset, prev, next, dist)

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

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.

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

Tria3D.offsetVar (ptToOffset, prev, next, distPrev, distNext)

Full Usage: Tria3D.offsetVar (ptToOffset, prev, next, distPrev, distNext)

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

Returns: ValueOption<Pnt>

Finds the offset point based on the previous and next unit normals (= offset direction), and their offset distances.

ptToOffset : Pnt
prev : Pnt
next : Pnt
distPrev : float
distNext : float
Returns: ValueOption<Pnt>

Type something to start searching.