Skip to content

[Crash] runSofa crashes when using DecimateMesh #43

Description

@FadiWahbeh

Description

I created a small scene to test a few compoenent in the CGALPlugin. While testing i founf out that the DecimateMesh component causes crashes. However, the simulation crashes immediately upon launching runSofa whenever this component is uncommented (as you will see in the video).

Since this is my first time using SOFA and creating a scene, it is entirely possible that this is caused by a the wrong configuration from my side, but it's better repporting it.

Attachments

Video of the crash:
https://github.com/user-attachments/assets/4531eb4b-36b3-4251-859e-a8805b8cf093

Scene file (XML):

Click to expand the XML scene
<?xml version="1.0" ?>
<Node dt="0.01" gravity="0 0 0" name="root">
    <RequiredPlugin name="sofa_base_plugins" pluginName="Sofa.Component.IO.Mesh
                                Sofa.Component.StateContainer
                                Sofa.Component.Topology.Container.Constant
                                Sofa.Component.Topology.Container.Dynamic
                                Sofa.Component.Visual
                                Sofa.GL.Component.Rendering3D"/>

    <RequiredPlugin name="cgal_plugin" pluginName="CGALPlugin"/>

    <DefaultAnimationLoop/>
    <DefaultVisualManagerLoop/>
    <VisualStyle displayFlags="showVisualModels showBehaviorModels"/>

    <!-- TEST - Baseline: load the mesh with pure SOFA components.       -->
    <Node name="Test1_Baseline_LoadMesh">
        <MeshOBJLoader filename="C:/Users/Fadi WAHBEH/DigitalTwin/Mesh_Pipeline/data/output/patient_01/liver/05b_visual_intersection_repair/Patient_01_liver_visual.obj" name="loader"/>
        <OglModel color="0.7 0.7 0.7 1.0" name="visual" src="@loader"/>
        <MechanicalObject name="state"/>
    </Node>

    <!-- TEST - DecimateMesh      -->
    <Node name="Test2_DecimateMesh">
        <MeshOBJLoader filename="C:/Users/Fadi WAHBEH/DigitalTwin/Mesh_Pipeline/data/output/patient_01/liver/05b_visual_intersection_repair/Patient_01_liver_visual.obj" name="input"/>
        <DecimateMesh inputPosition="@input.position" inputTriangles="@input.triangles" name="decim" targetedNumberOfEdges="1000"/>
        <OglModel color="0.4 0.4 0.9 1.0" name="decim_visual" position="@decim.outputPosition" triangles="@decim.outputTriangles"/>
    </Node>

    <!-- TEST - TriangularConvexHull3D
    <Node name="Test3_ConvexHull3D">
        <MeshOBJLoader filename="C:/Users/Fadi WAHBEH/DigitalTwin/Mesh_Pipeline/data/output/patient_01/liver/05b_visual_intersection_repair/Patient_01_liver_visual.obj" name="input"/>
        <TriangularConvexHull3D inputPosition="@input.position" name="hull"/>
        <OglModel color="0.3 0.9 0.3 0.3" name="hull_visual" position="@hull.outputPosition" triangles="@hull.outputTriangles"/>
    </Node>
    -->

    <!-- TEST - MeshGenerationFromPolyhedron.
    <Node name="Test4_VolumeTetMesh_CGAL_Mesh3_KEY_CANARY">
        <MeshOBJLoader filename="C:/Users/Fadi WAHBEH/DigitalTwin/Mesh_Pipeline/data/output/patient_01/liver/05b_visual_intersection_repair/Patient_01_liver_visual.obj" name="input"/>

        <MeshGenerationFromPolyhedron cellRatio="3.0" cellSize="10.0" exude="0" facetAngle="25.0" facetApproximation="2.0" facetSize="10.0" inputPoints="@input.position" inputTriangles="@input.triangles" lloyd="0" name="tetgen" odt="0" perturb="0"/>

        <TetrahedronSetTopologyContainer name="tet_topo" position="@tetgen.outputPoints" tetrahedra="@tetgen.outputTetras"/>

        <MechanicalObject name="tet_state" position="@tetgen.outputPoints" template="Vec3d"/>
    </Node>
    -->
    
    <!-- TEST - BooleanOperations 
    <Node name="Test5_BooleanOperations">
        <MeshOBJLoader filename="C:/Users/Fadi WAHBEH/DigitalTwin/Mesh_Pipeline/data/output/patient_01/liver/05b_visual_intersection_repair/Patient_01_liver_visual.obj" name="input_a"/>
        <MeshOBJLoader filename="C:/Users/Fadi WAHBEH/DigitalTwin/Mesh_Pipeline/data/output/patient_01/liver/09b_collision_intersection_repair/Patient_01_liver_collision.obj" name="input_b"/>

        <BooleanOperations inputAPosition="@input_a.position" inputATriangles="@input_a.triangles" inputBPosition="@input_b.position" inputBTriangles="@input_b.triangles" name="bool_op" operation="difference"/>

        <OglModel color="0.9 0.4 0.4 1.0" name="bool_visual" position="@bool_op.outputPosition" triangles="@bool_op.outputTriangles"/>
    </Node>
    -->
</Node>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions