Salome HOME
Adding test for bos #41748 [CEA] Issue in interpolation edition
[modules/shaper.git] / src / GeomAlgoAPI / GeomAlgoAPI_Prism.cpp
index 50b2ef2b16cc004b3d1c5d3b197f87962958cd21..eae39590229d4909691e4df9cdf40fc9f8b3093f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2020  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2024  CEA, EDF
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -184,11 +184,11 @@ GeomAlgoAPI_Prism::GeomAlgoAPI_Prism(const GeomShapePtr theBaseShape,
           Handle(Geom_RectangularTrimmedSurface)::DownCast(aSurface);
         aSurface = aTrimSurface->BasisSurface();
       }
-      if(aSurface->DynamicType() != STANDARD_TYPE(Geom_Plane)) {
-        return;
-      }
-      aPlane = Handle(Geom_Plane)::DownCast(aSurface);
-    } else {
+      if (aSurface->DynamicType() == STANDARD_TYPE(Geom_Plane))
+        aPlane = Handle(Geom_Plane)::DownCast(aSurface);
+    }
+
+    if (aPlane.IsNull()) {
       aPlane = aFindPlane.Plane();
       checkOrientation = true;
     }
@@ -416,6 +416,8 @@ void GeomAlgoAPI_Prism::buildByPlanes(const GeomShapePtr             theBaseShap
   TopoDS_Shape aResult = aPrismBuilder->Shape();
 
   BRepBndLib::Add(aResult, aBndBox);
+  aBndBox.Add(aFromPnt->impl<gp_Pnt>());
+  aBndBox.Add(aToPnt->impl<gp_Pnt>());
   Standard_Real aBndBoxSize = aBndBox.CornerMin().Distance(aBndBox.CornerMax());
 
   // Orienting bounding planes.