MatrixFactory Class

The MatrixFactory class provides a convenient way to generate different kinds of transformation matrices.
Inheritance Hierarchy
SystemObject
  Tekla.Structures.Geometry3dMatrixFactory

Namespace:  Tekla.Structures.Geometry3d
Assembly:  Tekla.Structures (in Tekla.Structures.dll) Version: 2023.0.3
Syntax
[SerializableAttribute]
public static class MatrixFactory

The MatrixFactory type exposes the following members.

Methods
  NameDescription
Public methodStatic memberCode exampleByCoordinateSystems
Returns a coordinate transformation matrix defined by two coordinate systems. With the returned matrix points can be transformed from the first coordinate system to the second coordinate system. The ByCoordinateSystems method is meant for transforming points between coordinate systems asked in the same work plane.
Public methodStatic memberCode exampleFromCoordinateSystem
Returns a coordinate transformation matrix defined by the given coordinate system. With the returned matrix points can be transformed from the given coordinate system to the current work plane coordinate system.
Public methodStatic memberRotate
Returns a rotation matrix in a Clockwise rotation around the given rotation axis, defined by the given angle and the given rotation axis.
Public methodStatic memberCode exampleToCoordinateSystem
Returns a coordinate transformation matrix defined by the given coordinate system. With the returned matrix points can be transformed from the current work plane coordinate system to the given coordinate system.
Top
Examples
The matrix factory can be used to create some useful transformation matrices between different coordinate systems:
using Tekla.Structures.Geometry3d;
using Tekla.Structures.Model;

public class Example
{
       public void Example1()
       {
           Beam Beam1 = new Beam();
           Beam Beam2 = new Beam();
           Point Point1 = new Point();

           CoordinateSystem Csys1 = Beam1.GetCoordinateSystem();
           CoordinateSystem Csys2 = Beam2.GetCoordinateSystem();

           Matrix Matrix = MatrixFactory.ByCoordinateSystems(Csys1, Csys2);
           Point Point2 = Matrix.Transform(Point1);

           // The same result for Point2 when using two separate transformations
           Matrix ToCurrentWP = MatrixFactory.FromCoordinateSystem(Csys1);
           Point CurrentPoint = ToCurrentWP.Transform(Point1);

           Matrix ToLocal = MatrixFactory.ToCoordinateSystem(Csys2);
           Point2 = ToLocal.Transform(CurrentPoint);
       }
}
See Also
Was this helpful?
The feedback you give here is not visible to other users. We use your comments to improve the content.
Previous
Next