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)
* 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
//=======================================================================
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 ) -
//=======================================================================
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 ) -