I would like to group all primitives that are:
* directly adjacent to each other
* share the same normal with x% of possible deviation
My attempts so far worked with finding primitives with the same normal (using the partition sop), however, it's not really optimal and I fail to combine this with only adjacent primitives. Any help is greatly appreciated.
Group adjacent primitives with similar Normal
2456 2 2- 8BitBeard
- Member
- 26 posts
- Joined: June 2016
- Offline
- Konstantin Magnus
- Member
- 670 posts
- Joined: Sept. 2013
- Online
8BitBeard
share the same normal with x% of possible deviation
vector normal = chv('normal'); float threshold = chf('threshold'); // compare user normals against surface normals float compare = distance(@N, normal); // assign to group if within threshold if(compare < threshold){ setprimgroup(0, "angle_select", @ptnum, 1, "set"); }
8BitBeardhttps://sidefx.com/forum/topic/48424/ [sidefx.com]
directly adjacent to each other
https://procegen.konstantinmagnus.de/ [procegen.konstantinmagnus.de]
- Konstantin Magnus
- Member
- 670 posts
- Joined: Sept. 2013
- Online
Regarding adjacent primitives primpoints will tell you what points are connected to the selected prim. feeding those points into a pointsprim function will give you all the prims connected to those points. by comparing the prim normals you can restrict this expansion. put both steps into a for loop to increase the spread.
I attached a little tool that hopefully does the job.
I attached a little tool that hopefully does the job.
Edited by Konstantin Magnus - April 25, 2017 13:14:46
https://procegen.konstantinmagnus.de/ [procegen.konstantinmagnus.de]
-
- Quick Links