All Frameworks  Object Hierarchy  This Framework  Indexes   

SWKSegment (Object)

This interface deals with a segment of a manikin.

Property Index

AttachSize
Returns the number of objects currently attached to the segment.
EndPositionX
Returns the global x coordinate of the endpoint of the segment.
EndPositionY
Returns the global y coordinate of the endpoint of the segment.
EndPositionZ
Returns the global z coordinate of the endpoint of the segment.
IsDOFAt0
Returns True if there is a DOF at index 0, False otherwise.
IsDOFAt1
Returns True if there is a DOF at index 1, False otherwise.
IsDOFAt2
Returns True if there is a DOF at index 2, False otherwise.
IsOnHand
This property is True if this segment belongs to the manikin's hand.
IsOnLeftSide
This property is True if this segment is on the left side of the manikin.
IsOnRightSide
This property is True if this segment is on the right side of the manikin.
IsOnSpine
This property is True if this segment belongs to the manikin's spine.
Length
Returns the length of the segment, in centimeters.
MirrorSegment
This property returns the equivalent segment, but on the opposite side (ex.
NbDOFs
Returns the number of degrees of freedom on the current segment.

Method Index

ApplyPosition
Applies a new relative position for the segment.
Attach
Attach a geometry to the segment.
CreateReachEnvelope
This method creates and displayed the reach envelope on the current segment.
DestroyReachEnvelope
This method destroys the reach envelope previously created for this segment.
Detach
Detach a geometry previously attached to the segment.
DetachAll
Detach all objects attached so far to the segment.
GetAttachedObject
Retrieve one object currently attached to the segment.
GetDOF
Returns a specific degree of freedom of the segment.
GetIKOffset
GetIKPosition
IsAttached
IsObjectReachable
Reachability check.
IsReachable
Reachability check.
LockPosture
Lock the posture of the segment.
MirrorCopyAngularLimitations
Mirror copy the angular limitations of the segment.
MirrorCopyPosture
Copy the posture on the equivalent segment, on the other side of the manikin.
MirrorCopyPrefAngles
Mirror copy the preferred angles of the segment.
Optimize
Sets the limits to match the best PrefAngle for the DOF piDOFId
RemoveLimits
Removes the angular limitations of the segment.
ResetAngularLimitations
Reset the angular limitations of the segment depending on piReset: 0 -> 2 OR 3 OR 4 depending of the first encountered.
ResetPosture
Set the segment's posture back to its default position.
ResetPrefAngles
Reset the preferred angles of the segment.
SetPercentage
Sets the angular limitations to a percentage for the DOF piDOFId
SetPosition
Sets a new absolute position for the segment.
SwapAngularLimitations
Swap the angular limitations of the segment.
SwapPosture
Swap the posture with the equivalent segment, on the other side of the manikin.
SwapPrefAngles
Swap the preferred angles of the segment.

Properties


o Property AttachSize() As (Read Only)
Returns the number of objects currently attached to the segment.
o Property EndPositionX() As (Read Only)
Returns the global x coordinate of the endpoint of the segment.
o Property EndPositionY() As (Read Only)
Returns the global y coordinate of the endpoint of the segment.
o Property EndPositionZ() As (Read Only)
Returns the global z coordinate of the endpoint of the segment.
o Property IsDOFAt0() As (Read Only)
Returns True if there is a DOF at index 0, False otherwise.
o Property IsDOFAt1() As (Read Only)
Returns True if there is a DOF at index 1, False otherwise.
o Property IsDOFAt2() As (Read Only)
Returns True if there is a DOF at index 2, False otherwise.
o Property IsOnHand() As (Read Only)
This property is True if this segment belongs to the manikin's hand.
o Property IsOnLeftSide() As (Read Only)
This property is True if this segment is on the left side of the manikin.
o Property IsOnRightSide() As (Read Only)
This property is True if this segment is on the right side of the manikin.
o Property IsOnSpine() As (Read Only)
This property is True if this segment belongs to the manikin's spine.
o Property Length() As (Read Only)
Returns the length of the segment, in centimeters.
o Property MirrorSegment() As (Read Only)
This property returns the equivalent segment, but on the opposite side (ex.: right leg <-> left leg).
o Property NbDOFs() As (Read Only)
Returns the number of degrees of freedom on the current segment.
Each segment can have up to three degrees of freedom. Therefore
the value of this property will never be higher than 3.

Methods


o Sub ApplyPosition( piPositionIncrement,
piStartSegment)
Applies a new relative position for the segment.
Parameters:
piPositionIncrement
The new position to combine with the segment's current position.
This array must contain 12 numbers, and msut be initialized using the four columns of a transformation matrix. The first nine components represent the rotation matrix.
The last three components represent the translation vector.
piStartSegment
The short name of the first segment of the kinematics chain. The short name specified has to identify a valid segment, which is an ancestor of the current one. For instance, is the segment to position is the right hand, then that start segment might be "RSArCl" (right clavicular). If the string "Default" is specified, then the start segment will be automatically chosen.
Example:
This example sets the segment to a 45-degree rotation around the x axis and at a (10, 20, 30) translation from the origin.
 Dim myPosition(11)
 'Rotation (45 degrees around the x axis)
 myPosition(0)  = 1.000
 myPosition(1)  = 0
 myPosition(2)  = 0
 myPosition(3)  = 0
 myPosition(4)  = 0.707
 myPosition(5)  = 0.707
 myPosition(6)  = 0
 myPosition(7)  = -0.707
 myPosition(8)  = 0.707
 'Translation vector (10,20,30)
 myPosition(9)  = 10.000
 myPosition(10) = 20.000
 myPosition(11) = 30.000
 myManikin.Body.GetItem("LSHaCPr").ApplyPosition myPosition
 
o Sub Attach( piObjectToAttach)
Attach a geometry to the segment.
Parameters:
piObjectToAttach
The object to attach. This object must be a movable object. Once the attach relationship is made, the object's postition will be updated every time the segment moves.
o Sub CreateReachEnvelope()
This method creates and displayed the reach envelope on the current segment. This segment must be part of the hand, otherwise an error code is returned.
Property IsOnHand can be used to check whether the segment is located on the hand.
o Sub DestroyReachEnvelope()
This method destroys the reach envelope previously created for this segment.
o Sub Detach( piObjectToDetach)
Detach a geometry previously attached to the segment.
Parameters:
piObjectToDetach
The object to detach. This object's will no longer be driven by the segment's position.
o Sub DetachAll()
Detach all objects attached so far to the segment.
o Func GetAttachedObject( piIndex) As
Retrieve one object currently attached to the segment.
Parameters:
piIndex
The index of the object to retrieve. First attached object is at index 0.
o Func GetDOF( piDOFNumber) As
Returns a specific degree of freedom of the segment.
A segment may have up to three degrees of freedom,
and these are numbered from 0 to 2.
However, the degrees of freedom do not always have
consecutive indices. For instance the forearm
has 2 DOFs, but these are numbered 0 and 2.
That is why the set of DOFs under a segment cannot
be properly accessed as if it was a collection.
To loop through the degrees of freedom of a segment,
one should test the value of properties IsDOFAt0, IsDOFAt1 or IsDOFAt2, and work with the
DOF only if the value of one of the corresponding property is
True.
Parameters:
piDOFNumber
The index of the DOF to retrieve.
This parameter must be either 0, 1 or 2.
o Sub GetIKOffset( poOffset)
Returns:
The IK offset for this segment.
o Sub GetIKPosition( poIKPosition)
Returns:
The position used for IK on this segment.
o Func IsAttached( piObject) As
Returns:
true if the object passed in the parameter is attached to the segment, false otherwise.
o Func IsObjectReachable( piObject) As
Reachability check.
Returns:
true if the object passed is reachable by the segment, false otherwise. The position taken is that of the center of the object.
o Func IsReachable( piX,
piY,
piZ) As
Reachability check.
Returns:
true if the location expressed in the coordinates is reachable by the segment, false otherwise.
o Sub LockPosture( piDOFId)
Lock the posture of the segment.
o Sub MirrorCopyAngularLimitations( piDOFId)
Mirror copy the angular limitations of the segment.
o Sub MirrorCopyPosture()
Copy the posture on the equivalent segment, on the other side of the manikin. For instance, it copies the posture from the right leg to the left leg.
o Sub MirrorCopyPrefAngles( piDOFId)
Mirror copy the preferred angles of the segment.
o Sub Optimize( piDOFId)
Sets the limits to match the best PrefAngle for the DOF piDOFId
o Sub RemoveLimits( piDOFId)
Removes the angular limitations of the segment.
o Sub ResetAngularLimitations( piDOFId,
piReset)
Reset the angular limitations of the segment depending on piReset: 0 -> 2 OR 3 OR 4 depending of the first encountered. 1 -> 2 AND 3 AND 4 2 -> Unlock the value 3 -> Restore the angular limitations if it is "No Limits" 4 -> Set back the angular limitations to their default value (50.0%)
o Sub ResetPosture()
Set the segment's posture back to its default position.
o Sub ResetPrefAngles( piDOFId)
Reset the preferred angles of the segment.
o Sub SetPercentage( piPercentage,
piDOFId)
Sets the angular limitations to a percentage for the DOF piDOFId
o Sub SetPosition( piNewPosition,
piStartSegment)
Sets a new absolute position for the segment.
Parameters:
piNewPosition
The new position to place the segment.
This array must contain 12 numbers, and msut be initialized using the four columns of a transformation matrix. The first nine components represent the rotation matrix.
The last three components represent the translation vector.
piStartSegment
The short name of the first segment of the kinematics chain. The short name specified has to identify a valid segment, which is an ancestor of the current one. For instance, is the segment to position is the right hand, then that start segment might be "RSArCl" (right clavicular). If the string "Default" is specified, then the start segment will be automatically chosen.
Example:
This example sets the segment to a 45-degree rotation around the x axis and at a (10, 20, 30) translation from the origin.
 Dim myPosition(11)
 'Rotation (45 degrees around the x axis)
 myPosition(0)  = 1.000
 myPosition(1)  = 0
 myPosition(2)  = 0
 myPosition(3)  = 0
 myPosition(4)  = 0.707
 myPosition(5)  = 0.707
 myPosition(6)  = 0
 myPosition(7)  = -0.707
 myPosition(8)  = 0.707
 'Translation vector (10,20,30)
 myPosition(9)  = 10.000
 myPosition(10) = 20.000
 myPosition(11) = 30.000
 myManikin.Body.GetItem("LSHaCPr").SetPosition myPosition, "Default"
 
o Sub SwapAngularLimitations( piDOFId)
Swap the angular limitations of the segment.
o Sub SwapPosture()
Swap the posture with the equivalent segment, on the other side of the manikin. For instance, the right leg takes the posture of the left leg, and vice versa.
o Sub SwapPrefAngles( piDOFId)
Swap the preferred angles of the segment.

Copyright © 2003, Dassault Systèmes. All rights reserved.