diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-03-05 04:50:18 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-03-05 04:50:18 +0400 |
commit | 4d84e869a0fd540247a99edbfeca24ffb75644cd (patch) | |
tree | 09c2b88dce2b66316f5e17d969170fdfd0cffbbc /source/blender/bmesh/intern/bmesh_mods.h | |
parent | 5f509134ec22102cb00fdc9a623798c149fa43a9 (diff) |
Improvements to bmesh edge rotate
On a user level, edge rotate now works better with multiple edges selected, it wont make zero area faces or rotate edges into existing ones.
With a single edge selected - rotate is less strict and will allow ugly resulting faces but still checks on duplicate edges.
API:
* BM_edge_rotate now takes a flag, to optionally...
** check for existing edge
** splice edge (rotate and merge)
** check for degenerate resulting faces (overlapping geometry, zero area)
** beauty - only rotate to a better fit.
... this allows it to still be used as a low level API function since all checks can be skipped.
* BM_edge_rotate() now works a bit different, it find the new edge rotation before joining the faces - exposed by BM_edge_rotate_calc().
* Added api call bmesh_radial_faceloop_find_vert() - Radial Find a Vertex Loop in Face
Diffstat (limited to 'source/blender/bmesh/intern/bmesh_mods.h')
-rw-r--r-- | source/blender/bmesh/intern/bmesh_mods.h | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/source/blender/bmesh/intern/bmesh_mods.h b/source/blender/bmesh/intern/bmesh_mods.h index d530e9d8666..f3344f2d687 100644 --- a/source/blender/bmesh/intern/bmesh_mods.h +++ b/source/blender/bmesh/intern/bmesh_mods.h @@ -53,8 +53,23 @@ BMVert *BM_edge_split_n(BMesh *bm, BMEdge *e, int numcuts); int BM_face_validate(BMesh *bm, BMFace *face, FILE *err); +void BM_edge_rotate_calc(BMesh *bm, BMEdge *e, int ccw, + BMLoop **r_l1, BMLoop **r_l2); int BM_edge_rotate_check(BMesh *UNUSED(bm), BMEdge *e); -BMEdge *BM_edge_rotate(BMesh *bm, BMEdge *e, int ccw); +int BM_edge_rotate_check_degenerate(BMesh *bm, BMEdge *e, + BMLoop *l1, BMLoop *l2); +int BM_edge_rotate_check_beauty(BMesh *bm, BMEdge *e, + BMLoop *l1, BMLoop *l2); +BMEdge *BM_edge_rotate(BMesh *bm, BMEdge *e, const short ccw, const short check_flag); + +/* flags for BM_edge_rotate */ +enum { + BM_EDGEROT_CHECK_EXISTS = (1 << 0), /* disallow to rotate when the new edge matches an existing one */ + BM_EDGEROT_CHECK_SPLICE = (1 << 1), /* overrides existing check, if the edge already, rotate and merge them */ + BM_EDGEROT_CHECK_DEGENERATE = (1 << 2), /* disallow creating bow-tie, concave or zero area faces */ + BM_EDGEROT_CHECK_BEAUTY = (1 << 3) /* disallow to rotate into ugly topology */ +}; + BMVert *BM_vert_rip(BMesh *bm, BMFace *sf, BMVert *sv); |