Shear: enter an angle instead of offset #118414

Open
opened 2024-02-17 18:43:27 +01:00 by Jorijn de Graaf · 7 comments
Contributor

System Information
Operating system: Windows 10
Graphics card: RTX 2070 SUPER

Blender Version
Broken: Every version
Worked: Never

Short description of error
It's not an error per se, but I find that setting the Offset value is not an intuitive way to use the Shear tool.
In other programs shear takes an angle value, which I find much more intuitive.

Exact steps for others to reproduce the error
Use the Shear tool, then try getting a specific angle by setting the Offset value.

Solution
Replace Offset with Angle, and internally convert it with this formula: offset = tan(radians(90) - angle)

Notes
Perhaps this should be a feature request on another site rather than an issue here, but I decided to open one anyway since I'm going to make a pull request here.

**System Information** Operating system: Windows 10 Graphics card: RTX 2070 SUPER **Blender Version** Broken: Every version Worked: Never **Short description of error** It's not an error per se, but I find that setting the Offset value is not an intuitive way to use the Shear tool. In other programs shear takes an angle value, which I find much more intuitive. **Exact steps for others to reproduce the error** Use the Shear tool, then try getting a specific angle by setting the Offset value. **Solution** Replace Offset with Angle, and internally convert it with this formula: `offset = tan(radians(90) - angle)` **Notes** Perhaps this should be a feature request on another site rather than an issue here, but I decided to open one anyway since I'm going to make a pull request here.
Jorijn de Graaf added the
Type
Report
Priority
Normal
Status
Needs Triage
labels 2024-02-17 18:43:28 +01:00
Author
Contributor

Oh boy, all the transform operators are part of one big thing.
This might be more complicated than I thought.

Oh boy, all the transform operators are part of one big thing. This might be more complicated than I thought.

Oh boy, all the transform operators are part of one big thing.

I know that feeling :)

In any case, I would suggest discussing potentially complicated changes with module members before you spend a lot of time on coding. I can see your solution to be useful, but other users may want to use offset too, so I think there are things to discuss before implementing the feature.

> Oh boy, all the transform operators are part of one big thing. I know that feeling :) In any case, I would suggest discussing potentially complicated changes with module members before you spend a lot of time on coding. I can see your solution to be useful, but other users may want to use offset too, so I think there are things to discuss before implementing the feature.
Member

offset = tan(radians(90) - angle)

Hi, I'm not able to verify this. Could reference the source .cc file?

> offset = tan(radians(90) - angle) Hi, I'm not able to verify this. Could reference the source .cc file?
Pratik Borhade added
Module
Modeling
Status
Needs Info from Developers
and removed
Status
Needs Triage
labels 2024-02-19 07:00:46 +01:00
Author
Contributor

offset = tan(radians(90) - angle)

Hi, I'm not able to verify this.

My bad, it's just tan(angle); I found it through trial and error, and 90 minus 36 degrees was what I needed in a project.
Note that the angle needs to be in radians for tan to give sensible results, so when typing it in the UI you have to use tan(radians(angle)).

Could reference the source .cc file?

Relevant source files might be transform_gizmo_3d_shear.cc, transform_mode_shear.cc, or transform_ops.cc.
I stopped looking into it when I realized it might be complicated, but will resume if this is a feature people want.

Initially I thought angle would replace offset, but now I'm thinking there should be a way to use both (whichever the user prefers).

> > offset = tan(radians(90) - angle) > > Hi, I'm not able to verify this. My bad, it's just `tan(angle)`; I found it through trial and error, and 90 minus 36 degrees was what I needed in a project. Note that the angle needs to be in radians for tan to give sensible results, so when typing it in the UI you have to use `tan(radians(angle))`. > Could reference the source .cc file? Relevant source files might be `transform_gizmo_3d_shear.cc`, `transform_mode_shear.cc`, or `transform_ops.cc`. I stopped looking into it when I realized it might be complicated, but will resume if this is a feature people want. Initially I thought angle would replace offset, but now I'm thinking there should be a way to use both (whichever the user prefers).
Member

I'm still confused here. so if I enter offset value 2, operator evaluates it as tan(2 radian)?: Result when I offset an edge by 2
I think @mano-wii knows better about transform code.

I'm still confused here. so if I enter offset value 2, operator evaluates it as tan(2 radian)?: [Result when I offset an edge by 2](/attachments/2bdaa500-9247-4526-a332-3bb774cf06aa) I think @mano-wii knows better about transform code.
Author
Contributor

I'm still confused here. so if I enter offset value 2, operator evaluates it as tan(2 radian)?

That's the wrong way around, let me try to explain it with some examples:
When you enter tan(radians(45)), that evaluates to an offset of 1, which visually is 45 degrees.
An offset of 2 equates to an angle around 63 degrees, because tan(radians(angle)) = offset.
This offset value in turn is plugged into the transformation matrix in some way I don't fully grasp.

> I'm still confused here. so if I enter offset value 2, operator evaluates it as tan(2 radian)? That's the wrong way around, let me try to explain it with some examples: When you enter `tan(radians(45))`, that evaluates to an offset of 1, which visually is 45 degrees. An offset of 2 equates to an angle around 63 degrees, because `tan(radians(angle)) = offset`. This offset value in turn is plugged into the transformation matrix in some way I don't fully grasp.
Germano Cavalcante changed title from Shear tool Offset is unintuitive to Shear: enter an angle instead of offset 2024-02-23 03:12:52 +01:00

To support this it would be convenient to copy some of the solutions seen in the "TRANSFORM_OT_rotate_normal" operator.
Such as:

  • use angle property for "value" in transform_ops.cc.
  • use mouse input INPUT_ANGLE in transform_mode_shear.cc.

Since the offset value is currently the tangent of the angle, the conversion would basically make the angle a tangent with tanf(value).

I'm not much in position to confirm feature requests, but it seems like a convenient change. Therefore I added this task i created:
#73993 Snapping & precision modeling improvements

(I also added #73908: Shear: Support modal axis & user/local space switching).

@bonj, feel free to create a PR if you are working on this ;)

To support this it would be convenient to copy some of the solutions seen in the "TRANSFORM_OT_rotate_normal" operator. Such as: - use angle property for "value" in `transform_ops.cc`. - use mouse input `INPUT_ANGLE` in `transform_mode_shear.cc`. Since the offset value is currently the tangent of the angle, the conversion would basically make the angle a tangent with `tanf(value)`. I'm not much in position to confirm feature requests, but it seems like a convenient change. Therefore I added this task i created: #73993 Snapping & precision modeling improvements (I also added #73908: Shear: Support modal axis & user/local space switching). @bonj, feel free to create a PR if you are working on this ;)
Germano Cavalcante added
Status
Confirmed
Type
To Do
and removed
Status
Needs Info from Developers
Type
Report
labels 2024-02-23 03:25:28 +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
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#118414
No description provided.