From 987cc89eb93d1b6e8cc673bc75668bee712c1f9e Mon Sep 17 00:00:00 2001 From: eap Date: Thu, 19 May 2011 08:09:14 +0000 Subject: [PATCH] 0020982: EDF 1547 SMESH: Creation of non-conformal quadratic pyramids / note 0011144 Use GeomAdaptor_Surface instead of BRepAdaptor_Surface which gives surface UV limits according to face boundaries (edges) instead of the whole surface --- src/SMESH/SMESH_MesherHelper.cxx | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/SMESH/SMESH_MesherHelper.cxx b/src/SMESH/SMESH_MesherHelper.cxx index e6e832b76..98ef58d82 100644 --- a/src/SMESH/SMESH_MesherHelper.cxx +++ b/src/SMESH/SMESH_MesherHelper.cxx @@ -40,6 +40,7 @@ #include #include #include +//#include #include #include #include @@ -225,9 +226,15 @@ void SMESH_MesherHelper::SetSubShape(const TopoDS_Shape& aSh) for ( TopExp_Explorer eF( aSh, TopAbs_FACE ); eF.More(); eF.Next() ) { const TopoDS_Face& face = TopoDS::Face( eF.Current() ); - BRepAdaptor_Surface surface( face ); - if ( surface.IsUPeriodic() || surface.IsVPeriodic() ) + TopLoc_Location loc; + Handle(Geom_Surface) surface = BRep_Tool::Surface( face, loc ); + + if ( surface->IsUPeriodic() || surface->IsVPeriodic() ) { + //while ( surface->IsKind(STANDARD_TYPE(Geom_RectangularTrimmedSurface ))) + //surface = Handle(Geom_RectangularTrimmedSurface)::DownCast( surface )->BasisSurface(); + GeomAdaptor_Surface surf( surface ); + for (TopExp_Explorer exp( face, TopAbs_EDGE ); exp.More(); exp.Next()) { // look for a seam edge @@ -239,13 +246,13 @@ void SMESH_MesherHelper::SetSubShape(const TopoDS_Shape& aSh) if ( Abs( uv1.Coord(1) - uv2.Coord(1) ) < Abs( uv1.Coord(2) - uv2.Coord(2) )) { myParIndex |= U_periodic; - myPar1[0] = surface.FirstUParameter(); - myPar2[0] = surface.LastUParameter(); + myPar1[0] = surf.FirstUParameter(); + myPar2[0] = surf.LastUParameter(); } else { myParIndex |= V_periodic; - myPar1[1] = surface.FirstVParameter(); - myPar2[1] = surface.LastVParameter(); + myPar1[1] = surf.FirstVParameter(); + myPar2[1] = surf.LastVParameter(); } // store seam shape indices, negative if shape encounters twice int edgeID = meshDS->ShapeToIndex( edge ); -- 2.39.2