Python scripting - Workmethod operators

CENPyOlpWM_GeometryOperator

 

The object of the CENPyOlpWM_GeometryOperator class may be obtained with the CENPyOlpWM_POAttribOperator.

 

[Example]

def PostProcessOperationAttributes(poa):

# parser

   geometryOperator = poa.GetGeometryOperator()   

   vector0 = geometryOperator.CreateVector(0, 1, 1)

   vector1 = geometryOperator.CreateVector(0, 0, 1)

   vectorN = geometryOperator.CreateVector(0, 0, 1)

   angle = GetIncludedAngle = geometryOperator.GetIncludedAngle(vector0, vector1, vectorN, 0)

   rad = geometryOperator.ToRadian(180)

   deg180 = geometryOperator.ToDegrees(rad)

   pass

 

 

Methods

 

CreateVector(x : float, y : float, z : float): CENPyOlpVector

 

o

x

X-direction

 

o

y

Y-direction

 

o

z

Z-direction

 

o

return

Object of CENPyOlpVector class

 

[Example]

   vector0 = geometryOperator.CreateVector(0, 1, 1)

 


 

GetIncludedAngle(v0 : CENPyOlpVector, v1 : CENPyOlpVector, normal : CENPyOlpVector, dir : int): float

 

o

v0

The first vector to calculate angle.

 

o

v1

The second vector to calculate angle.

 

o

normal

The normal to the rotational plane.

 

o

dir

The direction for angle measurement (dir=1:anticlockwise  dir=-1:clockwise).

 

o

return

Angle between the two vectors @v0 and @v1 in radians.

 

This method returns the absolute included angle between the two input vectors in the specified direction about the given normal. Returns radian values from 0 to 2*Pi.

 

[Example]

   angle = GetIncludedAngle = geometryOperator.GetIncludedAngle(vector0, vector1, vectorN, 0)

 


 

ToRadian(degrees : float): float

 

o

degrees

given degree value

 

o

return

returns the value in radians

 

Converts the given value from degrees to radians.

 

[Example]

   rad = geometryOperator.ToRadian(180)

 


 

ToDegrees(radians : float): float

 

o

radians

given radian value

 

o

return

returns the value in degrees

 

Converts the given value from radians to degrees.

 

[Example]

    deg180 = geometryOperator.ToDegrees(rad)

 


 

 


Previous
Page précédente
Chapter
Page principale du chapitre
Next
Page suivante