Page MenuHome

Fix T84078: Improve UV unwrapping for quads with an internal reflex angle.
ClosedPublic

Authored by Chris Blackbourn (chrisbblend) on Nov 15 2022, 1:18 AM.

Details

Summary

When triangulating meshes, the UV unwrapper was previously using a heuristic to split quads into triangles. If one of the internal angles is greater than 180degrees, ("reflex angle") the heuristic was giving a poor choice of split.

Instead of using a special case for quads, this change routes everything through the generic ngon polyfill_beautify method instead.

Diff Detail

Repository
rB Blender

Event Timeline

Chris Blackbourn (chrisbblend) requested review of this revision.Nov 15 2022, 1:18 AM
Chris Blackbourn (chrisbblend) created this revision.

This doesn't seem correct as as the check for existing triangles uses a fan-fill which may not be the topology used once BLI_polyfill_calc_arena has run.

A simple fix could be to handle the case of quads (where p_quad_split_direction takes existing faces into account), but that doesn't help for ngons.

BLI_polyfill_beautify could optionally take existing triangles not to use ... but this seems like a fairly involved workaround which would be better spent on more general support for n-gons.

source/blender/geometry/intern/uv_parametrizer.cc
3847–3851

This could be reported as a bug, then reference the task, these kinds of steps seem a little too verbose for code-comments and are likely to become outdated.

kk, I'll split the differential up into 3 parts.

  1. Update asserts (Update: Done rBda82d46a5ae6)
  2. Report non-manifold triangulation with n-gons and fix (Update T102543 + D16521)
  3. Fix for reflex angles on quads. ( i.e. D16505 / T84078 )

From what I remember, the reason I didn't use p_add_ngon also for quads is that lead asymmetric triangulation, and in turn asymmetric UVs. Would be good if we could try to keep symmetry somehow.

Chris Blackbourn (chrisbblend) edited the summary of this revision. (Show Details)

Split into 3x Differentials

Brecht Van Lommel (brecht) requested changes to this revision.Nov 16 2022, 3:14 PM

See my previous comment.

This revision now requires changes to proceed.Nov 16 2022, 3:14 PM

From what I remember, the reason I didn't use p_add_ngon also for quads is that lead asymmetric triangulation, and in turn asymmetric UVs. Would be good if we could try to keep symmetry somehow.

Is this an instance of T78101 or is something else going on?

Do you have an example .blend file which illustrates the asymmetry?

I tried to create a model to illustrate the asymmetry problem:

Here's unwrap without change:

And after applying D16505 in it's current form:

With git blame I traced it back to T32198: UV sphere unwrap is an elongated ellipse.

It seems that at least in the test file there, the n-gon splitting also preserves the symmetry, and in a few other files it also seems to work ok.

This revision is now accepted and ready to land.Nov 16 2022, 11:44 PM