4241 |
jacho |
1 |
//Funkce pro generovani sloupku |
|
|
2 |
module sloupek( |
|
|
3 |
vyska, |
|
|
4 |
zapust, |
|
|
5 |
vzdalenost_der, |
|
|
6 |
vzdalenost_od_okraje, |
|
|
7 |
vzdalenost_od_diry, |
|
|
8 |
radidus_hrany, |
|
|
9 |
prumer_sroubu, |
|
|
10 |
prumer_matice, |
|
|
11 |
vyska_matice, |
|
|
12 |
posuv_dorazu, |
|
|
13 |
matice_sila_materialu) { |
|
|
14 |
|
|
|
15 |
difference () { |
|
|
16 |
union () { |
|
|
17 |
color("green") |
|
|
18 |
translate([-(vzdalenost_od_okraje-radidus_hrany),-(vzdalenost_od_okraje-radidus_hrany),0]) // center top screw |
|
|
19 |
cylinder(vyska, d=(2*radidus_hrany), center=true); |
|
|
20 |
|
|
|
21 |
color("cyan") |
|
|
22 |
translate([vzdalenost_der/4, vzdalenost_der/4, -vyska/2]) |
|
|
23 |
linear_extrude(height = vyska) |
|
|
24 |
square([vzdalenost_der/2, vzdalenost_der/2], center = true); |
|
|
25 |
|
|
|
26 |
color("gray") |
|
|
27 |
translate([-vzdalenost_od_okraje/2, vzdalenost_der/4, -vyska/2]) |
|
|
28 |
linear_extrude(height = vyska) |
|
|
29 |
square([(vzdalenost_od_okraje), vzdalenost_der/2], center = true); |
|
|
30 |
|
|
|
31 |
color("gray") |
|
|
32 |
translate([vzdalenost_der/4, -vzdalenost_od_okraje/2, -vyska/2]) |
|
|
33 |
linear_extrude(height = vyska) |
|
|
34 |
square([vzdalenost_der/2, vzdalenost_od_okraje], center = true); |
|
|
35 |
|
|
|
36 |
color("red") |
|
|
37 |
translate([-(vzdalenost_od_okraje-radidus_hrany)/2, -vzdalenost_od_okraje/2, -vyska/2]) |
|
|
38 |
linear_extrude(height = vyska) |
|
|
39 |
square([vzdalenost_od_okraje-radidus_hrany, vzdalenost_od_okraje], center = true); |
|
|
40 |
|
|
|
41 |
color("red") |
|
|
42 |
translate([-vzdalenost_od_okraje/2,-(vzdalenost_od_okraje-radidus_hrany)/2, -vyska/2]) |
|
|
43 |
linear_extrude(height = vyska) |
|
|
44 |
square([vzdalenost_od_okraje, vzdalenost_od_okraje-radidus_hrany], center = true); |
|
|
45 |
|
|
|
46 |
color("green") |
|
|
47 |
translate([vzdalenost_der, -vzdalenost_od_okraje/2, -(vyska-(2*zapust))/2]) |
|
|
48 |
linear_extrude(height = (vyska-(2*zapust))) |
|
|
49 |
square([vzdalenost_der, vzdalenost_od_okraje], center = true); |
|
|
50 |
|
|
|
51 |
color("red") |
|
|
52 |
translate([-vzdalenost_od_okraje/2,vzdalenost_der, -(vyska-(2*zapust))/2]) |
|
|
53 |
linear_extrude(height = (vyska-(2*zapust))) |
|
|
54 |
square([ vzdalenost_od_okraje,vzdalenost_der], center = true); |
|
|
55 |
|
|
|
56 |
color("cyan") |
|
|
57 |
translate([vzdalenost_od_diry/2, vzdalenost_der, -(vyska-(2*zapust))/2]) |
|
|
58 |
linear_extrude(height = (vyska-(2*zapust))) |
|
|
59 |
square([(vzdalenost_od_diry), vzdalenost_der], center = true); |
|
|
60 |
|
|
|
61 |
color("cyan") |
|
|
62 |
translate([vzdalenost_der, vzdalenost_od_diry/2, -(vyska-(2*zapust))/2]) |
|
|
63 |
linear_extrude(height = (vyska-(2*zapust))) |
|
|
64 |
square([vzdalenost_der, vzdalenost_od_diry ], center = true); |
|
|
65 |
} |
|
|
66 |
|
|
|
67 |
//diry na sroub |
|
|
68 |
translate([0,0,0]) // center top screw |
|
|
69 |
cylinder(2*vyska, d=(prumer_sroubu), center=true); |
|
|
70 |
|
|
|
71 |
translate([vzdalenost_der,0,0]) // center top screw |
|
|
72 |
cylinder(2*vyska, d=(prumer_sroubu), center=true); |
|
|
73 |
|
|
|
74 |
translate([0,vzdalenost_der,0]) // center top screw |
|
|
75 |
cylinder(2*vyska, d=(prumer_sroubu), center=true); |
|
|
76 |
|
|
|
77 |
//diry na matice |
|
|
78 |
//1. krajni matice |
|
|
79 |
translate([vzdalenost_der,(((((prumer_matice)/2)+posuv_dorazu+vzdalenost_od_diry)/2)-(posuv_dorazu+prumer_matice/2)),((vyska-2*zapust)/2-vyska_matice/2)-matice_sila_materialu]) // center top screw |
|
|
80 |
|
|
|
81 |
cube([prumer_matice, prumer_matice+posuv_dorazu+vzdalenost_od_diry,vyska_matice], center = true); |
|
|
82 |
|
|
|
83 |
translate([vzdalenost_der,(((((prumer_matice)/2)+posuv_dorazu+vzdalenost_od_diry)/2)-(posuv_dorazu+prumer_matice/2)),-(((vyska-2*zapust)/2-vyska_matice/2)-matice_sila_materialu)]) // center top screw |
|
|
84 |
|
|
|
85 |
cube([prumer_matice, prumer_matice+posuv_dorazu+vzdalenost_od_diry,vyska_matice], center = true); |
|
|
86 |
|
|
|
87 |
|
|
|
88 |
//2. krajni matice |
|
|
89 |
translate([(((((prumer_matice)/2)+posuv_dorazu+vzdalenost_od_diry)/2)-(posuv_dorazu+prumer_matice/2)), vzdalenost_der,((vyska-2*zapust)/2-vyska_matice/2)-matice_sila_materialu]) // center top screw |
|
|
90 |
|
|
|
91 |
cube([ prumer_matice+posuv_dorazu+vzdalenost_od_diry,prumer_matice,vyska_matice], center = true); |
|
|
92 |
|
|
|
93 |
translate([(((((prumer_matice)/2)+posuv_dorazu+vzdalenost_od_diry)/2)-(posuv_dorazu+prumer_matice/2)), vzdalenost_der,-(((vyska-2*zapust)/2-vyska_matice/2)-matice_sila_materialu)]) // center top screw |
|
|
94 |
|
|
|
95 |
cube([ prumer_matice+posuv_dorazu+vzdalenost_od_diry,prumer_matice,vyska_matice], center = true); |
|
|
96 |
|
|
|
97 |
//prostredni dira |
|
|
98 |
translate([0,(((((prumer_matice)/2)+posuv_dorazu+vzdalenost_od_diry)/2)-(posuv_dorazu+prumer_matice/2)),((vyska)/2-vyska_matice/2)-matice_sila_materialu]) // center top screw |
|
|
99 |
|
|
|
100 |
cube([prumer_matice, prumer_matice+posuv_dorazu+vzdalenost_od_diry,vyska_matice], center = true); |
|
|
101 |
|
|
|
102 |
translate([0,(((((prumer_matice)/2)+posuv_dorazu+vzdalenost_od_diry)/2)-(posuv_dorazu+prumer_matice/2)),-(((vyska)/2-vyska_matice/2)-matice_sila_materialu)]) // center top screw |
|
|
103 |
|
|
|
104 |
cube([prumer_matice, prumer_matice+posuv_dorazu+vzdalenost_od_diry,vyska_matice], center = true); |
|
|
105 |
|
|
|
106 |
} |
|
|
107 |
} |