Decimate Planar generates concave edges #44780

Closed
opened 2015-05-20 01:48:59 +02:00 by Mikhail Rachinskiy · 17 comments

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

  • Open blend file decimate_planar.blend
  • Enable Decimate modifier:
    • on the most left object (hard edges) → no concave edges
    • on the center object (smooth edges) → concave edges, very nasty

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:
dcm_cnc.gif

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

**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** - Open blend file [decimate_planar.blend](https://archive.blender.org/developer/F177716/decimate_planar.blend) - Enable Decimate modifier: - on the most left object (hard edges) → no concave edges - on the center object (smooth edges) → concave edges, very nasty ## 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: ![dcm_cnc.gif](https://archive.blender.org/developer/F177719/dcm_cnc.gif) Note: I cannot use Collapse mode, because it generates artifacts that are impossible to fix. ![dcm_clps.png](https://archive.blender.org/developer/F177722/dcm_clps.png)
Author
Member

Changed status to: 'Open'

Changed status to: 'Open'
Author
Member

Added subscriber: @MikhailRachinskiy

Added subscriber: @MikhailRachinskiy

Added subscriber: @sindra1961

Added subscriber: @sindra1961

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.
{F177730}Ex1.png

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. {[F177730](https://archive.blender.org/developer/F177730/Ex2.png)}![Ex1.png](https://archive.blender.org/developer/F177732/Ex1.png)
Author
Member

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.

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.

Added subscriber: @ideasman42

Added subscriber: @ideasman42

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).

@MikhailRachinskiy, 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.
24e1d7f4f4
b5bf5b36f1

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

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). @MikhailRachinskiy, 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. 24e1d7f4f4 b5bf5b36f1 With these changes, the test file looks better then it did before, but the artifacts pointed out are still noticeable.
Author
Member

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:

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.

>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: - Part of the trinket: [trinket.blend](https://archive.blender.org/developer/F178305/trinket.blend) - Part of the not bulgari earring: [notbulgari_earring.blend](https://archive.blender.org/developer/F178306/notbulgari_earring.blend) 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.
Author
Member

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 :) #39748

>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 :) #39748

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
Campbell Barton self-assigned this 2015-05-21 10:28:57 +02:00

@MikhailRachinskiy, 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.

aa54d93a29

See Example images:
248_decimate_topology_01.png
248_decimate_topology_02.png

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.

@MikhailRachinskiy, 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. aa54d93a29 See Example images: ![248_decimate_topology_01.png](https://archive.blender.org/developer/F178310/248_decimate_topology_01.png) ![248_decimate_topology_02.png](https://archive.blender.org/developer/F178308/248_decimate_topology_02.png) 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.
Author
Member

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.

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.

Changed status from 'Resolved' to: 'Open'

Changed status from 'Resolved' to: 'Open'

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).
out_ring_alm.png

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). ![out_ring_alm.png](https://archive.blender.org/developer/F178318/out_ring_alm.png)
Author
Member

WOW! This is the result I was looking for!

WOW! This is the result I was looking for!

This issue was referenced by e37c4e5819

This issue was referenced by e37c4e5819aec1f853fdd71cf60004aa2363f7d9

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#44780
No description provided.