Peter Polidoro avatar Peter Polidoro committed 40079a2

Scaled parts so that stl files will have units of mm instead of inches

Comments (0)

Files changed (9)

fly_bowls/src/fly_bowls/export.scad

 //==================================================================//
 
 $fn = 50;
-color([0.30000,0.30000,0.30000,1.00000]){ difference() {
-    color([0.30000,0.30000,0.30000,1.00000]){ cube(size = [12.00000,12.00000,0.25000], center = true);
+scale(v=[25.40000,25.40000,25.40000]){ color([0.80000,0.80000,0.80000,0.80000]){ difference() {
+    color([0.80000,0.80000,0.80000,0.80000]){ cube(size = [12.00000,12.00000,0.50000], center = true);
     }
-    color([0.30000,0.30000,0.30000,1.00000]){ cylinder(h = 0.50000, r = 3.00000, center = true);
-    }
-    color([0.30000,0.30000,0.30000,1.00000]){ union() {
-        translate(v=[-2.75000,-4.50000,-0.07500]){ color([0.30000,0.30000,0.30000,1.00000]){ cylinder(h = 0.60000, r = 0.07950, center = true);
+    translate(v=[0.00000,0.00000,0.11200]){ color([0.80000,0.80000,0.80000,0.80000]){ rotate_extrude(convexity = 10) {
+        polygon(
+                points = [
+                        [1.58743,0.00000],
+                        [1.59881,0.00004],
+                        [1.61019,0.00014],
+                        [1.62157,0.00032],
+                        [1.63295,0.00057],
+                        [1.64433,0.00088],
+                        [1.65571,0.00127],
+                        [1.66709,0.00173],
+                        [1.67847,0.00226],
+                        [1.68985,0.00285],
+                        [1.70123,0.00352],
+                        [1.71261,0.00425],
+                        [1.72399,0.00504],
+                        [1.73537,0.00591],
+                        [1.74675,0.00683],
+                        [1.75813,0.00782],
+                        [1.76950,0.00888],
+                        [1.78088,0.01000],
+                        [1.79226,0.01117],
+                        [1.80364,0.01241],
+                        [1.81502,0.01370],
+                        [1.82640,0.01505],
+                        [1.83778,0.01646],
+                        [1.84916,0.01792],
+                        [1.86054,0.01943],
+                        [1.87192,0.02100],
+                        [1.88330,0.02261],
+                        [1.89468,0.02427],
+                        [1.90606,0.02598],
+                        [1.91744,0.02773],
+                        [1.92882,0.02952],
+                        [1.94020,0.03136],
+                        [1.95158,0.03323],
+                        [1.96295,0.03514],
+                        [1.97433,0.03708],
+                        [1.98571,0.03906],
+                        [1.99709,0.04107],
+                        [2.00847,0.04311],
+                        [2.01985,0.04517],
+                        [2.03123,0.04726],
+                        [2.04261,0.04937],
+                        [2.05399,0.05150],
+                        [2.06537,0.05365],
+                        [2.07675,0.05581],
+                        [2.08813,0.05799],
+                        [2.09951,0.06018],
+                        [2.11089,0.06237],
+                        [2.12227,0.06458],
+                        [2.13365,0.06679],
+                        [2.14503,0.06900],
+                        [2.85497,0.20700],
+                        [0.00000,0.20700],
+                        [0.00000,0.00000],
+                        [1.58743,0.00000]],
+                paths = [[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53]]);
+        
+    }}}
+    color([0.80000,0.80000,0.80000,0.80000]){ union() {
+        translate(v=[-2.75000,-4.50000,0.25000]){ color([0.80000,0.80000,0.80000,0.80000]){ union() {
+            translate(v=[0.00000,0.00000,-0.50000]){ color([0.80000,0.80000,0.80000,0.80000]){ cylinder(h = 1.00000, r = 0.10050, center = true);
+            }}
+            translate(v=[0.00000,0.00000,-0.04500]){ color([0.80000,0.80000,0.80000,0.80000]){ cylinder(h = 0.29000, r = 0.18750, center = true);
+            }}
+        }}}
+        translate(v=[2.75000,-4.50000,0.25000]){ color([0.80000,0.80000,0.80000,0.80000]){ union() {
+            translate(v=[0.00000,0.00000,-0.50000]){ color([0.80000,0.80000,0.80000,0.80000]){ cylinder(h = 1.00000, r = 0.10050, center = true);
+            }}
+            translate(v=[0.00000,0.00000,-0.04500]){ color([0.80000,0.80000,0.80000,0.80000]){ cylinder(h = 0.29000, r = 0.18750, center = true);
+            }}
+        }}}
+        translate(v=[-2.75000,4.50000,0.25000]){ color([0.80000,0.80000,0.80000,0.80000]){ union() {
+            translate(v=[0.00000,0.00000,-0.50000]){ color([0.80000,0.80000,0.80000,0.80000]){ cylinder(h = 1.00000, r = 0.10050, center = true);
+            }}
+            translate(v=[0.00000,0.00000,-0.04500]){ color([0.80000,0.80000,0.80000,0.80000]){ cylinder(h = 0.29000, r = 0.18750, center = true);
+            }}
+        }}}
+        translate(v=[2.75000,4.50000,0.25000]){ color([0.80000,0.80000,0.80000,0.80000]){ union() {
+            translate(v=[0.00000,0.00000,-0.50000]){ color([0.80000,0.80000,0.80000,0.80000]){ cylinder(h = 1.00000, r = 0.10050, center = true);
+            }}
+            translate(v=[0.00000,0.00000,-0.04500]){ color([0.80000,0.80000,0.80000,0.80000]){ cylinder(h = 0.29000, r = 0.18750, center = true);
+            }}
+        }}}
+        translate(v=[-5.50000,-4.50000,0.25000]){ color([0.80000,0.80000,0.80000,0.80000]){ union() {
+            translate(v=[0.00000,0.00000,-0.50000]){ color([0.80000,0.80000,0.80000,0.80000]){ cylinder(h = 1.00000, r = 0.10050, center = true);
+            }}
+            translate(v=[0.00000,0.00000,-0.04500]){ color([0.80000,0.80000,0.80000,0.80000]){ cylinder(h = 0.29000, r = 0.18750, center = true);
+            }}
+        }}}
+        translate(v=[5.50000,-4.50000,0.25000]){ color([0.80000,0.80000,0.80000,0.80000]){ union() {
+            translate(v=[0.00000,0.00000,-0.50000]){ color([0.80000,0.80000,0.80000,0.80000]){ cylinder(h = 1.00000, r = 0.10050, center = true);
+            }}
+            translate(v=[0.00000,0.00000,-0.04500]){ color([0.80000,0.80000,0.80000,0.80000]){ cylinder(h = 0.29000, r = 0.18750, center = true);
+            }}
+        }}}
+        translate(v=[-5.50000,4.50000,0.25000]){ color([0.80000,0.80000,0.80000,0.80000]){ union() {
+            translate(v=[0.00000,0.00000,-0.50000]){ color([0.80000,0.80000,0.80000,0.80000]){ cylinder(h = 1.00000, r = 0.10050, center = true);
+            }}
+            translate(v=[0.00000,0.00000,-0.04500]){ color([0.80000,0.80000,0.80000,0.80000]){ cylinder(h = 0.29000, r = 0.18750, center = true);
+            }}
+        }}}
+        translate(v=[5.50000,4.50000,0.25000]){ color([0.80000,0.80000,0.80000,0.80000]){ union() {
+            translate(v=[0.00000,0.00000,-0.50000]){ color([0.80000,0.80000,0.80000,0.80000]){ cylinder(h = 1.00000, r = 0.10050, center = true);
+            }}
+            translate(v=[0.00000,0.00000,-0.04500]){ color([0.80000,0.80000,0.80000,0.80000]){ cylinder(h = 0.29000, r = 0.18750, center = true);
+            }}
+        }}}
+        translate(v=[-5.50000,-2.25000,0.25000]){ color([0.80000,0.80000,0.80000,0.80000]){ union() {
+            translate(v=[0.00000,0.00000,-0.50000]){ color([0.80000,0.80000,0.80000,0.80000]){ cylinder(h = 1.00000, r = 0.10050, center = true);
+            }}
+            translate(v=[0.00000,0.00000,-0.04500]){ color([0.80000,0.80000,0.80000,0.80000]){ cylinder(h = 0.29000, r = 0.18750, center = true);
+            }}
+        }}}
+        translate(v=[5.50000,-2.25000,0.25000]){ color([0.80000,0.80000,0.80000,0.80000]){ union() {
+            translate(v=[0.00000,0.00000,-0.50000]){ color([0.80000,0.80000,0.80000,0.80000]){ cylinder(h = 1.00000, r = 0.10050, center = true);
+            }}
+            translate(v=[0.00000,0.00000,-0.04500]){ color([0.80000,0.80000,0.80000,0.80000]){ cylinder(h = 0.29000, r = 0.18750, center = true);
+            }}
+        }}}
+        translate(v=[-5.50000,2.25000,0.25000]){ color([0.80000,0.80000,0.80000,0.80000]){ union() {
+            translate(v=[0.00000,0.00000,-0.50000]){ color([0.80000,0.80000,0.80000,0.80000]){ cylinder(h = 1.00000, r = 0.10050, center = true);
+            }}
+            translate(v=[0.00000,0.00000,-0.04500]){ color([0.80000,0.80000,0.80000,0.80000]){ cylinder(h = 0.29000, r = 0.18750, center = true);
+            }}
+        }}}
+        translate(v=[5.50000,2.25000,0.25000]){ color([0.80000,0.80000,0.80000,0.80000]){ union() {
+            translate(v=[0.00000,0.00000,-0.50000]){ color([0.80000,0.80000,0.80000,0.80000]){ cylinder(h = 1.00000, r = 0.10050, center = true);
+            }}
+            translate(v=[0.00000,0.00000,-0.04500]){ color([0.80000,0.80000,0.80000,0.80000]){ cylinder(h = 0.29000, r = 0.18750, center = true);
+            }}
+        }}}
+    }}
+    color([0.80000,0.80000,0.80000,0.80000]){ union() {
+        translate(v=[-5.50000,-5.50000,-0.20000]){ color([0.80000,0.80000,0.80000,0.80000]){ cylinder(h = 1.10000, r = 0.13300, center = true);
         }}
-        translate(v=[2.75000,-4.50000,-0.07500]){ color([0.30000,0.30000,0.30000,1.00000]){ cylinder(h = 0.60000, r = 0.07950, center = true);
+        translate(v=[5.50000,-5.50000,-0.20000]){ color([0.80000,0.80000,0.80000,0.80000]){ cylinder(h = 1.10000, r = 0.13300, center = true);
         }}
-        translate(v=[-2.75000,4.50000,-0.07500]){ color([0.30000,0.30000,0.30000,1.00000]){ cylinder(h = 0.60000, r = 0.07950, center = true);
+        translate(v=[-5.50000,5.50000,-0.20000]){ color([0.80000,0.80000,0.80000,0.80000]){ cylinder(h = 1.10000, r = 0.13300, center = true);
         }}
-        translate(v=[2.75000,4.50000,-0.07500]){ color([0.30000,0.30000,0.30000,1.00000]){ cylinder(h = 0.60000, r = 0.07950, center = true);
-        }}
-        translate(v=[-5.50000,-4.50000,-0.07500]){ color([0.30000,0.30000,0.30000,1.00000]){ cylinder(h = 0.60000, r = 0.07950, center = true);
-        }}
-        translate(v=[5.50000,-4.50000,-0.07500]){ color([0.30000,0.30000,0.30000,1.00000]){ cylinder(h = 0.60000, r = 0.07950, center = true);
-        }}
-        translate(v=[-5.50000,4.50000,-0.07500]){ color([0.30000,0.30000,0.30000,1.00000]){ cylinder(h = 0.60000, r = 0.07950, center = true);
-        }}
-        translate(v=[5.50000,4.50000,-0.07500]){ color([0.30000,0.30000,0.30000,1.00000]){ cylinder(h = 0.60000, r = 0.07950, center = true);
-        }}
-        translate(v=[-5.50000,-2.25000,-0.07500]){ color([0.30000,0.30000,0.30000,1.00000]){ cylinder(h = 0.60000, r = 0.07950, center = true);
-        }}
-        translate(v=[5.50000,-2.25000,-0.07500]){ color([0.30000,0.30000,0.30000,1.00000]){ cylinder(h = 0.60000, r = 0.07950, center = true);
-        }}
-        translate(v=[-5.50000,2.25000,-0.07500]){ color([0.30000,0.30000,0.30000,1.00000]){ cylinder(h = 0.60000, r = 0.07950, center = true);
-        }}
-        translate(v=[5.50000,2.25000,-0.07500]){ color([0.30000,0.30000,0.30000,1.00000]){ cylinder(h = 0.60000, r = 0.07950, center = true);
+        translate(v=[5.50000,5.50000,-0.20000]){ color([0.80000,0.80000,0.80000,0.80000]){ cylinder(h = 1.10000, r = 0.13300, center = true);
         }}
     }}
-    color([0.30000,0.30000,0.30000,1.00000]){ union() {
-        translate(v=[-5.50000,-5.50000,-0.07500]){ color([0.30000,0.30000,0.30000,1.00000]){ cylinder(h = 0.60000, r = 0.13300, center = true);
+    color([0.80000,0.80000,0.80000,0.80000]){ union() {
+        translate(v=[0.00000,0.00000,0.11500]){ color([0.80000,0.80000,0.80000,0.80000]){ cylinder(h = 0.49400, r = 0.79550, center = true);
         }}
-        translate(v=[5.50000,-5.50000,-0.07500]){ color([0.30000,0.30000,0.30000,1.00000]){ cylinder(h = 0.60000, r = 0.13300, center = true);
-        }}
-        translate(v=[-5.50000,5.50000,-0.07500]){ color([0.30000,0.30000,0.30000,1.00000]){ cylinder(h = 0.60000, r = 0.13300, center = true);
-        }}
-        translate(v=[5.50000,5.50000,-0.07500]){ color([0.30000,0.30000,0.30000,1.00000]){ cylinder(h = 0.60000, r = 0.13300, center = true);
-        }}
+        color([0.80000,0.80000,0.80000,0.80000]){ cylinder(h = 1.00000, r = 0.15000, center = true);
+        }
     }}
-}}
+}}}

fly_bowls/src/fly_bowls/fly_bowl.py

 # import cad.cad_export.bom as bom
 
 
+# Units of inches, scale later to be in mm
 PARAMETERS = {
     'x' : 12.0,
     'y' : 12.0,
     'bowl_diameter' : 5,
     'bowl_slope' : 11,
     'counterbore_size' : '10',
-    'counterbore_x' : [[-2.75,2.75],[-5.5,5.5],[-5.5,5.5]],
-    'counterbore_y' : [[-4.5,4.5],[-4.5,4.5],[-2.25,2.25]],
+    'counterbore_x_distances' : [2.75,5.5],
+    'counterbore_y_distances' : [2.25,4.5],
     'mounting_hole_size' : '1/2',
     'mounting_hole_x' : [-5.5,5.5],
     'mounting_hole_y' : [-5.5,5.5],
     'food_dish_depth' : 0.244,
     'extraction_hole_diameter' : 0.3,
     'color' : [0.8,0.8,0.8,0.8],
+    'scale' : [25.4,25.4,25.4],
     'name' : 'FLYBOWL',
     'description' : '',
     'vendor' : '',
         # self.__set_bom()
         self.set_color(self.parameters['color'],recursive=True)
 
+        # convert to mm
+        scale = self.parameters['scale']
+        self.set_scale(scale)
+
     def get_parameters(self):
         return copy.deepcopy(self.parameters)
 
         counterbore.translate([0,0,z_offset])
 
 
-        counterbore_x = self.parameters['counterbore_x']
-        counterbore_y = self.parameters['counterbore_y']
+        counterbore_x_distances = self.parameters['counterbore_x_distances']
+        counterbore_y_distances = self.parameters['counterbore_y_distances']
+        cxd = list(set([abs(number) for number in counterbore_x_distances]))
+        cxd.sort()
+        cyd = list(set([abs(number) for number in counterbore_y_distances]))
+        cyd.sort()
+        counterbore_x = [[-cxd[0],cxd[0]],[-cxd[1],cxd[1]],[-cxd[1],cxd[1]]]
+        counterbore_y = [[-cyd[1],cyd[1]],[-cyd[1],cyd[1]],[-cyd[0],cyd[0]]]
         counterbores = po.LinearArraySet(counterbore,x=counterbore_x,y=counterbore_y)
         self.add_obj(counterbores)
 
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.