Python scripting OLP - Objects

CENPyOlpVector

 

Methods

 

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

 

o

x

x coordinate in meters

 

o

y

y coordinate in meters

 

o

z

z coordinate in meters

 

Create new vector object

Note that object will be deleted automatically by python at the end of current callback scope.

 

[Example]

   myNewVector = CENPyOlpVector(1, 2.22, -3.333)

 


 

SetXYZ(x: float, y: float, z: float)

 

o

x

x coordinate in meters

 

o

y

y coordinate in meters

 

o

z

z coordinate in meters

 

Set coordinates.

 

[Example]

   myNewVector.SetXYZ(-1, 2.2, 3)

 


 

GetXYZ(): tuple

 

o

return

tuple (x coordinate, y coordinate, z coordinate) in meters

 

Get coordinates as tuple .

 

[Example]

   myVectorCoordinates = myNewVector.GetXYZ()

 


 

GetX(): float

 

o

return

x coordinate in meters

 

Get x coordinate.

 

[Example]

   myVectorXCoord = myNewVector.GetX()

 


 

GetY(): float

 

o

return

y coordinate in meters

 

Get y coordinate.

 

[Example]

   myVectorYCoord = myNewVector.GetY()

 


 

GetZ(): float

 

o

return

z coordinate in meters

 

Get z coordinate.

 

 [Example]

   myVectorZCoord = myNewVector.GetZ()

 


 

SetX(val: float)

 

o

val

new x coordinate in meters

 

Set x coordinate.

 

[Example]

   myNewVector.SetX(0.1)

 


 

SetY(val: float)

 

o

val

new y coordinate in meters

 

Set y coordinate.

 

[Example]

   myNewVector.SetY(-0.2)

 


 

SetZ(val: float)

 

o

val

new z coordinate in meters

Set z coordinate.

 

 [Example]

   myNewVector.SetZ(-0.003)

 


 

Normalize()

 

 

 

Normalize vector.

 

 [Example]

   myNewVector.Normalize()

 


 

Transform(pyTransformationMatrix: CENPyOlpMatrix)

 

o

pyTransformationMatrix

CENPyOlpMatrix matrix object

 

Transform vector.

 

[Example]

   myNewVector.Transform(myMat)

 


 

Angle(pySecondVec: CENPyOlpVector): float

 

o

pySecondVec

CENPyOlpVector matrix object

 

o

return

angle in radians

Compute angle between this and another vector.

 

 [Example]

   rotAxisZ = CENPyOlpVector(0, 0, 1)

   rotAxisXZ = CENPyOlpVector(1, 0, 1)

   axisAngle = rotAxisZ.Angle(rotAxisXZ)

   logOperator.LogDebug(str(axisAngle))

 


 

Invert()

 

Invert vector.

 

 [Example]

   myNewVector.Invert()

 


 

 


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