mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-24 13:50:49 +03:00
0028844: Regression vs 7.1.0: Exception is raised by the solid classification algorithm
Protection from normalization of the null vector. Test cases for the issue.
This commit is contained in:
@@ -33,8 +33,14 @@ void Intf::PlaneEquation (const gp_Pnt& P1,
|
||||
gp_XYZ v2=P3.XYZ()-P2.XYZ();
|
||||
gp_XYZ v3=P1.XYZ()-P3.XYZ();
|
||||
NormalVector= (v1^v2)+(v2^v3)+(v3^v1);
|
||||
NormalVector.Normalize();
|
||||
PolarDistance = NormalVector * P1.XYZ();
|
||||
Standard_Real aNormLen = NormalVector.Modulus();
|
||||
if (aNormLen < gp::Resolution()) {
|
||||
PolarDistance = 0.;
|
||||
}
|
||||
else {
|
||||
NormalVector.Divide(aNormLen);
|
||||
PolarDistance = NormalVector * P1.XYZ();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user