[ Issue #7125 ] [ Bug ] Changing Draft snapRange on-the-fly breaks FreeCAD.Units.Quantity?

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
Post Reply
User avatar
Roy_043
Veteran
Posts: 5266
Joined: Thu Dec 27, 2018 12:28 pm

[ Issue #7125 ] [ Bug ] Changing Draft snapRange on-the-fly breaks FreeCAD.Units.Quantity?

Post by Roy_043 »

Changing the Draft snapRange on-the-fly seems to break FreeCAD.Units.Quantity.

Test scenario:
  1. Start FreeCAD.
  2. Switch to the Draft WB.
  3. Change the gridSpacing to 1 mm (Edit → Preferences... → Draft → Grid and snapping → Grid → Grid spacing)
  4. Open a new document.
  5. Paste: FreeCAD.Units.Quantity("1,00 mm") in the Python console.
  6. Result: 1.0 mm. OK.
  7. Make sure the grid is visible (Draft_ToggleGrid)
  8. Start the Draft_Line command.
  9. Pick the first point in the 3D view.
  10. Click the "[" key to increase the snapRange (see Draft_Snap#Preferences).
  11. Move the cursor a little bit.
  12. Result: the grid disappears.
  13. Pick a second point to finish the command.
  14. Paste: FreeCAD.Units.Quantity("1,00 mm") in the Python console.
  15. Result: 2.2250738585072014e-308. Bug?

Code: Select all

OS: Windows 8.1 (6.3)
Word size of FreeCAD: 64-bit
Version: 0.21.29283 (Git)
Build type: Release
Branch: master
Hash: 15e3e86c5a683f3b2e5c7b95d4b26cd719ab367a
Python 3.8.13, Qt 5.12.9, Coin 4.0.0, Vtk 9.1.0, OCC 7.5.3
Locale: Dutch/Netherlands (nl_NL)
Installed mods: 
Last edited by Roy_043 on Fri Jul 01, 2022 9:13 am, edited 1 time in total.
Bance
Veteran
Posts: 2713
Joined: Wed Feb 11, 2015 3:00 pm
Location: London

Re: [ Bug ] Changing Draft snapRange on-the-fly breaks FreeCAD.Units.Quantity?

Post by Bance »

Confirmed in :-

Code: Select all

OS: Manjaro Linux (XFCE/xfce)
Word size of FreeCAD: 64-bit
Version: 0.20.29177 (Git) AppImage
Build type: Release
Branch: (HEAD detached at 0.20)
Hash: 68e337670e227889217652ddac593c93b5e8dc94
Python 3.10.5, Qt 5.12.9, Coin 4.0.0, Vtk 9.1.0, OCC 7.5.3
Locale: English/United Kingdom (en_GB)
Installed mods: 
  * Curves 0.5.0
  * fasteners 0.3.46
  * fcgear 1.0.0
  * kicadStepUpMod 10.13.2
User avatar
Roy_043
Veteran
Posts: 5266
Joined: Thu Dec 27, 2018 12:28 pm

Re: [ Bug ] Changing Draft snapRange on-the-fly breaks FreeCAD.Units.Quantity?

Post by Roy_043 »

Thanks for testing.
Post Reply