MatrixFactory Class |
The MatrixFactory class provides a convenient way to generate different
kinds of transformation matrices.
Inheritance Hierarchy
Namespace: Tekla.Structures.Geometry3d
Assembly: Tekla.Structures (in Tekla.Structures.dll) Version: 2024.0.0+a110b435391768740483e3032720a566518c9a63
Syntax
The MatrixFactory type exposes the following members.
Methods
Name | Description | |
---|---|---|
ByCoordinateSystems |
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.
| |
FromCoordinateSystem |
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.
| |
Rotate |
Returns a rotation matrix in a Clockwise rotation around the given rotation axis,
defined by the given angle and the given rotation axis.
| |
ToCoordinateSystem |
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.
|
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