Documentation

Support

Asset Transformer SDK


User Manual

Python API

C# API

Changelog

Discussions

Asset Transformer SDK

Geom

Python API functions
Read time 7 minutesLast updated 19 hours ago

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

Type

Name

Description

GeomEntityentityThe geometric entity.
Matrix4matrixThe transformation matrix.

configureFunctionLogger

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

Type

Name

Description

StringfunctionName
BooleanenableFunction
BooleanenableParameters
BooleanenableExecutionTime

getEntityAABB

Retrieve the Axis-Aligned Bounded Box of a geometric entity.
geom.getEntityAABB(entity) -> geom.AABB
Parameters

Type

Name

Description

GeomEntityentityThe geometric entity.
Returns

Type

Name

Description

AABBaabbThe axis aligned bounded box.

Math

changeOfBasisMatrix

Construct a Change of Basis Matrix (e.g multiplying the point [0,0,0] will result to the point origin).
geom.changeOfBasisMatrix(origin, x, y, z) -> geom.Matrix4
Parameters

Type

Name

Description

Point3originOrigin of the new basis.
Vector3xX axis of the new basis.
Vector3yY axis of the new basis.
Vector3zZ axis of the new basis.
Returns

Type

Name

Description

Matrix4changeOfBasisThe change of basis matrix.
See also:

fromAffine

Create a Matrix from an Affine.
geom.fromAffine(affine) -> geom.Matrix4
Parameters

Type

Name

Description

AffineaffineThe affine.
Returns

Type

Name

Description

Matrix4matrixThe created Matrix.
See also:

fromLookAtMatrix

Get camera position, up and target vectors.
geom.fromLookAtMatrix(matrix, distanceFromTarget=1) -> geom.Point3, geom.Vector3, geom.Point3
Parameters

Type

Name

Description

Matrix4matrixThe created Matrix.
DistancedistanceFromTarget
Returns

Type

Name

Description

Point3positionThe camera position.
Vector3upThe up vector.
Point3targetThe target position.
See also:

fromOriginNormal

Create a Matrix from an origin and a normal vector.
geom.fromOriginNormal(origin, normal) -> geom.Matrix4
Parameters

Type

Name

Description

Point3originThe origin point.
Vector3normalThe normal vector.
Returns

Type

Name

Description

Matrix4matrixThe created Matrix.
See also:

fromTRS

Create a Matrix from translation, rotation and scaling vectors.
geom.fromTRS(T, R, S) -> geom.Matrix4
Parameters

Type

Name

Description

Vector3TThe translation vector.
Vector3RThe rotations vector.
Vector3SThe scaling vector.
Returns

Type

Name

Description

Matrix4matrixThe created Matrix.
See also:

getMaxScale

Get maximum matrix scale.
geom.getMaxScale(matrix) -> core.Double
Parameters

Type

Name

Description

Matrix4matrix
Returns

Type

Name

Description

DoublescaleMax scale value.
See also:

invertMatrix

Invert a matrix.
geom.invertMatrix(matrix=geom.IdentityMatrix4) -> geom.Matrix4
Parameters

Type

Name

Description

Matrix4matrixThe matrix to invert.
Returns

Type

Name

Description

Matrix4invertedThe inverted matrix.
See also:

lookAtMatrix

Create a matrix from a camera position, up and target.
geom.lookAtMatrix(position, up, target) -> geom.Matrix4
Parameters

Type

Name

Description

Point3positionThe camera position.
Vector3upThe up vector.
Point3targetThe target position.
Returns

Type

Name

Description

Matrix4matrixThe created matrix.
See also:

multiplyMatrices

Multiply two matrices, returns left*right.
geom.multiplyMatrices(left=geom.IdentityMatrix4, right=geom.IdentityMatrix4) -> geom.Matrix4
Parameters

Type

Name

Description

Matrix4leftLeft side matrix.
Matrix4rightRight side matrix.
Returns

Type

Name

Description

Matrix4resultResult of the matrices multiplication.
See also:

multiplyMatrixPoint

Multiply a point by a matrix (i.e apply the matrix to a point).
geom.multiplyMatrixPoint(matrix=geom.IdentityMatrix4, point) -> geom.Point3
Parameters

Type

Name

Description

Matrix4matrixThe matrix to apply.
Point3pointThe point to multiply.
Returns

Type

Name

Description

Point3resultThe resulting point.
See also:

multiplyMatrixVector

Multiply a vector by a matrix (i.e apply the matrix to a vector).
geom.multiplyMatrixVector(matrix=geom.IdentityMatrix4, vector) -> geom.Vector3
Parameters

Type

Name

Description

Matrix4matrixThe matrix to apply.
Vector3vectorThe vector to multiply.
Returns

Type

Name

Description

Vector3resultThe resulting point.
See also:

orthographicMatrix

Create an orthographic matrix from a 3D width, a 3D height, a near, and a far clipping distance.
geom.orthographicMatrix(width3D, height3D, nearClipDistance, farClipDistance) -> geom.Matrix4
Parameters

Type

Name

Description

Doublewidth3DThe 3D width to consider.
Doubleheight3DThe 3D height to consider.
DistancenearClipDistanceThe near clipping distance.
DistancefarClipDistanceThe far clipping distance.
Returns

Type

Name

Description

Matrix4matrixThe created matrix.
See also:

perspectiveMatrix

Create a perspective matrix from a fovX, an aspect ratio, a near, and a far clipping distance.
geom.perspectiveMatrix(fovX, aspectRatio, nearClipDistance, farClipDistance) -> geom.Matrix4
Parameters

Type

Name

Description

AnglefovXThe field of view on the x axis.
DoubleaspectRatioThe aspect ratio foxX/fovY.
DistancenearClipDistanceThe near clipping distance.
DistancefarClipDistanceThe far clipping distance.
Returns

Type

Name

Description

Matrix4matrixThe created matrix.
See also:

toTRS

Decompose a Matrix into translation, rotation and scaling vectors.
geom.toTRS(matrix=geom.IdentityMatrix4) -> geom.Vector3List
Parameters

Type

Name

Description

Matrix4matrixThe Matrix to be decomposed.
Returns

Type

Name

Description

Vector3ListTRSThe TRS list.
See also:

debug