ImplicitSurfaceMapping
Compute an iso-surface from a set of particles
Vec3d,Vec3d
Templates:
- Vec3d,Vec3d
Target: SofaImplicitField
namespace: sofa::component::mapping
parents:
- Mapping
- MeshTopology
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 |
mapForces | Are forces mapped ? | 1 |
mapConstraints | Are constraints mapped ? | 1 |
mapMasses | Are masses mapped ? | 1 |
mapMatrices | Are matrix explicit mapped? | 0 |
applyRestPosition | set to true to apply this mapping to restPosition at init | 0 |
filename | Filename of the mesh | |
position | List of point positions | |
edges | List of edge indices | |
triangles | List of triangle indices | |
quads | List of quad indices | |
tetrahedra | List of tetrahedron indices | |
hexahedra | List of hexahedron indices | |
uv | List of uv coordinates | |
step | Step | 0.5 |
radius | Radius | 2 |
isoValue | Iso Value | 0.5 |
min | Grid Min | -100 -100 -100 |
max | Grid Max | 100 100 100 |
Visualization | ||
drawEdges | if true, draw the topology Edges | 0 |
drawTriangles | if true, draw the topology Triangles | 0 |
drawQuads | if true, draw the topology Quads | 0 |
drawTetrahedra | if true, draw the topology Tetrahedra | 0 |
drawHexahedra | if true, draw the topology hexahedra | 0 |
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 |
input | Input object to map | State<Vec3d> |
output | Output object to map | State<Vec3d> |
Examples
ImplicitSurfaceMapping.scn
<Node dt="0.005" gravity="0 -10 0">
<RequiredPlugin name="Sofa.Component.IO.Mesh"/> <!-- Needed to use components [MeshGmshLoader] -->
<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.StateContainer"/> <!-- Needed to use components [MechanicalObject] -->
<RequiredPlugin name="Sofa.Component.Visual"/> <!-- Needed to use components [VisualStyle] -->
<RequiredPlugin name="Sofa.GL.Component.Rendering3D"/> <!-- Needed to use components [OglModel] -->
<RequiredPlugin name="SofaImplicitField"/> <!-- Needed to use components [ImplicitSurfaceMapping] -->
<VisualStyle displayFlags="showBehaviorModels showForceFields" />
<Node name="Liver">
<EulerImplicitSolver name="cg_odesolver" printLog="false" rayleighStiffness="0.1" rayleighMass="0.1" />
<CGLinearSolver iterations="25" name="linear solver" tolerance="1.0e-9" threshold="1.0e-9" />
<MeshGmshLoader name="loader" filename="mesh/liver.msh" />
<MechanicalObject src="@loader" name="dofs" />
<UniformMass name="M1" vertexMass="1" />
<Node id="Visual">
<OglModel name="VModel" color="blue" />
<ImplicitSurfaceMapping name="MarchingCube" input="@../dofs" output="@VModel" isoValue="0.5" radius="0.75" step="0.25" />
</Node>
</Node>
</Node>
def createScene(root_node):
node = root_node.addChild('node', dt="0.005", gravity="0 -10 0")
node.addObject('RequiredPlugin', name="Sofa.Component.IO.Mesh")
node.addObject('RequiredPlugin', name="Sofa.Component.LinearSolver.Iterative")
node.addObject('RequiredPlugin', name="Sofa.Component.Mass")
node.addObject('RequiredPlugin', name="Sofa.Component.ODESolver.Backward")
node.addObject('RequiredPlugin', name="Sofa.Component.StateContainer")
node.addObject('RequiredPlugin', name="Sofa.Component.Visual")
node.addObject('RequiredPlugin', name="Sofa.GL.Component.Rendering3D")
node.addObject('RequiredPlugin', name="SofaImplicitField")
node.addObject('VisualStyle', displayFlags="showBehaviorModels showForceFields")
liver = node.addChild('Liver')
liver.addObject('EulerImplicitSolver', name="cg_odesolver", printLog="false", rayleighStiffness="0.1", rayleighMass="0.1")
liver.addObject('CGLinearSolver', iterations="25", name="linear solver", tolerance="1.0e-9", threshold="1.0e-9")
liver.addObject('MeshGmshLoader', name="loader", filename="mesh/liver.msh")
liver.addObject('MechanicalObject', src="@loader", name="dofs")
liver.addObject('UniformMass', name="M1", vertexMass="1")
node = Liver.addChild('node', id="Visual")
node.addObject('OglModel', name="VModel", color="blue")
node.addObject('ImplicitSurfaceMapping', name="MarchingCube", input="@../dofs", output="@VModel", isoValue="0.5", radius="0.75", step="0.25")