...
(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 |
---|
language | py |
---|
theme | Midnight |
---|
linenumbers | true |
---|
|
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 |
---|
title | Solution (only visible by instructors; please contact us to request access) |
---|
|
Include Page |
---|
| S7.3 Introduction to transformation matrices |
---|
| S7.3 Introduction to transformation matrices |
---|
|
|
...