Issues with VTU File Conversion and Utilization in SOFA pneumatic simulations. #243
-
Hi, I am currently working on a project involving a soft, bellows-like robot and am utilizing code from the SoftRobots.Inverse examples in SOFA. My goal is to convert mesh files of my robot and run them with the following example code, which loads the Stanford bunny in pneumatic actuation: bunny = rootNode.addChild('bunny')
bunny.addObject('EulerImplicitSolver')
bunny.addObject('SparseLDLSolver', template="CompressedRowSparseMatrixd")
load = bunny.addObject('MeshVTKLoader', name='loader', filename=path + 'Hollow_Stanford_Bunny.vtu')
bunny.addObject('MeshTopology', src='@loader', name='container')
bunny.addObject('MechanicalObject')
bunny.addObject('UniformMass', totalMass=0.5)
bunny.addObject('TetrahedronSetTopologyContainer', position=load.position.getLinkPath(), tetras=load.tetras.getLinkPath(), name='container')
bunny.addObject('TetrahedronFEMForceField', poissonRatio=0.45, youngModulus=60000)
bunny.addObject('BoxROI', name='boxROI', box=[0, 0, 0, 30, 30, 5], drawBoxes=True)
bunny.addObject('RestShapeSpringsForceField', points=bunny.boxROI.indices.linkpath, stiffness=1e12)
bunny.addObject('LinearSolverConstraintCorrection') However, I am encountering a couple of challenges: VTU File Conversion and Parsing: Errors with Tetrahedron FEM Force Field: Any insights or advice on these matters would be greatly appreciated. Thank you in advance for your time and assistance. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
Hello, If you have a .vtk file, there's no need to convert it. As the name of the component suggests, the "MeshVTKLoader" should load .vtk files. Do you get errors when you do that? |
Beta Was this translation helpful? Give feedback.
@EulalieCoevoet Sorry for the delayed response. I've discovered that my mesh is ill-conditioned in certain segments, and as you mentioned, whether it's VTU or VTK doesn't make a difference. Thank you for your guidance, regardless.