end0tknr's kipple - web写経開発

太宰府天満宮の狛犬って、妙にカワイイ

BOSL2 for OpenSCAD の 手習い

shapes3d.scad · BelfrySCAD/BOSL2 Wiki · GitHub

//// https://github.com/BelfrySCAD/BOSL2/wiki/shapes3d.scad
include <BOSL2/std.scad>

module base_board(w,h){ // 単なる立方体による下地板
    cube([w, h, 12]);
}

module tile( tile_size ){ // 面取り付き立方体
    cuboid(tile_size, chamfer=4, edges=[TOP],
           anchor=FRONT+LEFT+BOT);
}

// BOSL2のgrid_copies() は、中心座標からcopyし
// 使いづらいため、自力でcopy
module tiles(){
    tile_size = [217,60,20];
    for( col = [0 : 4]){
        for( row = [0 : 35]){
            y = (tile_size[1]+8)  * row;
            x = (tile_size[0]+8) * col - tile_size[0]/2 * (row % 2);
            move([x,y,12]) tile( tile_size );
        }
    }
}

module trimed_tiles(){
    difference() { //外形をtrim
        tiles();
        translate([-300, -5,-5]) cube([300, 2500, 40]);
        translate([ 891, -5,-5]) cube([300, 2500, 40]);
    }
}

module pipe(height) {
    rect_tube(size=[32,14], wall=1, rounding=1, h=height);
}

module pipes() {
    move([32/2,       0,     -14/2]) rot([-90, 0,  0]) pipe(2400);
    move([900-32/2,   0,     -14/2]) rot([-90, 0,  0]) pipe(2400);
    move([0,       32/2,     -14/2]) rot([-90, 0,-90]) pipe(900);
    move([0,       32/2+800, -14/2]) rot([-90, 0,-90]) pipe(900);
    move([0,       32/2+1600,-14/2]) rot([-90, 0,-90]) pipe(900);
    move([0,       32/2+2400,-14/2]) rot([-90, 0,-90]) pipe(900);
}


base_board(891,2431);
trimed_tiles();
pipes();