Saturday, November 6, 2010

Selection features, better controlled unfolding

I added some selection features last weekend, and I finally got edge loop selection working and added "edge ring" selection.

Debugging line loop selection:
I just deleted the whole shit and started from scratch again. I did everything the same way as before, and it worked fine...

Edge ring selection:
It's very similar to edge loop selection, it's just the data are the opposite:
I search all the edges that share the same polygon (in case of loop: same vertex) with the current edge. If there are 3 selectable edges (4, including the current one), we can proceed. Get the edge, that doesn't share any vertices (in case of loop: any polygons) with the current edge, and if it's not selected: select it and continue with the algo.

Convert polygon selection to edge border selection:
If bunch of polygons are selected, it will select the borders of it:

Unfolding:
Only unfold selected polygons and it's controlled by selected edges: the algo will split the geometry at the selected edges.

This level of control is still not enough. Simple objects can be unfolded fast and easy, but convex objects not: I still have problems with the chair model. I don't know how would I unfold it with experience with manual unfolding. So I need a way to at least show/advise the user how to unfold at least some general objects.

Okay, I guess it's not clear, so some screenshots:

Unfolding a sphere
edge selection level: selecting one edge

select edge ring feature
 
select edge loop feature

deselecting the "equator" ring: shift+mouse drag selection (note, that "backfacing" edges can be selected, maybe I add "ignore backfacing" feature to edge selection too)

element selection level: select element (thus whole mesh in this case)

unfold feature, and switched to unfold view.