[Bf-committers] BMesh split face edge net

Francesc Juhe fjuhec at gmail.com
Wed Oct 26 13:08:48 CEST 2016

Yes, haven’t found issues caused by it directly, just seemed weird to pass the other list to code below.

Found it while looking into another issue I was having were faces 464 and 465 of Suzanne were not cut when intersected with a cube.

Steps to reproduce:
Default scene.
Add suzanne.
Add boolean modifier to suzanne, select difference with cube.
Translate suzanne to Z +1.0
suzanne disappears as long as those two faces are intersected.

If I understand the code correctly, there seems to be a difference it the way the next edge is selected because bm_face_split_edgenet_find_loop_pair is separating wires and boundaries before testing the angle while bm_face_split_edgenet_find_loop_walk doesn’t, it compares the angles of both wires and boundaries, which normally would select the wire but in this case selects the boundary and the face is not split.

Fixed it with this code, but don’t know if you would consider it acceptable. I considered separating lists like on find_loop_pair but for testing this was the smallest modification I could think of.

diff --git a/source/blender/bmesh/intern/bmesh_polygon_edgenet.c b/source/blender/bmesh/intern/bmesh_polygon_edgenet.c
@@ -386,6 +386,8 @@ walk_nofork:
                        for (j = 0; j < STACK_SIZE(edge_order); j++) {
                                edge_order[j].angle = angle_signed_on_axis_v3v3v3_v3(v_prev->co, v->co, edge_order[j].v->co, face_normal);
+                               /* give higher sorting priority to wire edges */
+                               edge_order[j].angle -= 10.0f * bm_edge_flagged_radial_count(edge_order[j].v->e);
                        qsort(edge_order, STACK_SIZE(edge_order), sizeof(struct VertOrder), BLI_sortutil_cmp_float_reverse);

On 26 Oct 2016, at 05:20, Campbell Barton <ideasman42 at gmail.com> wrote:

> Thanks for the report, fixed
> https://developer.blender.org/rBa1f137767fe7bf7213543a54e1e73e8cc5f29f07
> Although its not so bad, I couldn't get this to cause an actual error
> since the function splits off closed regions until there are none
> remaining.
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at blender.org
> https://lists.blender.org/mailman/listinfo/bf-committers

More information about the Bf-committers mailing list