Parametric goban and stones for blind players
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

85 lines
3.2 KiB

include <params.scad>
module goban() {
$goban_width = $cell_width*($goban_size-1) +
$goban_size*$line_width +
$goban_padding*2;
$goban_length = $cell_length*($goban_size-1) +
$goban_size*$line_width +
$goban_padding*2;
difference() {
cube([$goban_width, $goban_length, $goban_height]);
for(n=[0:$goban_size-1]) {
translate([
$goban_padding,
$goban_padding + n*($cell_length+$line_width),
$goban_height - $line_depth])
cube([
$goban_size*($line_width+$cell_width)-$cell_length,
$line_width,
$line_depth+1
]);
translate([
$goban_padding + n*($cell_width+$line_width),
$goban_padding,
$goban_height - $line_depth])
cube([
$line_width,
$goban_size*($line_width+$cell_length)-$cell_length,
$line_depth+1
]);
for(y=[0:$goban_size-1]) {
translate([
$goban_padding + n*($cell_width+$line_width),
$goban_padding + y*($cell_length+$line_width),
0
]) union() {
translate([0, 0, $goban_height - $stone_height])
cylinder(
h=$stone_height+1,
r=$stone_radius+$clearance,
$fn=100);
translate([0, 0, $goban_height - $marble_radius*0.3])
sphere(
r=$marble_radius+$clearance,
$fn=100);
translate([0, 0, $goban_height - $stone_height])
cylinder(
r=$marble_radius+$clearance,
h=$marble_radius+1,
$fn=100);
if(search(n+1, $hoshi_pos) && search(y+1, $hoshi_pos)) {
translate([
0, 0,
$goban_height-$stone_height-$line_depth])
cylinder(
h=$line_depth+1,
r=$marble_radius+$line_width+$clearance,
$fn=100
);
}
translate([0, 0, $goban_height-$stone_height*2]) {
intersection() {
cylinder(
h=$stone_height*2,
r=$stone_radius+$clearance,
$fn=100
);
translate([0, $stone_radius*1.25, 0])
cylinder(
h=$stone_height*2,
r=$stone_radius+$clearance,
$fn=100
);
}
}
}
}
}
}
}
goban();