vibe-openscad

iter-png-3/gpt-4.1 / tier-2-offset-handle-mug

success tier 2

bare (gpt 4.1)

render
bare render of tier-2-offset-handle-mug
loading STL…
success 12.2s · 1687/870t · $0.0103
SCAD (67 lines)
// マグ本体パラメータ
mug_outer_diameter = 80;    // mm
mug_inner_diameter = 70;    // mm
mug_height = 90;            // mm
mug_wall_thickness = 5;     // mm
mug_bottom_thickness = 6;   // mm

// 取手パラメータ
handle_inner_height = 30;    // mm
handle_inner_width  = 25;    // mm
handle_thickness    = 12;    // mm  // 指が入りつつ頑丈さ優先

mug_radius = mug_outer_diameter / 2;
mug_inner_radius = mug_inner_diameter / 2;

// 取手スケッチ中心位置
handle_center_z = mug_height/2;

module mug_body() {
    difference() {
        cylinder(h = mug_height, r = mug_radius, $fn = 128);
        translate([0, 0, mug_bottom_thickness])
            cylinder(h = mug_height - mug_bottom_thickness, r = mug_inner_radius, $fn = 128);
    }
}

module handle_D() {
    // D字断面の外周
    inner_r = handle_inner_height/2;  // D字の半円内半径
    outer_r = inner_r + handle_thickness;

    // D字2Dプロファイル
    //   左辺(本体接触)が直線、右辺が半円
    handle_profile = 
        concat( // 下から上への直線
            [ [0, -inner_r], [0, inner_r] ],
            [ for (a = [90 : -1 : -90])
                [handle_inner_width/2 + inner_r * cos(a), inner_r * sin(a)] ],
            [ [handle_inner_width, -inner_r] ]
        );
    // 外周も同様にオフセット
    handle_outer_profile = 
        concat(
            [ [0, -outer_r], [0, outer_r] ],
            [ for (a = [90 : -1 : -90]) 
                  [handle_inner_width/2 + outer_r * cos(a), outer_r * sin(a)] ],
            [ [handle_inner_width, -outer_r] ]
        );
    // 2Dハンドル断面
    polygon(
        concat(
            handle_outer_profile,
            [for (i = [len(handle_profile)-1 : -1 : 0]) handle_profile[i]] // 内周を逆順で結ぶ
        )
    );
}

// 実体化
union() {
    mug_body();

    // 取手: X軸方向に平行で、マグ高さ中央に配置
    translate([mug_radius, 0, handle_center_z])  // 本体外周に密着
        rotate([90,0,0])  // 平面をY-Zに(マグ円筒に垂直に)
        linear_extrude(height=handle_inner_width, center=true)
            handle_D();
}
パラメータ (8)
スライダを動かすと openscad-wasm で再レンダリング

meta

runIditer-png-3_gpt-4.1-b935d527ceb8-2026-04-28T19-01-49-969Z
matrixIditer-png-3/gpt-4.1
signatureb935d527ceb843f5…
provideropenai
modelgpt-4.1-2025-04-14
harnessbare
statussuccess
duration12.17s (wallclock: load + prompt eval + generation + network)
tokens1687 in / 870 out
wallclock tok/s71.5 tok/s (end-to-end)
cost$0.0103
createdAt2026-04-28T19:01:49.969Z
gitCommit781e6c683dda
openscadOpenSCAD version 2026.04.27

iteration chain

各 iteration step は独立した benchmark run です。parentRunId で前段にリンクします。

prompt

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

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

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

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