Crashes if tool angle is set to 0 in Geometry Object properties

Issue #377 resolved
Ennis Massey created an issue

If you set the diameter of a V-bit tool to 0 in the Geometry Object dialog, Flatcam will immediately crash. I presume this is some kind of divide by 0 error, and should be fixed to prevent loss of work from inputting an incorrect number by accident

Comments (7)

  1. Marius Stanciu

    Ok, Thanks. I handled the ZeroDivisionError exception but what do you think is better: to enforce a minimum tip angle of let’s say 1 degree or to just ignore the angle and set the Cut Z to zero value?

  2. Ennis Massey reporter

    If possible, I’d outline the box in red if the value is invalid, so the user is aware that the value given is not usable, and ignore a value equal to 0. You’d have to keep the previous valid value that was in the box for calculations. It’d be easier to just overwrite the users input to the minimum valid value, but it’s frustrating for users when the UI ignores what they put in, so it’s better if the user can input whatever they want. As for minimum valid value, I’d say 1 degree would be reasonable.

  3. Marius Stanciu

    I think I’ll stick with not allowing the user enter values below the lower limit. Too much work otherwise.
    I could add a range in the tool tip but that will make things harder in translations.

  4. Ennis Massey reporter

    Right. Was mostly thinking about user experience, since I’ve noticed a lot of developer driven software does things that for devs are fine, but become frustrating and confusing for normal users. Maybe something to shelve for future improvement.

  5. Marius Stanciu

    OK. I’ve added some messages that will confirm if the value entered is valid or if it is out of range.

  6. Log in to comment