Page 1 of 2
Coordinates of muscle points with wrapping surfaces
Posted: Tue Jun 06, 2017 12:00 am
by simaoluz
Hi
Been trying to figure out how to determine the coordinates of muscle points whose trajectory changes due to wrapping surfaces.
Basically would like to know the coordinates of multiple points in the muscle path.
Is PathWrapPoint or getCurrentDisplayPath unavailable in OpenSim 3.3?
Cheers
Re: Coordinates of muscle points with wrapping surfaces
Posted: Tue Jun 06, 2017 1:42 am
by tkuchida
A similar question was asked and answered on this Forum thread:
viewtopicPhpbb.php?f=91&t=7723.
Re: Coordinates of muscle points with wrapping surfaces
Posted: Tue Jun 06, 2017 6:48 pm
by simaoluz
Thanks Tom
So basically the answer is no. Was this possible in previous OpenSim versions?
Cheers
Re: Coordinates of muscle points with wrapping surfaces
Posted: Tue Jun 06, 2017 10:58 pm
by tkuchida
If you're seeking an answer to the question "Is PathWrapPoint or getCurrentDisplayPath
unavailable in OpenSim 3.3?" [emphasis added], then I believe you are correct and the answer is "no". To clarify, if you're trying to extract points along a muscle's path, I believe the scripts (written in both 3.3 and 4.0) posted to topic 7723 (
viewtopicPhpbb.php?f=91&t=7723) do that. Please provide more detail if that isn't what you're trying to do.
Re: Coordinates of muscle points with wrapping surfaces
Posted: Tue Jun 06, 2017 11:06 pm
by simaoluz
Thanks for your reply Tom
Sorry if i havent been clear.
I would like to determine the coordinates of multiple points along a path that intercepts a wrapping surface. Or the points along the "arc" that is created due to the interception between muscle path and a wrap object.
Cheers
Re: Coordinates of muscle points with wrapping surfaces
Posted: Tue Jun 06, 2017 11:34 pm
by tkuchida
Thanks for clarifying. Not sure you can access the path points that lie on the surface of the wrap object in 3.3, but I think you can at least access the endpoints of the arc via
getCurrentPath():
Code: Select all
import org.opensim.modeling.*
% Load model and create underlying computational system.
model = Model('arm26.osim');
state = model.initSystem();
% References to points defining muscle path.
BRA = model.getMuscles().get('BRA');
pathPointSet = BRA.getGeometryPath().getPathPointSet();
currentPath = BRA.getGeometryPath().getCurrentPath(state);
% Inspect pathPointSet.
for i = 0:pathPointSet.getSize()-1
fprintf('pathPointSet[%d]: %s\n', i, ...
char(pathPointSet.get(i).getLocation()));
end
% Inspect currentPath.
for i = 0:currentPath.getSize()-1
fprintf('currentPath[%d]: %s\n', i, ...
char(currentPath.get(i).getLocation()));
end
The following is displayed in the MATLAB Command Window:
Code: Select all
pathPointSet[0]: ~[0.0068,-0.1739,-0.0036]
pathPointSet[1]: ~[-0.0032,-0.0239,0.0009]
currentPath[0]: ~[0.0068,-0.1739,-0.0036]
currentPath[1]: ~[0.018729,-0.290559,-0.00910357]
currentPath[2]: ~[0.0135788,-0.304312,-0.0100326]
currentPath[3]: ~[-0.0032,-0.0239,0.0009]
Re: Coordinates of muscle points with wrapping surfaces
Posted: Tue Jun 06, 2017 11:41 pm
by simaoluz
Thats a start for sure
What about with older versions?
Cheers
Re: Coordinates of muscle points with wrapping surfaces
Posted: Wed Jun 07, 2017 11:55 am
by tkuchida
What about with older versions?
MATLAB scripting wasn't introduced until 3.0. I believe functionality has strictly increased with newer versions.
Re: Coordinates of muscle points with wrapping surfaces
Posted: Wed Jun 07, 2017 5:04 pm
by simaoluz
Sure
I think I will try and replicate (in Matlab) a similar method OpenSim uses to recreate the wrapping points around cylinder:
https://github.com/opensim-org/opensim- ... r.cpp#L164
Is the above link the correct one?
Cheers
Re: Coordinates of muscle points with wrapping surfaces
Posted: Wed Jun 07, 2017 10:36 pm
by tkuchida
Is the above link the correct one?
Yes, it looks like that's where the points are calculated.