From 37cd1cb1c9bc8e6e3de22acc9ac767fc4366b26f Mon Sep 17 00:00:00 2001 From: tstellanova Date: Sat, 31 Dec 2016 09:54:41 -0800 Subject: [PATCH] Add panel instances to panel list properly See issue 226: https://bitbucket.org/jpcgt/flatcam/issues/226/problem-panelizing-excellon --- tclCommands/TclCommandPanelize.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/tclCommands/TclCommandPanelize.py b/tclCommands/TclCommandPanelize.py index 9f77b78c..f04d7819 100644 --- a/tclCommands/TclCommandPanelize.py +++ b/tclCommands/TclCommandPanelize.py @@ -1,4 +1,6 @@ from ObjectCollection import * +from copy import copy,deepcopy + import TclCommand @@ -102,19 +104,26 @@ class TclCommandPanelize(TclCommand.TclCommand): def initialize_local(obj_init, app): obj_init.solid_geometry = obj.solid_geometry obj_init.offset([float(currentx), float(currenty)]), + objs.append(obj_init) def initialize_local_excellon(obj_init, app): - FlatCAMExcellon.merge(obj, obj_init) - obj_init.offset([float(currentx), float(currenty)]), + obj_init.tools = obj.tools + # drills are offset, so they need to be deep copied + obj_init.drills = deepcopy(obj.drills) + obj_init.offset([float(currentx), float(currenty)]) + obj_init.create_geometry() + objs.append(obj_init) def initialize_geometry(obj_init, app): FlatCAMGeometry.merge(objs, obj_init) def initialize_excellon(obj_init, app): + # merge expects tools to exist in the target object + obj_init.tools = obj.tools.copy() FlatCAMExcellon.merge(objs, obj_init) objs = [] - if obj is not None: + if obj is not None: for row in range(args['rows']): currentx = 0