vibe-openscad

tier-2-offset-handle-mug / gpt-6-sol

6 run / 累計 163.3s / 累計 $0.1209

openai gpt 6 sol bare

bare (provider default effort)

run detail →
render
bare render of tier-2-offset-handle-mug
loading STL…
success 19.8s · 273/1314t · $0.0137
SCAD (44 lines)
$fn = 96;

// Dimensions in mm
outer_radius = 40;
inner_radius = 35;
mug_height = 90;
bottom_thickness = 6;
handle_thickness = 14;
arc_steps = 48;

// A D-shaped outline in the X–Z plane:
// straight edge on the left, semicircular edge on the right.
module d_outline(left_x, arc_center_x, center_z, radius) {
    polygon(points = concat(
        [[left_x, center_z - radius]],
        [for (i = [0 : arc_steps])
            [arc_center_x + radius * cos(-90 + 180 * i / arc_steps),
             center_z + radius * sin(-90 + 180 * i / arc_steps)]],
        [[left_x, center_z + radius]]
    ));
}

module handle() {
    rotate([90, 0, 0])
        linear_extrude(height = handle_thickness, center = true)
            difference() {
                // The straight edge overlaps the mug wall for a solid join.
                d_outline(38, 52, 45, 25);
                // Opening: 30 mm high and 25 mm wide.
                d_outline(43, 53, 45, 15);
            }
}

union() {
    difference() {
        cylinder(h = mug_height, r = outer_radius);
        translate([0, 0, bottom_thickness])
            cylinder(h = mug_height - bottom_thickness + 1,
                     r = inner_radius);
    }

    // Handle only on the +X side.
    handle();
}
パラメータ (6) —
スライダを動かすと openscad-wasm で再レンダリング

prompt

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

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

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

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

variant: effort

low success →
low
13.0s · 273/840t · $0.0089
SCAD (58 lines)
$fn = 128;

outer_d = 80;
inner_d = 70;
mug_h = 90;
bottom_thickness = 6;

handle_thickness = 12;
handle_center_z = mug_h / 2;
handle_outer_radius = 32;
handle_opening_width = 25;
handle_opening_height = 30;
handle_join_x = 37;             // 本体外周に食い込ませて接続
handle_straight_x = outer_d / 2;

module mug_body() {
    difference() {
        cylinder(h = mug_h, d = outer_d);
        translate([0, 0, bottom_thickness])
            cylinder(h = mug_h - bottom_thickness + 1, d = inner_d);
    }
}

module handle_profile() {
    difference() {
        union() {
            // 本体側の直線部分
            translate([handle_join_x, handle_center_z - handle_outer_radius])
                square([
                    handle_straight_x - handle_join_x,
                    2 * handle_outer_radius
                ]);

            // +X 側だけに広がる半円
            intersection() {
                translate([handle_straight_x, handle_center_z])
                    circle(r = handle_outer_radius);
                translate([handle_straight_x,
                           handle_center_z - handle_outer_radius])
                    square([handle_outer_radius, 2 * handle_outer_radius]);
            }
        }

        // 高さ 30 mm × 幅 25 mm の指を入れる空間
        translate([handle_straight_x,
                   handle_center_z - handle_opening_height / 2])
            square([handle_opening_width, handle_opening_height]);
    }
}

union() {
    mug_body();

    translate([0, handle_thickness / 2, 0])
        rotate([90, 0, 0])
            linear_extrude(height = handle_thickness)
                handle_profile();
}
medium (default) success →
medium
19.8s · 273/1314t · $0.0137
SCAD (44 lines)
$fn = 96;

// Dimensions in mm
outer_radius = 40;
inner_radius = 35;
mug_height = 90;
bottom_thickness = 6;
handle_thickness = 14;
arc_steps = 48;

// A D-shaped outline in the X–Z plane:
// straight edge on the left, semicircular edge on the right.
module d_outline(left_x, arc_center_x, center_z, radius) {
    polygon(points = concat(
        [[left_x, center_z - radius]],
        [for (i = [0 : arc_steps])
            [arc_center_x + radius * cos(-90 + 180 * i / arc_steps),
             center_z + radius * sin(-90 + 180 * i / arc_steps)]],
        [[left_x, center_z + radius]]
    ));
}

module handle() {
    rotate([90, 0, 0])
        linear_extrude(height = handle_thickness, center = true)
            difference() {
                // The straight edge overlaps the mug wall for a solid join.
                d_outline(38, 52, 45, 25);
                // Opening: 30 mm high and 25 mm wide.
                d_outline(43, 53, 45, 15);
            }
}

union() {
    difference() {
        cylinder(h = mug_height, r = outer_radius);
        translate([0, 0, bottom_thickness])
            cylinder(h = mug_height - bottom_thickness + 1,
                     r = inner_radius);
    }

