Bug reason: the med file includes polygons based on none of nodes.
Solution: forbid creating such polygons
{
if ( NbFaces() % CHECKMEMORY_INTERVAL == 0 ) CheckMemory();
+ if ( nodes.empty() )
+ throw std::invalid_argument("Polygon without nodes is forbidden");
if ( SMDS_MeshCell* cell = myCellFactory->NewCell( ID ))
{
cell->init( SMDSEntity_Polygon, nodes );
const int ID)
{
if ( NbFaces() % CHECKMEMORY_INTERVAL == 0 ) CheckMemory();
+ if ( nodes.empty() )
+ throw std::invalid_argument("Polygon without nodes is forbidden");
if ( SMDS_MeshCell* cell = myCellFactory->NewCell( ID ))
{
cell->init( SMDSEntity_Quad_Polygon, nodes );
if ( ! ( nodes[i] = getMeshDS()->FindNode( IDsOfNodes[i] )))
return 0;
+ if ( NbNodes == 0 )
+ {
+ INFOS("Polygon without nodes is forbidden");
+ return 0;
+ }
+
const SMDS_MeshElement* elem = getMeshDS()->AddPolygonalFace(nodes);
// Update Python script
for (int i = 0; i < NbNodes; i++)
nodes[i] = getMeshDS()->FindNode(IDsOfNodes[i]);
+ if ( NbNodes == 0 )
+ {
+ INFOS("Polygon without nodes is forbidden");
+ return 0;
+ }
+
const SMDS_MeshElement* elem = getMeshDS()->AddQuadPolygonalFace(nodes);
// Update Python script