From 8f7a92634c7b185ed988e4c867cb16224c8648c6 Mon Sep 17 00:00:00 2001 From: "Zheng, Lei" Date: Tue, 10 Jul 2018 08:25:37 +0800 Subject: [PATCH] utils: fix axis construction in getElementRotation() Closes #16. Thanks to @Ultran1. --- utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils.py b/utils.py index ec894d0..f9922ff 100644 --- a/utils.py +++ b/utils.py @@ -344,12 +344,12 @@ def getElementRotation(obj,reverse=False): fit_plane_to_surface1(face.Surface) error_normalized = error / face.BoundBox.DiagonalLength if error_normalized < 10**-6: #then good plane fit - axis = plane_norm + axis = FreeCAD.Vector(plane_norm) axis_fitted, _center, error = \ fit_rotation_axis_to_surface1(face.Surface) error_normalized = error / face.BoundBox.DiagonalLength if error_normalized < 10**-6: #then good rotation_axis fix - axis = axis_fitted + axis = FreeCAD.Vector(axis_fitted) else: edge = getElementShape(obj,Part.Edge) if edge: