grafikzeug Posted December 24, 2019 Share Posted December 24, 2019 (edited) Hello good people of the interwebs! I have a VEX (beginner) question. I want to group points of a poligonal mesh based on their acuteness (i.e. how "pointy" they are). Very similar to what the group node allows to do with edges, where one can simply define the minimal edge angle of the two adjacent primitives to decide if an edge is included in the group. I need a similar thing, but with points and a point group and taking into consideration the angles between the three (or more) adjacent edges. (I imagine a loop and the neighbor and neighbor count functions and some angle comparison wizardry but I can't figure out how to tie all that together in any meaningful way Houdini can understand.) Your help is very much appreciated. Beautiful holidays to you and sweet learning by your handsome examples to me! Felix Edited December 24, 2019 by grafikzeug Quote Link to comment Share on other sites More sharing options...
markinglevfx Posted December 24, 2019 Share Posted December 24, 2019 Does it have to be a VEX solution? Because you can measure the curvature of each point using the measure SOP and come to the same conclusion. In the measure node: set the element type to points, and measure to curvature. Then you can isolate the pointy points with a point wrangle and setting a threshold value: if(@curvature > 2.5){ i@pointy = 1; } Quote Link to comment Share on other sites More sharing options...
konstantin magnus Posted December 24, 2019 Share Posted December 24, 2019 (edited) Hi Felix, first you would iterate over all neighbours() with foreach(), adding all dot products of the point's and the neighbors' normals. Then you divide this sum by the number of its neighbors. // INPUT float thresh = chf('threshold'); // PROCESS float d = 0.0; int nbs[] = neighbours(0, i@ptnum); foreach(int nb; nbs){ vector nml_nb = point(0, 'N', nb); d += dot(v@N, nml_nb); } d /= len(nbs); // OUTPUT f@acuteness = d; i@group_acute = thresh > d; v@Cd = hsvtorgb(set(1.0 - d,1,1)); There is a a bit on curvature and the likes in the documentation about the new measure SOP: https://www.sidefx.com/docs/houdini/nodes/sop/measure.html acuteness.hipnc Edited December 24, 2019 by konstantin magnus Quote Link to comment Share on other sites More sharing options...
grafikzeug Posted December 25, 2019 Author Share Posted December 25, 2019 Hey Mark and Konstantin, your responses are very valuable to me. The measure SOP approach is useful because it's so straightforward (and showing me that there are many thins readily available) and the VEX solution is a perfect learning opportunity for me. Great! Thanks for the time you put into helping me! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.