vibe-openscad

tier-2-offset-handle-mug / gpt-5.6-terra

6 run / 累計 445.1s / 累計 $0.4723

openai gpt 5.6 terra bare

bare (provider default effort)

run detail →
render
bare render of tier-2-offset-handle-mug
loading STL…
success 35.1s · 273/2974t · $0.0362
SCAD (90 lines)
$fn = 128;

// マグ本体寸法
outer_r = 40;     // 外径 80mm
inner_r = 35;     // 内径 70mm
cup_h   = 90;
bottom_t = 6;

// 取手寸法・配置
handle_y_thickness = 12;
handle_center_z    = cup_h / 2;

attach_x      = 37;   // 本体外周へ十分に食い込ませる
outer_center_x = 47;
outer_r_handle = 24;

inner_left_x   = 41;
inner_center_x = 51;
inner_r_handle = 15;  // 内側高さ 30mm
                         // 内側幅: 41mm ~ 66mm = 25mm

module right_semicircle(cx, cz, r) {
    intersection() {
        translate([cx, cz])
            circle(r = r);

        translate([cx, cz - r])
            square([r, 2 * r]);
    }
}

module handle_profile_2d() {
    difference() {
        union() {
            // 本体側の直線部分
            translate([attach_x, handle_center_z - outer_r_handle])
                square([
                    outer_center_x - attach_x,
                    2 * outer_r_handle
                ]);

            // 外側半円部分
            right_semicircle(
                outer_center_x,
                handle_center_z,
                outer_r_handle
            );
        }

        union() {
            // 内側開口部の直線部分
            translate([inner_left_x, handle_center_z - inner_r_handle])
                square([
                    inner_center_x - inner_left_x,
                    2 * inner_r_handle
                ]);

            // 内側開口部の半円部分
            right_semicircle(
                inner_center_x,
                handle_center_z,
                inner_r_handle
            );
        }
    }
}

module handle() {
    rotate([90, 0, 0])
        linear_extrude(
            height = handle_y_thickness,
            center = true,
            convexity = 10
        )
            handle_profile_2d();
}

union() {
    // 中空マグ本体
    difference() {
        cylinder(h = cup_h, r = outer_r);

        // 底厚 6mm を残す内部空間
        translate([0, 0, bottom_t])
            cylinder(h = cup_h - bottom_t + 0.1, r = inner_r);
    }

    // +X 軸方向のみに付く取手
    handle();
}
パラメータ (11) —
スライダを動かすと openscad-wasm で再レンダリング

prompt

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

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

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

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

variant: effort

low success →
low
24.8s · 273/2139t · $0.0262
SCAD (83 lines)
$fn = 96;

// マグ本体寸法
outer_diameter = 80;
inner_diameter = 70;
mug_height     = 90;
bottom_thickness = 6;

// 取手寸法
handle_thickness_y = 12;
handle_center_z    = mug_height / 2;

// D字取手の2D形状を、XZ平面上に作成してY方向へ押し出す
module d_handle() {
    outer_cx = 50;
    outer_cz = handle_center_z;
    outer_r  = 21;

    inner_cx = 52;
    inner_cz = handle_center_z;
    inner_r  = 15;   // 内側高さ 30mm

    outer_left_x = 36;  // 本体外周(半径40)へ4mm重なる
    inner_left_x = 42;  // 内側空間の開始位置
    arc_steps = 48;

    outer_points = concat(
        [
            [outer_left_x, outer_cz - outer_r],
            [outer_cx,     outer_cz - outer_r]
        ],
        [
            for (i = [0 : arc_steps])
                [
                    outer_cx + outer_r * cos(-90 + 180 * i / arc_steps),
                    outer_cz + outer_r * sin(-90 + 180 * i / arc_steps)
                ]
        ],
        [
            [outer_left_x, outer_cz + outer_r]
        ]
    );

    inner_points = concat(
        [
            [inner_left_x, inner_cz - inner_r],
            [inner_cx,     inner_cz - inner_r]
        ],
        [
            for (i = [0 : arc_steps])
                [
                    inner_cx + inner_r * cos(-90 + 180 * i / arc_steps),
                    inner_cz + inner_r * sin(-90 + 180 * i / arc_steps)
                ]
        ],
        [
            [inner_left_x, inner_cz + inner_r]
        ]
    );

