Coppercube API Documentation
Class Triangle3d
3d triangle class consisting of 3 points in space, formin a triangle
Class Overview
Triangle3d(a, b, c)
3d triangle class consisting of 3 points in space, formin a triangle
- Parameters:
- a
- {Vect3d} first point of the triangle, can be null.
- b
- {Vect3d} second point of the triangle, can be null.
- c
- {Vect3d} 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 Triangle3d
copyTo(tgt)
Copies the content of this triangle to another triangle
- Parameters:
- tgt
- {Triangle3d} Target vector
getIntersectionOfPlaneWithLine(linePoint, lineVect)
Returns the intersection of the plane described by this triangle and a line.
- Parameters:
- linePoint
- {Vect3d} point on the line
- lineVect
- {Vect3d} 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:
- linePoint
- {Vect3d} point on the line
- lineVect
- {Vect3d} vector of the line
- Returns:
- null if there is no intersection or a vect3d describing the point of intersection
{Vect3d}
getNormal()
Returns the normal of this triangle
- Returns:
- {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:
- p
- {Vect3d} 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:
- p
- {Vect3d} point to test
- Returns:
- {Boolean} true if inside, false if not
isTotalInsideBox(box)
Returns the the triangle is totally inside a box
- Parameters:
- box
- {Box3d}