Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions Sofa/framework/Core/src/sofa/core/visual/DrawMesh.h
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,17 @@ struct SOFA_CORE_API DrawElementMesh<sofa::geometry::Tetrahedron>
const auto& elements = topology->getTetrahedra();
const auto& facets = topology->getTriangles();

if(facets.empty())
{
static bool firstTime = true;
if (firstTime)
{
msg_error("DrawElementMesh<Tetrahedron>") << "Drawing tetrahedra needs the associated triangles in the topology.";
firstTime = false;
}
return;
}

for ( auto& p : renderedPoints)
{
p.resize(elementIndices.size() * sofa::geometry::Triangle::NumberOfNodes);
Expand Down Expand Up @@ -474,6 +485,17 @@ struct SOFA_CORE_API DrawElementMesh<sofa::geometry::Hexahedron>
const auto& elements = topology->getHexahedra();
const auto& facets = topology->getQuads();

if(facets.empty())
{
static bool firstTime = true;
if (firstTime)
{
msg_error("DrawElementMesh<Hexahedron>") << "Drawing hexahedra needs the associated quads in the topology.";
firstTime = false;
}
return;
}

for ( auto& p : renderedPoints)
{
p.resize(elementIndices.size() * sofa::geometry::Quad::NumberOfNodes);
Expand Down
Loading