+
+//=================================================================================================
+std::shared_ptr<GeomAPI_Shape> GeomAlgoAPI_ShapeTools::faceToInfinitePlane(const std::shared_ptr<GeomAPI_Shape>& theFace)
+{
+ if (!theFace.get())
+ return std::shared_ptr<GeomAPI_Shape>();
+
+ TopoDS_Face aPlaneFace = TopoDS::Face(theFace->impl<TopoDS_Shape>());
+ if (aPlaneFace.IsNull())
+ return std::shared_ptr<GeomAPI_Shape>();
+
+ Handle(Geom_Plane) aPlane = Handle(Geom_Plane)::DownCast(BRep_Tool::Surface(aPlaneFace));
+ if (aPlane.IsNull())
+ return std::shared_ptr<GeomAPI_Shape>();
+
+ // make an infinity face on the plane
+ TopoDS_Shape anInfiniteFace = BRepBuilderAPI_MakeFace(aPlane->Pln()).Shape();
+
+ std::shared_ptr<GeomAPI_Shape> aResult(new GeomAPI_Shape);
+ aResult->setImpl(new TopoDS_Shape(anInfiniteFace));
+ return aResult;
+}