Skip to content

MeshGenerationFromPolyhedron

Generate tetrahedral mesh from triangular mesh

Vec3d

Templates:

  • Vec3d

Target: CGALPlugin

namespace: cgal

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
inputPoints Rest position coordinates of the degrees of freedom
inputTriangles List of triangles
inputQuads List of quads (if no triangles)
outputPoints New Rest position coordinates from the tetrahedral generation
outputTetras List of tetrahedra
frozen true to prohibit recomputations of the mesh 0
facetAngle Lower bound for the angle in degrees of the surface mesh facets 25
facetSize Uniform upper bound for the radius of the surface Delaunay balls 0.15
facetApproximation Upper bound for the center-center distances of the surface mesh facets 0.008
cellRatio Upper bound for the radius-edge ratio of the tetrahedra 4
cellSize Uniform upper bound for the circumradii of the tetrahedra in the mesh 0.2
sharpEdgeAngle Threshold angle to detect sharp edges in input surface (activated with CGAL 3.8+ if sharpEdgeSize > 0) 120
sharpEdgeSize Meshing size for sharp feature edges (activated with CGAL 3.8+ if sharpEdgeSize > 0) 0
odt activate odt optimization 0
lloyd activate lloyd optimization 0
perturb activate perturb optimization 0
exude activate exude optimization 0
odt_max_it odt max iteration number 200
lloyd_max_it lloyd max iteration number 200
perturb_max_time perturb maxtime 20
exude_max_time exude max time 20
ordering output points and elements ordering (0 = none, 1 = longest bbox axis) 0
constantMeshProcess deterministic choice of first point used in meshing process (true = constant output / false = variable output) 0
meshingSeed seed used when picking first point in meshing process 0
Visualization
drawTetras display generated tetra mesh 0
drawSurface display input surface mesh 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 BaseObject
master nullptr for regular objects, or master object for which this object is one sub-objects BaseObject

Examples

MeshGenerationFromPolyhedron.scn

<?xml version="1.0"?>
<Node name="root" dt="0.05" showBoundingTree="0" gravity="0 -9 1">
    <VisualStyle displayFlags="showVisual" />
    <RequiredPlugin pluginName="CGALPlugin"/>

    <MeshOBJLoader name="loader" filename="mesh/torus.obj" />   

    <Node name="visu_surface">
        <MechanicalObject name="dofs" position="@../loader.position"/>
        <TriangleSetTopologyContainer name="topo" triangles="@../loader.triangles"/>
        <TriangleSetTopologyModifier   name="Modifier" />
        <TriangleSetGeometryAlgorithms template="Vec3d" name="GeomAlgo" drawTriangles="1" />
    </Node>

    <Node name="tetra_mesh">
        <MeshGenerationFromPolyhedron name="MeshGenerator" inputPoints="@../loader.position" inputTriangles="@../loader.triangles" inputQuads="@../loader.quads"/>
        <MechanicalObject name="dofs" position="@MeshGenerator.outputPoints"/>
        <TetrahedronSetTopologyContainer name="topo" tetrahedra="@MeshGenerator.outputTetras"/>
        <TetrahedronSetGeometryAlgorithms template="Vec3d" name="GeomAlgo" drawTetrahedra="1" drawScaleTetrahedra="0.8"/>
    </Node>


</Node>
def createScene(root_node):

   root = root_node.addChild('root', dt="0.05", showBoundingTree="0", gravity="0 -9 1")

   root.addObject('VisualStyle', displayFlags="showVisual")
   root.addObject('RequiredPlugin', pluginName="CGALPlugin")
   root.addObject('MeshOBJLoader', name="loader", filename="mesh/torus.obj")

   visu_surface = root.addChild('visu_surface')

   visu_surface.addObject('MechanicalObject', name="dofs", position="@../loader.position")
   visu_surface.addObject('TriangleSetTopologyContainer', name="topo", triangles="@../loader.triangles")
   visu_surface.addObject('TriangleSetTopologyModifier', name="Modifier")
   visu_surface.addObject('TriangleSetGeometryAlgorithms', template="Vec3d", name="GeomAlgo", drawTriangles="1")

   tetra_mesh = root.addChild('tetra_mesh')

   tetra_mesh.addObject('MeshGenerationFromPolyhedron', name="MeshGenerator", inputPoints="@../loader.position", inputTriangles="@../loader.triangles", inputQuads="@../loader.quads")
   tetra_mesh.addObject('MechanicalObject', name="dofs", position="@MeshGenerator.outputPoints")
   tetra_mesh.addObject('TetrahedronSetTopologyContainer', name="topo", tetrahedra="@MeshGenerator.outputTetras")
   tetra_mesh.addObject('TetrahedronSetGeometryAlgorithms', template="Vec3d", name="GeomAlgo", drawTetrahedra="1", drawScaleTetrahedra="0.8")