Table of Contents

Class Geom

Namespace
Geom

Methods

applyTransform

Apply a transformation matrix to a geometrical entity

geom.applyTransform(entity, matrix=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]])

Parameters

entity GeomEntity

The geometric entity

matrix Matrix4

The transformation matrix

configureFunctionLogger

geom.configureFunctionLogger(functionName, enableFunction, enableParameters, enableExecutionTime)

Parameters

functionName String
enableFunction Boolean
enableParameters Boolean
enableExecutionTime Boolean

getEntityAABB

Retrieve the Axis-Aligned Bounded Box of a geometric entity

geom.getEntityAABB(entity) -> geom.AABB

Parameters

entity GeomEntity

The geometric entity

Returns

AABB

The axis aligned bounded box

changeOfBasisMatrix

geom.changeOfBasisMatrix(origin, x, y, z) -> geom.Matrix4

Parameters

origin Point3

Origin of the new basis

x Vector3

X axis of the new basis

y Vector3

Y axis of the new basis

z Vector3

Z axis of the new basis

Returns

Matrix4

The change of basis matrix

fromAffine

geom.fromAffine(affine) -> geom.Matrix4

Parameters

affine Affine

The affine

Returns

Matrix4

The created Matrix

fromLookAtMatrix

geom.fromLookAtMatrix(matrix, distanceFromTarget) -> geom.Point3, geom.Vector3, geom.Point3

Parameters

matrix Matrix4

The created Matrix

distanceFromTarget Distance

Returns

Point3

The camera position

fromOriginNormal

geom.fromOriginNormal(origin, normal) -> geom.Matrix4

Parameters

origin Point3

The origin point

normal Vector3

The normal vector

Returns

Matrix4

The created Matrix

fromTRS

geom.fromTRS(T, R, S) -> geom.Matrix4

Parameters

T Vector3

The translation vector

R Vector3

The rotations vector

S Vector3

The scaling vector

Returns

Matrix4

The created Matrix

invertMatrix

geom.invertMatrix(matrix) -> geom.Matrix4

Parameters

matrix Matrix4

The matrix to invert

Returns

Matrix4

The inverted matrix

lookAtMatrix

geom.lookAtMatrix(position, up, target) -> geom.Matrix4

Parameters

position Point3

The camera position

up Vector3

The up vector

target Point3

The target position

Returns

Matrix4

The created matrix

multiplyMatrices

geom.multiplyMatrices(left, right) -> geom.Matrix4

Parameters

left Matrix4

Left side matrix

right Matrix4

Right side matrix

Returns

Matrix4

Result of the matrices multiplication

multiplyMatrixPoint

geom.multiplyMatrixPoint(matrix, point) -> geom.Point3

Parameters

matrix Matrix4

The matrix to apply

point Point3

The point to multiply

Returns

Point3

The resulting point

multiplyMatrixVector

geom.multiplyMatrixVector(matrix, vector) -> geom.Vector3

Parameters

matrix Matrix4

The matrix to apply

vector Vector3

The vector to multiply

Returns

Vector3

The resulting point

orthographicMatrix

geom.orthographicMatrix(width3D, height3D, nearClipDistance, farClipDistance) -> geom.Matrix4

Parameters

width3D Double

The 3D width to consider

height3D Double

The 3D height to consider

nearClipDistance Distance

The near clipping distance

farClipDistance Distance

The far clipping distance

Returns

Matrix4

The created matrix

perspectiveMatrix

geom.perspectiveMatrix(fovX, aspectRatio, nearClipDistance, farClipDistance) -> geom.Matrix4

Parameters

fovX Angle

The field of view on the x axis

aspectRatio Double

The aspect ratio foxX/fovY

nearClipDistance Distance

The near clipping distance

farClipDistance Distance

The far clipping distance

Returns

Matrix4

The created matrix

toTRS

geom.toTRS(matrix) -> geom.Vector3List

Parameters

matrix Matrix4

The Matrix to be decomposed

Returns

Vector3List

The TRS list