]> OCCT Git - occt.git/commitdiff
# fix cone with holes
authormzernova <mzernova@opencascade.com>
Wed, 31 Jul 2024 15:04:36 +0000 (16:04 +0100)
committermzernova <mzernova@opencascade.com>
Fri, 6 Sep 2024 10:50:35 +0000 (11:50 +0100)
src/StdSelect/StdSelect_BRepSelectionTool.cxx

index 7add5462b8b4df87a22ff7eb2eff60bb7fcde74b..8c2ee296208ac50dbb80d3002e914d860644416d 100644 (file)
@@ -569,18 +569,24 @@ void StdSelect_BRepSelectionTool::GetEdgeSensitive (const TopoDS_Shape& theShape
 static NCollection_Sequence<gp_Circ> getCylinderCircles (const TopoDS_Face& theHollowCylinder)
 {
   NCollection_Sequence<gp_Circ> 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<gp_Circ>();
+    }
   }
 
   return aCircles;