Ondsel-Development / FreeCAD

This is the official source code of FreeCAD, a free and opensource multiplatform 3D parametric modeler.
https://www.freecad.org
Other
192 stars 8 forks source link

setting invalid values in the cylindrical constraint limits causes all the limits to silently fail #61

Closed kevenwyld closed 5 months ago

kevenwyld commented 5 months ago

Is there an existing issue for this?

Problem description

When attempting to set limits for the cylindrical constraint only certain values for min and max seem to be valid. Negative values for min, positive values for max, etc. When setting a value that is invalid, for example a positive min, all the limits silently break. There doesn't seem to be any error output visible to the user in the console or report view, the object is just allowed to move past all the limits when any one of the values is invalid.

Thanks!

Full version info

OS: Arch Linux (sway/sway)
Word size of Ondsel: 64-bit
Version: 2024.2.0.37191 (Git) AppImage
Build type: Release
Branch: (HEAD detached at 2024.2.0)
Hash: 2ad5fb327d068ae6280cf702d528b3a6e35770a7
Python 3.11.9, Qt 5.15.13, Coin 4.0.2, Vtk 9.2.6, OCC 7.7.2
Locale: English/United States (en_US)
Installed mods: 
  * Ondsel-Lens 2024.5.6.01

Subproject(s) affected?

Assembly

Anything else?

https://github.com/Ondsel-Development/FreeCAD/assets/11936535/7619959a-e542-4b7e-bafa-8fbe29829f93

Code of Conduct

PaddleStroke commented 5 months ago

Thanks for the report. Note that limits have merged into freecad main. So it is best to post the issue there, so that more people can see it.

Onto the problem itself: We could add a check on joint creation to check if the limits are valid and prevent validation if they are not.

PaddleStroke commented 5 months ago

The alternate solution is to fix automatically if the limits are invalid. So if min is less than max we just swap them when solving. This way we avoid the blocking error message.

kevenwyld commented 5 months ago

Thanks @PaddleStroke! I'll try to test the PR you linked if I can manage to build it.