|
1 |
| -# Company: Hexastorm |
2 |
| -# Author: Henri Starmans |
3 |
| -# Date: 26-6-2017 |
4 |
| - |
5 |
| -from os import system |
6 |
| -from math import sqrt, ceil |
7 |
| -from solid.objects import cylinder, cube, polygon, import_stl, scale |
8 |
| -from solid.utils import scad_render_to_file, up, back, right, translate |
9 |
| -from solid.utils import rotate, left, down, mirror, forward, hole, linear_extrude, hull |
10 |
| - |
11 |
| - |
12 |
| -THCKW = 2 # [mm], wall thickness |
13 |
| -SGM = 30 # number of segment for circle |
14 |
| - |
15 |
| - |
16 |
| -def ueyeholder(): |
17 |
| - """ueyeholder |
18 |
| - creates a holder for an ueye camera |
19 |
| -
|
20 |
| - A holder for an uEye camera to view upward. |
21 |
| - The uEye camera cannot look upward due its connector on the back. |
22 |
| - This design solves this problem via a cubical enclosure. |
23 |
| - """ |
24 |
| - #### UEYE cubical dimension |
25 |
| - margin = 0.3 |
26 |
| - size_x = 34 # mm |
27 |
| - size_y = 32 # mm |
28 |
| - size_z = 34.6 # mm |
29 |
| - ### UEYE screw |
30 |
| - screw_d = 3 # mm |
31 |
| - screw_z = 30.4 # sep z-direction |
32 |
| - screw_z -= screw_d |
33 |
| - screw_ytop = 19.8 # mm |
34 |
| - screw_ytop -= screw_d |
35 |
| - screw_ybottom = 21.8 |
36 |
| - screw_ybottom -= screw_d |
37 |
| - screw_zoff = 1.3+screw_d/2 |
38 |
| - connector_z = 18 # mm |
39 |
| - connector_x = 16.2 # mm |
40 |
| - #### |
41 |
| - # box |
42 |
| - # camera is pushed in from bottom |
43 |
| - holder = cube([size_x+2*THCKW+margin, size_y+2*THCKW+margin, size_z+THCKW+connector_z+margin]) |
44 |
| - holder -= translate([THCKW, THCKW , THCKW])(cube([size_x+margin, size_y+margin, |
45 |
| - size_z+THCKW+connector_z+margin])) |
46 |
| - # 4 screw holes |
47 |
| - socket = cylinder(h=size_x+2*THCKW, r=screw_d/2, segments=SGM) |
48 |
| - socket = rotate([0,90,0])(socket) |
49 |
| - sockets = socket+forward(screw_ybottom)(socket) |
50 |
| - temp = (screw_ytop-screw_ybottom)*0.5 |
51 |
| - sockets += up(screw_z)(back(temp)(socket)+forward(screw_ytop-temp)(socket)) |
52 |
| - # substraction prep sockets |
53 |
| - holder -= translate([0, (size_y-screw_ybottom)*0.5+THCKW+0.5*margin, |
54 |
| - screw_zoff+THCKW+connector_z+0.5*margin])(sockets) |
55 |
| - # space connector |
56 |
| - holder -=translate([THCKW+0.5*(size_x-connector_x),0,THCKW])(cube([connector_x, |
57 |
| - THCKW,size_z+THCKW+connector_z])) |
58 |
| - return holder |
59 |
| - |
60 |
| -if __name__ == "__main__": |
61 |
| - |
62 |
| - holder_print = ueyeholder() |
63 |
| - scad_render_to_file(holder_print, "holderprint.scad") |
64 |
| - |
| 1 | +# Company: Hexastorm |
| 2 | +# Author: Henri Starmans |
| 3 | +# Date: 26-6-2017 |
| 4 | + |
| 5 | +from os import system |
| 6 | +from math import sqrt, ceil |
| 7 | +from solid.objects import cylinder, cube, polygon, import_stl, scale |
| 8 | +from solid.utils import scad_render_to_file, up, back, right, translate |
| 9 | +from solid.utils import rotate, left, down, mirror, forward, hole, linear_extrude, hull |
| 10 | + |
| 11 | + |
| 12 | +THCKW = 2 # [mm], wall thickness |
| 13 | +SGM = 30 # number of segment for circle |
| 14 | + |
| 15 | + |
| 16 | +def ueyeholder(): |
| 17 | + """ueyeholder |
| 18 | + creates a holder for an ueye camera |
| 19 | +
|
| 20 | + A holder for an uEye camera to view upward. |
| 21 | + The uEye camera cannot look upward due its connector on the back. |
| 22 | + This design solves this problem via a cubical enclosure. |
| 23 | + """ |
| 24 | + #### UEYE cubical dimension |
| 25 | + margin = 0.3 |
| 26 | + size_x = 34 # mm |
| 27 | + size_y = 32 # mm |
| 28 | + size_z = 34.6 # mm |
| 29 | + ### UEYE screw |
| 30 | + screw_d = 3 # mm |
| 31 | + screw_z = 30.4 # sep z-direction |
| 32 | + screw_z -= screw_d |
| 33 | + screw_ytop = 19.8 # mm |
| 34 | + screw_ytop -= screw_d |
| 35 | + screw_ybottom = 21.8 |
| 36 | + screw_ybottom -= screw_d |
| 37 | + screw_zoff = 1.3+screw_d/2 |
| 38 | + connector_z = 18 # mm |
| 39 | + connector_x = 16.2 # mm |
| 40 | + #### |
| 41 | + # box |
| 42 | + # camera is pushed in from bottom |
| 43 | + holder = cube([size_x+2*THCKW+margin, size_y+2*THCKW+margin, size_z+THCKW+connector_z+margin]) |
| 44 | + holder -= translate([THCKW, THCKW , THCKW])(cube([size_x+margin, size_y+margin, |
| 45 | + size_z+THCKW+connector_z+margin])) |
| 46 | + # 4 screw holes |
| 47 | + socket = cylinder(h=size_x+2*THCKW, r=screw_d/2, segments=SGM) |
| 48 | + socket = rotate([0,90,0])(socket) |
| 49 | + sockets = socket+forward(screw_ybottom)(socket) |
| 50 | + temp = (screw_ytop-screw_ybottom)*0.5 |
| 51 | + sockets += up(screw_z)(back(temp)(socket)+forward(screw_ytop-temp)(socket)) |
| 52 | + # substraction prep sockets |
| 53 | + holder -= translate([0, (size_y-screw_ybottom)*0.5+THCKW+0.5*margin, |
| 54 | + screw_zoff+THCKW+connector_z+0.5*margin])(sockets) |
| 55 | + # space connector |
| 56 | + holder -=translate([THCKW+0.5*(size_x-connector_x),0,THCKW])(cube([connector_x, |
| 57 | + THCKW,size_z+THCKW+connector_z])) |
| 58 | + return holder |
| 59 | + |
| 60 | +if __name__ == "__main__": |
| 61 | + |
| 62 | + holder_print = ueyeholder() |
| 63 | + scad_render_to_file(holder_print, "holderprint.scad") |
| 64 | +
|
0 commit comments