Hard edges to edge group?

   744   4   0
User Avatar
Member
1075 posts
Joined: 4月 2017
Offline
Hi!

If I have a geo with vertex normals, is there a way to get an edge group containing only the hard edges? Currently, I have a way to group all the points that have different vertex normals but when I use the group_promote sop, I get some problem areas.

Also, I DON'T want to group by edge angle. I want to group edges purely by the vertex normals already existing on my geo.

-Olivier
Edited by olivierth - 2024年10月4日 16:52:41

Attachments:
Houdini_hardEdges_01.JPG (57.7 KB)
Houdini_hardEdges_02.JPG (59.2 KB)

User Avatar
Member
8042 posts
Joined: 9月 2011
Offline
have you tried using "N" with the group from attribute boundary node?
User Avatar
Member
1075 posts
Joined: 4月 2017
Offline
arg... sadly, that doesn't work.
Edited by olivierth - 2024年10月5日 01:19:44

Attachments:
Houdini_hardEdges_03.JPG (88.5 KB)

User Avatar
Member
495 posts
Joined: 7月 2005
Offline
Here is one way which should work:
for each edge (point pair) -> get both half edges -> get both prims (for each half edge) -> get all vertices for each edge point -> find for each prim the corresponding vertex for each vertexlist -> now you have two vertex pairs for each point containing the vertices of both prims -> now you can compare the vertex normals and if the angles of both pairs are greater than a threshold value put the edge into the group.
Edited by Aizatulin - 2024年10月5日 03:49:51
User Avatar
Member
153 posts
Joined: 8月 2017
Offline
Play with this.
//#include <hedgedeep.vfl>

int hedge_nextequiv = hedge_nextequiv(0, @elemnum);
if ( chi("../includeunshared") ) {
    if ( @elemnum < hedge_nextequiv || hedge_nextequiv == -1 ) return;//includeunshared
} else {
    if ( @elemnum <= hedge_nextequiv || hedge_nextequiv == -1 ) return;//excludeunshared
}

// int hedge_dstpoint = vertexpoint(0, hedge_nextequiv);
int hedge_dstpoint = hedge_dstpoint(0, @vtxnum);
// printf('\n%d', hedge_srcpoint);

// if ( hedge_dstpoint != 57 ) return;
// printf('\n%d', @ptnum);

string edgeGrps[] = split(chs("../edgeGroup"));
foreach(string edgeGrp; edgeGrps) {
    if ( !inedgegroup(0, edgeGrp, @ptnum, hedge_dstpoint) ) return;
}

vector posdst = point(0, 'P', hedge_dstpoint);

vector dir = normalize(posdst - v@P);

float dot = dot(dir, normalize(chv('../dir')));
dot = chi("../bidir") ? abs(dot) : dot;
i@outgrp = ( dot > chf('../threshold') ) ^ chi("../reverseGroup");

Attachments:
hedgedeep.vfl (5.4 KB)

Conservation of Momentum
  • Quick Links