# Commits

committed 9e6c491

• Participants
• Parent commits 1749aa5
• Branches default

# File examples/smorgasbord.py

• Ignore whitespace
` from py2scad import *`
` import scipy`
` `
`-if 1:`
`+if 0:`
` `
`     c = Circle(r=2.0)`
`     s = Square(size=[3,1])`
`     torus.write('test.scad')`
`     print torus`
` `
`-if 0:`
`+if 1:`
` `
`     x = scipy.linspace(0,8,500)`
` `

• Ignore whitespace
`         self.front = plate_maker.make()`
`         self.back = plate_maker.make()`
` `
`-    def add_holes(self, hole_list):`
`+    def add_holes(self, hole_list, cut_depth = None):`
`         """`
`         Add holes to given panel of the enclosure. `
`         """`
`-`
`-        wall_thickness = self.params['wall_thickness']`
`+        if not cut_depth:`
`+            cut_depth = 2*self.params['wall_thickness']`
` `
`         for hole in hole_list:`
` `
`             # Create differencing cylinder for hole based on hole type.`
`             if hole['type'] == 'round':`
`                 radius = 0.5*hole['size']`
`-                hole_cyl = Cylinder(r1=radius, r2=radius, h = 2*wall_thickness)`
`+                hole_cyl = Cylinder(r1=radius, r2=radius, h=cut_depth)`
`             elif hole['type'] == 'square':`
`                 sz_x, sz_y = hole['size']`
`-                sz_z = 2*wall_thickness`
`+                sz_z = cut_depth `
`                 hole_cyl = Cube(size = (sz_x,sz_y,sz_z))`
`             elif hole['type'] == 'rounded_square':`
`                 sz_x, sz_y, radius = hole['size']`
`-                sz_z = 2*wall_thickness`
`+                sz_z = cut_depth `
`                 hole_cyl = rounded_box(sz_x, sz_y, sz_z, radius, round_z=False)`
`             else:`
`                 raise ValueError, 'unkown hole type {0}'.format(hole['type'])`