From 1ac99281d872b626db27f46c34839971c380b993 Mon Sep 17 00:00:00 2001 From: skl Date: Fri, 19 Feb 2010 14:38:11 +0000 Subject: [PATCH] Changes for bug 0020705. --- src/StdMeshers/StdMeshers_FaceSide.cxx | 65 +++++++++++++++++++++++++- 1 file changed, 63 insertions(+), 2 deletions(-) diff --git a/src/StdMeshers/StdMeshers_FaceSide.cxx b/src/StdMeshers/StdMeshers_FaceSide.cxx index 55ff0aa3b..e464d0f12 100644 --- a/src/StdMeshers/StdMeshers_FaceSide.cxx +++ b/src/StdMeshers/StdMeshers_FaceSide.cxx @@ -49,6 +49,9 @@ #include #include +#include +#include + #include #include "utilities.h" @@ -190,6 +193,28 @@ StdMeshers_FaceSide::StdMeshers_FaceSide(const SMDS_MeshNode* theNode, } } + +//======================================================================= +//function : IsUniform +//purpose : auxilary function +//======================================================================= +bool IsUniform(const Handle(Geom2d_Curve)& C2d, double fp, double lp) +{ + //cout<<"IsUniform fp = "<Value( myFirst[i] * ( 1 - r ) + myLast[i] * r ); + + double par = myFirst[i] * ( 1 - r ) + myLast[i] * r; + + // check parametrization of curve + if( !IsUniform( myC2d[i], myFirst[i], myLast[i] ) ) { + double fp,lp; + TopLoc_Location L; + Handle(Geom_Curve) C3d = BRep_Tool::Curve(myEdge[i],L,fp,lp); + fp = myFirst[i]; + lp = myLast[i]; + GeomAdaptor_Curve A3dC( C3d ); + double aLen3d = GCPnts_AbscissaPoint::Length( A3dC, fp, lp ); + double aLen3dU = aLen3d*r; + if(fp>lp) { + aLen3dU = -aLen3dU; + } + GCPnts_AbscissaPoint AbPnt( A3dC, aLen3dU, fp ); + if( AbPnt.IsDone() ) { + par = AbPnt.Parameter(); + } + } + return myC2d[ i ]->Value(par); + } //return gp_Pnt2d( 1e+100, 1e+100 ); return myDefaultPnt2d; -- 2.30.2