CopperLicht API Documentation
Class CL3D.Triangle3d
3d triangle class consisting of 3 points in space, formin a triangle
Class Overview
CL3D.Triangle3d(a, b, c)
3d triangle class consisting of 3 points in space, formin a triangle
- Parameters:
- {CL3D.Vect3d} a
- first point of the triangle, can be null.
- {CL3D.Vect3d} b
- second point of the triangle, can be null.
- {CL3D.Vect3d} c
- third point of the triangle, can be null.
Field Attributes | Field Name and Description |
---|---|
First point of the triangle
|
|
Second point of the triangle
|
|
Third point of the triangle
|
Method Attributes | Method Name and Description |
---|---|
clone()
Creates a copy of this vector and returns it
|
|
copyTo(tgt)
Copies the content of this triangle to another triangle
|
|
getIntersectionOfPlaneWithLine(linePoint, lineVect)
Returns the intersection of the plane described by this triangle and a line.
|
|
getIntersectionWithLine(linePoint, lineVect)
Returns the intersection of the triangle and a line.
|
|
Returns the normal of this triangle
|
|
getPlane()
Creates a 3d plane based on this triangle
|
|
Returns if a point is in this triangle using a slow method
|
|
Returns if a point is in this triangle using a fast method
|
|
isTotalInsideBox(box)
Returns the the triangle is totally inside a box
|
Field Detail
{Vect3d}
pointA
First point of the triangle
{Vect3d}
pointB
Second point of the triangle
{Vect3d}
pointC
Third point of the triangle
Method Detail
clone()
Creates a copy of this vector and returns it
- Returns:
- the new CL3D.Triangle3d
copyTo(tgt)
Copies the content of this triangle to another triangle
- Parameters:
- {CL3D.Triangle3d} tgt
- Target vector
getIntersectionOfPlaneWithLine(linePoint, lineVect)
Returns the intersection of the plane described by this triangle and a line.
- Parameters:
- {CL3D.Vect3d} linePoint
- point on the line
- {CL3D.Vect3d} lineVect
- vector of the line
- Returns:
- null if there is no intersection or a vect3d describing the point of intersection
getIntersectionWithLine(linePoint, lineVect)
Returns the intersection of the triangle and a line.
- Parameters:
- {CL3D.Vect3d} linePoint
- point on the line
- {CL3D.Vect3d} lineVect
- vector of the line
- Returns:
- null if there is no intersection or a vect3d describing the point of intersection
{CL3D.Vect3d}
getNormal()
Returns the normal of this triangle
- Returns:
- {CL3D.Vect3d} the normal.
getPlane()
Creates a 3d plane based on this triangle
- Returns:
- Triangle3d
{Boolean}
isPointInside(p)
Returns if a point is in this triangle using a slow method
- Parameters:
- {CL3D.Vect3d} p
- point to test
- Returns:
- {Boolean} true if inside, false if not
{Boolean}
isPointInsideFast(p)
Returns if a point is in this triangle using a fast method
- Parameters:
- {CL3D.Vect3d} p
- point to test
- Returns:
- {Boolean} true if inside, false if not
isTotalInsideBox(box)
Returns the the triangle is totally inside a box
- Parameters:
- {CL3D.Box3d} box