Salome HOME
0021086: EDF 1686 GEOM: Bad triangle in a BLSURF + GHS3D mesh after
authoreap <eap@opencascade.com>
Thu, 26 May 2011 16:22:57 +0000 (16:22 +0000)
committereap <eap@opencascade.com>
Thu, 26 May 2011 16:22:57 +0000 (16:22 +0000)
converting to quadratic (Bug1686_Convert2Quad.py)
   in GetMiddleUV(), get period from a base surface of Geom_RectangularTrimmedSurface

src/SMESH/SMESH_MesherHelper.cxx

index 9199f20a5cc70d655574ddf2d8fb049a80322d91..ec1ec85ce8e4a810b929f116d4cf83c719e361aa 100644 (file)
@@ -40,7 +40,7 @@
 #include <GeomAPI_ProjectPointOnCurve.hxx>
 #include <GeomAPI_ProjectPointOnSurf.hxx>
 #include <Geom_Curve.hxx>
-//#include <Geom_RectangularTrimmedSurface.hxx>
+#include <Geom_RectangularTrimmedSurface.hxx>
 #include <Geom_Surface.hxx>
 #include <ShapeAnalysis.hxx>
 #include <TopExp.hxx>
@@ -735,7 +735,14 @@ gp_XY SMESH_MesherHelper::GetMiddleUV(const Handle(Geom_Surface)& surface,
                                       const gp_XY&                p1,
                                       const gp_XY&                p2)
 {
-  return applyIn2D( surface, p1, p2, & AverageUV );
+  // NOTE:
+  // the proper place of getting basic surface seems to be in applyIn2D()
+  // but we put it here to decrease a risk of regressions just before releasing a version
+  Handle(Geom_Surface) surf = surface;
+  while ( !surf.IsNull() && surf->IsKind(STANDARD_TYPE(Geom_RectangularTrimmedSurface )))
+    surf = Handle(Geom_RectangularTrimmedSurface)::DownCast( surf )->BasisSurface();
+
+  return applyIn2D( surf, p1, p2, & AverageUV );
 }
 
 //=======================================================================