Jump to content
Sign in to follow this  
Masoud

How could I force point normals to facing to a correct direction?

Recommended Posts

Hello;

Please take a look at image bellow (and attached hip file).

I would like to expand boundary of a flat geometry  (without adding any new points), so I tried to use Peak SOP. The problem is I can't align point normals to a right direction.

Normals.hip

Normals.jpg

Edited by Masoud

Share this post


Link to post
Share on other sites

Here  is  how  I  have  handled  that  in  the  past.  Use  a  tube  or  ring  around  the  exterior  and  transfer  the  normals  from  the  outer  object  to  the  inner  one.

Untitled-1.jpg

After  looking  at  the  image,  I  guess  that  is  not  right  either..?

ap_Normals.hiplc

Edited by Atom

Share this post


Link to post
Share on other sites

What  about  something  like  this?

Use  a  polyextrude  to  generate  vertex  normals,  then   use  a  wrangle  to  throw  away  the  newly  extruded  points?

Untitled-1.jpg

ap_Normals.hiplc

Edited by Atom

Share this post


Link to post
Share on other sites
On 2/23/2019 at 4:58 PM, Atom said:

Here  is  how  I  have  handled  that  in  the  past.  Use  a  tube  or  ring  around  the  exterior  and  transfer  the  normals  from  the  outer  object  to  the  inner  one.

Untitled-1.jpg

After  looking  at  the  image,  I  guess  that  is  not  right  either..?

ap_Normals.hiplc

 

Hi "Atom"; normals are not correct.

Share this post


Link to post
Share on other sites
On 2/23/2019 at 5:09 PM, Atom said:

What  about  something  like  this?

Use  a  polyextrude  to  generate  vertex  normals,  then   use  a  wrangle  to  throw  away  the  newly  extruded  points?

Untitled-1.jpg

ap_Normals.hiplc

 

I don't want to change geometry topology (I would like to keep point numbers intact).

Share this post


Link to post
Share on other sites

Eventually, you'll catch on to the workflow. All you have to do is promote the vertex normals, back to point and then attribute transfer them onto the original geometry, thus preserving it.

Untitled-1.jpg

Share this post


Link to post
Share on other sites

Put an Ends SOP before your polyframe and set 'close u' to "unroll", essentially converting your geo to a curve. Then put another Ends SOP after the polyframe and set 'close u' to "close" to close the polygon again.

Share this post


Link to post
Share on other sites

Yep, that works too. I had to add a wrangle to flip the normals back around and a reverse.

 

Untitled-1.jpg

Edited by Atom

Share this post


Link to post
Share on other sites
Posted (edited)

This seemed like an interesting VEX challenge and I wanted to give it a go :)

 

Searched for a solution and found this https://stackoverflow.com/questions/14066933/direct-way-of-computing-clockwise-angle-between-2-vectors

Used that in a wrangle node to determine if a corner is convex or concave and added some other stuff and so far it seems to work.

For now, the solution works only for closed curves and treats them as 2D shapes on a XZ plane.

compute_normals.png

compute_normals.hiplc

Edited by berglte
  • Like 2

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×