•
|
Translate(x: float, y: float, z: float, withinLocalSystem: bool)
|
|
|
x coordinate
|
|
|
y coordinate
|
|
|
z coordinate
|
|
|
the referring to local system (True), (False) for global
|
Translate the matrix.
[Example]
myMat.Translate(0, 1, 2, False)
Rotate around x axis.
[Example]
myMat.RotateX(90)
Rotate around y axis.
[Example]
myMat.RotateY(-180)
Rotate around z axis.
[Example]
myMat.RotateZ(60)
|
|
angle in degrees to rotate
|
|
|
axis to rotate around
|
Rotate around given axis.
[Example]
def PostInitManufacturingGeometry(TechMfGeoInitOperator):
logOperator = TechMfGeoInitOperator.GetLoggerOperator()
currentProcessGeometryOperator = TechMfGeoInitOperator.GetCurrentProcessGeometryOperator()
myMat = currentProcessGeometryOperator.GetRegshapeCenter()
logOperator.LogDebug(str(myMat.GetRotation()))
rotAxis = CENPyOlpVector(0, 0, 1)
myMat.Rotate(90, rotAxis)
logOperator.LogDebug(str(myMat.GetRotation()))
Get position of matrix as a point.
[Example]
matPosition = myMat.GetPosition()
Get x direction as vector.
[Example]
directionX = myMat.GetXDirection()
Get y direction as vector.
[Example]
directionY = myMat.GetYDirection()
Get z direction as vector.
[Example]
directionZ = myMat.GetZDirection()
Transform a point with this matrix.
[Example]
transformedPoint = myMat.Transform(pyPoint)
•
|
GetRotation(inDegrees: bool): tuple
|
|
|
tuple(angleX, angleY, angleZ)
|
|
|
Flag that determines whether to return angles in radians or degrees. Default: radians (when nothing or False is specified)
|
Get rotation X, Y, Z angles of this matrix as tuple. Rotation angles are in radians by default and in degrees if input parameter True is specified.
[Example]
logOperator.LogDebug("RX, RY, RZ angles in radians: " + str(matrix.GetRotation()))
logOperator.LogDebug("RX, RY, RZ angles in degrees: " + str(matrix.GetRotation(True)))
Invert the matrix.
[Example]
invMax = myMat.Inverse()
Multiply two matrices.
[Example]
resMax = myMat.Multiply(myMatL, myMatR)
Sets the rotational part of the matrix as determined by the two input vectors.
The input vectors are assumed to be orthogonal and normalized.
[Example]
myMat.SetRotation(Axis1, Axis2, ROTATIONAXES_YZ)
Sets the rotational part of the matrix as determined by three input vectors.
The input vectors are assumed to be orthogonal and normalized.
[Example]
myMat.SetRotation(Axis1, Axis2, ROTATIONAXES_YZ)
|
|
CENPyOlpMatrix object that contains another matrix
|
|
|
The distance to another matrix
|
Returns the distance between this matrix and the given matrix.
[Example]
distance = myMat.GetDistance(toolMatrix)
|
|
True if object is associated with valid OLP matrix, false if not
|
[Example]
toolFrameMatrix = olpController.GetActiveToolFrameMatrix()
if toolFrameMatrix.IsValid():
logging.LogInfo("ToolFrameMatrix is valid!")
else:
logging.LogInfo("ToolFrameMatrix is invalid!")
|