Draft: intermediate fix for get_normal: check if 3D view exists
This avoids issues with TechDraw views of Arch models if there is no active 3D view.
This commit is contained in:
@@ -253,9 +253,11 @@ def get_normal(shape, tol=-1):
|
||||
|
||||
# Check the 3D view to flip the normal if the GUI is available
|
||||
if App.GuiUp:
|
||||
v_dir = gui_utils.get_3d_view().getViewDirection()
|
||||
if normal.getAngle(v_dir) < 0.78:
|
||||
normal = normal.negative()
|
||||
view = gui_utils.get_3d_view()
|
||||
if view is not None:
|
||||
v_dir = view.getViewDirection()
|
||||
if normal.getAngle(v_dir) < 0.78:
|
||||
normal = normal.negative()
|
||||
|
||||
return normal
|
||||
|
||||
|
||||
Reference in New Issue
Block a user