Jump to content

Select points by mutual normal angle


Recommended Posts

Hello everyone, rookie here... I’m trying to get a point group from whose mutual normal angle are less than let’s say 45 degree on this geometry (to be more clear, something like occlusion effect). Now I shrink the point to this area to prevent the calculation running on all the points, but I don’t know how to go further. And I must keep this geometry intact not divide it into 2 spheres. Please anyone could enlight me a bit? Tons of thanks.

image.thumb.png.e455ec18b919094ccfa4b0a73dd02997.png

Link to comment
Share on other sites

I don't entirely understand the question, but here are some pointers that might help you:

-you need have points normal computed first (just in case if they don't exist in the first place), you can use "Normal" node to do that, so after you load the geo, use "convert" node if needed (eg. to unpack them), then "Normal" node (make sure it's being set to point and not vertex)--> now you have normal attributes on each point

-when you use pcopen : I remember there are different ways to use this function, look for the one that returns a list of point index(es), so the result should be logically similar to this : current point has 7 points near it and their indices are [45,64,...] 

-Now, use these indices to get the normal of each point, a vex could should be like vector other_normal = point(geoself(),"N",indices)...ok that is a little bit short description! the idea is to loop over each index and use point vex function to get its normal

-Then, for each normal you return use use dot product to compute the cosine angle (make sure that normals have unit length first), then have a test like if dot()<cos(45) flag your point (you can color them or add them to a group)

Okay, there are so many fill in blanks in the above steps :) I know! they are just pointers. BTW, this is a manual way, I don't remember having a sop node that does that automatically!

good luck

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...