/*
Creator : Kerem Yollu 
date : 30.06.2021
Description : library for din rail and accessories. 
*/
	

include <box.scad>
$fn = 100; 
va = 0.02;      // Visual addition for difference
vap = va/2;     // Half of visual addition 
van = -(va/2);  // Negative half of visual addition


pb1_small_dia = 10.8;
pb1_big_dia = 13.2;
pb1_lenght = 13;

pb_holder(pb1_big_dia,pb1_small_dia,pb1_lenght); 



module pb_holder(big_dia = 10, small_dia = 5 , distance = 10)
{
    wall_thickness = 1.6; 

    #difference()
    {
        hull()
        {
            translate([0,0,distance/2+van])
                cube(size=([big_dia+2*wall_thickness,big_dia+2*wall_thickness,va]),center=true);
            translate([0,0,-distance/2+vap])
                cube(size=([small_dia+2*wall_thickness,small_dia+2*wall_thickness,va]),center=true);
        }

        hull()
        {
        translate([0,0,distance/2])
            cylinder(d=big_dia, h=va, center = true);

        translate([0,0,-distance/2])
            cylinder(d=small_dia, h=va, center = true);
        }

        hull()
        {
            translate([0,big_dia/2,distance/2+van])
                cube(size=([big_dia,big_dia,va]),center=true);
            translate([0,small_dia/2,-distance/2+vap])
                cube(size=([small_dia,small_dia,va]),center=true);
        }
    }   
}