Parametric Hook

Gallery

Pasted image 20260126210935.png

Pasted image 20260126211543.png

Pasted image 20260126211552.png

Pasted image 20260126211644.png

Code

height = 10;
thickness = 3;
inner_gap = 13;

//length of the arms
arm_length = 30;

//small hook inner distance
small_hook_inner_distance = 31;
//small hook additonal arm length
//make this negative to shorten the arm with the hook
small_hook_additonal_arm_length = -10;

square_hook_top = true;

module ring(h = 1, diameter=6, thick=1, $fn = 64)
union() 
{ 
    difference(){
     //outer ring
     cylinder(h=h, r=(diameter/2) + thickness, center=true);

     //inner
     cylinder(h=h+1, r=diameter/2, center=true);

     //this cuts off half of the ring
     translate([150,0,0])
     cube(300, center=true);
    }
    
    translate([0,diameter/2 + thickness/2,0])
     cylinder(h=h, r=thickness/2, center=true);
    
    translate([0,-(diameter/2 + thickness/2),0])
     cylinder(h=h, r=thickness/2, center=true);

}

module arm(len, width, height, offset, $fn = 64)
{
    translate([len/2,offset,0])
    {
      cube([len,width,height], center=true);
    }
    
    translate([0,offset,0])
    cylinder(d=width,h=height, center= true);
    
    
    translate([len,offset,0])
    cylinder(d=width,h=height, center= true);

}

if (square_hook_top)
{
  cube([thickness,inner_gap+2*(thickness),height], center=true);
  
}
else
{
    ring(h=height, diameter=inner_gap, thick=thickness);
}

mirror([180, 0, 0])
    translate([-(arm_length + small_hook_additonal_arm_length),(inner_gap + small_hook_inner_distance)/2 + thickness,0])
    ring(h=height, diameter=small_hook_inner_distance, thick=thickness);

arm(arm_length + small_hook_additonal_arm_length
, thickness, height, inner_gap/2+thickness/2);
arm(arm_length, thickness, height, -(inner_gap/2+thickness/2));