PNS: Use mouse behavior to set H/V/45 breakpoint behavior
Description
Some other tools have the ability to use the movement of the mouse to hint at the corner behavior that will be placed by the interactive router.
This behavior is somewhat difficult to explain by text, but I will try, and then later capture a screencast if it's not clear.
Say you start routing at a pin, and go southeast (right, down). Assuming you are using the H/V/45 mode (which is most common), what KiCad does today is to draw a horizontal segment to the right, until a 45-degree segment can be started that will end at the mouse cursor:
You actually might prefer the other option: Start with the 45-degree segment, then the horizontal segment:
This is currently hard to do in KiCad, because there is a hard-coded preference for how to break segments to enforce the H/V/45 rule.
The desired feature is to use the relative movement of the mouse cursor around the start point (i.e. mouse gestures) to switch between these two break options.
The mouse behavior I am used to in other programs that accomplishes this is basically:
- If the user moves the mouse away from the start point, start drawing a segment in the direction that matches the mouse movement the closest (i.e. one of the 8 valid directions).
- Once a breakpoint is needed because the mouse moves far enough away from the initial vector, lock in the direction of that initial segment (not necessarily its length).
- If the user wants to change the direction of the starting segment, they can just backtrack to the point at which only one proposed segment is drawn, which unlocks the direction of that starting segment. Go back to step 1.
I'm attaching a video that shows a simplified example of where this would reduce frustration: Towards the middle of the video, you can see that as I move the mouse to the right, the breakpoint solution changes (from 45-H to H-45). The behavior I'm hoping for is that the breakpoint solution remains 45-H for as long as a valid solution exists that maintains that style.
(At the end of the video shows what happens when I fix the first segment with a click, then later use backspace to back up -- here I also think the better behavior is to maintain the breakpoint solution since it has equal cost to the other solution).
KiCad Version
Application: Pcbnew
Version: (5.99.0-951-gb2cc45487-dirty), debug build
Libraries:
wxWidgets 3.0.4
libcurl/7.58.0 OpenSSL/1.1.1 zlib/1.2.11 libidn2/2.0.4 libpsl/0.19.1 (+libidn2/2.0.4) nghttp2/1.30.0 librtmp/2.3
Platform: Linux 4.15.0-88-generic x86_64, 64 bit, Little endian, wxGTK
Build Info:
Build date: Feb 26 2020 22:06:30
wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8) GTK+ 2.24
Boost: 1.65.1
OpenCASCADE Community Edition: 6.9.1
Curl: 7.58.0
Compiler: GCC 7.4.0 with C++ ABI 1011
Build settings:
KICAD_SCRIPTING=OFF
KICAD_SCRIPTING_MODULES=OFF
KICAD_SCRIPTING_PYTHON3=OFF
KICAD_SCRIPTING_WXPYTHON=OFF
KICAD_SCRIPTING_WXPYTHON_PHOENIX=OFF
KICAD_SCRIPTING_ACTION_MENU=OFF
BUILD_GITHUB_PLUGIN=ON
KICAD_USE_OCE=ON
KICAD_USE_OCC=OFF
KICAD_SPICE=ON
KICAD_STDLIB_DEBUG=OFF
KICAD_STDLIB_LIGHT_DEBUG=OFF
KICAD_SANITIZE=ON