if ( nbSegments )
edgeLength /= nbSegments;
}
- if ( _hypMaxElementArea )
+ else if ( _hypMaxElementArea )
{
double maxArea = _hypMaxElementArea->GetMaxArea();
edgeLength = sqrt(2. * maxArea/sqrt(3.0));
}
+ else
+ {
+ // set edgeLength by a longest segment
+ double maxSeg2 = occgeo.GetBoundingBox().Diam();
+ for ( int iW = 0; iW < nbWires; ++iW )
+ {
+ const UVPtStructVec& points = wires[ iW ]->GetUVPtStruct();
+ gp_Pnt pPrev = SMESH_TNodeXYZ( points[0].node );
+ for ( size_t i = 1; i < points.size(); ++i )
+ {
+ gp_Pnt p = SMESH_TNodeXYZ( points[i].node );
+ maxSeg2 = Max( maxSeg2, p.SquareDistance( pPrev ));
+ pPrev = p;
+ }
+ }
+ edgeLength = sqrt( maxSeg2 ) * 1.05;
+ }
if ( edgeLength < DBL_MIN )
edgeLength = occgeo.GetBoundingBox().Diam();
netgen::mparam.maxh = edgeLength;
netgen::mparam.minh = aMesher.GetDefaultMinSize( aShape, netgen::mparam.maxh );
netgen::mparam.quad = _hypQuadranglePreference ? 1 : 0;
- netgen::mparam.grading = 0.7; // very coarse mesh by default
+ netgen::mparam.grading = 0.4; // Moderate fineness by default
}
occgeo.face_maxh = netgen::mparam.maxh;
netgen::mparam.maxh = Max( netgen::mparam.maxh, size );
}
}
+ //cerr << "min " << netgen::mparam.minh << " max " << netgen::mparam.maxh << endl;
netgen::mparam.minh *= 0.9;
netgen::mparam.maxh *= 1.1;