pinch.scad 658 B

12345678910111213141516171819202122
  1. module pinch(pinchRadius, circleRadius, centerWidth=0, round=false, center=true) {
  2. zero = 0.0001;
  3. height=circleRadius*2;
  4. width = max(zero, centerWidth);
  5. cube(1,1,1,center=true);
  6. hull() {
  7. translate([0,0,center ? -circleRadius : 0]) {
  8. intersection() {
  9. translate([pinchRadius,0,circleRadius]) sphere(circleRadius);
  10. difference() {
  11. cylinder(height, r=pinchRadius);
  12. translate([0,0,-1]) cylinder(height + 2, r=pinchRadius - zero);
  13. }
  14. }
  15. translate([0,-.5*width,0]) cube([zero,1*width,height]);
  16. }
  17. }
  18. }