diff options
Diffstat (limited to 'gerber/primitives.py')
-rw-r--r-- | gerber/primitives.py | 11 |
1 files changed, 7 insertions, 4 deletions
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)
|