vibe-openscad

bare-max/claude-fable-5-1 / tier-2-offset-handle-mug

success tier 2

bare (claude fable 5.1)

render
bare render of tier-2-offset-handle-mug
loading STL…
success 149.4s · 345/9347t · $0.4708
SCAD (70 lines)
// ============================================================
//  マグカップ(向き固定:底面 Z=0、上向き +Z、取手は +X 方向のみ)
// ============================================================
$fn = 96;

// ---------- 本体寸法 ----------
outer_d  = 80;   // 外径
inner_d  = 70;   // 内径(肉厚 5mm)
mug_h    = 90;   // 高さ
bottom_t = 6;    // 底面の厚み

// ---------- 取手寸法 ----------
handle_inner_h = 30;        // 取手内側空間の高さ(Z 方向)
handle_inner_w = 25;        // 取手内側空間の幅(X 方向)
handle_t       = 8;         // 取手の断面太さ(XZ 面内)
handle_depth   = 12;        // 取手の奥行き(Y 方向の厚み)
handle_embed   = 4;         // 本体肉厚への埋め込み量(内側空洞には届かない)
handle_z       = mug_h / 2; // 取手中心の高さ(マグの中央)

// ------------------------------------------------------------
//  D 字 2D 形状
//   u=-back 側が直線(本体側)、+u 側が半円(外側)
//   r        : 半円の半径(= 高さの半分)
//   straight : 直線部から半円中心までの距離
//   back     : 直線側へ延ばす量(本体への埋め込み用)
// ------------------------------------------------------------
module d_shape(r, straight, back) {
    intersection() {
        union() {
            translate([-back, -r]) square([back + straight, 2 * r]);
            translate([straight, 0]) circle(r = r);
        }
        // 半円の左側はみ出しを切り落として直線にする
        translate([-back, -r - 1]) square([back + straight + r + 2, 2 * r + 2]);
    }
}

// ------------------------------------------------------------
//  取手(+X 側面に接続、断面を Y 方向へ押し出し)
// ------------------------------------------------------------
module handle() {
    r_in     = handle_inner_h / 2;        // 内側半円の半径 = 15
    straight = handle_inner_w - r_in;     // 内側直線部の長さ = 10 → 幅 25

    translate([outer_d / 2, 0, handle_z])   // 本体外周(X=40)、高さ中央へ
        rotate([90, 0, 0])                  // 2D の (u,v) → (X,Z)
            linear_extrude(height = handle_depth, center = true)
                difference() {
                    d_shape(r_in + handle_t, straight, handle_embed); // 外形
                    d_shape(r_in,            straight, handle_embed); // 内側空間
                }
}

// ------------------------------------------------------------
//  マグ本体 + 取手
//   本体と取手を union した後に内側空洞をくり抜くことで、
//   取手の埋め込み部が空洞に露出せずマニフォールドを保つ
// ------------------------------------------------------------
module mug() {
    difference() {
        union() {
            cylinder(h = mug_h, d = outer_d);   // 外筒
            handle();                           // +X 方向の取手
        }
        translate([0, 0, bottom_t])
            cylinder(h = mug_h, d = inner_d);   // 内側空洞(底厚 6mm を残す)
    }
}

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

meta

runIdbare-max_claude-fable-5-1-68e2e4fc3892-2026-09-05T12-36-06-052Z
matrixIdbare-max/claude-fable-5-1
signature68e2e4fc38923375…
provideranthropic
modelclaude-fable-5-1
harnessbare
statussuccess
duration149.39s (wallclock: load + prompt eval + generation + network)
tokens345 in / 9347 out
wallclock tok/s62.6 tok/s (end-to-end)
cost$0.4708
createdAt2026-09-05T12:36:06.052Z
gitCommit69ade4654888
openscadOpenSCAD version 2026.04.27

prompt

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

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

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

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