Page 1 of 1

Ligament wrapping visualisation

Posted: Sun Oct 29, 2017 1:44 am
by hamed-hn
Hi everybody,

I defined a wrapping object for knee ligaments. But, as far as I can see, ligament do not wrap arround it. Is this a visualisation problem or I should define some via points in addition to the attachment points for the ligament. this is how I defined the wrap object:

Code: Select all

<WrapEllipsoid name="tibia_med_r">
								<!--Display Pref. 0:Hide 1:Wire 3:Flat 4:Shaded-->
								<display_preference>4</display_preference>
								<xyz_body_rotation> 0 0 0</xyz_body_rotation>
								<translation> -0.0 -0.03 -0.003</translation>
								<active>true</active>
								<quadrant>-z</quadrant>
								<VisibleObject>
									<!--Set of geometry files and associated attributes, allow .vtp, .stl, .obj-->
									<GeometrySet>
										<objects />
										<groups />
									</GeometrySet>
									<!--Three scale factors for display purposes: scaleX scaleY scaleZ-->
									<scale_factors> 1 1 1</scale_factors>
									<!--transform relative to owner specified as 3 rotations (rad) followed by 3 translations rX rY rZ tx ty tz-->
									<transform> 0 0 0 0.0 -0.03 -0.003</transform>
									<!--Whether to show a coordinate frame-->
									<show_axes>false</show_axes>
									<!--Display Pref. 0:Hide 1:Wire 3:Flat 4:Shaded Can be overriden for individual geometries-->
									<display_preference>4</display_preference>
								</VisibleObject>
								<dimensions> 0.05 0.03 0.03</dimensions>
							</WrapEllipsoid>

And this is the ligament definition:

Code: Select all

				<Ligament name="aMCL_r">
					<isDisabled> false </isDisabled>
					<GeometryPath name="">
						<PathPointSet name="">
							<objects>
								<PathPoint name="aMCL_r-P1">
									<location>       0.00770000      -0.07960000      -0.02760000 </location>
									<VisibleObject name="">
										<!--Set of geometry files and associated attributes, allow .vtp, .stl,
										    .obj-->
										<GeometrySet name="">
											<objects/>
											<groups/>
										</GeometrySet>
										<!--Three scale factors for display purposes: scaleX scaleY scaleZ-->
										<scale_factors>       1.00000000       1.00000000       1.00000000 </scale_factors>
										<!--transform relative to owner specified as 3 rotations (rad) followed by
										    3 translations rX rY rZ tx ty tz-->
										<transform>      -0.00000000       0.00000000      -0.00000000       0.00000000       0.00000000       0.00000000 </transform>
										<!--Whether to show a coordinate frame-->
										<show_axes> false </show_axes>
										<!--Display Pref. 0:Hide 1:Wire 3:Flat 4:Shaded Can be overriden for
										    individual geometries-->
										<display_preference> 4 </display_preference>
									</VisibleObject>
									<body> tibia_r </body>
								</PathPoint>
								<PathPoint name="aMCL_r-P2">
									<location>      -0.00740000      -0.40440000      -0.03500000 </location>
									<VisibleObject name="">
										<!--Set of geometry files and associated attributes, allow .vtp, .stl,
										    .obj-->
										<GeometrySet name="">
											<objects/>
											<groups/>
										</GeometrySet>
										<!--Three scale factors for display purposes: scaleX scaleY scaleZ-->
										<scale_factors>       1.00000000       1.00000000       1.00000000 </scale_factors>
										<!--transform relative to owner specified as 3 rotations (rad) followed by
										    3 translations rX rY rZ tx ty tz-->
										<transform>      -0.00000000       0.00000000      -0.00000000       0.00000000       0.00000000       0.00000000 </transform>
										<!--Whether to show a coordinate frame-->
										<show_axes> false </show_axes>
										<!--Display Pref. 0:Hide 1:Wire 3:Flat 4:Shaded Can be overriden for
										    individual geometries-->
										<display_preference> 4 </display_preference>
									</VisibleObject>
									<body> femur_r </body>
								</PathPoint>
							</objects>
							<groups/>
						</PathPointSet>
						<VisibleObject name="">
							<!--Set of geometry files and associated attributes, allow .vtp, .stl,
							    .obj-->
							<GeometrySet name="">
								<objects/>
								<groups/>
							</GeometrySet>
							<!--Three scale factors for display purposes: scaleX scaleY scaleZ-->
							<scale_factors>       1.00000000       1.00000000       1.00000000 </scale_factors>
							<!--transform relative to owner specified as 3 rotations (rad) followed by
							    3 translations rX rY rZ tx ty tz-->
							<transform>      -0.00000000       0.00000000      -0.00000000       0.00000000       0.00000000       0.00000000 </transform>
							<!--Whether to show a coordinate frame-->
							<show_axes> false </show_axes>
							<!--Display Pref. 0:Hide 1:Wire 3:Flat 4:Shaded Can be overriden for
							    individual geometries-->
							<display_preference> 0 </display_preference>
						</VisibleObject>
						<PathWrapSet name="">
							<objects/>
								<PathWrap name="">
									<wrap_object> tibia_med_r </wrap_object>
									<method> hybrid </method>
									<range> -1 -1 </range>
								</PathWrap>
							<groups/>
						</PathWrapSet>
					</GeometryPath>
I appreciate your help.

regards,
Hamed

Re: Ligament wrapping visualisation

