more designs

This commit is contained in:
2020-12-15 14:00:31 +01:00
parent ef4b44f021
commit a277a02720
9 changed files with 250 additions and 0 deletions

53
mesh_knit_bag.scad Normal file
View File

@@ -0,0 +1,53 @@
linear_extrude(1)
pattern(1000, 1, 4){
// square(size=[50, 50], center=true);
scale_uniform(3){
import("/home/bart/Downloads/laura_bag_1.svg");
}
}
module pattern(mesh_size, line_width, spacing){
union(){
intersection(){
mesh(mesh_size, line_width, spacing);
children(0);
}
// calculate border
difference(){
children(0);
offset(r=-line_width){
children(0);
}
}
}
}
module mesh(size, line_width, spacing){
// Note that mesh always has to be even.
// This translates into the first lines being perfectly centered.
// Start by calculating amount of spacings
n_size = (size-line_width)/(line_width+spacing);
step = line_width + spacing;
for(i=[0:n_size/2]){
// vertical lines
translate([i*step, 0, 0])
square(size=[line_width, size], center=true);
translate([-i*step, 0, 0])
square(size=[line_width, size], center=true);
// horizontal lines
translate([0, i*step, 0])
square(size=[size, line_width], center=true);
translate([0, -i*step, 0])
square(size=[size, line_width], center=true);
}
}
module scale_uniform(my_scale){
scale([my_scale, my_scale]){
children(0);
}
}