Hello,
I am currently working on the construction of a bipedal rodent model (jerboa) in OpenSim using the matlab API. My question involves the potential ability to vary the number of via points generated by a wrapping surface. In one particular case (the knee joint), muscles that are wrapping around the knee are only being constrained by a single via point along the wrapping surface, and penetrating through the rest. I have attached an image with an example of the vastus intermedius (mesh represents the muscle mask), but this is the case for all knee extensors wrapping around this cylindrical wrap.
I believe this could be a scaling issue potentially as the scale of the Jerboa is much smaller than other models. I also know this is not just a visual discrepancy as it appears to affect the smoothness of moment arm plots. Is there anyway to change the amount of points generated by a wrapping surface for a muscle that enters its path. Thank you in advance for taking the time to read my message.
Best,
Yasser
Wrapping surface point discretization
- Yasser Abdelrahman
- Posts: 3
- Joined: Sun Jul 25, 2021 9:00 pm
Wrapping surface point discretization
- Attachments
-
- Screenshot 2022-10-14 201916.png (432.58 KiB) Viewed 284 times
Tags:
- Thomas Uchida
- Posts: 1797
- Joined: Wed May 16, 2012 11:40 am
Re: Wrapping surface point discretization
I think the issue is in WrapCylinder.cpp, lines 676-678 (https://github.com/opensim-org/opensim- ... r.cpp#L676):
This length (2 mm) is hard-coded into the WrapCylinder class. "Muscle wrapping and path calculations" is one of the plans listed on the "Modeling and Simulation Roadmap" (https://simtk-confluence.stanford.edu:8 ... on+Roadmap). For now, to get more points in your model, I see a few possible strategies:
Code: Select all
// Each muscle segment on the surface of the cylinder should be
// 0.002 meters long. This assumes the model is in meters, of course.
int numWrapSegments = (int)(aWrapResult.wrap_path_length / 0.002);
- Build OpenSim from source and change the number on line 678 of WrapCylinder.cpp.
- Create a plugin for a new WrapCylinder class that is identical to the current one but with a different number on line 678.
- Scale up the model.