mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2024-12-25 17:00:34 +05:00
#19232 [CEA] overal Mesh quality crash on imported MED
Bug reason: the med file includes polygons based on none of nodes. Solution: forbid creating such polygons
This commit is contained in:
parent
501b1a0f68
commit
1deb1c3b7e
@ -831,6 +831,8 @@ SMDS_Mesh::AddPolygonalFaceWithID (const std::vector<const SMDS_MeshNode*> & nod
|
|||||||
{
|
{
|
||||||
if ( NbFaces() % CHECKMEMORY_INTERVAL == 0 ) CheckMemory();
|
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 ))
|
if ( SMDS_MeshCell* cell = myCellFactory->NewCell( ID ))
|
||||||
{
|
{
|
||||||
cell->init( SMDSEntity_Polygon, nodes );
|
cell->init( SMDSEntity_Polygon, nodes );
|
||||||
@ -874,6 +876,8 @@ SMDS_Mesh::AddQuadPolygonalFaceWithID (const std::vector<const SMDS_MeshNode*> &
|
|||||||
const int ID)
|
const int ID)
|
||||||
{
|
{
|
||||||
if ( NbFaces() % CHECKMEMORY_INTERVAL == 0 ) CheckMemory();
|
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 ))
|
if ( SMDS_MeshCell* cell = myCellFactory->NewCell( ID ))
|
||||||
{
|
{
|
||||||
cell->init( SMDSEntity_Quad_Polygon, nodes );
|
cell->init( SMDSEntity_Quad_Polygon, nodes );
|
||||||
|
@ -1069,6 +1069,12 @@ CORBA::Long SMESH_MeshEditor_i::AddPolygonalFace (const SMESH::long_array & IDsO
|
|||||||
if ( ! ( nodes[i] = getMeshDS()->FindNode( IDsOfNodes[i] )))
|
if ( ! ( nodes[i] = getMeshDS()->FindNode( IDsOfNodes[i] )))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
if ( NbNodes == 0 )
|
||||||
|
{
|
||||||
|
INFOS("Polygon without nodes is forbidden");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
const SMDS_MeshElement* elem = getMeshDS()->AddPolygonalFace(nodes);
|
const SMDS_MeshElement* elem = getMeshDS()->AddPolygonalFace(nodes);
|
||||||
|
|
||||||
// Update Python script
|
// Update Python script
|
||||||
@ -1098,6 +1104,12 @@ CORBA::Long SMESH_MeshEditor_i::AddQuadPolygonalFace (const SMESH::long_array &
|
|||||||
for (int i = 0; i < NbNodes; i++)
|
for (int i = 0; i < NbNodes; i++)
|
||||||
nodes[i] = getMeshDS()->FindNode(IDsOfNodes[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);
|
const SMDS_MeshElement* elem = getMeshDS()->AddQuadPolygonalFace(nodes);
|
||||||
|
|
||||||
// Update Python script
|
// Update Python script
|
||||||
|
Loading…
Reference in New Issue
Block a user