Commits

iorodeo committed cf73708 Draft

Finished initial design. Need to clean up a bit - move some buried parameters
to the params dictionary.

Comments (0)

Files changed (2)

make_enclosure.py

 INCH2MM = 25.4
 
 # Inside dimensions
-x,y,z = 8.5*INCH2MM, 6.0*INCH2MM, 2.5*INCH2MM
+x,y,z = 8.5*INCH2MM, 4.5*INCH2MM, 2.5*INCH2MM
+fn = 50
 
 params = {
         'inner_dimensions'        : (x,y,z), 
-        'wall_thickness'          : (1.0/4.0)*INCH2MM, 
+        'wall_thickness'          : 6.0, 
         'lid_radius'              : 0.25*INCH2MM,  
         'top_x_overhang'          : 0.2*INCH2MM,
         'top_y_overhang'          : 0.2*INCH2MM,
         'lid2front_tab_width'     : 0.75*INCH2MM,
         'lid2side_tab_width'      : 0.75*INCH2MM, 
         'side2side_tab_width'     : 0.5*INCH2MM,
+        'tab_depth_adjust'        : -0.6,
         'standoff_diameter'       : 0.5*INCH2MM,
         'standoff_offset'         : 0.05*INCH2MM,
         'standoff_hole_diameter'  : 0.196*INCH2MM, 
-        'filter_holder_thickness' : (1.0/4.0)*INCH2MM,
+        'filter_holder_thickness' : 6.0,
         'filter_location'         : (1.25*INCH2MM,0),
+        'cover_thickness'         : 3.0,
         'hole_list'               : [],
         }
 
 enclosure = Transilluminator(params)
 enclosure.make()
 
-part_assembly = enclosure.get_assembly(explode=(0,0,0),show_bottom=True)
+part_assembly = enclosure.get_assembly(explode=(0,0,0),show_top=True,show_filter_holder=True,show_bottom=True)
 part_projection = enclosure.get_projection()
+part_cover_plate = enclosure.get_cover_plate_projection()
+part_filter_holder = enclosure.get_filter_holder_projection()
 
 prog_assembly = SCAD_Prog()
-prog_assembly.fn = 50
+prog_assembly.fn = fn 
 prog_assembly.add(part_assembly)
 prog_assembly.write('enclosure_assembly.scad')
 
 prog_projection = SCAD_Prog()
-prog_projection.fn = 50
+prog_projection.fn = fn 
 prog_projection.add(part_projection)
 prog_projection.write('enclosure_projection.scad')
 
+prog_cover_plate = SCAD_Prog()
+prog_cover_plate.fn = fn
+prog_cover_plate.add(part_cover_plate)
+prog_cover_plate.write('cover_plate_projection.scad')
+
+prog_filter_holder = SCAD_Prog()
+prog_filter_holder.fn = fn
+prog_filter_holder.add(part_filter_holder)
+prog_filter_holder.write('filter_holder_projection.scad')
+
+
+
+

transilluminator.py

+import scipy
 from py2scad import *
 
 class Transilluminator(Basic_Enclosure):
         self.params = params
 
     def make(self):
-        self.__make_filter_holder()
+        self.__make_holder_and_cover()
         super(Transilluminator,self).make()
         self.__make_custom_holes()
 
+    def get_filter_holder_projection(self):
+        return Projection(self.filter_holder)
+
+    def get_cover_plate_projection(self):
+        return Projection(self.cover_plate)
+
     def  __make_custom_holes(self): 
         hole_list = []
 
         filter_location = self.params['filter_location']
         holder_thickness = self.params['filter_holder_thickness']
+        inner_x, inner_y, inner_z = self.params['inner_dimensions']
+
         # Add square hole to top
         hole = {
                 'panel' : 'top',
                 'size': (65,65),
                 }
         hole_list.append(hole)
+
+        # Add square hole to filter holder
         hole = { 
                 'panel' : 'filter_holder',
                 'type' :  'square',
                 }
         hole_list.append(hole)
 
-        # Add holes for power connector 
+        # Add hole for power connector 
         hole = {
                 'panel': 'left',
                 'type':  'square',
                 'size':  (26.9, 27.6)
                 }
         hole_list.append(hole)
+
+        # Add mounting holes for power connector
+        # 5-40 threaded.
         for i in (-1,1):
             hole  = {
                     'panel' : 'left',
                     'type':  'round', 
                     'location' : (i*43.8/2.0, 0),
-                    'size'  : 3.3
+                    'size'  : 0.104*INCH2MM 
                     }
             hole_list.append(hole)
