3d Part design with Inkscape and OpenSCAD #87: Customizable sluicebox part 2

Part 2 of a customizable sluice box designed with Inkscape and OpenSCAD

3 min read
By Bob
3d Part design with Inkscape and OpenSCAD #87: Customizable sluicebox part 2

For part 2 I added the capabilty to import an SVG pattern to use on the board, this adds the ability to make a surface that is pretty much any pattern you can imagine.

Here is the updated code:

/*[Board]*/
show_board= true;
peak_height = 25.5;//[0:.01:100]
width = 200; // [0:.01:400]
length = 1919; //[0:.01:4000]
thickness = 2; // [.1:.01:5]
peaks = .75; // [0:.01:7]
move_board_Z=0;//[0:.01:20]

/*[Riffles]*/
show_riffles= true;
riffle_size=2.29;//[0:.01:25]
riffle_spacing = 240.94;//[1:.01:1000]
riffle_shape=20; //[3:1:100]
riffle_rotate=0;//[0:.1:360]
move_riffles_Z=2;//[0:.01:20]

/*[Holes]*/
show_holes= true;
hole_number_X=8; //[1:1:100]
hole_number_Y=9; //[1:1:100]
hole_size = 3.5; //[0:.01:25.4]
hole_shape = 50; //[3:1:50]
hole_spacing_x = 24.46;//[0:.01:50]
hole_spacing_y = 21.62;//[0:.01:200]
hole_height=50;//[.1:.01:200]
move_holes_x = 110; //[0:.01:400]
move_holes_y = -100; //[-400:.01:400]
move_holes_z = -4; //[-400:.01:400]

/*[SVG Holes]*/
show_SVG_holes= false;
Path_to_SVG_File="/home/none3/Desktop/drawing.svg";
SVG_hole_number_X=8; //[1:1:100]
SVG_hole_number_Y=9; //[1:1:100]
SVG_hole_size = 1; //[-25.4:.01:25.4]
SVG_hole_spacing_x = 24.46;//[0:.01:50]
SVG_hole_spacing_y = 21.62;//[0:.01:200]
SVG_hole_height=50;//[.1:.01:200]
move_SVG_holes_x = 110; //[0:.01:400]
move_SVG_holes_y = -100; //[-400:.01:400]
move_SVG_holes_z = -4; //[-400:.01:400]

/*[Sluice box]*/
show_box= true;
box_height = 50;//[20:.01:100]
box_length = 200;//[20:.01:400]
box_width = 200;//[20:.01:400]
wall_thickness = 2;//[.1:.01:4]
rounding = 40; //[4:1:40]

module board(){
if (show_board)
translate([0,0,move_board_Z])
rotate([90,0,0])
linear_extrude(width)
 for (i=[0:length]){
  hull(){
  translate([i*.1,peak_height/2.5*(1+sin(-90+i*peaks)),0])
  circle(thickness,$fn=20);
  translate([(i+1)*.1,peak_height/2.5*(1+sin(-90+(i+1)*peaks)),0])
  circle(thickness,$fn=20);
}}}

module riffles(){
if (show_riffles)
 translate([riffle_size,0,move_board_Z])
 rotate([90,0,0])
 linear_extrude(width)
 translate([0,move_riffles_Z,0])
for (i=[0:riffle_spacing:length]){
 translate([i*.1,peak_height/2.5*(1+sin(-90+i*peaks)),0])
 rotate([0,0,riffle_rotate])
 circle(riffle_size,$fn=riffle_shape);
}}

module holes(){
if (show_holes)
 for(x=[0:hole_number_X-1])
 for(y=[0:hole_number_Y-1])
 translate([(x-hole_number_X/2)*hole_spacing_x,(y-hole_number_Y/2+.5)*hole_spacing_y,-5])
 linear_extrude(hole_height,convexity=11)
 
 circle(hole_size,$fn=hole_shape);
}

module SVG_holes(){
if (show_SVG_holes)
 for(x=[0:SVG_hole_number_X-1])
 for(y=[0:SVG_hole_number_Y-1])
 translate([(x-SVG_hole_number_X/2)*SVG_hole_spacing_x,(y-SVG_hole_number_Y/2+.5)*SVG_hole_spacing_y,-5])
 linear_extrude(SVG_hole_height,convexity=11)
 scale([SVG_hole_size,SVG_hole_size,SVG_hole_size])
 import(Path_to_SVG_File,convexity=10);
}

module box(){
if (show_box){
translate([0,0,box_height/2])
difference(){
cube([box_length,box_width,box_height],center=true);
cube([box_length-wall_thickness+12,box_width-wall_thickness,box_height],center=true);
}
cube([box_length,box_width,1],center=true);
}}
if (show_box){
minkowski(){
translate([.5*box_length,-.5*box_width,0])
box();
sphere(wall_thickness,$fn=rounding);
}}


difference(){
board();
translate([move_holes_x,move_holes_y,move_holes_z])
holes();
translate([move_SVG_holes_x,move_SVG_holes_y,move_SVG_holes_z])
SVG_holes();
}

riffles();

And here are some different designs I came up with in just a few minutes of testing:

Adding this feature makes it possible to experiment with different patterns and see how well they capture fine gold, I will be making other improvements over time so stay tuned.