Edge Angle Node -> Signed Angle returns wrong sign #101979

Open
opened 2022-10-21 14:08:35 +02:00 by Emil Forslund · 5 comments

System Information
Operating system: Windows-10-10.0.22000-SP0 64 Bits
Graphics card: GeForce RTX 2070 with Max-Q Design/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 462.59

Blender Version
Broken: version: 3.3.1, branch: master, commit date: 2022-10-04 18:35, hash: b292cfe5a9
Worked: Never (to my knowledge)

Short description of error
The Edge Angle Node computes the angle between the two faces connected by an edge. If one of the faces stretch behind the edge, then the node may report the edge as being convex even though the edge is concave.

Exact steps for others to reproduce the error
The .blend-file: debug_edge_angle_sign.blend

Illustration of the problem:
debug_edge_angle_sign.png

In the example, I have two meshes that share a geometry-node setup that highlights convex edges in blue and concave edges in red. A single vertex is different in the two input meshes, but that vertex is not part of any of the highlighted edges. It still affects the signed angle of the concave edge though, making it appear convex.

**System Information** Operating system: Windows-10-10.0.22000-SP0 64 Bits Graphics card: GeForce RTX 2070 with Max-Q Design/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 462.59 **Blender Version** Broken: version: 3.3.1, branch: master, commit date: 2022-10-04 18:35, hash: `b292cfe5a9` Worked: Never (to my knowledge) **Short description of error** The Edge Angle Node computes the angle between the two faces connected by an edge. If one of the faces stretch *behind* the edge, then the node may report the edge as being convex even though the edge is concave. **Exact steps for others to reproduce the error** The .blend-file: [debug_edge_angle_sign.blend](https://archive.blender.org/developer/F13737715/debug_edge_angle_sign.blend) Illustration of the problem: ![debug_edge_angle_sign.png](https://archive.blender.org/developer/F13737729/debug_edge_angle_sign.png) In the example, I have two meshes that share a geometry-node setup that highlights convex edges in blue and concave edges in red. A single vertex is different in the two input meshes, but that vertex is not part of any of the highlighted edges. It still affects the signed angle of the concave edge though, making it appear convex.
Author

Added subscriber: @pyknic

Added subscriber: @pyknic

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

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

Added subscriber: @mano-wii

Added subscriber: @mano-wii
Emil Forslund was assigned by Pratik Borhade 2022-10-22 07:56:09 +02:00
Philipp Oeser removed the
Interest
Nodes & Physics
label 2023-02-10 08:43:32 +01:00
Member

The edge angle node needs a reference point on both adjacent faces to tell if the face is convex (positive angle) or concave (negative angle). It calculates a tangent vector from the edge center to the reference point and the dot product with the other face's normal.

The reference point currently used is the center of the entire polygon, which means that a concave polygon can generate a point behind the other adjacent face, leading to a flipped angle, even when the local tangent direction should yield the opposite sign.

For a more robust detection of concavity the generated face triangles must be used, because those can define a valid local tangent direction through the 3rd vertex.

To illustrate the point, here is an example where the normals of the faces are exactly the same, and only the reference point makes the difference between a convex and a concave edge angle:
image
image

The edge angle node needs a reference point on both adjacent faces to tell if the face is convex (positive angle) or concave (negative angle). It calculates a tangent vector from the edge center to the reference point and the dot product with the other face's normal. The reference point currently used is the center of the entire polygon, which means that a concave polygon can generate a point _behind_ the other adjacent face, leading to a flipped angle, even when the _local_ tangent direction should yield the opposite sign. For a more robust detection of concavity the generated face triangles must be used, because those can define a valid local tangent direction through the 3rd vertex. To illustrate the point, here is an example where the normals of the faces are exactly the same, and only the reference point makes the difference between a convex and a concave edge angle: ![image](/attachments/61c45160-7b48-4b05-86a9-51e0fe0c90ed) ![image](/attachments/d38bac59-8ebd-4ebd-b107-0681098a575d)

Yes, it seems to be good to accept the fact that this can only work correctly for a flat polygon, after which a branch in the looptris direction can be found for any edge

Yes, it seems to be good to accept the fact that this can only work correctly for a flat polygon, after which a branch in the looptris direction can be found for any edge
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Code Documentation
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
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
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
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
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
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
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#101979
No description provided.