Commits

Anonymous committed da98bb6 Draft

Modified get_projection method of Basic_Enclosure so that it can take an exclude list.

Comments (0)

Files changed (1)

py2scad/highlevel.py

         return part_list
 
 
-    def get_projection(self, show_ref_cube=True, spacing_factor=4, project=True):
+    def get_projection(self, show_ref_cube=True, spacing_factor=4, project=True, exclude_list=[]):
         """
         Retruns a list of enclosure parts as 2D projections for saving as a dxf file.
 
         ref_cube = Translate(ref_cube,v=(0,y_shift,0))
 
         # Create part list
-        part_list = [top, bottom, front, back, left, right]
+        part_dict = {
+                'top'     : top, 
+                'bottom'  : bottom, 
+                'front'   : front, 
+                'back'    : back, 
+                'left'    : left,
+                'right'   : right
+                }
+        part_list= []
+        for name, part in part_dict.iteritems():
+            if name in exclude_list:
+                continue
+            part_list.append(part)
+
+        #part_list = [top, bottom, front, back, left, right]
+
         if show_ref_cube == True:
             part_list.append(ref_cube)