vibe-openscad

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

6 run / 累計 239.5s / 累計 $0.5245

openai gpt 5.6 sol bare

bare (provider default effort)

run detail →
render
bare render of tier-2-offset-handle-mug
loading STL…
success 25.9s · 273/1808t · $0.0556
SCAD (41 lines)
$fn = 128;

outer_radius = 40;
inner_radius = 35;
mug_height   = 90;
bottom_thickness = 6;

handle_thickness = 14;
handle_wall = 7;

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

module handle_opening_2d() {
    polygon(points = concat(
        [[44, 30]],
        [for (a = [-90 : 3 : 90])
            [54 + 15 * cos(a), 45 + 15 * sin(a)]],
        [[44, 60]]
    ));
}

module handle() {
    rotate([90, 0, 0])
        linear_extrude(height = handle_thickness, center = true, convexity = 10)
            difference() {
                offset(delta = handle_wall)
                    handle_opening_2d();
                handle_opening_2d();
            }
}

union() {
    mug_body();
    handle();
}
パラメータ (6) —
スライダを動かすと openscad-wasm で再レンダリング

prompt

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

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

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

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

variant: effort

low success →
low
18.2s · 273/1226t · $0.0381
SCAD (80 lines)
$fn = 128;

// Mug dimensions
outer_diameter = 80;
inner_diameter = 70;
mug_height     = 90;
bottom_thickness = 6;

// Handle dimensions
handle_depth = 12;
handle_center_z = mug_height / 2;

// Inner D-shaped opening: 25 mm wide × 30 mm high
inner_radius = 15;
inner_straight_length = 10;
inner_base_x = 43;
inner_center_x = inner_base_x + inner_straight_length;

// Handle wall thickness
handle_wall = 6;
outer_radius = inner_radius + handle_wall;
outer_base_x = 37;
outer_center_x = inner_center_x;

arc_steps = 64;

