ExtrudeSurface
Engine creating a mesh from the extrusion of the surface of a given mesh.
Vec3d
Templates:
- Vec3d
Target: Sofa.Component.Engine.Generate
namespace: sofa::component::engine::generate
parents:
- DataEngine
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 |
isVisible | is Visible ? | 1 |
heightFactor | Factor for the height of the extrusion (based on normal) | 1 |
Inputs | ||
triangles | Triangle topology (list of BaseMeshTopology::Triangle) | |
surfaceVertices | Position coordinates of the surface | |
surfaceTriangles | Indices of the triangles of the surface to extrude | |
Outputs | ||
extrusionVertices | Position coordinates of the extrusion | |
extrusionTriangles | Subset triangle topology used for the extrusion |
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
ExtrudeSurface.scn
<?xml version="1.0"?>
<Node name="root" dt="0.02">
<RequiredPlugin name="Sofa.Component.Engine.Generate"/> <!-- Needed to use components [ExtrudeSurface RandomPointDistributionInSurface] -->
<RequiredPlugin name="Sofa.Component.Engine.Select"/> <!-- Needed to use components [SphereROI] -->
<RequiredPlugin name="Sofa.Component.IO.Mesh"/> <!-- Needed to use components [MeshOBJLoader] -->
<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.GL.Component.Rendering3D"/> <!-- Needed to use components [OglModel] -->
<DefaultAnimationLoop/>
<Node name="extrude">
<MeshOBJLoader name="meshLoader" filename="mesh/liver.obj" />
<MechanicalObject src="@meshLoader"/>
<SphereROI name="surface1" centers="2 4 0" radii="0.88" drawSize="0" isVisible="0" src="@meshLoader" />
<ExtrudeSurface template="Vec3" name="extrusion" triangles="@meshLoader.triangles" surfaceVertices="@meshLoader.position" surfaceTriangles="@surface1.triangleIndices" isVisible="0" />
<RandomPointDistributionInSurface template="Vec3" vertices="@extrusion.extrusionVertices" triangles="@extrusion.extrusionTriangles" numberOfInPoints="100" numberOfTests="3" minDistanceBetweenPoints="0.1" />
</Node>
<Node name="Extrusion">
<MeshTopology points="@../extrude/extrusion.extrusionVertices" triangles="@../extrude/extrusion.extrusionTriangles" />
<MechanicalObject position="@../extrude/extrusion.extrusionVertices"/>
<OglModel color="red" />
</Node>
<Node>
<MeshOBJLoader name='myLoader' filename='mesh/liver.obj'/>
<OglModel src='@myLoader'/>
</Node>
</Node>
def createScene(root_node):
root = root_node.addChild('root', dt="0.02")
root.addObject('RequiredPlugin', name="Sofa.Component.Engine.Generate")
root.addObject('RequiredPlugin', name="Sofa.Component.Engine.Select")
root.addObject('RequiredPlugin', name="Sofa.Component.IO.Mesh")
root.addObject('RequiredPlugin', name="Sofa.Component.StateContainer")
root.addObject('RequiredPlugin', name="Sofa.Component.Topology.Container.Constant")
root.addObject('RequiredPlugin', name="Sofa.GL.Component.Rendering3D")
root.addObject('DefaultAnimationLoop', )
extrude = root.addChild('extrude')
extrude.addObject('MeshOBJLoader', name="meshLoader", filename="mesh/liver.obj")
extrude.addObject('MechanicalObject', src="@meshLoader")
extrude.addObject('SphereROI', name="surface1", centers="2 4 0", radii="0.88", drawSize="0", isVisible="0", src="@meshLoader")
extrude.addObject('ExtrudeSurface', template="Vec3", name="extrusion", triangles="@meshLoader.triangles", surfaceVertices="@meshLoader.position", surfaceTriangles="@surface1.triangleIndices", isVisible="0")
extrude.addObject('RandomPointDistributionInSurface', template="Vec3", vertices="@extrusion.extrusionVertices", triangles="@extrusion.extrusionTriangles", numberOfInPoints="100", numberOfTests="3", minDistanceBetweenPoints="0.1")
extrusion = root.addChild('Extrusion')
extrusion.addObject('MeshTopology', points="@../extrude/extrusion.extrusionVertices", triangles="@../extrude/extrusion.extrusionTriangles")
extrusion.addObject('MechanicalObject', position="@../extrude/extrusion.extrusionVertices")
extrusion.addObject('OglModel', color="red")
node = root.addChild('node')
node.addObject('MeshOBJLoader', name="myLoader", filename="mesh/liver.obj")
node.addObject('OglModel', src="@myLoader")