3D part design with OpenSCAD #142 : Making a 3d drain sieve.

1 min read
By Bob
3D part design with OpenSCAD #142 : Making a 3d drain sieve.

Here is an example of a hair or food catcher for a drain that is a little different. Most designs are a basket with holes, I wanted one that would have a grid that fills the center that I could rotate the grid so the holes are larger at the top and smaller at the botom.

Here is the code:

//

/*[Basket Parameters]*/
Diameter=50.8;//[20:.01:200]
Height=25.4;//[10:.01:200]
Wall_thickness=5;//[1:.01:10]
Lip_width=8;//[1:.01:20]
Lip_thickness=2;//[1:.01:6]

/*[Grid Parameters]*/
Grid_spacing=3;//[1:.01:10]
rotate_x=45;//[0:.01:180]

/*[Hidden]*/
$fa=$preview? 2:1;;
$fs=$preview?.5:.1;;

module slots(){
for(i=[1:Grid_spacing:Diameter]){
translate([0,i-2,Height])
rotate([rotate_x,0,0])
cube([Diameter*2,1,Height*2],center=true);
translate([0,-i,Height])
rotate([rotate_x,0,0])
cube([Diameter*2,1,Height*2],center=true);
}}

module Cylinder(){
render()
difference(){
cylinder(Height,r=Diameter/2);
cylinder(Height,r=Diameter/2-Wall_thickness);
}}

module Lip(){
translate([-Diameter,0,0]);
difference(){
cylinder(Lip_thickness,r=Diameter/2+Lip_width);
cylinder(Lip_thickness,r=Diameter/2-Wall_thickness);
}}

module slotsX(){
intersection(){
translate([0,0,-Height])
slots();
cylinder(Height,r=Diameter/2-Wall_thickness,center=false);
}}

module slotsY(){
rotate([0,0,90])
intersection(){
translate([0,0,-Height])
slots();
cylinder(Height,r=Diameter/2-Wall_thickness,center=false);
}}

Cylinder();
slotsX();
slotsY();
render()
translate([0,0,Height-.5])
Lip();

Here is an "x-ray" view: