vibe-openscad

bare-think-off/claude-opus-4-8 / tier-2-offset-handle-mug

success tier 2

bare (claude opus 4.8)

render
bare render of tier-2-offset-handle-mug
loading STL…
success 21.4s · 343/1325t · $0.0348
SCAD (108 lines)
// マグカップ(取手は +X 方向のみ)

// ===== パラメータ =====
outer_d   = 80;   // 本体外径
inner_d   = 70;   // 本体内径
wall      = (outer_d - inner_d) / 2; // 肉厚 5mm
height    = 90;   // 全体高さ
bottom_th = 6;    // 底厚

// 取手パラメータ
handle_inner_h = 30;  // 取手内側の高さ
handle_inner_w = 25;  // 取手内側の幅(本体外周からの突き出し方向)
handle_th      = 8;   // 取手の太さ(断面直径)
handle_z       = height / 2; // 取手中心の高さ

$fn = 100;

// ===== 本体 =====
module body() {
    difference() {
        // 外形
        cylinder(d = outer_d, h = height);
        // 内側中空
        translate([0, 0, bottom_th])
            cylinder(d = inner_d, h = height - bottom_th + 1);
    }
}

// ===== 取手 =====
module handle() {
    // 取手の D 字外形:本体外周から +X 方向へ伸びる
    // 内側の空間を確保するため、外側の輪郭を rounded で作り、
    // 内側をくり抜く

    // 取手中心軸の X 位置
    x_outer = outer_d / 2;             // 本体外面 X
    // D字の外側半円中心
    inner_top_z    = handle_z + handle_inner_h / 2;
    inner_bottom_z = handle_z - handle_inner_h / 2;

    // 取手リングの中心線が描く矩形+半円の経路を太らせる
    // 簡易的に rotate_extrude 風ではなく hull で構成

    translate([0, 0, 0]) {
        // 上下の接続部(本体側 → 外側)を太い棒で作り、外側は半円
        difference() {
            // 取手の外側ソリッド形状
            hull_handle_outer();
            // 内側の空間をくり抜く
            hull_handle_inner();
        }
    }

    module hull_handle_outer() {
        // 外側の D 形状を太さ handle_th で作る
        // 経路上の点に球を配置して hull
        // 経路:本体側(x_outer)から外側(x_outer + handle_inner_w)へ
        x_far = x_outer + handle_inner_w;

        // 上側コーナー
        a_top    = [x_outer, 0, inner_top_z];
        b_top    = [x_far,   0, inner_top_z];
        // 下側コーナー
        a_bot    = [x_outer, 0, inner_bottom_z];
        b_bot    = [x_far,   0, inner_bottom_z];

        // 上辺
        hull() {
            place_sphere(a_top);
            place_sphere(b_top);
        }
        // 下辺
        hull() {
            place_sphere(a_bot);
            place_sphere(b_bot);
        }
        // 外側辺
        hull() {
            place_sphere(b_top);
            place_sphere(b_bot);
        }
        // 本体接続部(上)を本体内部まで食い込ませる
        hull() {
            place_sphere([x_outer - wall, 0, inner_top_z]);
            place_sphere(a_top);
        }
        // 本体接続部(下)
        hull() {
            place_sphere([x_outer - wall, 0, inner_bottom_z]);
            place_sphere(a_bot);
        }
    }

    module place_sphere(p) {
        translate(p) sphere(d = handle_th);
    }

    module hull_handle_inner() {
        // 何もくり抜かない(経路太らせ方式なので穴は自然にできる)
        // ダミー
    }
}

// ===== 組み立て =====
union() {
    body();
    handle();
}
パラメータ (7)
スライダを動かすと openscad-wasm で再レンダリング

meta

runIdbare-think-off_claude-opus-4-8-9e59faa0f893-2026-06-09T17-40-27-905Z
matrixIdbare-think-off/claude-opus-4-8
signature9e59faa0f8938572…
provideranthropic
modelclaude-opus-4-8
harnessbare
statussuccess
duration21.42s (wallclock: load + prompt eval + generation + network)
tokens343 in / 1325 out
wallclock tok/s61.9 tok/s (end-to-end)
cost$0.0348
createdAt2026-06-09T17:40:27.905Z
gitCommitc8a77106d384
openscadOpenSCAD version 2026.04.27

prompt

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

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

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

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