Decimate Modifier; Bad geometry when following subsurf with planar decimation on a mesh with holes #47998

Closed
opened 2016-03-30 04:46:24 +02:00 by Adam Friesen · 9 comments

System Information
OS - Windows 10 64 bit; CPU - Third-gen i7; GPU - ATI HD 7xxx; RAM - 24 gigs

Blender Version
Broken: Blender hash 211b539
Worked: Unknown

Short description of error
You get bad results when adding a subsurf modifier and following it up with planar decimation on a mesh with holes (faces start overlapping the holes and each other).
BadDecimate.jpg

Exact steps for others to reproduce the error
Open the .blend file and turn the decimate modifier on and off

.blend
BadDecimate.blend

**System Information** OS - Windows 10 64 bit; CPU - Third-gen i7; GPU - ATI HD 7xxx; RAM - 24 gigs **Blender Version** Broken: Blender hash 211b539 Worked: Unknown **Short description of error** You get bad results when adding a subsurf modifier and following it up with planar decimation on a mesh with holes (faces start overlapping the holes and each other). ![BadDecimate.jpg](https://archive.blender.org/developer/F299481/BadDecimate.jpg) **Exact steps for others to reproduce the error** Open the .blend file and turn the decimate modifier on and off **.blend** [BadDecimate.blend](https://archive.blender.org/developer/F299483/BadDecimate.blend)
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

Added subscriber: @Ace_Dragon

Added subscriber: @Ace_Dragon

Added subscriber: @ignatz

Added subscriber: @ignatz

OS - Windows 7 Pro 64-bit
Display: Nvidia GeForce GTX760

Blender Version
Broken: 29bb10e

A bit of extra information.

I get the same bad results on my system if I use the 'Planar' setting in the decimate modifier.

If I set decimate to either 'Collapse'or'Un-subdivide' then I get good (expected) results from the modifier.

OS - Windows 7 Pro 64-bit Display: Nvidia GeForce GTX760 Blender Version Broken: 29bb10e A bit of extra information. I get the same bad results on my system if I use the **'Planar'** setting in the decimate modifier. If I set decimate to either **'Collapse'**or**'Un-subdivide'** then I get good (expected) results from the modifier.
Campbell Barton self-assigned this 2016-03-30 08:46:17 +02:00

Added subscriber: @zeauro

Added subscriber: @zeauro

You can also avoïd that by using Delimit options of the modifier.
You can create seams like that.
planar_decimate_Seams.jpg

Or you can have a material or UVs that make sense as demarcation.

You can also avoïd that by using Delimit options of the modifier. You can create seams like that. ![planar_decimate_Seams.jpg](https://archive.blender.org/developer/F301009/planar_decimate_Seams.jpg) Or you can have a material or UVs that make sense as demarcation.

Looked into this. The cause of the error is edge-chains (edges following a path) are collapsed without checking:

  • If this flips the face direction (trivial check to add).
  • If collapsing the edge causes a face to self intersect (more complicated).

This could be handled by creating a large polygon with holes (ignoring central edge chains), then using the hole connection code (thats used for booleans - BM_face_split_edgenet_connect_islands). While this should work its quite a heavy solution for an operation which in many cases isn't even necessary.

Another solution could be to triangulate the ngon, then use the edges of the tessellated triangles to map a shorter path.

But think it would be simpler to treat this as an ear-clipping problem, where collapsing each vertex on an edge chain checks that the face which occupies triangle if formed, has no vertices inside that triangle.
While the overlap checks add some overhead, this can be optimized as is done with BLI_polyfill2d (using a KD-Tree), 2d projections can be cached too.

There is one gotcha with ear clipping - that is a vertex which prevents clipping, may its self be clipped later on during this process.
Once a vertex is clipped, the faces that used it, and previously weren't able to collapse at least one vertex - will need to re-tested (keeping track of which vertices prevented others from clipping could work too... but probably too much book-keeping to handle such a corner-case).

Looked into this. The cause of the error is edge-chains *(edges following a path)* are collapsed without checking: - If this flips the face direction (trivial check to add). - If collapsing the edge causes a face to self intersect (more complicated). ---- This could be handled by creating a large polygon with holes (ignoring central edge chains), then using the hole connection code (thats used for booleans - `BM_face_split_edgenet_connect_islands`). While this should work its quite a heavy solution for an operation which in many cases isn't even necessary. Another solution could be to triangulate the ngon, then use the edges of the tessellated triangles to map a shorter path. But think it would be simpler to treat this as an ear-clipping problem, where collapsing each vertex on an edge chain checks that the face which occupies triangle if formed, has no vertices inside that triangle. While the overlap checks add some overhead, this can be optimized as is done with `BLI_polyfill2d` (using a KD-Tree), 2d projections can be cached too. There is one gotcha with ear clipping - that is a vertex which prevents clipping, may its self be clipped later on during this process. Once a vertex is clipped, the faces that used it, and previously weren't able to collapse at least one vertex - will need to re-tested *(keeping track of which vertices prevented others from clipping could work too... but probably too much book-keeping to handle such a corner-case)*.

This issue was referenced by 12b0c03e49

This issue was referenced by 12b0c03e4971d5f7a407eb94424635527196b12e

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
5 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#47998
No description provided.