Posted: Mon Oct 30, 2017 8:50 am
by jimmy
I edited your code slightly to clean it up. In the default position you have defined, the ligament doesn't intersect with the wrap object. If you change the position of the insertion point of the ligament, you can see the wrapping (pictures are below).

Just for future reference, it is good practice to include pictures of your issue like I have done here. It makes it easier to diagnose the issue.

thanks.

Original ligament position (doesn't intersect with the wrap object)
Screen Shot 2017-10-30 at 8.41.35 AM.png
Screen Shot 2017-10-30 at 8.41.35 AM.png (272.48 KiB) Viewed 1105 times
Ligament position changed (can see the wrap)
Screen Shot 2017-10-30 at 8.42.04 AM.png
Screen Shot 2017-10-30 at 8.42.04 AM.png (261.36 KiB) Viewed 1105 times

Code: Select all

<WrapObjectSet>
	<objects>
		<WrapEllipsoid name="tibia_med_r">
			<!--Display Pref. 0:Hide 1:Wire 3:Flat 4:Shaded-->
			<display_preference>4</display_preference>
			<xyz_body_rotation> 0 0 0</xyz_body_rotation>
			<translation> -0 -0.03 -0.003</translation>
			<active>true</active>
			<quadrant>-z</quadrant>
			<VisibleObject>
				<!--Set of geometry files and associated attributes, allow .vtp, .stl, .obj-->
				<GeometrySet>
					<objects />
					<groups />
				</GeometrySet>
				<!--Three scale factors for display purposes: scaleX scaleY scaleZ-->
				<scale_factors> 1 1 1</scale_factors>
				<!--transform relative to owner specified as 3 rotations (rad) followed by 3 translations rX rY rZ tx ty tz-->
				<transform> 0 0 0 -0 -0.03 -0.003</transform>
				<!--Whether to show a coordinate frame-->
				<show_axes>false</show_axes>
				<!--Display Pref. 0:Hide 1:Wire 3:Flat 4:Shaded Can be overriden for individual geometries-->
				<display_preference>4</display_preference>
			</VisibleObject>
			<dimensions> 0.05 0.03 0.03</dimensions>
		</WrapEllipsoid>
	</objects>
	<groups />
</WrapObjectSet>

Code: Select all

<Ligament name="aMCL_r">
	<!--Flag indicating whether the force is disabled or not. Disabled means that the force is not active in subsequent dynamics realizations.-->
	<isDisabled>false</isDisabled>
	<!--the set of points defining the path of the ligament-->
	<GeometryPath>
		<!--The set of points defining the path-->
		<PathPointSet>
			<objects>
				<PathPoint name="aMCL_r-P1">
					<location> 0.0077 -0.0796 -0.0276</location>
					<body>tibia_r</body>
				</PathPoint>
				<PathPoint name="aMCL_r-P2">
					<location> -0.0074 -0.4044 -0.035</location>
					<body>femur_r</body>
				</PathPoint>
			</objects>
			<groups />
		</PathPointSet>
		<!--The wrap objecs that are associated with this path-->
		<PathWrapSet>
			<objects>
				<PathWrap>
					<wrap_object>tibia_med_r</wrap_object>
					<method>hybrid</method>
					<range> 1 2</range>
				</PathWrap>
			</objects>
			<groups />
		</PathWrapSet>
		<!--Used to display the path in the 3D window-->
		<VisibleObject name="display">
			<!--Set of geometry files and associated attributes, allow .vtp, .stl, .obj-->
			<GeometrySet>
				<objects />
				<groups />
			</GeometrySet>
			<!--Three scale factors for display purposes: scaleX scaleY scaleZ-->
			<scale_factors> 1 1 1</scale_factors>
			<!--transform relative to owner specified as 3 rotations (rad) followed by 3 translations rX rY rZ tx ty tz-->
			<transform> -0 0 -0 0 0 0</transform>
			<!--Whether to show a coordinate frame-->
			<show_axes>false</show_axes>
			<!--Display Pref. 0:Hide 1:Wire 3:Flat 4:Shaded Can be overriden for individual geometries-->
			<display_preference>4</display_preference>
		</VisibleObject>
		<!--Used to initialize the colour cache variable-->
		<default_color>0.9 0.9 0.9</default_color>
	</GeometryPath>
</Ligament>

Re: Ligament wrapping visualisation

Posted: Mon Nov 06, 2017 1:10 am
by hamed-hn
Dear James,

Thanks for your clear reply. I implemented your advice in the model and now it is working well. About your suggestion on uploading images that show the problem, you are right and I will do it in future.

Regards,
Hamed

Re: Ligament wrapping visualisation

Posted: Wed Apr 18, 2018 6:56 am
by bunker
Hi James.
Very interesting and useful.
I try to insert the ligaments like you have show with MCL and LCL (medial an lateral collateral ligaments).
Could be useful to add also the ACL/PCL (anterior and posterior cruciate ligament).
I need to specify a force value ?
Where I can find the exact position for the insertion and origin point ?
Thank you
Andrea

Re: Ligament wrapping visualisation

Posted: Wed Apr 18, 2018 3:22 pm
by jimmy
I need to specify a force value ?
The documentation for ligaments is here; https://simtk.org/api_docs/opensim/api_ ... ament.html
Where I can find the exact position for the insertion and origin point ?
Each ligament will have a geometry path that has path points. The origin and insertion will be the first and last path points for that geometry path.

Re: Ligament wrapping visualisation

Posted: Wed May 02, 2018 9:06 am
by bunker
OK, thank you.
I'm working on a complete model I fid under the project and check how is done.

Thank you
Andrea