N-Sphere radius output of Voronoi node is broken for 1D settings #89494

Closed
opened 2021-06-28 10:05:09 +02:00 by Florian · 7 comments

System Information
Operating system: Windows-10-10.0.19041-SP0 64 Bits
Graphics card: NVIDIA GeForce RTX 3080/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 465.89

Blender Version
Broken: version: 2.93.0, branch: master, commit date: 2021-06-02 11:21, hash: 84da05a8b8
Worked: (newest version of Blender that worked as expected)

Short description of error
The "N-Sphere Radius" output of the Voronoi node is supposed to return half the width of the Voronoi cell, but the output values seem to be wrong

Exact steps for others to reproduce the error
This picture shows, from top to bottom:

  1. Distance To Edge output of a 1-D Voronoi node
  2. The N-Sphere Radius output of the same node (note how the edges line up, it is the same Voronoi pattern)
  3. The Distance To Edge divided by N-Sphere radius: this should produce a pattern with peaks of equal height (as the distance to edge is maximum at the cell center and equal to the sphere radius there)

image.png

Here is the node setup for point 3):

image.png

And the .blend file: voronoi_bug_1_v01.blend

Edit: When looking at what was changed in the source code for another bug in the Voronoi node, it seems to me that it may be actually the same error: https://developer.blender.org/rC7f5d86c43150628588d9173076f3c88b4ab5d720

**System Information** Operating system: Windows-10-10.0.19041-SP0 64 Bits Graphics card: NVIDIA GeForce RTX 3080/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 465.89 **Blender Version** Broken: version: 2.93.0, branch: master, commit date: 2021-06-02 11:21, hash: `84da05a8b8` Worked: (newest version of Blender that worked as expected) **Short description of error** The "N-Sphere Radius" output of the Voronoi node is supposed to return half the width of the Voronoi cell, but the output values seem to be wrong **Exact steps for others to reproduce the error** This picture shows, from top to bottom: 1) Distance To Edge output of a 1-D Voronoi node 2) The N-Sphere Radius output of the same node (note how the edges line up, it is the same Voronoi pattern) 3) The Distance To Edge divided by N-Sphere radius: this should produce a pattern with peaks of equal height (as the distance to edge is maximum at the cell center and equal to the sphere radius there) ![image.png](https://archive.blender.org/developer/F10204407/image.png) Here is the node setup for point 3): ![image.png](https://archive.blender.org/developer/F10204409/image.png) And the .blend file: [voronoi_bug_1_v01.blend](https://archive.blender.org/developer/F10204411/voronoi_bug_1_v01.blend) Edit: When looking at what was changed in the source code for another bug in the Voronoi node, it seems to me that it may be actually the same error: https://developer.blender.org/rC7f5d86c43150628588d9173076f3c88b4ab5d720
Author

Added subscriber: @LordoftheFleas

Added subscriber: @LordoftheFleas
Member

Added subscriber: @wannes.malfait

Added subscriber: @wannes.malfait
Member

I think the current implementation is correct. I think your reasoning is wrong at this point: the feature point is where the maximum distance is to the edges. In general the center point between two edges is not a feature point. I admit that it is confusing to think about, and I might have made a mistake myself. Hopefully the image below makes it a bit clearer.

With the node setup below you can see what the n-sphere radius is: half the distance from the closest feature point to the the second closest feature point. Notice how the circles always touch one of the edges.
image.png

I think the current implementation is correct. I think your reasoning is wrong at this point: the feature point is where the maximum distance is to the edges. In general the center point between two edges is not a feature point. I admit that it is confusing to think about, and I might have made a mistake myself. Hopefully the image below makes it a bit clearer. With the node setup below you can see what the n-sphere radius is: half the distance from the closest feature point to the the second closest feature point. Notice how the circles always touch one of the edges. ![image.png](https://archive.blender.org/developer/F10204730/image.png)
Author

You are correct, especially when considering the higher dimensional case: it is generally impossible to find an N_sphere that touches all of the edges / hyperplanes of a cell, so centering the sphere on the feature point at least ensures consistency for all dimensions. (I should have read the documentation more closely here).

By the way is there a simple method to access the width of the cell in the 1D case from the existing outputs?

You are correct, especially when considering the higher dimensional case: it is generally impossible to find an N_sphere that touches *all* of the edges / hyperplanes of a cell, so centering the sphere on the feature point at least ensures consistency for all dimensions. (I should have read the documentation more closely here). By the way is there a simple method to access the width of the cell in the 1D case from the existing outputs?
Member

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

Changed status from 'Needs Triage' to: 'Resolved'
Wannes Malfait self-assigned this 2021-06-28 17:17:52 +02:00
Member

By the way is there a simple method to access the width of the cell in the 1D case from the existing outputs?

I don't think there is a way to do it with the outputs provided. If we had F3 as an output you could do (F2+F3)/2, but I don't immediately see a way to calculate F3 from the current outputs. If you really need it, you're probably better off creating a 1D voronoi from scratch, where you calculate this value as well, but that doesn't qualify as "simple" :)

> By the way is there a simple method to access the width of the cell in the 1D case from the existing outputs? I don't think there is a way to do it with the outputs provided. If we had F3 as an output you could do `(F2+F3)/2`, but I don't immediately see a way to calculate F3 from the current outputs. If you really need it, you're probably better off creating a 1D voronoi from scratch, where you calculate this value as well, but that doesn't qualify as "simple" :)
Author

Just to close this off (and for future reference), I think I managed to extract at least the distance between feature points (which is enough for my own purposes). The cell width could be done similarly:

image.png

voronoi_feature_distance_1_v01.blend

Just to close this off (and for future reference), I think I managed to extract at least the distance between feature points (which is enough for my own purposes). The cell width could be done similarly: ![image.png](https://archive.blender.org/developer/F10204991/image.png) [voronoi_feature_distance_1_v01.blend](https://archive.blender.org/developer/F10204993/voronoi_feature_distance_1_v01.blend)
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
2 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#89494
No description provided.