mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-10 18:51:21 +03:00
0026750: Method IsNormal(...) for gp_Vec2d returns FALSE if the angle between two vectors is equal to -90 degree (-M_PI/2 radian)
The bug has been fixed. Test case for this issue has been created. Correct alignment.
This commit is contained in:
parent
b400611710
commit
d0fcf95a09
@ -4485,6 +4485,41 @@ static Standard_Integer OCC24537(
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : OCC26750
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
static Standard_Integer OCC26750( Draw_Interpretor& theDI,
|
||||||
|
Standard_Integer /*theNArg*/,
|
||||||
|
const char ** /*theArgVal*/)
|
||||||
|
{
|
||||||
|
const gp_Vec2d aVec1(1.0, 0.0);
|
||||||
|
const gp_Vec2d aVec2(0.0, -1.0);
|
||||||
|
|
||||||
|
if(aVec1.IsNormal(aVec2, Precision::Angular()))
|
||||||
|
{
|
||||||
|
theDI << "gp_Vec2d OK. Vectors are normal.\n";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
theDI << "Error in gp_Vec2d. Vectors should be normal.\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
const gp_Dir2d aD1(1.0, 0.0);
|
||||||
|
const gp_Dir2d aD2(0.0, -1.0);
|
||||||
|
|
||||||
|
if(aD1.IsNormal(aD2, Precision::Angular()))
|
||||||
|
{
|
||||||
|
theDI << "gp_Dir2d OK. Vectors are normal.\n";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
theDI << "Error in gp_Dir2d. Vectors should be normal.\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
void QABugs::Commands_19(Draw_Interpretor& theCommands) {
|
void QABugs::Commands_19(Draw_Interpretor& theCommands) {
|
||||||
const char *group = "QABugs";
|
const char *group = "QABugs";
|
||||||
|
|
||||||
@ -4577,5 +4612,7 @@ void QABugs::Commands_19(Draw_Interpretor& theCommands) {
|
|||||||
theCommands.Add ("OCC26525", "OCC26525 result edge face ", __FILE__, OCC26525, group);
|
theCommands.Add ("OCC26525", "OCC26525 result edge face ", __FILE__, OCC26525, group);
|
||||||
|
|
||||||
theCommands.Add ("OCC24537", "OCC24537 [file]", __FILE__, OCC24537, group);
|
theCommands.Add ("OCC24537", "OCC24537 [file]", __FILE__, OCC24537, group);
|
||||||
|
theCommands.Add ("OCC26750", "OCC26750", __FILE__, OCC26750, group);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -70,14 +70,11 @@ inline const gp_XY& gp_Vec2d::XY () const
|
|||||||
{ return coord; }
|
{ return coord; }
|
||||||
|
|
||||||
inline Standard_Boolean gp_Vec2d::IsNormal
|
inline Standard_Boolean gp_Vec2d::IsNormal
|
||||||
(const gp_Vec2d& Other,
|
(const gp_Vec2d& theOther,
|
||||||
const Standard_Real AngularTolerance) const
|
const Standard_Real theAngularTolerance) const
|
||||||
{
|
{
|
||||||
Standard_Real Ang = Angle(Other);
|
const Standard_Real anAng = Abs(M_PI_2 - Abs(Angle(theOther)));
|
||||||
if (Ang < 0) Ang = - Ang;
|
return !(anAng > theAngularTolerance);
|
||||||
Ang = M_PI / 2.0 - Angle(Other);
|
|
||||||
if (Ang < 0) Ang = - Ang;
|
|
||||||
return Ang <= AngularTolerance;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
inline Standard_Boolean gp_Vec2d::IsOpposite
|
inline Standard_Boolean gp_Vec2d::IsOpposite
|
||||||
|
11
tests/bugs/modalg_6/bug26750
Normal file
11
tests/bugs/modalg_6/bug26750
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
puts "============"
|
||||||
|
puts "OCC26750"
|
||||||
|
puts "============"
|
||||||
|
puts ""
|
||||||
|
#############################################################################################
|
||||||
|
## Method IsNormal(...) for gp_Vec2d returns FALSE if the angle between two vectors is equal to -90 degree (-M_PI/2 radian)
|
||||||
|
#############################################################################################
|
||||||
|
|
||||||
|
pload QAcommands
|
||||||
|
|
||||||
|
OCC26750
|
Loading…
x
Reference in New Issue
Block a user