Bevel amount less than 1 mm and profile at 1 doesn't give expected result #79485

Open
opened 2020-08-03 13:16:19 +02:00 by Pasang Bomjan · 9 comments

Blender Version
Broken: version: 2.91.0 Alpha, branch: master, commit date: 2020-08-03 05:14, hash: 144f780c71, 2.79

Short description of error
When the bevel amount is smaller than 1mm., the bevel profile shape at 1 doesn't give the expected result.
The 'Depth' width type starts having the issue from 0.65 mm and below. All other width types suffer from 0.9 mm and below.
Bevel profile bug.png

Exact steps for others to reproduce the error
Bevel Profile Problem.blend
Try changing the bevel amount and the width type in the above file.

**Blender Version** Broken: version: **2.91.0** Alpha, branch: master, commit date: 2020-08-03 05:14, hash: `144f780c71`, **2.79** **Short description of error** When the bevel amount is smaller than 1mm., the bevel profile shape at 1 doesn't give the expected result. The 'Depth' width type starts having the issue from 0.65 mm and below. All other width types suffer from 0.9 mm and below. ![Bevel profile bug.png](https://archive.blender.org/developer/F8740991/Bevel_profile_bug.png) **Exact steps for others to reproduce the error** [Bevel Profile Problem.blend](https://archive.blender.org/developer/F8740972/Bevel_Profile_Problem.blend) Try changing the bevel amount and the width type in the above file.
Author

Added subscriber: @Pasang

Added subscriber: @Pasang
Member

Added subscriber: @HooglyBoogly

Added subscriber: @HooglyBoogly
Member

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

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

I'm guessing this is related to precision issues. Although I think it only shows up in the weld case (two beveled edges connecting to each other).
image.png
image.png
image.png

I'm guessing this is related to precision issues. Although I think it only shows up in the weld case (two beveled edges connecting to each other). ![image.png](https://archive.blender.org/developer/F8741519/image.png) ![image.png](https://archive.blender.org/developer/F8741525/image.png) ![image.png](https://archive.blender.org/developer/F8741531/image.png)
Author

Small correction: I actually meant to say 'width type'not'limit method'

Although I think it only shows up in the weld case (two beveled edges connecting to each other).

Only happens when two connecting edges are beveled. It doesn't happen with three edges.

20200803_233350.mp4

Small correction: I actually meant to say **'width type'**not**'limit method'** > Although I think it only shows up in the weld case (two beveled edges connecting to each other). Only happens when two connecting edges are beveled. It doesn't happen with three edges. [20200803_233350.mp4](https://archive.blender.org/developer/F8742069/20200803_233350.mp4)
Member

Added subscriber: @howardt

Added subscriber: @howardt
Member

Okay, I found the issue, or at least where it comes from.

Normally when the profile parameters are built for the weld case the profile on each side is moved so that it is coplanar with the unbeveled edges on each side of it.
But in this case, the bevel amount isn't large enough for this to happen.

In move_weld_profile_planes:

sub_v3_v3v3(d1, bv->v->co, bndv1->nv.co);
sub_v3_v3v3(d2, bv->v->co, bndv2->nv.co);
cross_v3_v3v3(no, d1, d2);
l1 = normalize_v3(no);
...
if (l1 > BEVEL_EPSILON && (l2 > BEVEL_EPSILON || l3 > BEVEL_EPSILON)) {
/* Move the profile planes. */
}

Just tweaking the epsilons to ...l1 > BEVEL_EPSILON_SQ... fixes my particular test case. But what I'm not understanding is why we need these checks at all.

If I remove all the checks from this function like in the following code the tests still pass and I haven't noticed any different behavior.

sub_v3_v3v3(d1, bv->v->co, bndv1->nv.co);
sub_v3_v3v3(d2, bv->v->co, bndv2->nv.co);
cross_v3_v3v3(no, d1, d2);
l1 = normalize_v3(no);
/* "no" is new normal projection plane, but don't move if it is coplanar with both of the

   * projection dirs. */

