22770: SMESH: Bi-quadratic mesh convert with medium nodes on geometry

This commit is contained in:
eap 2014-10-10 15:23:38 +04:00
parent 52f2003b81
commit e16f6412db
2 changed files with 22 additions and 12 deletions

View File

@ -594,14 +594,24 @@ gp_XY SMESH_MesherHelper::GetNodeUV(const TopoDS_Face& F,
Handle(Geom_Surface) S = BRep_Tool::Surface(F,loc);
Standard_Boolean isUPeriodic = S->IsUPeriodic();
Standard_Boolean isVPeriodic = S->IsVPeriodic();
gp_Pnt2d newUV = uv;
if ( isUPeriodic || isVPeriodic ) {
Standard_Real UF,UL,VF,VL;
S->Bounds(UF,UL,VF,VL);
if(isUPeriodic)
uv.SetX( uv.X() + ShapeAnalysis::AdjustToPeriod(uv.X(),UF,UL));
if(isVPeriodic)
uv.SetY( uv.Y() + ShapeAnalysis::AdjustToPeriod(uv.Y(),VF,VL));
if ( isUPeriodic )
newUV.SetX( uv.X() + ShapeAnalysis::AdjustToPeriod(uv.X(),UF,UL));
if ( isVPeriodic )
newUV.SetY( uv.Y() + ShapeAnalysis::AdjustToPeriod(uv.Y(),VF,VL));
}
if ( n2 )
{
gp_Pnt2d uv2 = GetNodeUV( F, n2, 0, check );
if ( isUPeriodic && Abs( uv.X()-uv2.X() ) < Abs( newUV.X()-uv2.X() ))
newUV.SetX( uv.X() );
if ( isVPeriodic && Abs( uv.Y()-uv2.Y() ) < Abs( newUV.Y()-uv2.Y() ))
newUV.SetY( uv.Y() );
}
uv = newUV;
}
}
else if(Pos->GetTypeOfPosition()==SMDS_TOP_VERTEX)

View File

@ -167,15 +167,15 @@ class SMESH_EXPORT SMESH_MesherHelper
* a0 p0 a1
*/
inline static gp_XY calcTFI(double x, double y,
const gp_XY a0,const gp_XY a1,const gp_XY a2,const gp_XY a3,
const gp_XY p0,const gp_XY p1,const gp_XY p2,const gp_XY p3);
const gp_XY& a0,const gp_XY& a1,const gp_XY& a2,const gp_XY& a3,
const gp_XY& p0,const gp_XY& p1,const gp_XY& p2,const gp_XY& p3);
/*!
* \brief Same as "gp_XY calcTFI(...)" but in 3D
*/
inline static gp_XYZ calcTFI(double x, double y,
const gp_XYZ a0,const gp_XYZ a1,const gp_XYZ a2,const gp_XYZ a3,
const gp_XYZ p0,const gp_XYZ p1,const gp_XYZ p2,const gp_XYZ p3);
const gp_XYZ& a0,const gp_XYZ& a1,const gp_XYZ& a2,const gp_XYZ& a3,
const gp_XYZ& p0,const gp_XYZ& p1,const gp_XYZ& p2,const gp_XYZ& p3);
/*!
* \brief Count nb of sub-shapes
* \param shape - the shape
@ -725,8 +725,8 @@ public:
//=======================================================================
inline gp_XY
SMESH_MesherHelper::calcTFI(double x, double y,
const gp_XY a0,const gp_XY a1,const gp_XY a2,const gp_XY a3,
const gp_XY p0,const gp_XY p1,const gp_XY p2,const gp_XY p3)
const gp_XY& a0,const gp_XY& a1,const gp_XY& a2,const gp_XY& a3,
const gp_XY& p0,const gp_XY& p1,const gp_XY& p2,const gp_XY& p3)
{
return
((1 - y) * p0 + x * p1 + y * p2 + (1 - x) * p3 ) -
@ -735,8 +735,8 @@ SMESH_MesherHelper::calcTFI(double x, double y,
//=======================================================================
inline gp_XYZ
SMESH_MesherHelper::calcTFI(double x, double y,
const gp_XYZ a0,const gp_XYZ a1,const gp_XYZ a2,const gp_XYZ a3,
const gp_XYZ p0,const gp_XYZ p1,const gp_XYZ p2,const gp_XYZ p3)
const gp_XYZ& a0,const gp_XYZ& a1,const gp_XYZ& a2,const gp_XYZ& a3,
const gp_XYZ& p0,const gp_XYZ& p1,const gp_XYZ& p2,const gp_XYZ& p3)
{
return
((1 - y) * p0 + x * p1 + y * p2 + (1 - x) * p3 ) -