1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

0028261: Chamfer fails on edge connected to cone's seam

Method GetType() of class GeomAdaptor_SurfaceOfRevolution was modified to create plane instead Cone or SurfaceOfRevolution for "plane like" within Precision::Confusion() restricted object.
For infinite objects Cone with semiangle > PI/2 - eps is replaced by SurfaceOfRevolution for eps < Precision::Confusion()
Tests cases are added

Small correction of shape names for issue CR28261_28266
This commit is contained in:
ifv
2017-01-26 13:19:20 +03:00
committed by apn
parent 0f358da3e3
commit 9f2d973602
3 changed files with 82 additions and 6 deletions

View File

@@ -401,13 +401,21 @@ GeomAbs_SurfaceType GeomAdaptor_SurfaceOfRevolution::GetType() const
{
Standard_Real TolConf = Precision::Confusion();
Standard_Real TolAng = Precision::Angular();
Standard_Real TolConeSemiAng = Precision::Confusion();
switch (myBasisCurve->GetType()) {
case GeomAbs_Line: {
gp_Ax1 Axe = myBasisCurve->Line().Position();
if (myAxis.IsParallel(Axe, TolAng))
return GeomAbs_Cylinder;
{
gp_Pnt P = Value(0., 0.);
Standard_Real R = gp_Vec(myAxeRev.Location(), P) * myAxeRev.XDirection();
if (R > TolConf)
{
return GeomAbs_Cylinder;
}
}
else if (myAxis.IsNormal(Axe, TolAng))
return GeomAbs_Plane;
else
@@ -425,16 +433,27 @@ GeomAbs_SurfaceType GeomAdaptor_SurfaceOfRevolution::GetType() const
gp_Vec vlin(pf,pl);
gp_Vec vaxe(myAxis.Direction());
Standard_Real projlen = Abs(vaxe.Dot(vlin));
Standard_Real aTolConf = len*TolAng;
if ((len - projlen) <= aTolConf)
return GeomAbs_Cylinder;
else if (projlen <= aTolConf)
if ((len - projlen) <= TolConf)
{
gp_Pnt P = Value(0., 0.);
Standard_Real R = gp_Vec(myAxeRev.Location(), P) * myAxeRev.XDirection();
if (R > TolConf)
{
return GeomAbs_Cylinder;
}
}
else if (projlen <= TolConf)
return GeomAbs_Plane;
}
gp_Vec V(myAxis.Location(), myBasisCurve->Line().Location());
gp_Vec W(Axe.Direction());
if (Abs(V.DotCross(myAxis.Direction(), W)) <= TolConf)
gp_Vec AxisDir(myAxis.Direction());
Standard_Real proj = Abs(W.Dot(AxisDir));
if (Abs(V.DotCross(AxisDir, W)) <= TolConf &&
(proj >= TolConeSemiAng && proj <= 1. - TolConeSemiAng))
{
return GeomAbs_Cone;
}
}
break;
}//case GeomAbs_Line: