new Triangle( [a] [, b] [, c] [, plane] [, host] [, offsetZ])
Creates a new triangle.
Parameters:
| Name | Type | Argument | Description |
|---|---|---|---|
a |
THREE.Vector3 |
<optional> |
An optional first vertex. |
b |
THREE.Vector3 |
<optional> |
An optional second vertex. |
c |
THREE.Vector3 |
<optional> |
An optional third vertex. |
plane |
THREE.Plane |
<optional> |
An optional plane equation for the triangle. |
host |
PD.Polygon | PD.BRep.Face | THREE.Mesh |
<optional> |
An optional host object to which the triangle belongs. |
offsetZ |
number |
<optional> |
A vertical offset value (in the Z axis), defaults to zero. |
Extends
- THREE.Triangle
Members
-
:PD.Polygon|PD.BRep.Face|THREE.Mesh|null
host
-
A reference to the host object to which the triangle belongs.
Type
- PD.Polygon | PD.BRep.Face | THREE.Mesh | null
-
:number
offsetZ
-
Stores a vertical offset value (in the Z axis), typically used to account for the different floor heights of level geometry.
This value is not used internally by any octree processes, but is returned with the intersected triangle as part of the hit results of any intersection tests. The resulting intersection point can then be adjusted as required by the host application.
All levels store their geometry at their own zero-based height, which is then translated into world coordinates when the level is rendered. This means that intersecting octrees on different levels may require adjustment based on the current level's floor height. Different parts of the BIM framework will use this value differently as needed.
Type
- number
-
:THREE.Plane|null
plane
-
Stores a reference to the plane equation of the triangle.
Type
- THREE.Plane | null
Methods
-
copy(triangle)
-
Copies the values of the given triangle to this instance.
Parameters:
Name Type Description trianglePD.Triangle The triangle to copy.
Returns:
A reference to this triangle.
- Type
- PD.Triangle
-
getNormal(target)
-
Returns the normal vector of the triangle, computing it if necessary.
Parameters:
Name Type Description targetVector3 The target vector that is used to store the method's result.
Returns:
The triangle's normal.
- Type
- Vector3
-
getPlane(target)
-
Returns the plane the triangle lies within, computing it if necessary.
Parameters:
Name Type Description targetPlane The target vector that is used to store the method's result.
Returns:
The plane the triangle lies within.
- Type
- Plane
-
insideBox(box)
-
Tests if the triangle is completely contained within the given box.
Parameters:
Name Type Description boxTHREE.Box3 The box to test against.
Returns:
Returns true if all triangle vertices are inside the box, otherwise false.
- Type
- boolean
-
intersectRay(ray, target)
-
Tests for an intersection between the given ray and this triangle.
Parameters:
Name Type Description rayTHREE.Ray The ray to test.
targetTHREE.Vector3 A point to receive the intersection position.
Returns:
Returns true if the triangle was hit and the intersection set.
- Type
- boolean