Hello,
I am working with a path spring that wraps around a surface, and I am attempting to find the coordinates of the wrapping points as they change throughout a movement. It is similar to the question asked about muscle wrapping here (viewtopicPhpbb.php?f=91&t=7831).
However when I tried to implement similar code (adapted from the 4.0 code listed here viewtopicPhpbb.php?f=91&t=7723) for the path spring, it said that path springs have no function .getGeometryPath. Is the geometry path stored differently for a spring? How might I access it in MatLab?
The code in question:
spring = model.getForceSet.get('spring');
pathPointSet = spring.getGeometryPath().getPathPointSet();
Thank you for your help,
Finn
Trouble finding GeometryPath of a PathSpring
- Finn Eagen
- Posts: 10
- Joined: Fri Jun 24, 2022 1:13 pm
- Ayman Habib
- Posts: 2248
- Joined: Fri Apr 01, 2005 12:24 pm
Re: Trouble finding GeometryPath of a PathSpring
Hi Finn,
When you retrieve a force from the ForceSet of the model, it comes back as a generic Force, as such it may or may not have an attached GeometryPath. To use methods specific to PathSpring for example you need to safeDownCast to it before making the call
-Ayman
When you retrieve a force from the ForceSet of the model, it comes back as a generic Force, as such it may or may not have an attached GeometryPath. To use methods specific to PathSpring for example you need to safeDownCast to it before making the call
Please let us know if that works for you,springAsForce = model.getForceSet.get('spring');
pathSpring = PathSpring.safeDownCast(sprigAsForce);
path = pathSpring.get_GeometryPath();
-Ayman
- Finn Eagen
- Posts: 10
- Joined: Fri Jun 24, 2022 1:13 pm
Re: Trouble finding GeometryPath of a PathSpring
It did! Thank you so much for your help.