    // Handle only on the +X side.
    handle();
}
high success →
high
21.4s · 273/1414t · $0.0147
SCAD (51 lines)
$fn = 96;

outer_diameter = 80;
inner_diameter = 70;
mug_height = 90;
bottom_thickness = 6;

handle_thickness = 12;  // Y方向
handle_center_z = 45;
arc_segments = 64;

// XZ平面上のD字形状。左側が直線、右側が半円。
module d_shape(left_x, arc_center_x, radius, center_z) {
    polygon(points = concat(
        [[left_x, center_z - radius]],
        [
            for (i = [0:arc_segments])
                let(a = -90 + 180 * i / arc_segments)
                [arc_center_x + radius * cos(a),
                 center_z + radius * sin(a)]
        ],
        [[left_x, center_z + radius]]
    ));
}

module mug_body() {
    difference() {
        cylinder(d = outer_diameter, h = mug_height);
        translate([0, 0, bottom_thickness])
            cylinder(d = inner_diameter,
                     h = mug_height - bottom_thickness + 1);
    }
}

module handle() {
    translate([0, handle_thickness / 2, 0])
        rotate([90, 0, 0])
            linear_extrude(height = handle_thickness)
                difference() {
                    // 外形:高さ50mm、+X方向へ張り出す半円
                    d_shape(37, 52, 25, handle_center_z);

                    // 指を入れる空間:高さ30mm、幅25mm(X=40~65)
                    d_shape(40, 50, 15, handle_center_z);
                }
}

union() {
    mug_body();
    handle();
}
max success →
max
49.4s · 273/4062t · $0.0412
SCAD (56 lines)
$fn = 128;

outer_diameter = 80;
inner_diameter = 70;
mug_height = 90;
base_thickness = 6;

handle_thickness = 12;  // Y方向の厚み
handle_center_z = mug_height / 2;
handle_attach_x = 38;   // 本体に重ねて確実に接続

// D字の外形:本体側は直線、外側は半円
outer_arc_x = 50.5;
outer_arc_radius = 25;

// 指を入れる開口:高さ30mm、X方向の幅25mm
opening_height = 30;
opening_width = 25;
opening_left_x = 43;
inner_arc_radius = opening_height / 2;
inner_arc_x = opening_left_x + opening_width - inner_arc_radius;

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

module mug_body() {
    difference() {
        cylinder(d = outer_diameter, h = mug_height);
        translate([0, 0, base_thickness])
            cylinder(d = inner_diameter,
                     h = mug_height - base_thickness + 1);
    }
}

module handle() {
    rotate([90, 0, 0])
        linear_extrude(height = handle_thickness, center = true, convexity = 10)
            difference() {
                d_profile(handle_attach_x, outer_arc_x,
                          handle_center_z, outer_arc_radius);
                d_profile(opening_left_x, inner_arc_x,
                          handle_center_z, inner_arc_radius);
            }
}

union() {
    mug_body();
    handle();
}
xhigh success →
xhigh
39.9s · 273/2816t · $0.0287
SCAD (56 lines)
$fn = 128;

mug_outer_d = 80;
mug_inner_d = 70;
mug_height = 90;
bottom_thickness = 6;

handle_depth = 14;       // Y方向の厚み
handle_z = mug_height / 2;

// 取手の外形:本体側が直線、外側が半円
outer_flat_x = mug_outer_d / 2 - 3;  // 本体に3mm食い込ませる
outer_arc_x = mug_outer_d / 2 + 11;
outer_radius = 24;

// 内側の空間:高さ30mm、幅25mm
inner_radius = 15;
inner_arc_x = mug_outer_d / 2 + 12;
inner_flat_x = inner_arc_x - (25 - inner_radius);

module d_profile(flat_x, arc_x, radius, center_z) {
    polygon(points = concat(
        [[flat_x, center_z - radius]],
        [for (a = [-90:3:90])
            [arc_x + radius * cos(a),
             center_z + radius * sin(a)]],
        [[flat_x, center_z + radius]]
    ));
}

module mug_body() {
    difference() {
        cylinder(d = mug_outer_d, h = mug_height);
        translate([0, 0, bottom_thickness])
            cylinder(
                d = mug_inner_d,
                h = mug_height - bottom_thickness + 1
            );
    }
}

module handle() {
    rotate([90, 0, 0])
        linear_extrude(height = handle_depth, center = true)
            difference() {
                d_profile(outer_flat_x, outer_arc_x,
                          outer_radius, handle_z);
                d_profile(inner_flat_x, inner_arc_x,
                          inner_radius, handle_z);
            }
}

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