    rotate([90, 0, 0])
        linear_extrude(height = handle_thickness_y, center = true)
            difference() {
                polygon(points = outer_points);
                polygon(points = inner_points);
            }
}

union() {
    // 中空の円筒形マグ本体
    difference() {
        cylinder(d = outer_diameter, h = mug_height);

        translate([0, 0, bottom_thickness])
            cylinder(
                d = inner_diameter,
                h = mug_height - bottom_thickness + 1
            );
    }

    // +X方向にのみ配置した取手
    d_handle();
}
medium (default) success →
medium
35.1s · 273/2974t · $0.0362
SCAD (90 lines)
$fn = 128;

// マグ本体寸法
outer_r = 40;     // 外径 80mm
inner_r = 35;     // 内径 70mm
cup_h   = 90;
bottom_t = 6;

// 取手寸法・配置
handle_y_thickness = 12;
handle_center_z    = cup_h / 2;

attach_x      = 37;   // 本体外周へ十分に食い込ませる
outer_center_x = 47;
outer_r_handle = 24;

inner_left_x   = 41;
inner_center_x = 51;
inner_r_handle = 15;  // 内側高さ 30mm
                         // 内側幅: 41mm ~ 66mm = 25mm

module right_semicircle(cx, cz, r) {
    intersection() {
        translate([cx, cz])
            circle(r = r);

        translate([cx, cz - r])
            square([r, 2 * r]);
    }
}

module handle_profile_2d() {
    difference() {
        union() {
            // 本体側の直線部分
            translate([attach_x, handle_center_z - outer_r_handle])
                square([
                    outer_center_x - attach_x,
                    2 * outer_r_handle
                ]);

            // 外側半円部分
            right_semicircle(
                outer_center_x,
                handle_center_z,
                outer_r_handle
            );
        }

        union() {
            // 内側開口部の直線部分
            translate([inner_left_x, handle_center_z - inner_r_handle])
                square([
                    inner_center_x - inner_left_x,
                    2 * inner_r_handle
                ]);

            // 内側開口部の半円部分
            right_semicircle(
                inner_center_x,
                handle_center_z,
                inner_r_handle
            );
        }
    }
}

module handle() {
    rotate([90, 0, 0])
        linear_extrude(
            height = handle_y_thickness,
            center = true,
            convexity = 10
        )
            handle_profile_2d();
}

union() {
    // 中空マグ本体
    difference() {
        cylinder(h = cup_h, r = outer_r);

        // 底厚 6mm を残す内部空間
        translate([0, 0, bottom_t])
            cylinder(h = cup_h - bottom_t + 0.1, r = inner_r);
    }

    // +X 軸方向のみに付く取手
    handle();
}
high success →
high
32.4s · 273/2607t · $0.0318
SCAD (69 lines)
$fn = 96;

// マグ本体寸法
outer_diameter = 80;
inner_diameter = 70;
mug_height     = 90;
bottom_thick   = 6;

// 取手寸法
handle_depth      = 12;   // Y方向の厚み
handle_center_z   = 45;   // 高さ方向中央
handle_outer_r    = 30;   // 外側半円半径
handle_flat_x     = 35;   // 本体に食い込ませる直線側X座標

// 内側開口: 幅25mm × 高さ30mm
handle_inner_x    = 38;
handle_inner_rx   = 25;
handle_inner_ry   = 15;

// D字取手の2D断面
module handle_profile_2d() {
    difference() {
        // 外側: 本体側が直線、外側が半円のD字
        polygon(points =
            concat(
                [
                    for (a = [-90 : 5 : 85])
                        [
                            handle_flat_x + handle_outer_r * cos(a),
                            handle_center_z + handle_outer_r * sin(a)
                        ]
                ],
                [[handle_flat_x, handle_center_z + handle_outer_r]]
            )
        );

        // 指を入れる内側空間: 幅25mm、高さ30mm
        polygon(points =
            concat(
                [
                    for (a = [-90 : 5 : 85])
                        [
                            handle_inner_x + handle_inner_rx * cos(a),
                            handle_center_z + handle_inner_ry * sin(a)
                        ]
                ],
                [[handle_inner_x, handle_center_z + handle_inner_ry]]
            )
        );
    }
}

union() {
    // 中空マグ本体
    difference() {
        cylinder(d = outer_diameter, h = mug_height);

        // 底厚6mmを残して上面を開放
        translate([0, 0, bottom_thick])
            cylinder(d = inner_diameter, h = mug_height - bottom_thick + 1);
    }

