- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Normal of a face with left handed uv surface
[ Edited ]- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
01-10-2012 01:41 AM - last edited on 01-27-2012 09:28 AM
Hi,
I need some help in calculating the normal of a face - with left handed uv surface.
The following code works correctly edutalent for all faces, except the ones with left handed surfaces.
Thanks,
Hari Polisetty
Face *face; // Input
SPApar_pos uv(u,v); // Input
SPAunit_vector normal; // Output
const surface& surf = face->geometry()->equation();
normal = surf.eval_normal(uv);
if(face->sense()==REVERSED)
normal = - normal;
Re: Normal of a face with left handed uv surface
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
01-10-2012 09:30 AM
I think your code is almost right, you just need to take into account both sense bits (the one on the face and the one on the surface). The logic with sense bits can be complex, but I think the problem could be corrected by simply adding the following lines of code after what you have done.
if( surf.left_handed_uv() )
{
normal = - normal
}
Please post if this doesn't work or if you've additional questions.
Eric Zenk
Re: Normal of a face with left handed uv surface
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
01-10-2012 10:19 AM
I think that this code will be more simple and clear:
if(face->sense(surf.left_handed_uv()) == REVERSED)
{
normal = - normal;
}Or this:
if(face->sense(surf.left_handed_uv()))
{
normal = - normal;
}

