Select unshared edges (border) from a point

   9531   9   3
User Avatar
Member
50 posts
Joined: Nov. 2016
Offline
I have grouped a point at the border of a mesh and i want to select only the unshared edges loop that my selected point is a part of. But there is a caveat! My mesh is triangulated and has unpleasent topology. The pictures give an example of what I want to do.
Edited by Thunderbeast - July 28, 2017 09:39:33

Attachments:
Capture2.PNG (382.4 KB)
Capture.PNG (347.1 KB)

User Avatar
Member
471 posts
Joined: Nov. 2013
Offline
Hello.
Use group promote node to convert your point group to edge group which is unshared based on your second image.
User Avatar
Member
50 posts
Joined: Nov. 2016
Offline
Nima, you didn't understand what I wanted to say (or I didn't explain it well enough). I want to get from picture 1 to picture 2
Essentially I want to procedurally find a specific unshared edges loop/border based on a specific point. I have figured out how to find the point I need, but I don't know how to grow the selection to a make a whole loop or make a group node find an unshared edges loop/border that only that point connects to. (doesn't matter if its points or edges since i can convert to one another)
User Avatar
Member
471 posts
Joined: Nov. 2013
Offline
Okay, I got it.
I uploaded simple HIP file for you.
Ask your question about the HIP if you have.
Hope this helps.

Attachments:
Unshared Edges.hip (59.8 KB)

User Avatar
Member
50 posts
Joined: Nov. 2016
Offline
That won't work for me because the loop I need to select in my scene is a high poly sculpt, the cylinder in the pictures was just a simple reference. The picture bellow is the actual edge loop. This specific sculpt has quads only but I want my little asset to work for any messy topology.
Currently I am reading into half-edges and they look promising but I am not there yet.

Attachments:
Capture.PNG (430.6 KB)

User Avatar
Member
555 posts
Joined: Feb. 2017
Offline
here's an easy solution but not foolproof…if your many borders are not too close to each other then this works fine, just select your hero point and dial up the tolerance to get your loop.
(your hero point does not actually have to be on an open edge loop)

Of course, when you have 2 loops close together…it may not work.

I know the logic for a foolproof solution but I'm not a coder….maybe someone can do this:

01) in the group SOP to define borders, enable Create Boundary Groups…so say in my case I named the group as borders…with Create Boundary Groups on, it will create extra groups as borders__0,1,2….etc…ie. it will create separate groups for separate holes.

02) in a wrangle, check all groups with names borders__*, using the function haspoint, if it has the hero point..then select all points in that group.

(naturally, this method DOES require the hero point to be on an open edge loop)
Edited by vusta - July 31, 2017 05:07:00

Attachments:
SelectHeroLoop.hipnc (109.7 KB)

User Avatar
Member
50 posts
Joined: Nov. 2016
Offline
Yeah, that totally works! Thanks vusta.
But I am stubborn and I want to create the foolproof way. Currently I am thinking of going through all half edges of a point until i find one that doesn't have an equivalent then using its destination point to to the same until i get a destination point that is equal to the my first source point of a half edge. And of course place the points in a group or attribute along the way. I think I found all the vex functions I need (best place to think? the gym ) and now I will try to do it. And of course I will give an update if it works.
User Avatar
Member
555 posts
Joined: Feb. 2017
Offline
great but i wouldn't mind seeing some guru doing a wrangle with the group names…I have no clue on them…
User Avatar
Member
50 posts
Joined: Nov. 2016
Offline
I wouldn't mind that either . Initially I wanted to split a group that contains all unshared edge loops into its own group loops but I couldn't figure it out for messy topology.
User Avatar
Member
50 posts
Joined: Nov. 2016
Offline
I made the loop and works like a charm! Oddly enough this is my first solo full-fledged code that isn't 5 line script. I also figured out how to isolate the desired points a lot easier with less vex… but I had to finish the code heavier version!

So here is how I did it:
int is_pt_grp = inpointgroup(0, "pt_starter", @ptnum);

if (is_pt_grp==1)
{

int src = @ptnum;
int end_pt= -1; //-1 so the first loop can start
int pt = src; //destination point and source to look which edge is unshared

int loop[]; // border loop array
int unshared_edge;
int unshared_edge_check = -1;

while (src != end_pt)//the loop will run untill it finds an unshared edge with a destination point that equals our first source point
{
setpointgroup(0, "loop", pt, 1, "set");
unshared_edge = pointhedge(0, pt);
unshared_edge_check = hedge_equivcount(0, unshared_edge);// either 1 or 2

//Goes to the next half edge with the same source point, until it finds an edge that doesn't have an equivalent -it's unshared/border edge
while (unshared_edge_check != 1)
{
unshared_edge = pointhedgenext(0, unshared_edge);
unshared_edge_check = hedge_equivcount(0, unshared_edge);
}

append(loop, pt);
pt = hedge_dstpoint(0, unshared_edge);//to carry on the loop
end_pt = pt; //this will stop the loop if true


}

}
Edited by Thunderbeast - Aug. 5, 2017 17:24:07
  • Quick Links