From 8d5e782ccf220d77f0aad5a4e5605dc5cbe0f410 Mon Sep 17 00:00:00 2001 From: Garret Fick Date: Sat, 6 Aug 2016 09:51:58 +0800 Subject: Fix multiple problems with the merge. There are still errors, but I will intentionally leave them because future merges might resolve them --- gerber/primitives.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'gerber/primitives.py') diff --git a/gerber/primitives.py b/gerber/primitives.py index 98b3e1c..d78c6d9 100644 --- a/gerber/primitives.py +++ b/gerber/primitives.py @@ -16,12 +16,14 @@ # limitations under the License. +from itertools import combinations import math from operator import add -from itertools import combinations - -from .utils import validate_coordinates, inch, metric, convex_hull, rotate_point, nearly_equal +from .utils import validate_coordinates, inch, metric, convex_hull, rotate_point, nearly_equal + + + class Primitive(object): """ Base class for all Cam file primitives @@ -721,7 +723,8 @@ class Rectangle(Primitive): def _abs_height(self): return (math.cos(math.radians(self.rotation)) * self.height + math.sin(math.radians(self.rotation)) * self.width) - + + @property def axis_aligned_height(self): return (self._cos_theta * self.height + self._sin_theta * self.width) -- cgit