BMesh: Knife tool Angle Constraint function #31433

Closed
opened 2012-05-12 22:53:02 +02:00 by Michael Chappell · 18 comments

%%%The BMesh Knife tool Angle Constraint function does not work properly; The cut veers off in one direction or another for a reason I haven't found out yet. This shouldn't need a .blend file; just use the default one and try to get the knife tool to get a perfect straight line(or 45 degree angle line) using the knife tool.

OS Version is Win7 64bit Home Premium

The error has been in Blender since BMesh was intergrated; my current version is 2.63.5 r46549

I've had a few people preform the error as well from a Blender support IRC channel.%%%

%%%The BMesh Knife tool Angle Constraint function does not work properly; The cut veers off in one direction or another for a reason I haven't found out yet. This shouldn't need a .blend file; just use the default one and try to get the knife tool to get a perfect straight line(or 45 degree angle line) using the knife tool. OS Version is Win7 64bit Home Premium The error has been in Blender since BMesh was intergrated; my current version is 2.63.5 r46549 I've had a few people preform the error as well from a Blender support IRC channel.%%%

Changed status to: 'Open'

Changed status to: 'Open'

%%%Sorry, I forgot to make set the Category to Mesh Editing.%%%

%%%Sorry, I forgot to make set the Category to Mesh Editing.%%%
Member

%%%I'm not sure what error you are reporting. Do you know that the angle is in screen space, not model space? Or are you talking about the fact that the snapping can make it not be exactly 45 degrees (though it is close)?%%%

%%%I'm not sure what error you are reporting. Do you know that the angle is in screen space, not model space? Or are you talking about the fact that the snapping can make it not be exactly 45 degrees (though it is close)?%%%

%%%I mean the angle-snapping.

Yes I do know that its viewport and not global.

And sort of; Its not perfect on any of them; see my picture for details on the verticle axis. I was using it for a retopo'ing project that needed straight lines, although it never got actually straight. It got as close as .00001 off, but not perfect, unfourtunantly.%%%

%%%I mean the angle-snapping. Yes I do know that its viewport and not global. And sort of; Its not perfect on any of them; see my picture for details on the verticle axis. I was using it for a retopo'ing project that needed straight lines, although it never got actually straight. It got as close as .00001 off, but not perfect, unfourtunantly.%%%

%%%I observed often the same problem rather often.
Sometime when i press C during a knife cut to constraint the angle, it works perfectly and as expected, the cut is indeed constrained to the white line.
But sometime it does not work good, the constrained angle is not exactly what it should be, it is more or less close to the "white line" showed by the constraint when pressing C, making it so you need to find manual non-knife workaround to actually get the cut to occur as desired.%%%

%%%I observed often the same problem rather often. Sometime when i press C during a knife cut to constraint the angle, it works perfectly and as expected, the cut is indeed constrained to the white line. But sometime it does not work good, the constrained angle is not exactly what it should be, it is more or less close to the "white line" showed by the constraint when pressing C, making it so you need to find manual non-knife workaround to actually get the cut to occur as desired.%%%

%%%So this is a confirmed bug?%%%

%%%So this is a confirmed bug?%%%

%%%I have this error as well. The endpoint of your cut remains a fixed distance to one side of the constraining line, so that moving out as far as possible is the only way to reduce the error. The problem may be related to the fact that moving the view while angle snapping is enabled causes drastic misalignment, except that it starts out that way even if the face normal is perfectly aligned with the viewport.%%%

%%%I have this error as well. The endpoint of your cut remains a fixed distance to one side of the constraining line, so that moving out as far as possible is the only way to reduce the error. The problem may be related to the fact that moving the view while angle snapping is enabled causes drastic misalignment, except that it starts out that way even if the face normal is perfectly aligned with the viewport.%%%

%%%I just realized what causes the problem. Error is directly related to whether you start your cut snapped to an edge. If your mouse is slightly off from the point where the cut actually starts (due to snapping), the cut will be offset from the angle constraint by that distance. The solution for now is to start the cut slightly away from the edge, then cut through it. All subsequent cuts in angle snap mode will work just fine; only the first cut has this problem. Hope this gets fixed soon.%%%

%%%I just realized what causes the problem. Error is directly related to whether you start your cut snapped to an edge. If your mouse is slightly off from the point where the cut actually starts (due to snapping), the cut will be offset from the angle constraint by that distance. The solution for now is to start the cut slightly away from the edge, then cut through it. All subsequent cuts in angle snap mode will work just fine; only the first cut has this problem. Hope this gets fixed soon.%%%

%%%Ah, thank you! Will do until its fixed! :)%%%

%%%Ah, thank you! Will do until its fixed! :)%%%

%%%i confirm the bug in all bmesh builds (last test on buildbot version r47060), thanks for the workaround in the meantime.%%%