-            
+
+        # Make vent holes for bottom
+        gap = 4*0.25*INCH2MM
+        vent_hole_diam = 0.25*INCH2MM
+        N = int(inner_x/(4*vent_hole_diam))
+        x_pos = scipy.linspace(-inner_x/2+gap, inner_x/2-gap,N)
+        y_pos = [-inner_y/4.0, inner_y/4.0]
+        for x in x_pos:
+            for y in y_pos:
+                hole = {
+                        'panel'    : 'bottom', 
+                        'type'     :  'round',
+                        'location' : (x,y),
+                        'size'     : vent_hole_diam,
+                        }
+                hole_list.append(hole)
+
+        # Make mount holes for UV lamp
+        # 8-32
+        lamp_mount_spacing = 142.0
+        lamp_mount_offset = 0.5*INCH2MM
+        lamp_mount_diam =0.136*INCH2MM   
+        for x in (-0.5*lamp_mount_spacing, 0.5*lamp_mount_spacing):
+            hole = {
+                    'panel'     : 'bottom', 
+                    'type'      : 'round',
+                    'location'  : (x-lamp_mount_offset,0),
+                    'size'      : lamp_mount_diam, 
+                    }
+            hole_list.append(hole)
+
         self.add_holes(hole_list, cut_depth=2*holder_thickness)
+        
 
-
-    def __make_filter_holder(self):
+    def __make_holder_and_cover(self):
         """
         Create copy of top for filter holder
         """
         holder_maker = Plate_W_Slots(holder_params)
         self.filter_holder = holder_maker.make()
 
+        # Create cover plate
+        top_size  = top_x, top_y, self.params['cover_thickness']
+        cover_params = {'size' : top_size, 'radius' : lid_radius, 'slots' : []}
+        cover_maker = Plate_W_Slots(cover_params)
+        self.cover_plate = cover_maker.make()
+
         # Add holes for standoffs
         standoff_diameter = self.params['standoff_diameter']
         standoff_offset = self.params['standoff_offset']
                         'size'      : standoff_hole_diameter,
                         }
                 hole_list.append(hole)
+                hole = { 
+                        'panel'     : 'cover_plate', 
+                        'type'      : 'round',
+                        'location'  : (x,y), 
+                        'size'      : standoff_hole_diameter,
+                        }
+                hole_list.append(hole)
 
         self.add_holes(hole_list,cut_depth=2*holder_thickness)
 
+
     def get_assembly(self, **kwargs):
-        explode = kwargs['explode']
+        assembly_options = {
+                'explode'            : (0,0,0),
+                'show_filter_holder' : True,
+                'show_cover_plate'   : True,
+                }
+        assembly_options.update(kwargs)
+        explode = assembly_options['explode']
+        explode_x, explode_y, explode_z = explode
 
         parts_list = super(Transilluminator,self).get_assembly(**kwargs)
 
-        # Translate filter holder into position
         inner_x, inner_y, inner_z = self.params['inner_dimensions']
         wall_thickness = self.params['wall_thickness']
         holder_thickness = self.params['filter_holder_thickness']
+        cover_thickness = self.params['cover_thickness']
         
-        explode_x, explode_y, explode_z = explode
-
         # Translate top and bottom into assembled positions
         top_z_shift = 0.5*inner_z + 0.5*wall_thickness + explode_z
         filter_z_shift = top_z_shift + 0.5*holder_thickness + 0.5*wall_thickness + explode_z
         filter_holder = Translate(self.filter_holder, v=(0.0,0.0,filter_z_shift))
         filter_holder = Color(filter_holder,rgba=(1,0,0,1))
-        parts_list.append(filter_holder)
+
+        # Translate cover plate into  positon
+        cover_z_shift = filter_z_shift + 0.5*cover_thickness + 0.5*wall_thickness 
+        cover_plate = Translate(self.cover_plate, v=(0,0,cover_z_shift+explode_z))
+        cover_plate = Color(cover_plate,rgba=(0,0,1,0.5))
+
+        if assembly_options['show_filter_holder'] == True:
+            parts_list.append(filter_holder)
+        if assembly_options['show_cover_plate'] == True:
+            parts_list.append(cover_plate)
 
         return parts_list
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.