Page MenuHome

Fix T69979: Make "offset edge loop" slide evenly
Needs RevisionPublic

Authored by Sebastian Parborg (zeddb) on Jul 22 2020, 6:33 PM.

Details

Summary

Edges now keep an even thickness when sliding. Even if we are sliding wire edges.

The only remaining question I have is if we should keep the "flip" option around or not.

In the current code it seems to me that there is not really any use for it?
It seems like it flips the range but also flips the edges. So the end result seems to be the same (?).

So to me it seems like it could be removed without any loss of functionality.

Diff Detail

Event Timeline

I actually realized that I have to use tangents for all the edges. So I will have to fix that.
Otherwise the thickness will only be even where you have edges "floating" inside an face.

Now I create tangents for all edges.

I guess we should perhaps have this behind a new flag?

So "even" and "even thickness" perhaps?

Looking into this, some notes:

  • This changes direction calculation for edges along a chain.

    Even though the current method of simply interpolating the directions is limited and not always ideal, it ends of reducing possible spikes and overlaps, since the edge loop moves in a single direction instead of vertices in the chain each calculating their own local direction.
  • There looks to be a bug where end-points are only offset half the width (probably simple to solve).

Comparison with existing/new behavior (the top pair has this patch applied).

Of course it's possible to make examples where this patch behaves much better too, this is just an example where it doesn't work so well.


Suggested changes:

  • Keep existing logic as-is for calculating dir_side for example.
  • Add a dir_side_even struct member which can have the direction used in this patch (some other way to switch between different directions would be fine too).
  • Also, I don't think there needs to be a dir_tangent member added. We could instead calculate shell_v3v3_mid_normalized_to_dist and store this in for example dir_side_even_scale[2], this way the logic in doEdgeSlide can be kept quite simple.
Campbell Barton (campbellbarton) requested changes to this revision.Jan 12 2021, 7:57 AM
This revision now requires changes to proceed.Jan 12 2021, 7:57 AM

Attached example blend file,