cross_v3_v3v3(no2, d1, bndv1->profile.proj_dir);
l2 = normalize_v3(no2);
cross_v3_v3v3(no3, d2, bndv2->profile.proj_dir);
l3 = normalize_v3(no3);
// if (l1 > BEVEL_EPSILON && (l2 > BEVEL_EPSILON || l3 > BEVEL_EPSILON)) {
dot1 = fabsf(dot_v3v3(no, no2));
dot2 = fabsf(dot_v3v3(no, no3));
// if (fabsf(dot1 - 1.0f) > BEVEL_EPSILON) {
copy_v3_v3(bndv1->profile.plane_no, no);

  *}* if (fabsf(dot2 - 1.0f) > BEVEL_EPSILON) {

copy_v3_v3(bndv2->profile.plane_no, no);

  *}* }

Theoretically, I'm also not sure why we would only want to use these new normals if they're not coplanar.

@howardt Maybe you remember the reasoning behind those checks or it's clear to you that I'm missing something?

Okay, I found the issue, or at least where it comes from. Normally when the profile parameters are built for the weld case the profile on each side is moved so that it is coplanar with the unbeveled edges on each side of it. But in this case, the bevel amount isn't large enough for this to happen. In `move_weld_profile_planes`: ```lang=c ``` sub_v3_v3v3(d1, bv->v->co, bndv1->nv.co); sub_v3_v3v3(d2, bv->v->co, bndv2->nv.co); cross_v3_v3v3(no, d1, d2); l1 = normalize_v3(no); ... if (l1 > BEVEL_EPSILON && (l2 > BEVEL_EPSILON || l3 > BEVEL_EPSILON)) { /* Move the profile planes. */ } ``` ``` Just tweaking the epsilons to `...l1 > BEVEL_EPSILON_SQ...` fixes my particular test case. But what I'm not understanding is why we need these checks at all. If I remove all the checks from this function like in the following code the tests still pass and I haven't noticed any different behavior. ```lang=c ``` sub_v3_v3v3(d1, bv->v->co, bndv1->nv.co); sub_v3_v3v3(d2, bv->v->co, bndv2->nv.co); cross_v3_v3v3(no, d1, d2); l1 = normalize_v3(no); /* "no" is new normal projection plane, but don't move if it is coplanar with both of the ``` * projection dirs. */ ``` cross_v3_v3v3(no2, d1, bndv1->profile.proj_dir); l2 = normalize_v3(no2); cross_v3_v3v3(no3, d2, bndv2->profile.proj_dir); l3 = normalize_v3(no3); // if (l1 > BEVEL_EPSILON && (l2 > BEVEL_EPSILON || l3 > BEVEL_EPSILON)) { dot1 = fabsf(dot_v3v3(no, no2)); dot2 = fabsf(dot_v3v3(no, no3)); // if (fabsf(dot1 - 1.0f) > BEVEL_EPSILON) { copy_v3_v3(bndv1->profile.plane_no, no); ``` *}* if (fabsf(dot2 - 1.0f) > BEVEL_EPSILON) { ``` copy_v3_v3(bndv2->profile.plane_no, no); ``` *}* } ``` Theoretically, I'm also not sure why we would only want to use these new normals if they're not coplanar. @howardt Maybe you remember the reasoning behind those checks or it's clear to you that I'm missing something?
Member

Here's a video for some extra clarity:
Screencast from 08-05-2020 12:21:22 PM.webm

Here's a video for some extra clarity: [Screencast from 08-05-2020 12:21:22 PM.webm](https://archive.blender.org/developer/F8749133/Screencast_from_08-05-2020_12_21_22_PM.webm)
Member

Sorry, I can't remember what I had in mind when I put that restriction. I would be a bit hesitant to remove it because I probably did have a particular case in mind. I wasn't as comprehensive as I should have been in having tests for all possible cases, sorry, so the fact that the tests pass without those conditions doesn't give me a large amount of reassurance.

Sorry, I can't remember what I had in mind when I put that restriction. I would be a bit hesitant to remove it because I probably did have a particular case in mind. I wasn't as comprehensive as I should have been in having tests for all possible cases, sorry, so the fact that the tests pass without those conditions doesn't give me a large amount of reassurance.
Philipp Oeser removed the
Interest
Modeling
label 2023-02-09 15:29:03 +01:00
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
3 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#79485
No description provided.