bos #24052 [CEA 24050] Body Fitting with shared faces

+ fix merging polyhedra
This commit is contained in:
eap 2021-07-28 19:14:53 +03:00
parent 3dd9e6ddb3
commit e9ce775931
3 changed files with 762 additions and 125 deletions

View File

@ -6959,9 +6959,19 @@ void SMESH_MeshEditor::MergeNodes (TListOfListOfNodes & theGroupsOfNodes,
for ( size_t i = 0; i < newElemDefs.size(); ++i )
{
if ( i > 0 || !mesh->ChangeElementNodes( elem,
& newElemDefs[i].myNodes[0],
newElemDefs[i].myNodes.size() ))
bool elemChanged = false;
if ( i == 0 )
{
if ( elem->GetGeomType() == SMDSGeom_POLYHEDRA )
elemChanged = mesh->ChangePolyhedronNodes( elem,
newElemDefs[i].myNodes,
newElemDefs[i].myPolyhedQuantities );
else
elemChanged = mesh->ChangeElementNodes( elem,
& newElemDefs[i].myNodes[0],
newElemDefs[i].myNodes.size() );
}
if ( i > 0 || !elemChanged )
{
if ( i == 0 )
{
@ -7128,6 +7138,7 @@ bool SMESH_MeshEditor::applyMerge( const SMDS_MeshElement* elem,
// each face has to be analyzed in order to check volume validity
if ( const SMDS_MeshVolume* aPolyedre = SMDS_Mesh::DownCast< SMDS_MeshVolume >( elem ))
{
toRemove = false;
int nbFaces = aPolyedre->NbFaces();
vector<const SMDS_MeshNode *>& poly_nodes = newElemDefs[0].myNodes;

View File

@ -256,14 +256,14 @@ bool SMESHDS_Mesh
{
ASSERT(nodes.size() > 3);
size_t i, len = nodes.size();
std::vector<smIdType> nodes_ids( len );
for ( i = 0; i < len; i++ )
nodes_ids[i] = nodes[i]->GetID();
if ( !SMDS_Mesh::ChangePolyhedronNodes( elem, nodes, quantities ))
return false;
smIdType i, len = nodes.size();
std::vector<smIdType> nodes_ids (len);
for (i = 0; i < len; i++) {
nodes_ids[i] = nodes[i]->GetID();
}
myScript->ChangePolyhedronNodes(elem->GetID(), nodes_ids, quantities);
return true;

File diff suppressed because it is too large Load Diff