Home › Forum › SOFA › Using SOFA › Constraint on collision model points
Tagged: 64_bits, Linux_other, SOFA_1706
- This topic has 5 replies, 2 voices, and was last updated 6 years, 11 months ago by Hugo.
-
AuthorPosts
-
9 October 2017 at 19:10 #10048AnnaBlocked
Hello,
I’d like to add constraints to some points of my collision model so they could remain fixed or at least be constrained to a frame (or a matrix, position ,etc) but I don’t really know how to do it. I came across different topics dealing with different constraints but it’s not clear to me at all.
I also looked at several examples dealing with constraints but they all seem to be applied on behavior model but but on collision or visual one. Is there do do that?
Thanks.
Anna
10 October 2017 at 01:39 #10049HugoKeymasterHi Anna
Could you share with us your SOFA scene so that we can better help you?
Cheers,Hugo
10 October 2017 at 10:43 #10051AnnaBlockedHi Hugo,
Thanks for you answer.
Here is an example using the sphere.obj found in the share/mesh/ directory.
<?xml version="1.0"?> <Node name="root" gravity="0 -10 0" animate="0" > <VisualStyle displayFlags="showBehaviorModels showForceFields showCollisionModels" /> <DefaultPipeline name="Collision Pipeline" /> <BruteForceDetection name="Detection" /> <MinProximityIntersection name="Proximity" alarmDistance="0.3" contactDistance="0.2" /> <DefaultContactManager name="Contact Manager" response="default" /> <DefaultCollisionGroupManager name="Collision Group Manager" /> <DefaultAnimationLoop name="defaultAnimationLoop" /> <Node name="Simulation" gravity="0 -10 0" dt="0.01" time="0" animate="0" > <EulerImplicitSolver name="Euler Implicit" /> <CGLinearSolver template="GraphScattered" name="Conjugate Gradient" iterations="25" tolerance="1e-05" threshold="1e-05" /> <MeshObjLoader name="loader" filename="/tmp/sphere.obj" /> <SparseGridTopology name="SparseGrid Topology" fileTopology="/tmp/sphere.obj" n="5 5 5" /> <MechanicalObject template="Vec3d" name="Particles"/> <UniformMass template="Vec3d" mass="1" /> <HexahedronFEMForceField template="Vec3d" name="HexahedronFEM Forcefield" poissonRatio="0.45" youngModulus="200" gatherPt=" " gatherBsize=" " /> <FixedConstraint template="Vec3d" name="BehaviorConstraints" indices="72 73 97 98" /> <Node name="Collision" gravity="0 -10 0" dt="0.01" time="0" animate="0" > <MeshTopology position="@../loader.position"triangles="@loader.triangles" quads="@loader.quads" tetrahedra="@loader.tetras" hexahedra="@loader.hexas" /> <MechanicalObject template="Vec3d" name="CollisionObject" /> <TTriangleModel template="Vec3d" name="TriangleCollision" moving="1" simulated="1" color="1 0.5 0 1" /> <TLineModel template="Vec3d" name="LineCollision" moving="1" simulated="1" color="1 0.5 0 1" /> <TPointModel template="Vec3d" name="PointCollision" moving="1" simulated="1" color="1 0.5 0 1" /> <BarycentricMapping template="Vec3d,Vec3d" name="MechanicalMapping" input="@/Simulation/Particles" output="@CollisionObject" /> <!-- <FixedConstraint template="Vec3d" name="CollisionConstraints" indices= "317 335 336 337 338 339 340 355 356 357 358 359 360 375 376 377 378 379 380 382 " /> --> </Node> </Node> </Node>
If you uncomment the CollisionConstraints fixed constraint and comment the BehaviorConstraints, you’ll get the difference. I was expecting that the fixed points of the collision model remain fixed.
Am I missing something?
10 October 2017 at 20:48 #10056HugoKeymasterHi Anna,
The collision model is a separate representation than the physical model. The collision model does not build a dynamic system, therefore no linear system Ax=b is build there.
The collision model computes no physics but computes forces (from the collision detection and response) and send these forces to the physics representation (where the simulation is run).
If I understand correctly, you want to simulate a sphere model (where the collision is computed) but you would like to use an hexahedral mesh for the physical model. In addition, you would like to have accurate dirichlet boundary conditions on your sphere object. Am I correct?
But this is not directly possible since you physics is not computed on the sphere but on hexa. An alternative is currently studied by researchers from the Mimesis team regarding IBM for mechanical simulation : An Immersed Boundary Method for Detail-Preserving Soft Tissue Simulation from Medical Images.If you need their contact or if anything is unclear do not hesitate to tell.
Best,Hugo
12 October 2017 at 14:57 #10068AnnaBlockedThanks for your answer Ugo,
Working with a thinner resolution of my hexa might be a trick then.
6 November 2017 at 11:38 #10117HugoKeymasterIndeed, using a fine grid for Hexas and boundary conditions defined on it would work.
Let us know about the outcome of your work !Cheers,
H
-
AuthorPosts
- You must be logged in to reply to this topic.