From 8a43a63b806f78a7bdd6ce61ec6c8b542f54bcc6 Mon Sep 17 00:00:00 2001 From: "Zheng, Lei" Date: Mon, 13 Jun 2016 13:18:55 +0800 Subject: [PATCH] Fixed mirroring list of geometries --- camlib.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/camlib.py b/camlib.py index 2e7a82d9..3a4a6767 100644 --- a/camlib.py +++ b/camlib.py @@ -928,11 +928,16 @@ class Geometry(object): px, py = point xscale, yscale = {"X": (1.0, -1.0), "Y": (-1.0, 1.0)}[axis] - ## solid_geometry ??? - # It's a cascaded union of objects. - self.solid_geometry = affinity.scale(self.solid_geometry, - xscale, yscale, origin=(px, py)) + def mirror_geom(obj): + if type(obj) is list: + new_obj = [] + for g in obj: + new_obj.append(mirror_geom(g)) + return new_obj + else: + return affinity.scale(obj,xscale,yscale,origin=(px,py)) + self.solid_geometry = mirror_geom(self.solid_geometry) class ApertureMacro: """