mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-04-08 10:57:26 +05:00
Fix regression of non-regression tests
- Coplanar faces filter (SMESH_Controls.cxx) - Convert to quadratic (SMESH_MesherHelper.cxx) - Missing Compute item in mesh pop-up in presence of a sub-mesh on compound only (no other algos) (SSMESHGUI_ComputeDlg.cxx) - set checkAll=False in call of SMESH_Gen::IsApplicable() (smeshBuilder.py)
This commit is contained in:
parent
aac6ba83a9
commit
7d08ac8481
@ -3013,12 +3013,13 @@ bool ConnectedElements::IsSatisfy( long theElementId )
|
|||||||
|
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
inline bool isLessAngle( const gp_Vec& v1, const gp_Vec& v2, const double cos2 )
|
inline bool isLessAngle( const gp_Vec& v1, const gp_Vec& v2, const double cos )
|
||||||
{
|
{
|
||||||
double dot = v1 * v2; // cos * |v1| * |v2|
|
double dot = v1 * v2; // cos * |v1| * |v2|
|
||||||
double l1 = v1.SquareMagnitude();
|
double l1 = v1.SquareMagnitude();
|
||||||
double l2 = v2.SquareMagnitude();
|
double l2 = v2.SquareMagnitude();
|
||||||
return ( dot * dot ) / l1 / l2 >= cos2;
|
return (( dot * cos >= 0 ) &&
|
||||||
|
( dot * dot ) / l1 / l2 >= ( cos * cos ));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
CoplanarFaces::CoplanarFaces()
|
CoplanarFaces::CoplanarFaces()
|
||||||
@ -3046,7 +3047,7 @@ void CoplanarFaces::SetMesh( const SMDS_Mesh* theMesh )
|
|||||||
if (!normOK)
|
if (!normOK)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const double cosTol2 = Cos( myToler ) * Cos( myToler );
|
const double cosTol = Cos( myToler * M_PI / 180. );
|
||||||
NCollection_Map< SMESH_TLink, SMESH_TLink > checkedLinks;
|
NCollection_Map< SMESH_TLink, SMESH_TLink > checkedLinks;
|
||||||
|
|
||||||
std::list< pair< const SMDS_MeshElement*, gp_Vec > > faceQueue;
|
std::list< pair< const SMDS_MeshElement*, gp_Vec > > faceQueue;
|
||||||
@ -3070,7 +3071,7 @@ void CoplanarFaces::SetMesh( const SMDS_Mesh* theMesh )
|
|||||||
if ( f->GetNodeIndex( n2 ) > -1 )
|
if ( f->GetNodeIndex( n2 ) > -1 )
|
||||||
{
|
{
|
||||||
gp_Vec norm = getNormale( static_cast<const SMDS_MeshFace*>(f), &normOK );
|
gp_Vec norm = getNormale( static_cast<const SMDS_MeshFace*>(f), &normOK );
|
||||||
if (!normOK || isLessAngle( myNorm, norm, cosTol2))
|
if (!normOK || isLessAngle( myNorm, norm, cosTol))
|
||||||
{
|
{
|
||||||
myCoplanarIDs.Add( f->GetID() );
|
myCoplanarIDs.Add( f->GetID() );
|
||||||
faceQueue.push_back( make_pair( f, norm ));
|
faceQueue.push_back( make_pair( f, norm ));
|
||||||
|
@ -4059,12 +4059,13 @@ namespace { // Structures used by FixQuadraticElements()
|
|||||||
|
|
||||||
const QFace* QLink::GetContinuesFace( const QFace* face ) const
|
const QFace* QLink::GetContinuesFace( const QFace* face ) const
|
||||||
{
|
{
|
||||||
for ( size_t i = 0; i < _faces.size(); ++i ) {
|
if ( _faces.size() <= 4 )
|
||||||
if ( _faces[i] == face ) {
|
for ( size_t i = 0; i < _faces.size(); ++i ) {
|
||||||
int iF = i < 2 ? 1-i : 5-i;
|
if ( _faces[i] == face ) {
|
||||||
return iF < (int)_faces.size() ? _faces[iF] : 0;
|
int iF = i < 2 ? 1-i : 5-i;
|
||||||
|
return iF < (int)_faces.size() ? _faces[iF] : 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
//================================================================================
|
//================================================================================
|
||||||
|
@ -1773,7 +1773,7 @@ void SMESHGUI_PrecomputeOp::getAssignedAlgos(_PTR(SObject) theMesh,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// check sub-meshes
|
// check sub-meshes
|
||||||
for ( aPart = SMESH::Tag_SubMeshOnEdge; aPart < SMESH::Tag_LastSubMesh; ++aPart )
|
for ( aPart = SMESH::Tag_SubMeshOnEdge; aPart <= SMESH::Tag_LastSubMesh; ++aPart )
|
||||||
{
|
{
|
||||||
if ( !theMesh->FindSubObject( aPart, aHypFolder ))
|
if ( !theMesh->FindSubObject( aPart, aHypFolder ))
|
||||||
continue;
|
continue;
|
||||||
|
@ -1421,6 +1421,8 @@ class StdMeshersBuilder_UseExistingElements_1D2D(Mesh_Algorithm):
|
|||||||
hyp.GetCopySourceMesh() == args[1], args[2] )
|
hyp.GetCopySourceMesh() == args[1], args[2] )
|
||||||
hyp = self.Hypothesis("ImportSource2D", [groups, toCopyMesh, toCopyGroups],
|
hyp = self.Hypothesis("ImportSource2D", [groups, toCopyMesh, toCopyGroups],
|
||||||
UseExisting=UseExisting, CompareMethod=compFun, toAdd=False)
|
UseExisting=UseExisting, CompareMethod=compFun, toAdd=False)
|
||||||
|
if groups and isinstance( groups, SMESH._objref_SMESH_GroupBase ):
|
||||||
|
groups = [groups]
|
||||||
hyp.SetSourceFaces(groups)
|
hyp.SetSourceFaces(groups)
|
||||||
hyp.SetCopySourceMesh(toCopyMesh, toCopyGroups)
|
hyp.SetCopySourceMesh(toCopyMesh, toCopyGroups)
|
||||||
self.mesh.AddHypothesis(hyp, self.geom)
|
self.mesh.AddHypothesis(hyp, self.geom)
|
||||||
|
@ -1680,9 +1680,10 @@ class Mesh:
|
|||||||
if self.mesh.HasShapeToMesh():
|
if self.mesh.HasShapeToMesh():
|
||||||
hyp_type = hyp.GetName()
|
hyp_type = hyp.GetName()
|
||||||
lib_name = hyp.GetLibName()
|
lib_name = hyp.GetLibName()
|
||||||
checkAll = ( not geom.IsSame( self.mesh.GetShapeToMesh() ))
|
# checkAll = ( not geom.IsSame( self.mesh.GetShapeToMesh() ))
|
||||||
if checkAll and geom:
|
# if checkAll and geom:
|
||||||
checkAll = geom.GetType() == 37
|
# checkAll = geom.GetType() == 37
|
||||||
|
checkAll = False
|
||||||
isApplicable = self.smeshpyD.IsApplicable(hyp_type, lib_name, geom, checkAll)
|
isApplicable = self.smeshpyD.IsApplicable(hyp_type, lib_name, geom, checkAll)
|
||||||
if isApplicable:
|
if isApplicable:
|
||||||
AssureGeomPublished( self, geom, "shape for %s" % hyp.GetName())
|
AssureGeomPublished( self, geom, "shape for %s" % hyp.GetName())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user