vibe-openscad

bare-think-off/gemini-3.8-flash / tier-2-offset-handle-mug

success tier 2

bare (gemini 3.8 flash)

render
bare render of tier-2-offset-handle-mug
loading STL…
success 4.1s · 232/766t · $0.0030
SCAD (69 lines)
$fn = 100;

// マグ本体パラメータ
outer_r = 80 / 2; // 外半径 40mm
inner_r = 70 / 2; // 内半径 35mm
height = 90;      // 高さ 90mm
bottom_t = 6;     // 底の厚み 6mm

// 取手パラメータ
handle_w = 25;    // 取手内側空間の幅 (X方向)
handle_h = 30;    // 取手内側空間の高さ (Z方向)
handle_t = 8;     // 取手の断面太さ (肉厚)

module mug_body() {
    difference() {
        cylinder(r = outer_r, h = height);
        translate([0, 0, bottom_t])
            cylinder(r = inner_r, h = height - bottom_t + 1);
    }
}

module handle() {
    // 高さ方向の中央に配置 (Z = height / 2)
    translate([0, 0, height / 2]) {
        // 取手断面をY軸まわりに回転させて押し出すため、XZ平面上で作図
        rotate([90, 0, 0]) {
            linear_extrude(height = handle_t, center = true) {
                difference() {
                    // 外形: 本体内部にめり込ませて接続を確実にするため、本体中心側(X=outer_r-2)から開始
                    hull() {
                        // 本体接続部 (直線側)
                        translate([outer_r - 2, -(handle_h / 2 + handle_t)])
                            square([1, handle_h + handle_t * 2]);
                        
                        // 外側の半円部
                        translate([outer_r + handle_w, -(handle_h - handle_w) / 2])
                            circle(r = handle_w / 2 + handle_t);
                        translate([outer_r + handle_w, (handle_h - handle_w) / 2])
                            circle(r = handle_w / 2 + handle_t);
                    }
                    
                    // 内側の空間: 高さ 30mm × 幅 25mm
                    hull() {
                        // 本体側エッジ
                        translate([outer_r, -handle_h / 2])
                            square([0.1, handle_h]);
                        
                        // 外側丸み
                        translate([outer_r + handle_w - handle_w / 2, -(handle_h - handle_w) / 2])
                            circle(r = handle_w / 2);
                        translate([outer_r + handle_w - handle_w / 2, (handle_h - handle_w) / 2])
                            circle(r = handle_w / 2);
                    }
                }
            }
        }
    }
}

// 結合
union() {
    mug_body();
    // 取手の内側がマグの内腔に貫通しないように本体内側を再差分
    difference() {
        handle();
        translate([0, 0, bottom_t])
            cylinder(r = inner_r, h = height - bottom_t + 1);
    }
}
パラメータ (5) —
スライダを動かすと openscad-wasm で再レンダリング

meta

runIdbare-think-off_gemini-3.8-flash-44bec25e5746-2026-09-05T10-12-58-392Z
matrixIdbare-think-off/gemini-3.8-flash
signature44bec25e574690c9…
providergoogle
modelgemini-3.8-flash
harnessbare
statussuccess
duration4.11s (wallclock: load + prompt eval + generation + network)
tokens232 in / 766 out
wallclock tok/s186.2 tok/s (end-to-end)
cost$0.0030
createdAt2026-09-05T10:12:58.392Z
gitCommitd69c2b8ad709
openscadOpenSCAD version 2026.04.27

prompt

OpenSCAD で、向きが指定されたマグカップを作ってください。

本体:
- 外径 80mm、内径 70mm(肉厚 5mm)、高さ 90mm の円筒形マグ
- 底面の厚みは 6mm
- 内側は飲み物を入れられるよう中空

取手(handle):
- マグの **+X 軸方向の側面のみ** に付ける(他の方向には付けない)
- 取手は D 字形状(外側が半円、本体側が直線)で、本体外周にしっかり接続する
- 取手の内側の空間は高さ 30mm × 幅 25mm(指 3 本ぐらい入る)
- 取手はマグの高さ方向の中央付近に付ける
- 本体と取手は確実に union され、マニフォールド(隙間や宙吊りなし)を保つ

完成したコード全体を ```openscad ... ``` のフェンスで囲んで出力してください。コードのみで、追加の説明は不要です。