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>2021-01-29 03:44:08 +0300
committerCampbell Barton <ideasman42@gmail.com>2021-01-29 03:44:08 +0300
commit3e5091bb2148a9fd0b950e3f1b9ebe52ba60ff8d (patch)
treef0d8791e5183a68debaed8bcee57dc42df6b9c0c /source/blender/bmesh
parentf560dc689227a23ffa815e35a890e4e01c20fcb1 (diff)
parent1e355b0992a68d108ab76ae5daf13e571a5d4fa7 (diff)
Merge branch 'blender-v2.92-release'
Diffstat (limited to 'source/blender/bmesh')
-rw-r--r--source/blender/bmesh/intern/bmesh_walkers_impl.c65
1 files changed, 64 insertions, 1 deletions
diff --git a/source/blender/bmesh/intern/bmesh_walkers_impl.c b/source/blender/bmesh/intern/bmesh_walkers_impl.c
index 7d56e560275..35350383e49 100644
--- a/source/blender/bmesh/intern/bmesh_walkers_impl.c
+++ b/source/blender/bmesh/intern/bmesh_walkers_impl.c
@@ -863,7 +863,70 @@ static void bmw_EdgeLoopWalker_begin(BMWalker *walker, void *data)
lwalk->is_boundary = BM_edge_is_boundary(e);
lwalk->is_single = (lwalk->is_boundary && bm_edge_is_single(e));
- /* could also check that vertex*/
+ /**
+ * Detect an NGon (face-hub)
+ * =========================
+ *
+ * The face-hub - #BMwEdgeLoopWalker.f_hub - is set when there is an ngon
+ * on one side of the edge and a series of faces on the other,
+ * loop around the ngon for as long as it's connected to faces which would form an edge loop
+ * in the absence of the ngon (used as the hub).
+ *
+ * This isn't simply ignoring the ngon though, as the edges looped over must all be
+ * connected to the hub.
+ *
+ * NGon in Grid Example
+ * --------------------
+ * \code{.txt}
+ * +-----+-----+-----+-----+-----+
+ * | | | | | |
+ * +-----va=ea=+==eb=+==ec=vb----+
+ * | | | |
+ * +-----+ +-----+
+ * | | f_hub | |
+ * +-----+ +-----+
+ * | | | |
+ * +-----+-----+-----+-----+-----+
+ * | | | | | |
+ * +-----+-----+-----+-----+-----+
+ * \endcode
+ *
+ * In the example above, starting from edges marked `ea/eb/ec`,
+ * the will detect `f_hub` and walk along the edge loop between `va -> vb`.
+ * The same is true for any of the un-marked sides of the ngon,
+ * walking stops for vertices with >= 3 connected faces (in this case they look like corners).
+ *
+ * Mixed Triangle-Fan & Quad Example
+ * ---------------------------------
+ * \code{.txt}
+ * +-----------------------------------------------+
+ * | f_hub |
+ * va-ea-vb=eb=+==ec=+=ed==+=ee=vc=ef=vd----------ve
+ * | |\ | | | / / \ |
+ * | | \ \ | / / / \ |
+ * | | \ | | | / / \ |
+ * | | \ \ | / / / \ |
+ * | | \ | | | / / \ |
+ * | | \ \ | / / / \ |
+ * | | \ | | | / / \ |
+ * | | \ \ | / / / \ |
+ * | | \| | |/ / \ |
+ * | | \\|// / \ |
+ * | | \|/ / \|
+ * +-----+-----------+-----+-----------------------+
+ * \endcode
+ *
+ * In the example above, starting from edges marked `eb/eb/ed/ed/ef`,
+ * the will detect `f_hub` and walk along the edge loop between `vb -> vd`.
+ *
+ * Notice `vb` and `vd` delimit the loop, since the faces connected to `vb`
+ * excluding `f_hub` don't share an edge, which isn't walked over in the case
+ * of boundaries either.
+ *
+ * Notice `vc` doesn't delimit stepping from `ee` onto `ef` as the stepping method used
+ * doesn't differentiate between the number of sides of faces opposite `f_hub`,
+ * only that each of the connected faces share an edge.
+ */
if ((lwalk->is_boundary == false) && (vert_edge_count[0] == 3 || vert_edge_count[1] == 3)) {
BMIter iter;
BMFace *f_iter;