Skip to content

Instantly share code, notes, and snippets.

@theanam
Created September 4, 2026 15:47
Show Gist options
  • Select an option

  • Save theanam/3e5903d54ae7353fe9e06065f5b6d17c to your computer and use it in GitHub Desktop.

Select an option

Save theanam/3e5903d54ae7353fe9e06065f5b6d17c to your computer and use it in GitHub Desktop.
C style shape for openscad with rounded ends. Designed for my own use.
module cshape(d,h,wall,angle = 180, reset = false){ //d = internal_diameter
rotate(reset == true?-(360-angle):0)
union(){
rotate_extrude(angle = angle, convexity = 10) translate([d,0])square([wall, h]);
translate([d + wall/2,0])cylinder(d = wall, h = h);
rotate(angle) translate([d + wall/2,0])cylinder(d = wall, h = h);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment