Crash when turning on Keep Boundary #95542

Closed
opened 2022-02-05 23:28:21 +01:00 by Gerstmann Bradley · 12 comments

System Information
Operating system: Windows-10-10.0.17134-SP0 64 Bits
Graphics card: NVIDIA GeForce GTX 970M/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 466.11

Blender Version
Broken: version: 3.1.0 Beta, branch: master, commit date: 2022-02-04 20:19, hash: 0b4cf2984f
Worked: (newest version of Blender that worked as expected)

Short description of error
Here's the file, I can't simplify more.
It's a very specific and weird crash case. not sure really a bug or not.

Exact steps for others to reproduce the error
Open the file, toggle on the first Keep Boundary as shown.
image.png
Crash should happen Instantaneously.
CRASH1.blend
Simplified file:
CRASH1_simple.blend

**System Information** Operating system: Windows-10-10.0.17134-SP0 64 Bits Graphics card: NVIDIA GeForce GTX 970M/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 466.11 **Blender Version** Broken: version: 3.1.0 Beta, branch: master, commit date: 2022-02-04 20:19, hash: `0b4cf2984f` Worked: (newest version of Blender that worked as expected) **Short description of error** Here's the file, I can't simplify more. It's a very specific and weird crash case. not sure really a bug or not. **Exact steps for others to reproduce the error** Open the file, toggle on the first Keep Boundary as shown. ![image.png](https://archive.blender.org/developer/F12849216/image.png) Crash should happen Instantaneously. [CRASH1.blend](https://archive.blender.org/developer/F12849212/CRASH1.blend) Simplified file: [CRASH1_simple.blend](https://archive.blender.org/developer/F12855152/CRASH1_simple.blend)

Added subscriber: @Bradley_G

Added subscriber: @Bradley_G

Added subscriber: @deadpin

Added subscriber: @deadpin

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'

Confirmed here. In debug builds it will hit the following assert:

BLI_assert failed: E:/source/blender-git/blender/source/blender/nodes/geometry/nodes/node_geo_dual_mesh.cc:452, sort_vertex_polys(), at 'j != connected_polygons.size()'

blender.exe!blender::nodes::node_geo_dual_mesh_cc::sort_vertex_polys(const Mesh & mesh, ... blender::MutableSpan<int> r_sorted_corners) Line 452	C++
blender.exe!blender::nodes::node_geo_dual_mesh_cc::calc_dual_mesh::__l2::<lambda>(blender::IndexRange range) Line 662	C++
blender.exe!blender::threading::parallel_for<void <lambda>(blender::IndexRange)>(blender::IndexRange range, __int64 grain_size, const blender::nodes::node_geo_dual_mesh_cc::calc_dual_mesh::__l2::void <lambda>(blender::IndexRange) & function) Line 83	C++
blender.exe!blender::nodes::node_geo_dual_mesh_cc::calc_dual_mesh(GeometrySet & geometry_set, const MeshComponent & in_component, const bool keep_boundaries) Line 645	C++
blender.exe!blender::nodes::node_geo_dual_mesh_cc::node_geo_exec::__l2::<lambda>(GeometrySet & geometry_set) Line 916	C++
Confirmed here. In debug builds it will hit the following assert: ``` BLI_assert failed: E:/source/blender-git/blender/source/blender/nodes/geometry/nodes/node_geo_dual_mesh.cc:452, sort_vertex_polys(), at 'j != connected_polygons.size()' blender.exe!blender::nodes::node_geo_dual_mesh_cc::sort_vertex_polys(const Mesh & mesh, ... blender::MutableSpan<int> r_sorted_corners) Line 452 C++ blender.exe!blender::nodes::node_geo_dual_mesh_cc::calc_dual_mesh::__l2::<lambda>(blender::IndexRange range) Line 662 C++ blender.exe!blender::threading::parallel_for<void <lambda>(blender::IndexRange)>(blender::IndexRange range, __int64 grain_size, const blender::nodes::node_geo_dual_mesh_cc::calc_dual_mesh::__l2::void <lambda>(blender::IndexRange) & function) Line 83 C++ blender.exe!blender::nodes::node_geo_dual_mesh_cc::calc_dual_mesh(GeometrySet & geometry_set, const MeshComponent & in_component, const bool keep_boundaries) Line 645 C++ blender.exe!blender::nodes::node_geo_dual_mesh_cc::node_geo_exec::__l2::<lambda>(GeometrySet & geometry_set) Line 916 C++ ```
Member

