Home › Forum › SOFA › Using SOFA › Mesh Generation in SOFA
Tagged: 64_bits, MacOS, Plugin_SoftRobots, SOFA_1706, SOFA_1712, volumetric mesh
- This topic has 0 replies, 1 voice, and was last updated 5 years, 2 months ago by MA.
Viewing 1 post (of 1 total)
-
AuthorPosts
-
8 October 2019 at 12:46 #14358MABlocked
Hello,
I am trying to convert the STL mesh to VTK mesh using the following code in SOFAimport Sofa import os path = os.path.dirname(os.path.abspath(__file__))+'/mesh/' def createScene(rootNode): rootNode.createObject('VisualStyle', displayFlags='showForceFields showBehaviorModels') rootNode.createObject('RequiredPlugin', pluginName='CGALPlugin') rootNode.createObject('RequiredPlugin', pluginName='SofaExporter') rootNode.createObject('RequiredPlugin', pluginName='SoftRobots') rootNode.findData('gravity').value='-9810 0 0'; node = rootNode.createChild('node') node.createObject('MeshSTLLoader', name='loader', filename=path+'Rope.stl') node.createObject('MeshGenerationFromPolyhedron', name='gen',inputPoints='@mesh.position', inputTriangles='@mesh.triangles', drawTetras='1') node.createObject('Mesh', position='@gen.outputPoints', tetrahedra='@gen.outputTetras') node.createObject('VTKExporter', filename='bunny', edges='0', tetras='1', exportAtBegin='1') node.createObject('MeshGenerationFromPolyhedron', inputPoints='@mesh.position', inputTriangles='@mesh.triangles', drawTetras='1', facetSize='0.35', facetApproximation='0.1', cellRatio='2', cellSize='0.5' )
it gives me the following in the console
- MeshTopology: 1 created with alias "Mesh" [INFO] [SceneCheckerVisitor] Finished validating node "root". [INFO] [VTKExporter(VTKExporter)] VTKExporter: found topology Mesh [INFO] [VTKExporter(VTKExporter)] ### VTKExporter[VTKExporter] ### Nb points: 0 Nb edges: 0 Nb triangles: 0 Nb quads: 0 Nb tetras: 0 Nb hexas: 0 ### ### Total nb cells: 0 [INFO] [VTKExporter(VTKExporter)] Export VTK XML in file bunny0.vtu done. [WARNING] [RealGUI] Global Bounding Box seems very small; Your viewer settings (based on the bbox) are likely invalid, switching to default value of [-1,-1,-1,1,1,1].This is caused by using component which does not implement properly the updateBBox function.You can remove this warning by manually forcing a value in the parameter bbox="minX minY minZ maxX maxY maxZ" in your root node [INFO] [SceneCheckerVisitor] Validating node "root" with checks: [SceneCheckAPIChange, SceneCheckDuplicatedName, SceneCheckMissingRequiredPlugin] [INFO] [SceneCheckAPIChange] No 'APIVersion' component in scene. Using the default APIVersion level: 17.06 [WARNING] [SceneCheckDuplicatedName] - Found duplicated names ['RequiredPlugin', ] in node '' Nodes with similar names at the same level in your scene can crash certain operations, please rename them [INFO] [SceneCheckerVisitor] Finished validating node "root".
The mesh in blender is okay,I am attaching the file https://gofile.io/?c=0VSgmD
I dont know how to solvw it, I dont have much experience in this regard, but the mesh is correct, no errors,i can read the details in blender. I am supposed todo physical simulation to test the mechanical properties of the yarn
-
AuthorPosts
Viewing 1 post (of 1 total)
- You must be logged in to reply to this topic.