X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGeomAPI%2FGeomAPI_Edge.cpp;h=4b758eb90da225df14b56d7a9cf0e3c519de3ec1;hb=7f873aed4bae5a98dca078209699b54276b46fce;hp=06c733f3baa888eb9662eedf0fc27baa2cc549be;hpb=3ad7c21c053ba989be61739e59d36c11c00cc53b;p=modules%2Fshaper.git diff --git a/src/GeomAPI/GeomAPI_Edge.cpp b/src/GeomAPI/GeomAPI_Edge.cpp index 06c733f3b..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; } @@ -100,7 +108,7 @@ std::shared_ptr GeomAPI_Edge::circle() } -bool GeomAPI_Edge::isEqual(std::shared_ptr theEdge) +bool GeomAPI_Edge::isEqual(const std::shared_ptr theEdge) const { const TopoDS_Shape& aMyShape = const_cast(this)->impl(); const TopoDS_Shape& aInShape = theEdge->impl();