Hard edges to edge group?
657 4 0- olivierth
- Member
- 1074 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
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
- jsmack
- Member
- 8038 posts
- Joined: 9月 2011
- Offline
- olivierth
- Member
- 1074 posts
- Joined: 4月 2017
- Offline
- Aizatulin
- 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.
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
- cncverkstad
- Member
- 152 posts
- Joined: 8月 2017
- Online
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");
Conservation of Momentum
-
- Quick Links