From bde35c8e849f57a6a7ce496f53cbf8a528e3bcdd Mon Sep 17 00:00:00 2001 From: adam-urbanczyk Date: Sun, 17 Jun 2018 18:20:32 +0200 Subject: [PATCH] Added multiply method for possible cqparts support --- cadquery/occ_impl/geom.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/cadquery/occ_impl/geom.py b/cadquery/occ_impl/geom.py index bfac70ed..9dc78fe8 100644 --- a/cadquery/occ_impl/geom.py +++ b/cadquery/occ_impl/geom.py @@ -164,20 +164,24 @@ class Matrix: """ def __init__(self, matrix=None): + if matrix is None: self.wrapped = gp_Trsf() else: self.wrapped = matrix def rotateX(self, angle): + self._rotate(gp.OX(), angle) def rotateY(self, angle): + self._rotate(gp.OY(), angle) def rotateZ(self, angle): + self._rotate(gp.OZ(), angle) @@ -190,8 +194,12 @@ class Matrix: self.wrapped = self.wrapped * new def inverse(self): + return Matrix(self.wrapped.Invert()) - + + def multiply(self,other): + + return Matrix(self.wrapped*other.wrapped) class Plane(object): """A 2D coordinate system in space