// find UV of the center of triangle on geomFace
SMESH_MesherHelper helper( mesh );
+ BRepAdaptor_Surface surface( geomFace );
gp_XY UV(0,0);
const SMDS_MeshNode* nodes[3] = { node1, node2, node3 };
for ( int n = 0; n < 3; ++n )
{
- const SMDS_MeshNode* node = nodes[n]
+ const SMDS_MeshNode* node = nodes[n];
gp_XY uv = helper.GetNodeUV( geomFace, node );
// check that uv is correct
gp_Pnt nodePnt ( node->X(), node->Y(), node->Z() );
double tol = BRep_Tool::Tolerance( geomFace );
- BRepAdaptor_Surface surface( geomFace );
if ( nodePnt.Distance( surface.Value( uv.X(), uv.Y() )) > 2 * tol ) {
// project node onto geomFace to get right UV
GeomAPI_ProjectPointOnSurf projector( nodePnt, surface.Surface().Surface() );
UV += uv / 3.;
}
// normale to face at node1
+ gp_Pnt node1Pnt ( node1->X(), node1->Y(), node1->Z() );
gp_Pnt node2Pnt ( node2->X(), node2->Y(), node2->Z() );
gp_Pnt node3Pnt ( node3->X(), node3->Y(), node3->Z() );
gp_Vec vec12( node1Pnt, node2Pnt );