Added subscriber: @PratikPB2123

Added subscriber: @PratikPB2123
Member

Added subscribers: @wannes.malfait, @JacquesLucke

Added subscribers: @wannes.malfait, @JacquesLucke
Member

The issue is probably that the Merge by Distance node produced fairly complex non-manifold geometry, that the dual mesh node does not handle correctly.
I simplified the file a bit and attached it to the report above.
@wannes.malfait can you have a look?

The issue is probably that the Merge by Distance node produced fairly complex non-manifold geometry, that the dual mesh node does not handle correctly. I simplified the file a bit and attached it to the report above. @wannes.malfait can you have a look?
Member

Yeah I saw this report and also tried simplifying it a little bit. I think the problem is that there are ngons which have more than 2 edges connected to a single vertex. I did not know that was possible. I tried creating the weirdest types of geometry for my tests, but apparently not weird enough. The current code assumes that each ngon has exactly 1 or 2 edges connected to a vertex, which causes the crash. The assert was there to ensure there was not some weird edge case that was missed for sorting, like this.

I'll try and take a look at it in the coming days. I'm afraid that there will be no "good" solution, either there will be some hole in the mesh, or the resulting dual ngon will have the vertices sorted badly.

In the mean time the best thing to do is add a triangulate node before the dual mesh which "solves" the problem.

Yeah I saw this report and also tried simplifying it a little bit. I think the problem is that there are ngons which have more than 2 edges connected to a single vertex. I did not know that was possible. I tried creating the weirdest types of geometry for my tests, but apparently not weird enough. The current code assumes that each ngon has exactly 1 or 2 edges connected to a vertex, which causes the crash. The assert was there to ensure there was not some weird edge case that was missed for sorting, like this. I'll try and take a look at it in the coming days. I'm afraid that there will be no "good" solution, either there will be some hole in the mesh, or the resulting dual ngon will have the vertices sorted badly. In the mean time the best thing to do is add a triangulate node before the dual mesh which "solves" the problem.
Member

I think the problem is that there are ngons which have more than 2 edges connected to a single vertex.

Hm, is that really the case? If yes, that sounds like it shouldn't be supported indeed and it may be a bug somewhere else. Doesn't that imply that an ngon has two corners at the same vertex?

> I think the problem is that there are ngons which have more than 2 edges connected to a single vertex. Hm, is that really the case? If yes, that sounds like it shouldn't be supported indeed and it may be a bug somewhere else. Doesn't that imply that an ngon has two corners at the same vertex?
Member

I have looked into it a little bit closer, and I have found the problem (or one of the problems). Basically the current code doesn't detect that the central vertex here is "non-manifold":
image.png

Then when it tries sorting all the polygon around that vertex it fails, because they can't be sorted. Don't know how easy it is to detect these kinds of vertices without something like the BMesh structure

I have looked into it a little bit closer, and I have found the problem (or one of the problems). Basically the current code doesn't detect that the central vertex here is "non-manifold": ![image.png](https://archive.blender.org/developer/F12857581/image.png) Then when it tries sorting all the polygon around that vertex it fails, because they can't be sorted. Don't know how easy it is to detect these kinds of vertices without something like the BMesh structure
Wannes Malfait self-assigned this 2022-02-09 19:25:20 +01:00

This issue was referenced by 82fc68ed90

This issue was referenced by 82fc68ed90bf1429579eddd5df14caf60b791b45
Member

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' 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
7 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#95542
No description provided.