Class Geom
Inheritance
Namespace:
Syntax
Methods
applyTransform
Apply a transformation matrix to a geometrical entity
Declaration
geom.applyTransform(entity, matrix=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]])
Parameters
| Type | Name | Description |
|---|---|---|
| GeomEntity | entity | The geometric entity |
| Matrix4 | matrix | The transformation matrix |
configureFunctionLogger
Declaration
geom.configureFunctionLogger(functionName, enableFunction, enableParameters, enableExecutionTime)
Parameters
| Type | Name | Description |
|---|---|---|
| String | functionName | |
| Boolean | enableFunction | |
| Boolean | enableParameters | |
| Boolean | enableExecutionTime |
getEntityAABB
Retrieve the Axis-Aligned Bounded Box of a geometric entity
Declaration
geom.getEntityAABB(entity) -> geom.AABB
Parameters
| Type | Name | Description |
|---|---|---|
| GeomEntity | entity | The geometric entity |
Returns
| Type | Description |
|---|---|
| AABB | The axis aligned bounded box |
changeOfBasisMatrix
Construct a Change of Basis Matrix (e.g multiplying the point [0,0,0] will result to the point origin)
See also:
Declaration
geom.changeOfBasisMatrix(origin, x, y, z) -> geom.Matrix4
Parameters
| Type | Name | Description |
|---|---|---|
| Point3 | origin | Origin of the new basis |
| Vector3 | x | X axis of the new basis |
| Vector3 | y | Y axis of the new basis |
| Vector3 | z | Z axis of the new basis |
Returns
| Type | Description |
|---|---|
| Matrix4 | The change of basis matrix |
fromAffine
Create a Matrix from an Affine
See also:
Declaration
geom.fromAffine(affine) -> geom.Matrix4
Parameters
| Type | Name | Description |
|---|---|---|
| Affine | affine | The affine |
Returns
| Type | Description |
|---|---|
| Matrix4 | The created Matrix |
fromLookAtMatrix
Get camera position, up and target vectors
See also:
Declaration
geom.fromLookAtMatrix(matrix, distanceFromTarget) -> geom.Point3, geom.Vector3, geom.Point3
Parameters
| Type | Name | Description |
|---|---|---|
| Matrix4 | matrix | The created Matrix |
| Distance | distanceFromTarget |
Returns
| Type | Description |
|---|---|
| Point3 | The camera position |
fromOriginNormal
Create a Matrix from an origin and a normal vector
See also:
Declaration
geom.fromOriginNormal(origin, normal) -> geom.Matrix4
Parameters
| Type | Name | Description |
|---|---|---|
| Point3 | origin | The origin point |
| Vector3 | normal | The normal vector |
Returns
| Type | Description |
|---|---|
| Matrix4 | The created Matrix |
fromTRS
Create a Matrix from translation, rotation and scaling vectors
See also:
Declaration
geom.fromTRS(T, R, S) -> geom.Matrix4
Parameters
| Type | Name | Description |
|---|---|---|
| Vector3 | T | The translation vector |
| Vector3 | R | The rotations vector |
| Vector3 | S | The scaling vector |
Returns
| Type | Description |
|---|---|
| Matrix4 | The created Matrix |
getMaxScale
Get maximum matrix scale
See also:
Declaration
geom.getMaxScale(matrix) -> core.Double
Parameters
| Type | Name | Description |
|---|---|---|
| Matrix4 | matrix |
Returns
| Type | Description |
|---|---|
| Double | Max scale value |
invertMatrix
Invert a matrix
See also:
Declaration
geom.invertMatrix(matrix) -> geom.Matrix4
Parameters
| Type | Name | Description |
|---|---|---|
| Matrix4 | matrix | The matrix to invert |
Returns
| Type | Description |
|---|---|
| Matrix4 | The inverted matrix |
lookAtMatrix
Create a matrix from a camera position, up and target
See also:
Declaration
geom.lookAtMatrix(position, up, target) -> geom.Matrix4
Parameters
| Type | Name | Description |
|---|---|---|
| Point3 | position | The camera position |
| Vector3 | up | The up vector |
| Point3 | target | The target position |
Returns
| Type | Description |
|---|---|
| Matrix4 | The created matrix |
multiplyMatrices
Multiply two matrices, returns left*right
See also:
Declaration
geom.multiplyMatrices(left, right) -> geom.Matrix4
Parameters
| Type | Name | Description |
|---|---|---|
| Matrix4 | left | Left side matrix |
| Matrix4 | right | Right side matrix |
Returns
| Type | Description |
|---|---|
| Matrix4 | Result of the matrices multiplication |
multiplyMatrixPoint
Multiply a point by a matrix (i.e apply the matrix to a point)
See also:
Declaration
geom.multiplyMatrixPoint(matrix, point) -> geom.Point3
Parameters
| Type | Name | Description |
|---|---|---|
| Matrix4 | matrix | The matrix to apply |
| Point3 | point | The point to multiply |
Returns
| Type | Description |
|---|---|
| Point3 | The resulting point |
multiplyMatrixVector
Multiply a vector by a matrix (i.e apply the matrix to a vector)
See also:
Declaration
geom.multiplyMatrixVector(matrix, vector) -> geom.Vector3
Parameters
| Type | Name | Description |
|---|---|---|
| Matrix4 | matrix | The matrix to apply |
| Vector3 | vector | The vector to multiply |
Returns
| Type | Description |
|---|---|
| Vector3 | The resulting point |
orthographicMatrix
Create an orthographic matrix from a 3D width, a 3D height, a near, and a far clipping distance
See also:
Declaration
geom.orthographicMatrix(width3D, height3D, nearClipDistance, farClipDistance) -> geom.Matrix4
Parameters
| Type | Name | Description |
|---|---|---|
| Double | width3D | The 3D width to consider |
| Double | height3D | The 3D height to consider |
| Distance | nearClipDistance | The near clipping distance |
| Distance | farClipDistance | The far clipping distance |
Returns
| Type | Description |
|---|---|
| Matrix4 | The created matrix |
perspectiveMatrix
Create a perspective matrix from a fovX, an aspect ratio, a near, and a far clipping distance
See also:
Declaration
geom.perspectiveMatrix(fovX, aspectRatio, nearClipDistance, farClipDistance) -> geom.Matrix4
Parameters
| Type | Name | Description |
|---|---|---|
| Angle | fovX | The field of view on the x axis |
| Double | aspectRatio | The aspect ratio foxX/fovY |
| Distance | nearClipDistance | The near clipping distance |
| Distance | farClipDistance | The far clipping distance |
Returns
| Type | Description |
|---|---|
| Matrix4 | The created matrix |
toTRS
Decompose a Matrix into translation, rotation and scaling vectors
See also:
Declaration
geom.toTRS(matrix) -> geom.Vector3List
Parameters
| Type | Name | Description |
|---|---|---|
| Matrix4 | matrix | The Matrix to be decomposed |
Returns
| Type | Description |
|---|---|
| Vector3List | The TRS list |