GridMeshCreator
Procedural creation of a two-dimensional mesh.
Target: Sofa.Component.IO.Mesh
namespace: sofa::component::io::mesh
parents:
- MeshLoader
Data
| Name | Description | Default value |
|---|---|---|
| name | object name | unnamed |
| printLog | if true, emits extra messages at runtime. | 0 |
| tags | list of the subsets the object belongs to | |
| bbox | this object bounding box | |
| componentState | The state of the component among (Dirty, Valid, Undefined, Loading, Invalid). | Undefined |
| listening | if true, handle the events, otherwise ignore the events | 0 |
| filename | Filename of the object | |
| flipNormals | Flip Normals | 0 |
| triangulate | Divide all polygons into triangles | 0 |
| createSubelements | Divide all n-D elements into their (n-1)-D boundary elements (e.g. tetrahedra to triangles) | 0 |
| onlyAttachedPoints | Only keep points attached to elements of the mesh | 0 |
| translation | Translation of the DOFs | 0 0 0 |
| rotation | Rotation of the DOFs | 0 0 0 |
| scale3d | Scale of the DOFs in 3 dimensions | 1 1 1 |
| transformation | 4x4 Homogeneous matrix to transform the DOFs (when present replace any) | [1 0 0 0,0 1 0 0,0 0 1 0,0 0 0 1] |
| resolution | Number of vertices in each direction | 2 2 |
| trianglePattern | 0: no triangles, 1: alternate triangles, 2: upward triangles, 3: downward triangles | 2 |
| Vectors | ||
| position | Vertices of the mesh loaded | |
| polylines | Polylines of the mesh loaded | |
| edges | Edges of the mesh loaded | |
| triangles | Triangles of the mesh loaded | |
| quads | Quads of the mesh loaded | |
| polygons | Polygons of the mesh loaded | |
| highOrderEdgePositions | High order edge points of the mesh loaded | |
| highOrderTrianglePositions | High order triangle points of the mesh loaded | |
| highOrderQuadPositions | High order quad points of the mesh loaded | |
| tetrahedra | Tetrahedra of the mesh loaded | |
| hexahedra | Hexahedra of the mesh loaded | |
| pentahedra | Pentahedra of the mesh loaded | |
| highOrderTetrahedronPositions | High order tetrahedron points of the mesh loaded | |
| highOrderHexahedronPositions | High order hexahedron points of the mesh loaded | |
| pyramids | Pyramids of the mesh loaded | |
| normals | Normals of the mesh loaded | |
| Groups | ||
| edgesGroups | Groups of Edges | |
| trianglesGroups | Groups of Triangles | |
| quadsGroups | Groups of Quads | |
| polygonsGroups | Groups of Polygons | |
| tetrahedraGroups | Groups of Tetrahedra | |
| hexahedraGroups | Groups of Hexahedra | |
| pentahedraGroups | Groups of Pentahedra | |
| pyramidsGroups | Groups of Pyramids | |
Links
| Name | Description | Destination type name |
|---|---|---|
| context | Graph Node containing this object (or BaseContext::getDefault() if no graph is used) | BaseContext |
| slaves | Sub-objects used internally by this object | BaseObject |
| master | nullptr for regular objects, or master object for which this object is one sub-objects | BaseObject |
Examples
GridMeshCreator.scn
<?xml version="1.0" ?>
<Node name="root" dt="0.04" gravity="0 -1 0">
<RequiredPlugin name="Sofa.Component.Constraint.Projective"/> <!-- Needed to use components [FixedProjectiveConstraint] -->
<RequiredPlugin name="Sofa.Component.Engine.Select"/> <!-- Needed to use components [BoxROI] -->
<RequiredPlugin name="Sofa.Component.IO.Mesh"/> <!-- Needed to use components [GridMeshCreator] -->
<RequiredPlugin name="Sofa.Component.LinearSolver.Iterative"/> <!-- Needed to use components [CGLinearSolver] -->
<RequiredPlugin name="Sofa.Component.Mass"/> <!-- Needed to use components [UniformMass] -->
<RequiredPlugin name="Sofa.Component.ODESolver.Backward"/> <!-- Needed to use components [EulerImplicitSolver] -->
<RequiredPlugin name="Sofa.Component.SolidMechanics.FEM.Elastic"/> <!-- Needed to use components [TriangleFEMForceField] -->
<RequiredPlugin name="Sofa.Component.SolidMechanics.Spring"/> <!-- Needed to use components [FastTriangularBendingSprings] -->
<RequiredPlugin name="Sofa.Component.StateContainer"/> <!-- Needed to use components [MechanicalObject] -->
<RequiredPlugin name="Sofa.Component.Topology.Container.Constant"/> <!-- Needed to use components [MeshTopology] -->
<RequiredPlugin name="Sofa.Component.Topology.Container.Dynamic"/> <!-- Needed to use components [EdgeSetGeometryAlgorithms] -->
<RequiredPlugin name="Sofa.Component.Visual"/> <!-- Needed to use components [VisualStyle] -->
<DefaultAnimationLoop/>
<VisualStyle displayFlags="showBehavior hideCollision hideVisual " />
<EulerImplicitSolver rayleighStiffness="0.1" rayleighMass="0.1" />
<CGLinearSolver iterations="25" tolerance="1e-5" threshold="1e-5" />
<Node name="Thin shell">
<GridMeshCreator name="loader" filename="nofile" resolution="2 2" trianglePattern="1" rotation="180 0 0 " scale="10 10 0" />
<MeshTopology src="@loader" />
<MechanicalObject name="defoDOF" template="Vec3" src="@loader" showObject="1"/>
<EdgeSetGeometryAlgorithms />
<BoxConstraint box="-0.5 -0.5 -0.5 10.5 0.005 0.005 " />
<TriangleFEMForceField name="FEM1" youngModulus="20000" poissonRatio="0.3" method="large" />
<FastTriangularBendingSprings bendingStiffness="1000" />
<UniformMass totalMass="2500" printLog="0" />
</Node>
</Node>
def createScene(root_node):
root = root_node.addChild('root', dt="0.04", gravity="0 -1 0")
root.addObject('RequiredPlugin', name="Sofa.Component.Constraint.Projective")
root.addObject('RequiredPlugin', name="Sofa.Component.Engine.Select")
root.addObject('RequiredPlugin', name="Sofa.Component.IO.Mesh")
root.addObject('RequiredPlugin', name="Sofa.Component.LinearSolver.Iterative")
root.addObject('RequiredPlugin', name="Sofa.Component.Mass")
root.addObject('RequiredPlugin', name="Sofa.Component.ODESolver.Backward")
root.addObject('RequiredPlugin', name="Sofa.Component.SolidMechanics.FEM.Elastic")
root.addObject('RequiredPlugin', name="Sofa.Component.SolidMechanics.Spring")
root.addObject('RequiredPlugin', name="Sofa.Component.StateContainer")
root.addObject('RequiredPlugin', name="Sofa.Component.Topology.Container.Constant")
root.addObject('RequiredPlugin', name="Sofa.Component.Topology.Container.Dynamic")
root.addObject('RequiredPlugin', name="Sofa.Component.Visual")
root.addObject('DefaultAnimationLoop', )
root.addObject('VisualStyle', displayFlags="showBehavior hideCollision hideVisual ")
root.addObject('EulerImplicitSolver', rayleighStiffness="0.1", rayleighMass="0.1")
root.addObject('CGLinearSolver', iterations="25", tolerance="1e-5", threshold="1e-5")
thin_shell = root.addChild('Thin shell')
thin_shell.addObject('GridMeshCreator', name="loader", filename="nofile", resolution="2 2", trianglePattern="1", rotation="180 0 0 ", scale="10 10 0")
thin_shell.addObject('MeshTopology', src="@loader")
thin_shell.addObject('MechanicalObject', name="defoDOF", template="Vec3", src="@loader", showObject="1")
thin_shell.addObject('EdgeSetGeometryAlgorithms', )
thin_shell.addObject('BoxConstraint', box="-0.5 -0.5 -0.5 10.5 0.005 0.005 ")
thin_shell.addObject('TriangleFEMForceField', name="FEM1", youngModulus="20000", poissonRatio="0.3", method="large")
thin_shell.addObject('FastTriangularBendingSprings', bendingStiffness="1000")
thin_shell.addObject('UniformMass', totalMass="2500", printLog="0")