if ( validU )
uv = C2d->Value( u );
else
- uv.SetCoord(0.,0.);
+ uv.SetCoord( Precision::Infinite(),0.);
if ( check || !validU )
uvOK = CheckNodeUV( F, n, uv.ChangeCoord(), 10*MaxTolerance( F ),/*force=*/ !validU );
uv = GetUVOnSeam( uv, GetNodeUV( F, n2, 0 ));
}
}
+ else
+ {
+ uvOK = CheckNodeUV( F, n, uv.ChangeCoord(), 10*MaxTolerance( F ));
+ }
if ( check )
*check = uvOK;
double distXYZ[4]) const
{
int shapeID = n->getshapeId();
- if ( force || toCheckPosOnShape( shapeID ))
+ bool infinit = ( Precision::IsInfinite( uv.X() ) || Precision::IsInfinite( uv.Y() ));
+ if ( force || toCheckPosOnShape( shapeID ) || infinit )
{
- double toldis = tol;
- double tolmin = 1.e-7*myMesh->GetMeshDS()->getMaxDim(); // nodes coordinates are stored in float format
- if (toldis < tolmin) toldis = tolmin;
// check that uv is correct
TopLoc_Location loc;
Handle(Geom_Surface) surface = BRep_Tool::Surface( F,loc );
gp_Pnt nodePnt = XYZ( n ), surfPnt(0,0,0);
double dist = 0;
if ( !loc.IsIdentity() ) nodePnt.Transform( loc.Transformation().Inverted() );
- bool infinit = ( Precision::IsInfinite( uv.X() ) || Precision::IsInfinite( uv.Y() ));
if ( infinit ||
(dist = nodePnt.Distance( surfPnt = surface->Value( uv.X(), uv.Y() ))) > tol )
{
int shapeID = n->getshapeId();
if ( force || toCheckPosOnShape( shapeID ))
{
- //double toldis = tol;
- //double tolmin = 1.e-7*myMesh->GetMeshDS()->getMaxDim(); // nodes coordinates are stored in float format
- //if (toldis < tolmin) toldis = tolmin;
- // check that u is correct
TopLoc_Location loc; double f,l;
Handle(Geom_Curve) curve = BRep_Tool::Curve( E,loc,f,l );
if ( curve.IsNull() ) // degenerated edge
distXYZ[0] = dist;
distXYZ[1] = curvPnt.X(); distXYZ[2] = curvPnt.Y(); distXYZ[3]=curvPnt.Z();
}
- if ( dist > tol /*toldis*/ )
+ if ( dist > tol )
{
setPosOnShapeValidity( shapeID, false );
// u incorrect, project the node to the curve
distXYZ[0] = dist;
distXYZ[1] = curvPnt.X(); distXYZ[2] = curvPnt.Y(); distXYZ[3]=curvPnt.Z();
}
- if ( dist > tol /*toldis*/)
+ if ( dist > tol )
{
MESSAGE( "SMESH_MesherHelper::CheckNodeU(), invalid projection" );
- MESSAGE("distance " << dist << " " << tol/*dis*/);
+ MESSAGE("distance " << dist << " " << tol );
return false;
}
// store the fixed U on the edge
#include <GeomAdaptor_Surface.hxx>
#include <Geom_Curve.hxx>
#include <Geom_Surface.hxx>
+#include <Precision.hxx>
#include <TopAbs_ShapeEnum.hxx>
#include <TopExp.hxx>
#include <TopExp_Explorer.hxx>
if (!node->getshapeId() &&
shellNodes.find( node ) == shellNodes.end() ) {
if ( S.ShapeType() == TopAbs_FACE )
- aMeshDS->SetNodeOnFace( node, shapeID );
+ aMeshDS->SetNodeOnFace( node, shapeID,
+ Precision::Infinite(),// <- it's a sign that UV is not set
+ Precision::Infinite());
else {
aMeshDS->SetNodeInVolume( node, shapeID );
shellNodes.insert( node );