function d_shape_points(base_x, center_x, center_z, radius) =
    concat(
        [[base_x, center_z + radius]],
        [
            for (i = [0 : arc_steps])
                let(a = 90 - 180 * i / arc_steps)
                [
                    center_x + radius * cos(a),
                    center_z + radius * sin(a)
                ]
        ],
        [[base_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() {
    rotate([90, 0, 0])
        linear_extrude(height = handle_depth, center = true, convexity = 10)
            difference() {
                polygon(
                    points = d_shape_points(
                        outer_base_x,
                        outer_center_x,
                        handle_center_z,
                        outer_radius
                    )
                );

                polygon(
                    points = d_shape_points(
                        inner_base_x,
                        inner_center_x,
                        handle_center_z,
                        inner_radius
                    )
                );
            }
}

union() {
    mug_body();
    handle();
}
medium (default) success →
medium
25.9s · 273/1808t · $0.0556
SCAD (41 lines)
$fn = 128;

outer_radius = 40;
inner_radius = 35;
mug_height   = 90;
bottom_thickness = 6;

handle_thickness = 14;
handle_wall = 7;

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

module handle_opening_2d() {
    polygon(points = concat(
        [[44, 30]],
        [for (a = [-90 : 3 : 90])
            [54 + 15 * cos(a), 45 + 15 * sin(a)]],
        [[44, 60]]
    ));
}

module handle() {
    rotate([90, 0, 0])
        linear_extrude(height = handle_thickness, center = true, convexity = 10)
            difference() {
                offset(delta = handle_wall)
                    handle_opening_2d();
                handle_opening_2d();
            }
}

union() {
    mug_body();
    handle();
}
high success →
high
49.7s · 273/3423t · $0.1041
SCAD (81 lines)
$fn = 128;

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

handle_center_z = cup_height / 2;
handle_depth    = 14;

// 内側空間: 高さ30mm × 幅25mm
inner_flat_x    = 42;
inner_width     = 25;
inner_half_h    = 15;

// 外側D形状
outer_flat_x    = 36;
outer_width     = 37;
outer_half_h    = 21;

profile_steps = 96;

module d_profile(flat_x, width, half_height, center_z) {
    polygon(
        points = concat(
            [[flat_x, center_z - half_height]],
            [
                for (a = [-90 : 180 / profile_steps : 90])
                    [
                        flat_x + width * cos(a),
                        center_z + half_height * sin(a)
                    ]
            ],
            [[flat_x, center_z + half_height]]
        )
    );
}

module mug_body() {
    difference() {
        cylinder(
            h = cup_height,
            d = cup_outer_diameter
        );

        translate([0, 0, bottom_thickness])
            cylinder(
                h = cup_height - bottom_thickness + 0.2,
                d = cup_inner_diameter
            );
    }
}

module handle() {
    rotate([90, 0, 0])
        linear_extrude(
            height = handle_depth,
            center = true,
            convexity = 10
        )
            difference() {
                d_profile(
                    outer_flat_x,
                    outer_width,
                    outer_half_h,
                    handle_center_z
                );

                d_profile(
                    inner_flat_x,
                    inner_width,
                    inner_half_h,
                    handle_center_z
                );
            }
}

union() {
    mug_body();
    handle();
}
max success →
max
83.3s · 273/6257t · $0.1891
SCAD (78 lines)
$fn = 128;

mug_outer_radius = 40;
mug_inner_radius = 35;
mug_height       = 90;
bottom_thickness = 6;

handle_opening_width  = 25;
handle_opening_height = 30;
handle_wall           = 7;
handle_depth          = 14;
handle_center_z       = mug_height / 2;

epsilon = 0.2;

module mug_body() {
    difference() {
        cylinder(r = mug_outer_radius, h = mug_height);

        translate([0, 0, bottom_thickness])
            cylinder(
                r = mug_inner_radius,
                h = mug_height - bottom_thickness + epsilon
            );
    }
}

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

module mug_handle() {
    opening_radius = handle_opening_height / 2;
    opening_left_x = mug_outer_radius + 3;
    arc_center_x   = opening_left_x
                   + handle_opening_width
                   - opening_radius;

    outer_radius = opening_radius + handle_wall;
    outer_left_x = opening_left_x - handle_wall;

    translate([0, 0, handle_center_z])
        rotate([90, 0, 0])
            linear_extrude(
                height = handle_depth,
                center = true,
                convexity = 10
            )
                difference() {
                    d_profile(
                        outer_left_x,
                        arc_center_x,
                        outer_radius
                    );

                    d_profile(
                        opening_left_x,
                        arc_center_x,
                        opening_radius
                    );
                }
}

union() {
    mug_body();
    mug_handle();
}
xhigh success →
xhigh
36.6s · 273/2687t · $0.0820
SCAD (82 lines)
$fn = 128;

// Mug dimensions
outer_radius = 40;
inner_radius = 35;
mug_height   = 90;
bottom_thickness = 6;

// Handle dimensions
handle_center_z = mug_height / 2;
opening_height  = 30;
opening_width   = 25;
handle_wall     = 6;
handle_depth    = 12;

// Opening begins just outside the mug body
opening_left_x = outer_radius + 1;

// D-shaped 2D profile:
// left side is straight, right side is semicircular.
module d_profile(left_x, center_z, profile_height, profile_width) {
    r = profile_height / 2;
    arc_center_x = left_x + profile_width - r;

    union() {
        translate([left_x, center_z - r])
            square([arc_center_x - left_x, profile_height]);

        intersection() {
            translate([arc_center_x, center_z])
                circle(r = r, $fn = 128);

            translate([arc_center_x, center_z - r - 1])
                square([r + 1, profile_height + 2]);
        }
    }
}

module mug_body() {
    difference() {
        cylinder(h = mug_height, r = outer_radius);

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

module mug_handle() {
    outer_left_x = opening_left_x - handle_wall;
    outer_height = opening_height + 2 * handle_wall;
    outer_width  = opening_width + 2 * handle_wall;

    rotate([90, 0, 0])
        linear_extrude(
            height = handle_depth,
            center = true,
            convexity = 10
        )
        difference() {
            d_profile(
                outer_left_x,
                handle_center_z,
                outer_height,
                outer_width
            );

            d_profile(
                opening_left_x,
                handle_center_z,
                opening_height,
                opening_width
            );
        }
}

union() {
    mug_body();
    mug_handle();
}