%%%i confirm the bug in all bmesh builds (last test on buildbot version r47060), thanks for the workaround in the meantime.%%%

%%%I'm trying to reproduce this error and I think I understand what's going on.

To me, there seems to be 2 problems occurring:

  1. When you rotate, pan, or zoom, the knife tool does not update how it constrains angles. Accidentally tweak any of these and you won't have nice angles.
  2. The code for how it draws constrained angles seems go give inconsistent results. Not as big a deal as 1, but it helps hide the problem.

I'll check into this.%%%

%%%I'm trying to reproduce this error and I think I understand what's going on. To me, there seems to be 2 problems occurring: 1) When you rotate, pan, or zoom, the knife tool does not update how it constrains angles. Accidentally tweak any of these and you won't have nice angles. 2) The code for how it draws constrained angles seems go give inconsistent results. Not as big a deal as 1, but it helps hide the problem. I'll check into this.%%%

%%%I should note, it seems to when you place a point to cut from, it at that point seems to decide how how constraints work. So, when you mess up constraints by rotating/panning/zooming, it is reset when you do select another point.%%%

%%%I should note, it seems to when you place a point to cut from, it at that point seems to decide how how constraints work. So, when you mess up constraints by rotating/panning/zooming, it is reset when you do select another point.%%%
Member

%%%The main problem is that the code snaps to edges and vertices when the cursor gets close to them (even when snapping is 'turned off' - it just does it to a lesser extent). And then it uses some interpolation code to find out where the intersection is. This has to be changed when the angle constraints is on, but I have to figure out the math. I hope to get to fixing this soon (it is first on my plate to fix).%%%

%%%The main problem is that the code snaps to edges and vertices when the cursor gets close to them (even when snapping is 'turned off' - it just does it to a lesser extent). And then it uses some interpolation code to find out where the intersection is. This has to be changed when the angle constraints is on, but I have to figure out the math. I hope to get to fixing this soon (it is first on my plate to fix).%%%

%%%Howard: Mmm, thanks for pointing that out; that makes sense.

Nicholas: Hooray! Someone is assigned! Thanks for helping out! :)%%%

%%%Howard: Mmm, thanks for pointing that out; that makes sense. Nicholas: Hooray! Someone is assigned! Thanks for helping out! :)%%%

%%%The exact problem is in knife_snap_angle() in editmesh_knife.c. the alignment code is reliant on previous mouse coordinates. The problem with this is that it does not currently correct the "mouse coordinates" to match the screen coordinates snapped-to edges or vertices.

The way I'm trying to approach this is to set the current mouse coordinates cur.mval to the appropriate screen coordinates in knife_update_active().

Handling the vertex snap is relatively simple since KnifeVert has a value for screen coordinates and is given one in knife_find_closest_vert().

KnifeEdge is not so simple because it currently does not store a vertex information. Thus, maybe it would be best to set mval to the snapped location in knife_find_closest_vert() and knife_find_closest_edge() respectively instead of knife_update_active()?

I'm not well familiarized with the code I'm looking at currently so I am not sure the best place to put this.%%%

%%%The exact problem is in knife_snap_angle() in editmesh_knife.c. the alignment code is reliant on previous mouse coordinates. The problem with this is that it does not currently correct the "mouse coordinates" to match the screen coordinates snapped-to edges or vertices. The way I'm trying to approach this is to set the current mouse coordinates cur.mval to the appropriate screen coordinates in knife_update_active(). Handling the vertex snap is relatively simple since KnifeVert has a value for screen coordinates and is given one in knife_find_closest_vert(). KnifeEdge is not so simple because it currently does not store a vertex information. Thus, maybe it would be best to set mval to the snapped location in knife_find_closest_vert() and knife_find_closest_edge() respectively instead of knife_update_active()? I'm not well familiarized with the code I'm looking at currently so I am not sure the best place to put this.%%%

%%%Just committed a patch, should work as of r48155. :)

Closing as fixed.%%%

%%%Just committed a patch, should work as of r48155. :) Closing as fixed.%%%

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'

%%%Would like to Re-Open, I have found it again in 2.64.9 r52715. Cannot seem to attach video, I uploaded it to dropbox instead; http://db.tt/haoVCS3v . Specs are same as above, but if it helps;

Win7 64bit
Current Blender version is 2.64.9, r52715

Also tested in;

  • 2.65 RC2
  • Latest Buildbot release (2.64.9, r52813)

The error persists. Thanks for your help!%%%

%%%Would like to Re-Open, I have found it again in 2.64.9 r52715. Cannot seem to attach video, I uploaded it to dropbox instead; http://db.tt/haoVCS3v . Specs are same as above, but if it helps; Win7 64bit Current Blender version is 2.64.9, r52715 Also tested in; - 2.65 RC2 - Latest Buildbot release (2.64.9, r52813) The error persists. Thanks for your help!%%%
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
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
6 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#31433
No description provided.