Matrix3D Object

Derived from: Base Object
Defined in namespace "adsk::core" and the header file is <Core/Geometry/Matrix3D.h>

Description

Transient 3D 4x4 matrix. This object is a wrapper over 3D matrix data and is used as way to pass matrix data in and out of the API and as a convenience when operating on matrix data. They are created statically using the create method of the Matrix3D class.

Methods

Name Description
asArray Returns the contents of the matrix as a 16 element array.
classType Static function that all classes support that returns the type of the class as a string. The returned string matches the string returned by the objectType property. For example if you have a reference to an object and you want to check if it's a SketchLine you can use myObject.objectType == fusion.SketchLine.classType().
copy Creates an independent copy of this matrix.
create Creates a transient 3d matrix object. It is initialized as an identity matrix and is created statically using the Matrix3D.create method.
getAsCoordinateSystem Gets the matrix data as the components that define a coordinate system.
getCell Gets the value of the specified cell in the 4x4 matrix.
invert Inverts this matrix.
isEqualTo Compares this matrix with another matrix and returns True if they're identical.
setCell Sets the specified cell in the 4x4 matrix to the specified value.
setToAlignCoordinateSystems Sets this matrix to be the matrix that maps from the 'from' coordinate system to the 'to' coordinate system.
setToIdentity Resets this matrix to an identify matrix.
setToRotateTo Sets to the matrix of rotation that would align the 'from' vector with the 'to' vector. The optional axis argument may be used when the two vectors are perpendicular and in opposite directions to specify a specific solution, but is otherwise ignored
setToRotation Sets this matrix to the matrix of rotation by the specified angle, through the specified origin, around the specified axis
setWithArray Sets the contents of the array using a 16 element array.
setWithCoordinateSystem Sets the matrix based on the components of a coordinate system.
transformBy Transforms this matrix using the input matrix.

Properties

Name Description
determinant Returns the determinant of the matrix.
isValid Indicates if this object is still valid, i.e. hasn't been deleted or some other action done to invalidate the reference.
objectType This property is supported by all objects in the API and returns a string that contains the full name (namespace::objecttype) describing the type of the object.

It's often useful to use this in combination with the classType method to see if an object is a certain type. For example: if obj.objectType == adsk.core.Point3D.classType():
translation Gets and sets the translation component of the matrix.

Accessed From

ConstructionPlane.transform, CustomGraphicsBRepBody.transform, CustomGraphicsCurve.transform, CustomGraphicsEntity.transform, CustomGraphicsGroup.transform, CustomGraphicsLines.transform, CustomGraphicsMesh.transform, CustomGraphicsPointSet.transform, CustomGraphicsText.transform, Decal.transform, DecalInput.transform, Matrix3D.copy, Matrix3D.create, MoveFeature.transform, MoveFeatureFreeMoveDefinition.transform, MoveFeatureInput.transform, Occurrence.transform, Occurrence.transform2, OptimizedOrientationResult.transformation, PatternElement.transform, ProjectedTextureMapControl.transform, SectionAnalysis.initialPosition, SectionAnalysis.transform, SectionAnalysisInput.initialPosition, SectionAnalysisInput.transform, Setup.workCoordinateSystem, Sketch.transform, SVGImportOptions.transform, TextureMapControl3D.transform, TriadCommandInput.lastTransform, TriadCommandInput.positionTransform, TriadCommandInput.transform, Viewport.modelToViewSpaceTransform

Samples

Name Description
moveFeatures.add Demonstrates the moveFeatures.add method.

Version

Introduced in version August 2014