vibe-openscad

bare-low/claude-opus-5 / tier-2-offset-handle-mug

success tier 2

bare (claude opus 5)

render
bare render of tier-2-offset-handle-mug
loading STL…
success 14.1s · 343/969t · $0.0259
SCAD (77 lines)
// ===== Mug with D-shaped handle on +X side =====

$fn = 120;

// --- Body parameters ---
outer_d   = 80;
inner_d   = 70;
mug_h     = 90;
bottom_th = 6;

// --- Handle parameters ---
hole_h    = 30;   // 取手内側の空間 高さ
hole_w    = 25;   // 取手内側の空間 幅
bar       = 8;    // 取手の太さ(断面)
handle_z  = mug_h / 2;              // 高さ方向の中央
overlap   = 4;    // 本体へ食い込ませる量(確実に union)

// 取手の外形サイズ
out_h = hole_h + 2*bar;   // 46
out_w = hole_w + bar;     // 33  (本体側は直線なので片側のみ)

// D 字断面(XZ 平面上の 2D プロファイル)を作って Y 方向に押し出す
module d_profile(w, h) {
    // 左端(本体側)が直線、右端が半円 の D 形状
    hull() {
        translate([0, -h/2]) square([0.01, h]);          // 直線側
        translate([w - h/2, 0]) circle(d = h);           // 半円側
    }
}

module handle() {
    x0 = outer_d/2 - overlap;   // 直線側の開始 X(本体内部に食い込む)
    difference() {
        // 外形
        translate([x0, bar/2, handle_z])
            rotate([90, 0, 0])
                linear_extrude(height = bar)
                    d_profile(out_w + overlap, out_h);
        // 内側の穴
        translate([x0 + bar + overlap, bar, handle_z])
            rotate([90, 0, 0])
                linear_extrude(height = bar * 2, center = false)
                    translate([-0.01, 0])
                        d_profile(hole_w, hole_h);
    }
}

module body() {
    difference() {
        cylinder(d = outer_d, h = mug_h);
        translate([0, 0, bottom_th])
            cylinder(d = inner_d, h = mug_h);   // 上へ突き抜ける
    }
}

module mug() {
    union() {
        body();
        intersection() {
            handle();
            // 取手が本体内部(中空部)へ侵入しないようにクリップ
            union() {
                // 本体外側の領域(+X 側)
                difference() {
                    translate([0, -100, -1])
                        cube([200, 200, mug_h + 2]);
                    translate([0, 0, bottom_th])
                        cylinder(d = inner_d, h = mug_h);
                }
                // 本体の実体部分は残す
                translate([0, -100, -1]) cube([0.001, 200, mug_h + 2]);
            }
        }
    }
}

mug();
パラメータ (8) —
スライダを動かすと openscad-wasm で再レンダリング

meta

runIdbare-low_claude-opus-5-537d1dcab945-2026-09-05T09-46-48-652Z
matrixIdbare-low/claude-opus-5
signature537d1dcab945dfaa…
provideranthropic
modelclaude-opus-5
harnessbare
statussuccess
duration14.09s (wallclock: load + prompt eval + generation + network)
tokens343 in / 969 out
wallclock tok/s68.8 tok/s (end-to-end)
cost$0.0259
createdAt2026-09-05T09:46:48.652Z
gitCommitae06af89b638
openscadOpenSCAD version 2026.04.27

prompt

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

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

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

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