Page MenuHome

Fix T71971: Inset with depth and offset relative has weird geometry or asserts
AbandonedPublic

Authored by Philipp Oeser (lichtwerk) on Nov 27 2019, 11:28 PM.

Details

Summary

This happens on larger selections for vertices 'inside' the selection
which have all of their edges set to a -1 index (at the start of
'bmo_inset_region_exec'). This would result in a division by zero (in
'bm_edge_info_average_length').

Relevant previous commits:
rBe387ccdb4270
rB41a5e731a2e1
rBf48efbf4642e

Not particularly sure which exact case rBf48efbf4642e was trying to
solve, but this is where it started.

Previous methods of calculating average edge length for inside verts as
well was also not working well, so what I tried here is reach out from
the inside vert until a valid vert is found on the boundary [excellent
excuse to have a look at bmesh walkers :)] and use its average edge
length instead. This results in a pretty solid looking inset, not sure
if this is really the purpose of "Offset Relative" option.

If this is all bogus, the least we should do is return 0 or 1 and not
return NANs...

Diff Detail

Repository
rB Blender
Branch
T71971_b (branched from master)
Build Status
Buildable 5820
Build 5820: arc lint + arc unit

Event Timeline

Campbell Barton (campbellbarton) requested changes to this revision.EditedDec 19 2019, 12:49 PM

While the idea is fine, I don't think it's efficient to do a full connected search for each vertex.

It could work like this:

  • bm_edge_info_average_length returns an error value on failure (-1 for e.g.).
  • Set a flag that values need to be filled in.
  • In the case of an error, run a second pass flood-filling the missing values until the there are no more missing values left.

    See BM_mesh_calc_edge_groups_as_arrays for example of looping over and tagging geometry, it could work roughly like this.
This revision now requires changes to proceed.Dec 19 2019, 12:49 PM