Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

(d) Close the arm26 model and open step1.osim. You will see a sphere at the origin of frame A and a marker at point p. Next, we will add frame B. Type the following in the ScriptingShell Window, filling in the missing information as indicated:

Code Block
languagepy
themeMidnight
linenumberstrue
angle  = 0  #fill in the angle
rot    = modeling.Rotation(angle, modeling.CoordinateAxis(2))  #Note: CoordinateAxis(2) refers to the Z-axis
transB = modeling.Transform(rot, modeling.Vec3(a,b,c))  #fill in a,b,c
frameA = model.getComponent('frameA')
frameA = modeling.PhysicalOffsetFrame.safeDownCast(frameA)
frameB = modeling.PhysicalOffsetFrame(frameA, trans)
frameB.setName('frameB')
model.addComponent(frameB)
model.finalizeConnections()
model.print('step2.osim')





.


Expand
titleSolution (only visible by instructors; please contact us to request access)

Include Page
S7.3 Introduction to transformation matrices
S7.3 Introduction to transformation matrices

...