Maniphest T44780

Decimate Planar generates concave edges
Closed, Resolved

Assigned To
Campbell Barton (campbellbarton)
Authored By
Mikhail Rachinskiy (alm)
May 20 2015, 1:48 AM
Tags
  • BF Blender
  • Modifiers
Subscribers
Campbell Barton (campbellbarton)
Mikhail Rachinskiy (alm)
perfection cat (sindra1961)

Description

System Information
Windows 8.1 x64
Renderer: GeForce GTX 860M/PCIe/SSE2

Blender Version
Broken: 2.74.5 05c4c24

Short description of error
Decimate modifier generates concave edges with certain geometry while in Planar mode.

Exact steps for others to reproduce the error

  1. Open blend file
  2. Enable Decimate modifier:
    1. on the most left object (hard edges) → no concave edges
    2. on the center object (smooth edges) → concave edges, very nasty
    3. on the most right object (more smooth edges) → concave edges, but no intersections (so technically model is fine)

Use case for this is jewelry design, it's better to optimize your models before boolean operations, and it is always appreciated to keep your STL file size small as possible to send them by email.

Here is simple GIF animation to illustrate the issue:

Note: I cannot use Collapse mode, because it generates artifacts that are impossible to fix.

Revisions and Commits

rB Blender

Related Objects

Mentioned In
rBb5bf5b36f127: BMesh: decimate, test for face flip was too low
Mentioned Here
rBaa54d93a29b3: BMesh: decimate improvement for flat surfaces
T39748: Remesh modifier produce non-manifold geometry
rB24e1d7f4f4ab: BMesh: decimate wasn't using face/edge centers
rBb5bf5b36f127: BMesh: decimate, test for face flip was too low
rB05c4c2409ea4: BMesh: add sharp edge delimiter

Event Timeline

Mikhail Rachinskiy (alm) created this task.May 20 2015, 1:48 AM
Mikhail Rachinskiy (alm) raised the priority of this task from to 90.
Mikhail Rachinskiy (alm) updated the task description.
Mikhail Rachinskiy (alm) added projects: BF Blender, Modifiers.
Mikhail Rachinskiy (alm) edited a custom field.
Mikhail Rachinskiy (alm) added a subscriber: Mikhail Rachinskiy (alm).
perfection cat (sindra1961) added a subscriber: perfection cat (sindra1961).May 20 2015, 3:05 AM

I do not know whether it is helpful for you, but there is such a method.
If you set some seam, it may be improved.

Mikhail Rachinskiy (alm) added a comment.May 20 2015, 3:33 AM

Yes I know I can escape concave edges by manualy mark seam/sharp edges, and in this case where I provided example scene as simple is it could possibly be—it looks like an OK solition. But production models are much more difficult than this, and sometimes I have to deal with STL models where it is impossible to select edge loops because it's all triangulated by format standard.

Campbell Barton (campbellbarton) mentioned this in rBb5bf5b36f127: BMesh: decimate, test for face flip was too low.May 20 2015, 4:05 PM
Campbell Barton (campbellbarton) added a subscriber: Campbell Barton (campbellbarton).EditedMay 20 2015, 4:23 PM

float precision is causing problems here, using double precision for quadric operations makes the example work as expected.

However this is just not going to be well supported (even with doubles, it may be possible to get a more extreme case to fail).

The problem is there are so many faces and they are so small, forming a near flat surface.
Because they are so small, the difference around some parts of the model is detected as zero.

Subdividing a mesh to make a near flat surface then applying decimate, is a rather contrived example. (fine for report of course).

@Mikhail Rachinskiy (alm), Could you show a practical example which causes this problem?

Edge collapsing is likely to cause some artifacts, In the cases you use it, its possible you'd be better off with re-meshing algorithm rather then decimation.
Or make decimation topology aware, to give better results (which is a much bigger change).


While checking on this report exposed some other issues.
rB24e1d7f4f4aba8e94effd6aec4a3d7d8308d4015
rBb5bf5b36f127079f81929ec970ec4d562f92d601

With these changes, the test file looks better then it did before, but the artifacts pointed out are still noticeable.

Mikhail Rachinskiy (alm) added a comment.May 21 2015, 9:59 AM

Subdividing a mesh to make a near flat surface then applying decimate, is a rather contrived example.

You have no idea:
http://www.bulgari.com/en-ch/products.html?product_detail_one=228&root_level=315&sign=18
http://www.bulgari.com/en-ch/products.html?product_detail_one=228&root_level=315&sign=21
http://www.bulgari.com/en-ch/products.html?product_detail_one=228&root_level=315&sign=48
http://www.korloff.fr/en/Jewelry/St-Petersbourg
http://www.korloff.fr/en/Jewelry/Yasmine
http://www.carreraycarrera.com/en/collections-en/baile-de-mariposas-collection
http://www.cartier.com/collections/jewelry/collections/trinity-de-cartier
…you got the point :)

Simple example I've provided actually represents the problem of triangle reduction of jewelry ring quite well.
But here are two production examples:

  1. Part of the trinket:
  2. Part of the not bulgari earring:

I can understand why there are issues with trinket part on the flat surface with little spheres carved out (but if you could fix it by adding another delimiter to the modifier—that would be just wonderful), but on the bottom of that part you can see exactly the problem I illustrated with the example file, the same thing with not bulgari earring part (note: it may take a while to perform reduction in this case).

Thanks for the fixes! I haven't been able to test them yet tho.

Mikhail Rachinskiy (alm) added a comment.May 21 2015, 10:08 AM

Edge collapsing is likely to cause some artifacts, In the cases you use it, its possible you'd be better off with re-meshing algorithm rather then decimation.

Well, if you brought that up yourself :) T39748

Campbell Barton (campbellbarton) changed the task status from Unknown Status to Resolved.EditedMay 21 2015, 10:28 AM
Campbell Barton (campbellbarton) claimed this task.

@Mikhail Rachinskiy (alm), I can see you're looking for the best solution here.
But from what I can tell Blender simply doesn't have a good way to remesh at the moment (at the quality level you're looking at).

Thats not really a bug, its just a limit in the software. It would be good to rewrite or add improved methods to the existing remesh modifier.

I looked into further improvements and made some reasonable progress for your example.

rBaa54d93a29b3ed8525670ddb76b2d86ef091142e

See Example images:


I managed to get it so none of the edges collapsed around the edges of the mesh (as stated in this report). But the other geometry has such bad topology that I prefer not to commit it.


Closing this report, while its not fixed strictly speaking, this case isn't really ideal for decimate modifier, and it works a lot better now then it did before.

Mikhail Rachinskiy (alm) added a comment.May 21 2015, 11:05 AM

Collapse decimation looks really beautiful now.
Big thanks for what you've done, it will spare me (and not only me) if not from all, but at least from part of the issues with decimation.

Campbell Barton (campbellbarton) changed the task status from Resolved to Unknown Status.EditedMay 21 2015, 11:47 AM

Checking further, notbulgari_earring.blend, it looks like we will need to use double precision.

See comparison: (current master, left, current master /w double precision quadric's, right).

Mikhail Rachinskiy (alm) added a comment.May 21 2015, 12:29 PM

WOW! This is the result I was looking for!

Campbell Barton (campbellbarton) changed the task status from Unknown Status to Resolved by committing rBe37c4e5819ae: Fix T44780: Decimate planar creates concave edges.May 21 2015, 1:11 PM
Campbell Barton (campbellbarton) added a commit: rBe37c4e5819ae: Fix T44780: Decimate planar creates concave edges.