Hi,
have you resolved the problem?
I also need to compute normals at each of the vertices from triangulation.
I have tried in these ways without great results:
1) Using method HasNormals of Poly_Triangulation class:
Handle(Poly_Triangulation) aTri = BRep_Tool::Triangulation(static_cast(face), aLocation);
if( aTri.IsNull() )
{
std::cout << "Error tessellating!!!" << std::endl;
return false;
}
if(aTri->HasNormals())
{
for(int i = 1; i < aTri->Normals().Length()+1; i=i+3)
{
aTri->Normals().Value(i);
aTri->Normals().Value(i+1);
aTri->Normals().Value(i+2);
}
}
aTri->HasNormals() give me always false. Is there a manner to force OpenCascade to calculate normals? Is it enabled only for some cad formats? I'm working with iges at the moment.
2) Following another post on this forum [1] i have tried to calculate normals (one for every triangle) but some normals seems reversed and reversing all when orientation is TopAbs_REVERSED doesn't resolve the problem (see attachment).
3) Has someone any suggestion to do the same thing using other functions? For example using (u, v) surface representation utilities [2]?
4) I think that presentation module of OpenCascade must calculate these normals somewhere. Could you give me some hints on how to find some pieces of code doing this?
Thanks in advance.
Regards
Commenter-1
[1] http://www.opencascade.org/org/forum/thread_12568/
[2] http://www.opencascade.org/org/forum/thread_21118/