FreeCAD: master d32631cc

Author Committer Branch Timestamp Parent
hyarion hyarion master 2021-01-31 19:24:59 master eb6167ff
Changeset [Draft] Add better error message in get_svg for direction

An AttributeError is raised when `direction=Vector(0,0,0)` and obj is
an Arch::Space on line: https://github.com/FreeCAD/FreeCAD/blob/bead9bb9381d039d6dda438b07e30dace7cf33ae/src/Mod/Draft/draftfunctions/svg.py#L799

This patch checks if early on if the direction vector and raises a
ValueError with a description of what has gone wrong.

A caveat with this solution is that this new behaviour might break old
code which depends on that invalid directions can be used.
mod - src/Mod/Draft/draftfunctions/svg.py Diff File
mod - src/Mod/Draft/drafttests/test_svg.py Diff File