Modifications for conformity with test base and non regressional tests.

This commit is contained in:
cconopoima 2024-03-04 19:35:29 +00:00
parent 89f68b9edc
commit 641ff4e312
3 changed files with 19 additions and 4 deletions

View File

@ -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 );

View File

@ -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)

View File

@ -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__":