mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2024-12-28 18:30:35 +05:00
Fix regressions in QuadTo4Tri() and QuadToTri()
mesh_Quadratic_00/A3 imps_09/K8
This commit is contained in:
parent
85b03c3643
commit
475d7c1304
@ -1601,13 +1601,13 @@ void SMESH_MeshEditor::QuadTo4Tri (TIDSortedElemSet & theElems)
|
|||||||
|
|
||||||
// create 4 triangles
|
// create 4 triangles
|
||||||
|
|
||||||
GetMeshDS()->RemoveFreeElement( quad, subMeshDS, /*fromGroups=*/false );
|
|
||||||
|
|
||||||
helper.SetIsQuadratic ( nodes.size() > 4 );
|
helper.SetIsQuadratic ( nodes.size() > 4 );
|
||||||
helper.SetIsBiQuadratic( nodes.size() == 9 );
|
helper.SetIsBiQuadratic( nodes.size() == 9 );
|
||||||
if ( helper.GetIsQuadratic() )
|
if ( helper.GetIsQuadratic() )
|
||||||
helper.AddTLinks( static_cast< const SMDS_MeshFace*>( quad ));
|
helper.AddTLinks( static_cast< const SMDS_MeshFace*>( quad ));
|
||||||
|
|
||||||
|
GetMeshDS()->RemoveFreeElement( quad, subMeshDS, /*fromGroups=*/false );
|
||||||
|
|
||||||
for ( int i = 0; i < 4; ++i )
|
for ( int i = 0; i < 4; ++i )
|
||||||
{
|
{
|
||||||
SMDS_MeshElement* tria = helper.AddFace( nodes[ i ],
|
SMDS_MeshElement* tria = helper.AddFace( nodes[ i ],
|
||||||
@ -2997,30 +2997,27 @@ bool SMESH_MeshEditor::QuadToTri (TIDSortedElemSet & theElems,
|
|||||||
}
|
}
|
||||||
|
|
||||||
const SMDS_MeshNode* aNodes [8];
|
const SMDS_MeshNode* aNodes [8];
|
||||||
const SMDS_MeshNode* inFaceNode = 0;
|
|
||||||
SMDS_ElemIteratorPtr itN = elem->nodesIterator();
|
SMDS_ElemIteratorPtr itN = elem->nodesIterator();
|
||||||
int i = 0;
|
for ( int i = 0; itN->more(); ++i )
|
||||||
|
aNodes[ i ] = static_cast<const SMDS_MeshNode*>( itN->next() );
|
||||||
|
|
||||||
|
const SMDS_MeshNode* inFaceNode = 0;
|
||||||
if ( helper.GetNodeUVneedInFaceNode() )
|
if ( helper.GetNodeUVneedInFaceNode() )
|
||||||
while ( itN->more() && !inFaceNode ) {
|
for ( int i = 0; i < 8 && !inFaceNode; ++i )
|
||||||
aNodes[ i++ ] = static_cast<const SMDS_MeshNode*>( itN->next() );
|
if ( aNodes[ i ]->GetPosition()->GetTypeOfPosition() == SMDS_TOP_FACE )
|
||||||
if ( aNodes[ i-1 ]->GetPosition()->GetTypeOfPosition() == SMDS_TOP_FACE )
|
inFaceNode = aNodes[ i ];
|
||||||
{
|
|
||||||
inFaceNode = aNodes[ i-1 ];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// find middle point for (0,1,2,3)
|
// find middle point for (0,1,2,3)
|
||||||
// and create a node in this point;
|
// and create a node in this point;
|
||||||
gp_XYZ p( 0,0,0 );
|
gp_XYZ p( 0,0,0 );
|
||||||
if ( surface.IsNull() ) {
|
if ( surface.IsNull() ) {
|
||||||
for(i=0; i<4; i++)
|
for ( int i = 0; i < 4; i++ ) p += SMESH_TNodeXYZ( aNodes[i] );
|
||||||
p += gp_XYZ(aNodes[i]->X(), aNodes[i]->Y(), aNodes[i]->Z() );
|
|
||||||
p /= 4;
|
p /= 4;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
TopoDS_Face geomFace = TopoDS::Face( helper.GetSubShape() );
|
TopoDS_Face geomFace = TopoDS::Face( helper.GetSubShape() );
|
||||||
gp_XY uv( 0,0 );
|
gp_XY uv( 0,0 );
|
||||||
for(i=0; i<4; i++)
|
for ( int i = 0; i < 4; i++ )
|
||||||
uv += helper.GetNodeUV( geomFace, aNodes[i], inFaceNode );
|
uv += helper.GetNodeUV( geomFace, aNodes[i], inFaceNode );
|
||||||
uv /= 4.;
|
uv /= 4.;
|
||||||
p = surface->Value( uv.X(), uv.Y() ).XYZ();
|
p = surface->Value( uv.X(), uv.Y() ).XYZ();
|
||||||
|
Loading…
Reference in New Issue
Block a user