diff --git a/src/StdSelect/StdSelect_BRepSelectionTool.cxx b/src/StdSelect/StdSelect_BRepSelectionTool.cxx index 7add5462b8..8c2ee29620 100644 --- a/src/StdSelect/StdSelect_BRepSelectionTool.cxx +++ b/src/StdSelect/StdSelect_BRepSelectionTool.cxx @@ -569,18 +569,24 @@ void StdSelect_BRepSelectionTool::GetEdgeSensitive (const TopoDS_Shape& theShape static NCollection_Sequence getCylinderCircles (const TopoDS_Face& theHollowCylinder) { NCollection_Sequence aCircles; + Standard_Integer aLinesNb = 0; TopExp_Explorer anEdgeExp; for (anEdgeExp.Init (theHollowCylinder, TopAbs_EDGE); anEdgeExp.More(); anEdgeExp.Next()) { const TopoDS_Edge& anEdge = TopoDS::Edge (anEdgeExp.Current()); BRepAdaptor_Curve anAdaptor (anEdge); + aLinesNb++; if (anAdaptor.GetType() == GeomAbs_Circle && BRep_Tool::IsClosed (anEdge)) { aCircles.Append (anAdaptor.Circle()); } + else if (anAdaptor.GetType() != GeomAbs_Line || aLinesNb > 4) + { + return NCollection_Sequence(); + } } return aCircles;