Forum Replies Created
-
AuthorPosts
-
10 March 2020 at 08:52 in reply to: Best Way to Implement Ligaments Attaching Finger Bones Together #15382jayyangBlocked
Hi @Wong, thanks for the link. That video does look really good, but I’m not sure how to implement that research for myself very easily. If someone could help point me to implementing that in a reasonable matter in a couple of weeks or using some otherwise similar software, I would really appreciate it.
Hi @NickHock, thank you for your advice. Do you have any resources on where I can get these models of high resolution MRI scans? From my (perhaps limited) understanding, in these MRI scans, it’s difficult to differentiate ligaments, and that’s why I am currently using some polygonal shapes made in SolidWorks that approximate them. I have good models for the bones themselves independent of soft tissue. My approach is to have rounded contact surfaces created from my bone models for the joint between the proximal phalange and metacarpal (the metacarpophalangeal joint) and to attach two linear collateral ligaments and two linear volar ligaments to link these bones (instead of a joint capsule with ligaments that completely surround the bones)
At this point, I am trying to use “Rigidify” as implemented in the “tripod” tutorial in the Soft Robotics plugin. Unfortunately, I am getting a very unstable simulation when attaching two bones with two linear ligaments collateral. If I push a bone at all, at some point the bone starts to fly away, pulling the ligaments along with them. I am using “RestShapeSpringsForceField” to attach the ligaments to the bones.# -*- coding: utf-8 -*- from stlib.physics.deformable import ElasticMaterialObject from stlib.scene import Node from stlib.physics.rigid import Floor, RigidObject import Sofa # from bones import MCfab from splib.objectmodel import SofaPrefab, SofaObject from stlib.physics.mixedmaterial import Rigidify from splib.numerics import vec3 from splib.numerics.quat import Quat from tutorial import * def rigidifyHelper(rootNode, mn, nodeLig, gind, f, n, attachment, origin): rigidifiedstruct = Rigidify(mn, nodeLig, groupIndices=gind, frames=f, name=n) rigidifiedstruct.DeformableParts.createObject("UncoupledConstraintCorrection") rigidifiedstruct.RigidParts.createObject("UncoupledConstraintCorrection") # Use this to activate some rendering on the rigidified object setData(rigidifiedstruct.RigidParts.dofs, showObject=True, showObjectScale=5, drawMode=2) setData(rigidifiedstruct.RigidParts.RigidifiedParticules.dofs, showObject=True, showObjectScale=0.1, drawMode=1, showColor=[1., 1., 0., 1.]) setData(rigidifiedstruct.DeformableParts.dofs, showObject=True, showObjectScale=0.1, drawMode=2) rigidifiedstruct.RigidParts.createObject("RestShapeSpringsForceField", name="s1", points=0, external_rest_shape=attachment.mstate, stiffness="1e100", angularStiffness="1e100", drawSpring=True) rigidifiedstruct.RigidParts.createObject("RestShapeSpringsForceField", name="s2", points=1, external_rest_shape=origin.mstate, stiffness="1e100", angularStiffness="1e100", drawSpring=True) rigidifiedstruct.RigidParts.addChild(attachment) rigidifiedstruct.RigidParts.addChild(origin) rootNode.Simulation.addChild(rigidifiedstruct) def createScene(rootNode): # -*- coding: utf-8 -*- from stlib.scene import MainHeader, ContactHeader from stlib.visuals import ShowGrid from stlib.physics.rigid import Floor from stlib.physics.rigid import Cube m=MainHeader(rootNode, plugins=["SoftRobots", "SofaSparseSolver"], gravity=[0, -9.810, 0], dt=0.001) voffset = 30.0 cd = 0.25 ContactHeader(rootNode, alarmDistance=2, contactDistance=cd, frictionCoef=0.08) groupIndices1 = [] frames1 = [] groupIndices2 = [] modelNode = rootNode.createChild("Modeling") DIP_AL1 = ElasticMaterialObject(modelNode, name="DIP_AL1", volumeMeshFileName="mesh/DIP_AL1_V2_2_noholes.vtk", surfaceMeshFileName="mesh/DIP_AL1_V2_2_noholes.stl", rotation = [90,-7,70], collisionMesh="mesh/DIP_AL1_V2_2_noholes.stl", translation=[-2.0,63.0,10.8], youngModulus=1e100, poissonRatio=0.45, totalMass=0.32e10, surfaceColor=[219.0/255,112.0/255,147.0/255]) DIP_AL2 = ElasticMaterialObject(modelNode, name="DIP_AL2", volumeMeshFileName="mesh/DIP_AL1_V2_2_noholes.vtk", surfaceMeshFileName="mesh/DIP_AL1_V2_2_noholes.stl", rotation = [90,7,70], collisionMesh="mesh/DIP_AL1_V2_2_noholes.stl", translation=[-2.0,63.0,-8.8], youngModulus=1E100, poissonRatio=0.45, totalMass=0.32e10, surfaceColor=[219.0/255,112.0/255,147.0/255]) # ElasticMaterialObject(rootNode, name="DIP_AL", volumeMeshFileName="mesh/DIP_AL1_V2_2_noholes.vtk", surfaceMeshFileName="mesh/DIP_AL1_V2_2_noholes.stl", rotation = [90,5,73], collisionMesh="mesh/DIP_AL1_V2_2_noholes.stl", translation=[-1.5,63.0,-7.0], surfaceColor=[219.0/255,112.0/255,147.0/255]) # DP = RigidObject(modelNode, name="DP", surfaceMeshFileName="mesh/simhandV2_DP_fine.obj", # translation=[21.06,128.8+voffset+cd+2,3.72], color=[1,1,1], totalMass = 0.39e-3) # MP = RigidObject(modelNode, name="MP", surfaceMeshFileName="mesh/simhandV2_MP_fine.obj", # translation=[11.59,101.51+voffset+cd+1,3.09], color=[1,1,1], totalMass = 1.56e-3) PP = RigidObject(modelNode, name="PP", surfaceMeshFileName="mesh/simhandV2_PP_fine.obj", translation=[2.83,58.02+voffset+cd,2.40], color=[1,1,1], totalMass = 4.73e-3) MC = RigidObject(modelNode, name="MC", surfaceMeshFileName="mesh/simhandV1_MC_fine.obj", translation=[0.0,0.0+voffset,0.0], color=[1,1,1], isAStaticObject=True, totalMass = 9.12e-3) Floor(modelNode, isAStaticObject=True, color=[0.9,0.9,0.9]) dis1 = DIP_AL1.createObject("SphereROI", name="distal_roi", template="Vec3", centers="1.5 72 12", radii="2", drawSphere="true", drawSize=1) pro1 = DIP_AL1.createObject("SphereROI", name="proximal_roi", template="Vec3", centers="-5.2 54 9.6", radii="2", drawSphere="true", drawSize=1) dis2 = DIP_AL2.createObject("SphereROI", name="distal_roi", template="Vec3", centers="1.5 72 -10.5", radii="2", drawSphere="true", drawSize=1) pro2 = DIP_AL2.createObject("SphereROI", name="proximal_roi", template="Vec3", centers="-5.2 54 -9.6", radii="2", drawSphere="true", drawSize=1) dis1.init() pro1.init() dis2.init() pro2.init() DIP_AL1.init() DIP_AL2.init() groupIndices1.append([ind[0] for ind in dis1.indices]) groupIndices1.append([ind[0] for ind in pro1.indices]) groupIndices2.append([ind[0] for ind in dis2.indices]) groupIndices2.append([ind[0] for ind in pro2.indices]) frames1.append([2.83,58.02+voffset+cd,2.40] + list(Quat.createFromEuler([0, 0, 0], inDegree=True))) frames1.append([0.0,0.0+voffset,0.0] + list(Quat.createFromEuler([0, 0, 0], inDegree=True))) simulationNode = rootNode.createChild("Simulation") simulationNode.createObject("EulerImplicitSolver") simulationNode.createObject("CGLinearSolver") rigidifyHelper(rootNode, modelNode, DIP_AL1, groupIndices1, frames1, "RigidifiedStructure1", rootNode.Modeling.PP, rootNode.Modeling.MC) rigidifyHelper(rootNode, modelNode, DIP_AL2, groupIndices2, frames1, "RigidifiedStructure2", rootNode.Modeling.PP, rootNode.Modeling.MC) m.getObject("VisualStyle").displayFlags="showForceFields showBehaviorModels" #ShowGrid(rootNode) return rootNode
https://drive.google.com/file/d/1MgKS6Zd_GvXaQ8DL5RPktGDch0-k43mB/view?usp=sharing
has my files, using SoftRobotics v19.04 Windows 64-bit binary as found here: https://project.inria.fr/softrobot/install-get-started-2/download/2 March 2020 at 03:23 in reply to: Best Way to Implement Ligaments Attaching Finger Bones Together #15260jayyangBlockedRight now I am trying to implement “attachConstraint” between a rigid and deformable part. I am not sure how to select the indices of a rigid part. I am able to select the indices of a deformable part using “BoxROI”, but it seems “BoxROI” does not output any vertices, lines, triangles, or anything else for the rigid part. Could I get advice on that?
-
AuthorPosts