Skip to content

ImplicitSurfaceMapping

Compute an iso-surface from a set of particles.

Vec3d,Vec3d

Templates:

  • Vec3d,Vec3d

Target: SofaImplicitField

namespace: sofaimplicitfield::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
edges List of edge
triangles List of triangle
quads List of quad
tetrahedra List of tetrahedron
hexahedra List of hexahedron
prisms List of prism
pyramids List of pyramid
quadratic_edges List of quadratic edge
quadratic_triangles List of quadratic triangle
quadratic_quads List of quadratic quad
quadratic_tetrahedra List of quadratic tetrahedron
quadratic_hexahedra List of quadratic hexahedron
quadratic_prisms List of quadratic prism
quadratic_pyramids List of quadratic pyramid
position List of point positions
uv List of uv coordinates
computeAllBuffers Option to compute all crossed topology buffers at init. False by default 0
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
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 BaseComponent
master nullptr for regular objects, or master object for which this object is one sub-objects BaseComponent
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 pluginName="Sofa.Component.IO.Mesh"/> <!-- Needed to use components [MeshGmshLoader] -->
    <RequiredPlugin pluginName="Sofa.Component.LinearSolver.Iterative"/> <!-- Needed to use components [CGLinearSolver] -->
    <RequiredPlugin pluginName="Sofa.Component.Mass"/> <!-- Needed to use components [UniformMass] -->
    <RequiredPlugin pluginName="Sofa.Component.ODESolver.Backward"/> <!-- Needed to use components [EulerImplicitSolver] -->
    <RequiredPlugin pluginName="Sofa.Component.StateContainer"/> <!-- Needed to use components [MechanicalObject] -->
    <RequiredPlugin pluginName="Sofa.Component.Visual"/> <!-- Needed to use components [VisualStyle] -->
    <RequiredPlugin pluginName="Sofa.GL.Component.Rendering3D"/> <!-- Needed to use components [OglModel] -->
    <RequiredPlugin pluginName="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" showObject="1" showObjectScale="10.0"/>
        <UniformMass name="M1" vertexMass="1" />
        <Node id="Visual">
            <OglModel name="VModel" color="blue" />
            <ImplicitSurfaceMapping name="MarchingCube" input="@../dofs" output="@VModel"
                                    isoValue="0.1" radius="0.5" step="0.25"
                                    min="-10 -10 -10" max="10 10 10"
            />
        </Node>
    </Node>
</Node>
def createScene(root_node):

   node = root_node.addChild('node', dt="0.005", gravity="0 -10 0")

   node.addObject('RequiredPlugin', pluginName="Sofa.Component.IO.Mesh")
   node.addObject('RequiredPlugin', pluginName="Sofa.Component.LinearSolver.Iterative")
   node.addObject('RequiredPlugin', pluginName="Sofa.Component.Mass")
   node.addObject('RequiredPlugin', pluginName="Sofa.Component.ODESolver.Backward")
   node.addObject('RequiredPlugin', pluginName="Sofa.Component.StateContainer")
   node.addObject('RequiredPlugin', pluginName="Sofa.Component.Visual")
   node.addObject('RequiredPlugin', pluginName="Sofa.GL.Component.Rendering3D")
   node.addObject('RequiredPlugin', pluginName="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", showObject="1", showObjectScale="10.0")
   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.1", radius="0.5", step="0.25", min="-10 -10 -10", max="10 10 10")