Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2012-03-05 04:50:18 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-03-05 04:50:18 +0400
commit4d84e869a0fd540247a99edbfeca24ffb75644cd (patch)
tree09c2b88dce2b66316f5e17d969170fdfd0cffbbc /source/blender/bmesh/intern/bmesh_structure.c
parent5f509134ec22102cb00fdc9a623798c149fa43a9 (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_structure.c')
-rw-r--r--source/blender/bmesh/intern/bmesh_structure.c29
1 files changed, 24 insertions, 5 deletions
diff --git a/source/blender/bmesh/intern/bmesh_structure.c b/source/blender/bmesh/intern/bmesh_structure.c
index ad6a8a615e3..abce7780e79 100644
--- a/source/blender/bmesh/intern/bmesh_structure.c
+++ b/source/blender/bmesh/intern/bmesh_structure.c
@@ -201,15 +201,13 @@ void bmesh_disk_edge_remove(BMEdge *e, BMVert *v)
dl1->next = dl1->prev = NULL;
}
-/*
- * bmesh_disk_edge_next
+/**
+ * \brief Next Disk Edge
*
* Find the next edge in a disk cycle
*
- * Returns -
- * Pointer to the next edge in the disk cycle for the vertex v.
+ * \return Pointer to the next edge in the disk cycle for the vertex v.
*/
-
BMEdge *bmesh_disk_edge_next(BMEdge *e, BMVert *v)
{
if (v == e->v1)
@@ -453,6 +451,27 @@ BMLoop *bmesh_radial_faceloop_find_next(BMLoop *l, BMVert *v)
return l;
}
+/* NOTE: this function has not been used or tested - so take care but it should work ok,
+ * I wrote it for some tool that ended up not using it, however this seems like a reasonable
+ * thing to be able to find the loop between a vertex and a face so keeping - campbell */
+/**
+ * \brief Radial Find a Vertex Loop in Face
+ *
+ * Finds the loop used which uses \a v in face loop \a l
+ */
+BMLoop *bmesh_radial_faceloop_find_vert(BMFace *f, BMVert *v) /* name is a bit awkward */
+{
+ BMLoop *l_iter, *l_first;
+ if (v->e && (l_iter = l_first = v->e->l)) {
+ do {
+ if (l_iter->v == v && l_iter->f == f) {
+ return l_iter;
+ }
+ } while ((l_iter = l_iter->radial_next) != l_first);
+ }
+ return NULL;
+}
+
int bmesh_radial_length(BMLoop *l)
{
BMLoop *l_iter = l;