Jump to content

selecting acute points by angle threshold


grafikzeug

Recommended Posts

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

happrentice_2019-12-24_13-42-35_jGn.png

Edited by grafikzeug
Link to comment
Share on other sites

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; 
}

 

Link to comment
Share on other sites

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));

acuteness.jpg.2e8572205f5ec15cec9ac112f37c79a2.jpg

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 by konstantin magnus
Link to comment
Share on other sites

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!

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...