    // +X方向側面にのみ接続する取手
    // 本体外周へ十分に食い込ませてunionする
    translate([0, handle_depth / 2, 0])
        rotate([90, 0, 0])
            linear_extrude(height = handle_depth)
                handle_profile_2d();
}
max success →
max
234.7s · 273/21709t · $0.2611
SCAD (73 lines)
$fn = 128;

body_outer_diameter = 80;
body_inner_diameter = 70;
body_height = 90;
bottom_thickness = 6;

body_outer_radius = body_outer_diameter / 2;

handle_opening_height = 30;
handle_opening_width = 25;
handle_wall = 5;
handle_depth = 12;
handle_center_z = body_height / 2;
handle_gap_from_body = 1;
handle_arc_segments = 64;

opening_radius = handle_opening_height / 2;
opening_left_x = body_outer_radius + handle_gap_from_body;
arc_center_x = opening_left_x + handle_opening_width - opening_radius;

handle_outer_left_x = opening_left_x - handle_wall;
handle_outer_radius = opening_radius + handle_wall;

module d_profile(left_x, arc_center_x, center_z, radius) {
    polygon(points = concat(
        [
            [left_x, center_z + radius],
            [left_x, center_z - radius]
        ],
        [
            for (i = [0 : handle_arc_segments])
                [
                    arc_center_x + radius * cos(-90 + 180 * i / handle_arc_segments),
                    center_z + radius * sin(-90 + 180 * i / handle_arc_segments)
                ]
        ]
    ));
}

module d_prism(left_x, arc_center_x, center_z, radius, depth) {
    rotate([90, 0, 0])
        linear_extrude(height = depth, center = true, convexity = 10)
            d_profile(left_x, arc_center_x, center_z, radius);
}

difference() {
    union() {
        cylinder(d = body_outer_diameter, h = body_height);

        d_prism(
            handle_outer_left_x,
            arc_center_x,
            handle_center_z,
            handle_outer_radius,
            handle_depth
        );
    }

    translate([0, 0, bottom_thickness])
        cylinder(
            d = body_inner_diameter,
            h = body_height - bottom_thickness + 1
        );

    d_prism(
        opening_left_x,
        arc_center_x,
        handle_center_z,
        opening_radius,
        handle_depth + 2
    );
}
xhigh success →
xhigh
83.2s · 273/6680t · $0.0807
SCAD (88 lines)
$fn = 128;

cup_outer_diameter = 80;
cup_inner_diameter = 70;
cup_height = 90;
bottom_thickness = 6;

cup_outer_radius = cup_outer_diameter / 2;
cup_inner_radius = cup_inner_diameter / 2;

handle_opening_height = 30;
handle_opening_width = 25;
handle_wall_thickness = 5;
handle_thickness = 12;

handle_center_z = cup_height / 2;

handle_inner_radius = handle_opening_height / 2;
handle_inner_left_x = cup_outer_radius;
handle_center_x = handle_inner_left_x + (handle_opening_width - handle_inner_radius);

handle_outer_radius = handle_inner_radius + handle_wall_thickness;
handle_outer_left_x = handle_inner_left_x - handle_wall_thickness;


module right_half_disk(cx, cz, r) {
    intersection() {
        translate([cx, cz])
            circle(r = r);

        translate([cx, cz - r])
            square([r, 2 * r]);
    }
}


module d_profile(left_x, center_x, center_z, radius) {
    union() {
        translate([left_x, center_z - radius])
            square([center_x - left_x, 2 * radius]);

        right_half_disk(center_x, center_z, radius);
    }
}


module mug_body() {
    difference() {
        cylinder(r = cup_outer_radius, h = cup_height);

        translate([0, 0, bottom_thickness])
            cylinder(
                r = cup_inner_radius,
                h = cup_height - bottom_thickness + 0.01
            );
    }
}


module handle() {
    rotate([90, 0, 0])
        linear_extrude(
            height = handle_thickness,
            center = true,
            convexity = 10
        )
        difference() {
            d_profile(
                handle_outer_left_x,
                handle_center_x,
                handle_center_z,
                handle_outer_radius
            );

            d_profile(
                handle_inner_left_x,
                handle_center_x,
                handle_center_z,
                handle_inner_radius
            );
        }
}


union() {
    mug_body();
    handle();
}