Home › Forum › SOFA › Using SOFA › [SOLVED] Get indices from MechanicalObject
Tagged: Linux_ubuntu, SOFA_2106, softrobots, ubuntu
- This topic has 10 replies, 3 voices, and was last updated 3 years, 2 months ago by BMan.
-
AuthorPosts
-
2 September 2021 at 07:39 #20294BManBlocked
Hi there,
I am trying to inflate a shape using the SoftRobots plugin.
The inside of my model is soft and able to increase in volume in all directions, however I want to put an outer shell around it, so that it can only inflate inwards.
I tried using collisions, however that is having problems due to how close the walls are initially, so I’ve decided to use fixed constraints instead.
The shape of the shell is a sheared/slanted cylinder and is therefore hard to constrain using BoxROIs. With BoxROIs, however, it is easy to grab their indices via BoxROI.indices.
I cannot find a similar way to achieve this with the points within a MechanicalObject? Is there a way to achieve this?
Thanks
BMan2 September 2021 at 08:42 #20295Alex BilgerBlockedHi,
is your shape made of tetrahedra? You can use a Tetra2TriangleTopologicalMapping component. You’ll get a triangle surface.
If you also have a surface for the inside (a hole in your shape), you may use a MeshROI. But it requires that you design a mesh to include only the points you want.Alex
3 September 2021 at 06:37 #20302BManBlockedHey there,
My shape is made of tetrahedra yes.
I used MeshROI by creating a new surface mesh, which is 75% working. The 25% that isn’t working seems to be due to some stray constraint indices which aren’t visible on the mesh, or in the sofa scene when I view the triangles.
Any ideas why this could be happening?
Also does MeshROI only work with 2D surfaces?
Thanks,
Brandon
3 September 2021 at 10:50 #20304Alex BilgerBlockedI have troubles to understand your problem…
From what I can see MeshROI job is to find all edges, triangles and tetrahedra contained in a mesh made of triangles.
4 September 2021 at 01:43 #20306BManBlockedHi there,
I tried to put links or embed images into here, however, It has marked me as a spammer.
Is there an alternative way for me to share images?
Thanks
Brandon
7 September 2021 at 09:15 #20316HugoKeymaster7 September 2021 at 12:40 #20319BManBlockedHi,
Apologies for the confusion, I’ll place some images to help describe the issue
(I could not put in more than one link without being labeled as spam so here is an album)There are four chambers to be inflated with air in my design. Here are two images (Images 4 & 5) showing one of the chamber’s inner face. There are no red-square highlighted indices (Which denote fixed constraint points). This is what I intend for all four chambers.
However, in this image (Images 6 & 7) I show the only chamber that strangely does have red-square indices highlighted on its front face. This prevents the chamber from moving.
Here from the top (Image 2) you can see that 3 of the 4 chambers are inflating correctly. The 4th one cannot as the front face is being constrained for no reason.
The surface I am using to create the meshROI can be seen in Images 1 & 3.
In SOFA it wraps around the exterior of the yellow object. It should ONLY be constraining the outside of the yellow object.
I’ve tried seeing if it is a problem with the mesh, however, I cannot see any deformities or oddities within it. Gmsh shows a normal looking mesh.
Thank you so much for the help
Brandon
7 September 2021 at 14:49 #20323Alex BilgerBlockedOk, I think I get it.
Check that the mesh you use for the MeshROI is correctly placed in the scene.
Check that the mesh you use for the MeshROI is closed.
Check that the mesh you use for the MeshROI has its triangles numbered such that the computation of the normal points toward the exterior of the mesh.
MeshROI might be buggy…
Since you have cylinder shapes, try something like this:
<Node name="root"> <VisualStyle displayFlags="showBehaviorModels showForceFields" /> <EulerImplicitSolver/> <CGLinearSolver/> <GenerateCylinder name="mechaCylinder" resCircumferential="20" resRadial="6" resHeight="10"/> <TetrahedronSetTopologyContainer tetrahedra="@mechaCylinder.tetrahedra" position="@mechaCylinder.output_TetrahedraPosition"/> <MechanicalObject/> <TetrahedronFEMForceField youngModulus="5000" poissonRatio="0.45"/> <GenerateCylinder name="constraintCylinder" radius="0.19" resCircumferential="20" resRadial="6" resHeight="10" height="2" origin="0 0 -0.5"/> <MeshROI name="roi" ROIposition="@constraintCylinder.output_TrianglesPosition" ROItriangles="@constraintCylinder.triangles"/> <FixedConstraint indices="@roi.indicesOut"/> </Node>
8 September 2021 at 05:20 #20332BManBlockedHi,
Thank you so much for all the help, I definitely learnt new things from all of this.
Strangely, however, I just re-exported the mesh again from gmsh and its working now!
I didn’t change anything in the mesh settings, or the mesh itself, I just simply re-exported it (For the 4th time by the way) and it just happens to be working now.Not sure if it really was just a strange glitch somewhere but for now I suppose it is solved.
Thanks again,
Brandon
8 September 2021 at 09:03 #20333Alex BilgerBlockedGood to know that your simulation is working.
What mesh did you re-export? The FEM mesh or the one used in the MeshROI?Please let us know if you find what caused your problem.
Cheers
11 September 2021 at 13:45 #20346BManBlockedIt was the MeshROI mesh that I re-exported.
So I just opened the original .step file in Gmsh and re-exported it as a .stl file again with the same settings as earlier.
At this point in time I still have no idea what caused it, but I will definitely update if I ever figure it out.
Thanks so much again!
-
AuthorPosts
- You must be logged in to reply to this topic.