Skip to content

Instantly share code, notes, and snippets.

@dcabines
Created November 2, 2022 13:34
Show Gist options
  • Save dcabines/adaf48faed1f23512fafd11d5b3b4bed to your computer and use it in GitHub Desktop.
Save dcabines/adaf48faed1f23512fafd11d5b3b4bed to your computer and use it in GitHub Desktop.
For hydroponic irrigation
tube_radius = 4;
wall = 1.2;
ring_degree = 310;
ring_radius = 80;
ring_step = 10;
hole_min_radius = 0.6;
hole_max_radius = 1;
hole_diff_radius = hole_max_radius - hole_min_radius;
tail_radius = 5;
extension_length = 15;
$fn= 360 / ring_step;
union() {
rotate(360 - ring_degree)
union() {
// cap
translate([ring_radius, wall, 0])
rotate([90, 0, 0])
cylinder(wall,tube_radius,tube_radius);
difference() {
// ring
rotate_extrude(angle = ring_degree)
translate([ring_radius, 0, 0])
difference() {
circle(tube_radius);
circle(tube_radius - wall);
}
// holes
rotate(-50)
mirror([0,1,0])
for (i = [ring_step / 4 : ring_step / 2 : ring_degree]) {
hole_percent = i / ring_degree;
hole_percent_radius = hole_diff_radius * hole_percent;
this_hole_radius = hole_percent_radius + hole_min_radius;
rotate(i)
translate([ring_radius, 0, wall])
cylinder(wall * 3, this_hole_radius, this_hole_radius);
}
}
}
// tail
translate([ring_radius, 0, 0])
union() {
// curve
mirror([1, 0, 0])
translate([-tail_radius, 0, 0])
rotate_extrude(angle = 90)
translate([tail_radius, 0, 0])
difference() {
circle(tube_radius);
circle(tube_radius - wall);
}
// extension
translate([tail_radius, tail_radius, 0])
rotate([0, 90, 0])
linear_extrude(extension_length)
difference() {
circle(tube_radius);
circle(tube_radius - wall);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment