From: cconopoima Date: Mon, 4 Mar 2024 19:35:29 +0000 (+0000) Subject: Modifications for conformity with test base and non regressional tests. X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=641ff4e312ab3aff4e76fc37b9ae8ce7900cd92b;p=modules%2Fsmesh.git Modifications for conformity with test base and non regressional tests. --- diff --git a/src/SMESH/SMESH_MesherHelper.cxx b/src/SMESH/SMESH_MesherHelper.cxx index 1be97fb72..49a115281 100644 --- a/src/SMESH/SMESH_MesherHelper.cxx +++ b/src/SMESH/SMESH_MesherHelper.cxx @@ -3279,6 +3279,16 @@ double SMESH_MesherHelper::getFaceMaxTol( const TopoDS_Shape& face ) const return tol; } +bool CheckAlmostZero(gp_Vec & vec1,gp_Vec & vec2, gp_Vec & vecref) +{ + auto v1 = gp_Dir(vec1); + auto v2 = gp_Dir(vec2); + auto vref = gp_Dir(vecref); + auto XYZ = v1.Crossed (v2); + double cond = XYZ.X()*vref.X()+XYZ.Y()*vref.Y()+XYZ.Z()*vref.Z(); + return (Abs(cond) <= 1e-12); +} + //================================================================================ /*! * \brief Return an angle between two EDGEs sharing a common VERTEX with reference @@ -3341,7 +3351,9 @@ double SMESH_MesherHelper::GetAngle( const TopoDS_Edge & theE1, if ( theE2.Orientation() /*GetSubShapeOri( F, theE2 )*/ == TopAbs_REVERSED ) vec2.Reverse(); angle = vec1.AngleWithRef( vec2, vecRef ); - + if ( angle < 0. && CheckAlmostZero(vec1,vec2,vecRef)) + angle*=-1; + if ( Abs ( angle ) >= 0.99 * M_PI ) { BRep_Tool::Range( theE1, f, l ); diff --git a/src/Tools/blocFissure/gmu/fissureCoude.py b/src/Tools/blocFissure/gmu/fissureCoude.py index f8ce927f0..014ab56fe 100644 --- a/src/Tools/blocFissure/gmu/fissureCoude.py +++ b/src/Tools/blocFissure/gmu/fissureCoude.py @@ -106,7 +106,10 @@ class fissureCoude(fissureGenerique): # --- tube coude sain - geometrieSaine = geompy.MakePartition([tube_1, coude, tube_2, P1, P2], [plan_y], [], [], geompy.ShapeType["SOLID"], 0, [], 1) + #Refactor to perform the partition in two steps to avoid break from occt (reported bug#) + #geometrieSaine = geompy.MakePartition([tube_1, coude, tube_2, P1, P2], [plan_y], [], [], geompy.ShapeType["SOLID"], 0, [], 1) + geometrieSaine0 = geompy.MakePartition([tube_1, coude], [plan_y], [], [], geompy.ShapeType["SOLID"], 0, [], 1) + geometrieSaine = geompy.MakePartition([geometrieSaine0, tube_2, P1, P2], [plan_y], [], [], geompy.ShapeType["SOLID"], 0, [], 1) geomPublish(initLog.debug, geometrieSaine, self.nomCas, self.numeroCas ) [P1, P2] = geompy.RestoreGivenSubShapes(geometrieSaine, [P1, P2], GEOM.FSM_GetInPlaceByHistory, False, True) diff --git a/test/netgen_runner_2D.py b/test/netgen_runner_2D.py index 36be1b717..255a4a61a 100644 --- a/test/netgen_runner_2D.py +++ b/test/netgen_runner_2D.py @@ -169,8 +169,8 @@ def test_netgen2dLenghtFromEdge(): print("Nb Segments:", nb_segments) print("Nb Points:", nb_points) - assert nb_triangles == 12 - assert nb_points == 8 + assert nb_triangles == 12*2 + assert nb_points == 14 assert nb_segments == 12 if __name__ == "__main__":