X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGeomAPI%2FGeomAPI_Edge.cpp;h=4b758eb90da225df14b56d7a9cf0e3c519de3ec1;hb=7f873aed4bae5a98dca078209699b54276b46fce;hp=759b0b323cb2c90205d2fef862abfe9c3fbc9c97;hpb=534832230a29726c5bf6f438f7630f9058d38ba9;p=modules%2Fshaper.git diff --git a/src/GeomAPI/GeomAPI_Edge.cpp b/src/GeomAPI/GeomAPI_Edge.cpp index 759b0b323..4b758eb90 100644 --- a/src/GeomAPI/GeomAPI_Edge.cpp +++ b/src/GeomAPI/GeomAPI_Edge.cpp @@ -46,8 +46,12 @@ bool GeomAPI_Edge::isCircle() const const TopoDS_Shape& aShape = const_cast(this)->impl(); double aFirst, aLast; Handle(Geom_Curve) aCurve = BRep_Tool::Curve((const TopoDS_Edge&)aShape, aFirst, aLast); - if (aCurve->IsKind(STANDARD_TYPE(Geom_Circle)) && aCurve->IsClosed()) - return true; + if (aCurve->IsKind(STANDARD_TYPE(Geom_Circle))) + { + // Check the difference of first and last parameters to be equal to the curve period + if (Abs(aLast - aFirst - aCurve->Period()) < Precision::PConfusion()) + return true; + } return false; } @@ -56,8 +60,12 @@ bool GeomAPI_Edge::isArc() const const TopoDS_Shape& aShape = const_cast(this)->impl(); double aFirst, aLast; Handle(Geom_Curve) aCurve = BRep_Tool::Curve((const TopoDS_Edge&)aShape, aFirst, aLast); - if (aCurve->IsKind(STANDARD_TYPE(Geom_Circle)) && !aCurve->IsClosed()) - return true; + if (aCurve->IsKind(STANDARD_TYPE(Geom_Circle))) + { + // Check the difference of first and last parameters is not equal the curve period + if (Abs(aLast - aFirst - aCurve->Period()) >= Precision::PConfusion()) + return true; + } return false; }