[bmesh]calc_vert_angle does not return the correct value. #43904

Closed
opened 2015-03-06 02:29:15 +01:00 by perfection cat · 20 comments

System Information
Windows XP/SP3 32bits

Blender Version
Broken: version 2.73 (sub 9), version 2.73 (sub 0), 2.71
Worked: unknown

Short description of error
[bmesh]calc_vert_angle does not return the correct value.

Exact steps for others to reproduce the error
[bmesh]calc_vert_angle does not return the correct value.
wrongbmeshangle.png
wrongbmeshangle2.png
This returns the correct value.
wrongbmeshangle3.png

**System Information** Windows XP/SP3 32bits **Blender Version** Broken: version 2.73 (sub 9), version 2.73 (sub 0), 2.71 Worked: unknown **Short description of error** [bmesh]calc_vert_angle does not return the correct value. **Exact steps for others to reproduce the error** [bmesh]calc_vert_angle does not return the correct value. ![wrongbmeshangle.png](https://archive.blender.org/developer/F147485/wrongbmeshangle.png) ![wrongbmeshangle2.png](https://archive.blender.org/developer/F147487/wrongbmeshangle2.png) This returns the correct value. ![wrongbmeshangle3.png](https://archive.blender.org/developer/F147489/wrongbmeshangle3.png)
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

Added subscriber: @sindra1961

Added subscriber: @sindra1961
Author

When edge sharing vertex is not only two, which edge is chosen?
In that case, can it appoint edge?
wrongbmeshangle.blend

When edge sharing vertex is not only two, which edge is chosen? In that case, can it appoint edge? [wrongbmeshangle.blend](https://archive.blender.org/developer/F147493/wrongbmeshangle.blend)

This issue was referenced by 8638142c3b

This issue was referenced by 8638142c3bf1d0701a08d3222366fcd92d3e7772

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'

Closed by commit 8638142c3b.

Closed by commit 8638142c3b.

Added subscriber: @ideasman42

Added subscriber: @ideasman42

This wasn't working usefully.

Renamed to calc_edge_angle, now it takes an optional fallback value when the vertex doesn't have 2 edges connected. If no fallback is given it raises an exception.

This wasn't working usefully. Renamed to `calc_edge_angle`, now it takes an optional fallback value when the vertex doesn't have 2 edges connected. If no fallback is given it raises an exception.

This issue was referenced by 720599e7a8994e73b47fba76cabe946ab241e1be

This issue was referenced by 720599e7a8994e73b47fba76cabe946ab241e1be
Author

I thank for what you revised, but do not think that the correction has a meaning.
How long will vertex shared only to two sides exist?
There are four in Plane.
There is nothing in Cube.
I want you to think about how many such vertex there are in a primitive object.
The grand total of the angle between all edge sharing vertex.
Or an angle between edge chosen from edge which shared vertex.
I think that it can include a useful function.
I think that it is easy to use a latter function personally.

I thank for what you revised, but do not think that the correction has a meaning. How long will vertex shared only to two sides exist? There are four in Plane. There is nothing in Cube. I want you to think about how many such vertex there are in a primitive object. The grand total of the angle between all edge sharing vertex. Or an angle between edge chosen from edge which shared vertex. I think that it can include a useful function. I think that it is easy to use a latter function personally.

This value doesn't have a single/correct answer, since many disconnected faces can use a vertex.

You can for example - take the angle between the vertex normal, and one of the faces that use it. or all of them. then accumulate the difference (weighted by the face-angle).

Blender has a function called BMVert.calc_shell_factor() that does this, but it is just an approximation.

You could do:

  f = v.calc_shell_factor()
  angle = math.acos(1.0 / f)
This value doesn't have a single/correct answer, since many disconnected faces can use a vertex. You can for example - take the angle between the vertex normal, and one of the faces that use it. or all of them. then accumulate the difference (weighted by the face-angle). Blender has a function called `BMVert.calc_shell_factor()` that does this, but it is just an approximation. You could do: ``` f = v.calc_shell_factor() angle = math.acos(1.0 / f) ```
Author

This comment was removed by @sindra1961

*This comment was removed by @sindra1961*
Author

@Campbell: This is correct?
screen.png
shellfactor.blend
screen.png

@Campbell: This is correct? ![screen.png](https://archive.blender.org/developer/F147866/screen.png) [shellfactor.blend](https://archive.blender.org/developer/F147864/shellfactor.blend) ![screen.png](https://archive.blender.org/developer/F147868/screen.png)
Author

@Campbell: Your correction seems to be wrong.
screen.png
imcomplete.blend

The version that I confirmed
version 2.73 (sub 9), branch b'master', commit date b'2015-03-06' b'16:53', hash b'cf1227d', b'Release'

screen.png

@Campbell: Your correction seems to be wrong. ![screen.png](https://archive.blender.org/developer/F147874/screen.png) [imcomplete.blend](https://archive.blender.org/developer/F147876/imcomplete.blend) The version that I confirmed version 2.73 (sub 9), branch b'master', commit date b'2015-03-06' b'16:53', hash b'cf1227d', b'Release' ![screen.png](https://archive.blender.org/developer/F147878/screen.png)
Author

Added subscriber: @JulianEisel

Added subscriber: @JulianEisel
Author

@JulianEisel (Julian Eisel):
I want you to open once again because a correction is not right.

@JulianEisel (Julian Eisel): I want you to open once again because a correction is not right.
Member

I'd prefer to let Campbell decide that. We usually double check before reopening reports and he is the better man for that ;)

I'd prefer to let Campbell decide that. We usually double check before reopening reports and he is the better man for that ;)
Author

@JulianEisel (Julian Eisel):
I understood it. I obey your decision.

@JulianEisel (Julian Eisel): I understood it. I obey your decision.

re: comment @Sat, Mar 7, 6:23 PM

This is working as expected. A vertex exactly in the middle of 2 edges has 0deg angle. But when on the side of the face, that face-corner is 180deg.

Its just different way of interpreting the value.

re: comment @Sat, Mar 7, 6:23 PM This is working as expected. A vertex exactly in the middle of 2 edges has 0deg angle. But when on the side of the face, that face-corner is 180deg. Its just different way of interpreting the value.
Author

@Campbell: I thank for your help.

This function was not the thing which I expected.

@Campbell: I thank for your help. This function was not the thing which I expected.
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#43904
No description provided.