Hi all, I want to set the dimensions of a WrapEllipsoid whit Matlab, I saw the methods and found this: getDimensionsString() whit return type java.lang.String. But I can't give it the input string, any suggestions?
Thanks for your answers!
Set dimension WrapEllipsoid whit Matlab
- Thomas Uchida
- Posts: 1793
- Joined: Wed May 16, 2012 11:40 am
Re: Set dimension WrapEllipsoid whit Matlab
A similar question was recently asked and answered here (topic 9584): viewtopicPhpbb.php?f=91&t=9584.
- Matteo Musso
- Posts: 12
- Joined: Wed May 23, 2018 3:42 am
Re: Set dimension WrapEllipsoid whit Matlab
Hi,I know these methods for the Wrapcylinder but they don't work for a WrapEllipsoid.
- Attachments
-
- Cattura.PNG (78.1 KiB) Viewed 396 times
- Thomas Uchida
- Posts: 1793
- Joined: Wed May 16, 2012 11:40 am
Re: Set dimension WrapEllipsoid whit Matlab
Ah, good point. The getRadii() method (in the WrapEllipsoid class) returns a Vec3 as expected, but there's no corresponding setRadii() method. However, this strategy seems to work:
The following is displayed in the MATLAB Command Window:
Code: Select all
% OpenSim 4.0
import org.opensim.modeling.*
model = Model('arm26.osim');
humerus = model.getBodySet().get('r_humerus');
wrapEllipsoid = WrapEllipsoid.safeDownCast( humerus.getWrapObject('TRIlonghh') );
fprintf('Original radii: %s\n', char(wrapEllipsoid.getRadii()));
prop = wrapEllipsoid.updPropertyByName('dimensions');
PropertyHelper.setValueDouble(1.1, prop, 0);
PropertyHelper.setValueDouble(2.22, prop, 1);
PropertyHelper.setValueDouble(3.333, prop, 2);
fprintf('New radii: %s\n', char(wrapEllipsoid.getRadii()));
Code: Select all
Original radii: ~[0.035,0.02,0.02]
New radii: ~[1.1,2.22,3.333]
- Matteo Musso
- Posts: 12
- Joined: Wed May 23, 2018 3:42 am
Re: Set dimension WrapEllipsoid whit Matlab
Ok, it work! Thanks!