/Designs/ROBOTS/TEFO01B/CAD/TEFO01B_BOX02A_USB/CAD/configuration/sloupek.scad
2,136 → 2,70
include <../configuration.scad>
use <MLAB_logo.scad>
 
//Funkce pro generovani sloupku
module sloupek(
vyska,
zapust,
vzdalenost_der,
vzdalenost_od_okraje,
vzdalenost_od_diry,
radidus_hrany,
prumer_sroubu,
prumer_matice,
vyska_matice,
posuv_dorazu,
matice_sila_materialu,logo_vyska,logo_sirka) {
sloupek ();
 
difference () {
union () {
color("green")
translate([-(vzdalenost_od_okraje-radidus_hrany),-(vzdalenost_od_okraje-radidus_hrany),0]) // center top screw
cylinder(vyska, d=(2*radidus_hrany), center=true);
 
color("cyan")
translate([vzdalenost_der/4, vzdalenost_der/4, -vyska/2])
linear_extrude(height = vyska)
square([vzdalenost_der/2, vzdalenost_der/2], center = true);
//Funkce pro generovani sloupku
module sloupek() {
 
color("gray")
translate([-vzdalenost_od_okraje/2, vzdalenost_der/4, -vyska/2])
linear_extrude(height = vyska)
square([(vzdalenost_od_okraje), vzdalenost_der/2], center = true);
color("gray")
translate([vzdalenost_der/4, -vzdalenost_od_okraje/2, -vyska/2])
linear_extrude(height = vyska)
square([vzdalenost_der/2, vzdalenost_od_okraje], center = true);
color("red")
translate([-(vzdalenost_od_okraje-radidus_hrany)/2, -vzdalenost_od_okraje/2, -vyska/2])
linear_extrude(height = vyska)
square([vzdalenost_od_okraje-radidus_hrany, vzdalenost_od_okraje], center = true);
color("red")
translate([-vzdalenost_od_okraje/2,-(vzdalenost_od_okraje-radidus_hrany)/2, -vyska/2])
linear_extrude(height = vyska)
square([vzdalenost_od_okraje, vzdalenost_od_okraje-radidus_hrany], center = true);
 
color("green")
translate([vzdalenost_der, -vzdalenost_od_okraje/2, -(vyska-(2*zapust))/2])
linear_extrude(height = (vyska-(2*zapust)))
square([vzdalenost_der, vzdalenost_od_okraje], center = true);
color("red")
translate([-vzdalenost_od_okraje/2,vzdalenost_der, -(vyska-(2*zapust))/2])
linear_extrude(height = (vyska-(2*zapust)))
square([ vzdalenost_od_okraje,vzdalenost_der], center = true);
difference () {
translate([-(prumer_matice+2*tloustka_bocnice-2*radidus_hrany)/2,-(prumer_matice+2*tloustka_bocnice-2*radidus_hrany)/2,0])
minkowski()
{
cube([prumer_matice+2*tloustka_bocnice-2*radidus_hrany,prumer_matice+2*tloustka_bocnice-2*radidus_hrany,vyska_matice+2*tloustka_bocnice]); // base plastics brick
cylinder(r=radidus_hrany,h=0.1);
}
translate([0,0,vyska_matice+2*tloustka_bocnice+0.1-tloustka_bocnice/2+0.2])
cylinder((tloustka_bocnice), d=(prumer_sroubu), center=true);
cylinder((vyska_matice+2*tloustka_bocnice), d=(prumer_sroubu), center=true);
//otvor na matici
translate([0,tloustka_bocnice/2-posuv_dorazu/2,(vyska_matice+2*tloustka_bocnice)/2])
color("cyan")
translate([vzdalenost_od_diry/2, vzdalenost_der, -(vyska-(2*zapust))/2])
linear_extrude(height = (vyska-(2*zapust)))
square([(vzdalenost_od_diry), vzdalenost_der], center = true);
color("cyan")
translate([vzdalenost_der, vzdalenost_od_diry/2, -(vyska-(2*zapust))/2])
linear_extrude(height = (vyska-(2*zapust)))
square([vzdalenost_der, vzdalenost_od_diry ], center = true);
cube([prumer_matice, prumer_matice+posuv_dorazu+tloustka_bocnice,vyska_matice], center = true);
}
 
}
difference () {
translate([-(prumer_matice+2*tloustka_bocnice)/2,-(prumer_matice+2*tloustka_bocnice)/2,-vyska_podpery])
rotate([0, 0, 45])
cylinder(vyska_podpery,0,sqrt(2*((prumer_matice+2*tloustka_bocnice)*(prumer_matice+2*tloustka_bocnice))),$fn=4);
difference () {
 
//diry na sroub
translate([0,0,0]) // center top screw
cylinder(2*vyska, d=(prumer_sroubu), center=true);
 
translate([vzdalenost_der,0,0]) // center top screw
cylinder(2*vyska, d=(prumer_sroubu), center=true);
 
translate([0,vzdalenost_der,0]) // center top screw
cylinder(2*vyska, d=(prumer_sroubu), center=true);
translate([-((sqrt(2*((prumer_matice+2*tloustka_bocnice)*(prumer_matice+2*tloustka_bocnice))*2))),-((sqrt(2*((prumer_matice+2*tloustka_bocnice)*(prumer_matice+2*tloustka_bocnice))*2))),-vyska_podpery])
cube([2*(sqrt(2*((prumer_matice+2*tloustka_bocnice)*(prumer_matice+2*tloustka_bocnice))*2)),2*(sqrt(2*((prumer_matice+2*tloustka_bocnice)*(prumer_matice+2*tloustka_bocnice))*2)),vyska_podpery+0.1]);
translate([-(prumer_matice+2*tloustka_bocnice-2*radidus_hrany)/2,-(prumer_matice+2*tloustka_bocnice-2*radidus_hrany)/2,-vyska_podpery+0.05])
minkowski()
{
cube([prumer_matice+2*tloustka_bocnice-2*radidus_hrany,prumer_matice+2*tloustka_bocnice-2*radidus_hrany,vyska_podpery+0.01]); // base plastics brick
cylinder(r=radidus_hrany,h=0.1);
}
}
}
 
//diry na matice
//1. krajni matice
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
cube([prumer_matice, prumer_matice+posuv_dorazu+vzdalenost_od_diry,vyska_matice], center = true);
}
 
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
cube([prumer_matice, prumer_matice+posuv_dorazu+vzdalenost_od_diry,vyska_matice], center = true);
 
 
//2. krajni matice
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
cube([ prumer_matice+posuv_dorazu+vzdalenost_od_diry,prumer_matice,vyska_matice], center = true);
 
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
cube([ prumer_matice+posuv_dorazu+vzdalenost_od_diry,prumer_matice,vyska_matice], center = true);
 
//prostredni dira
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
cube([prumer_matice, prumer_matice+posuv_dorazu+vzdalenost_od_diry,vyska_matice], center = true);
 
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
cube([prumer_matice, prumer_matice+posuv_dorazu+vzdalenost_od_diry,vyska_matice], center = true);
 
//----------------------------------------------------
//LOGO MLAB
union (){
translate ([5, -vzdalenost_od_okraje+1,0]) // ODROIDs passive components hole.
rotate([0, 90, 270])
scale(v = [logo_sirka, logo_vyska, 0.3])
MLAB_logo_short();
}
 
}
}
 
sloupek(
vyska,
zapust,
vzdalenost_der,
vzdalenost_od_okraje,
vzdalenost_od_diry,
radidus_hrany,
prumer_sroubu,
prumer_matice,
vyska_matice,
posuv_dorazu,
matice_sila_materialu,logo_vyska,logo_sirka);