vibe-openscad

tier-2-offset-handle-mug / claude-sonnet-4-5-20250929

2 run / 累計 18.0s / 累計 $0.0169

claude sonnet 4.5 2025-09-29 bare

bare (provider default effort)

run detail →
render
bare render of tier-2-offset-handle-mug
loading STL…
success 9.0s · 330/496t · $0.0084
SCAD (47 lines)
$fn = 100;

// パラメータ
outer_diameter = 80;
inner_diameter = 70;
wall_thickness = 5;
height = 90;
bottom_thickness = 6;

// 取手パラメータ
handle_hole_height = 30;
handle_hole_width = 25;
handle_thickness = 5;
handle_vertical_center = height / 2;

difference() {
    union() {
        // 本体外側
        cylinder(d = outer_diameter, h = height);
        
        // 取手(+X軸方向)
        translate([outer_diameter/2, 0, handle_vertical_center]) {
            rotate([0, 90, 0]) {
                difference() {
                    // 取手の外側形状(Dシェイプ)
                    hull() {
                        // 外側の半円部分
                        translate([0, handle_hole_width/2 + handle_thickness, 0])
                            cylinder(d = handle_hole_height + 2*handle_thickness, h = handle_thickness);
                        // 本体接続部分の上下
                        translate([handle_hole_height/2, 0, 0])
                            cube([0.1, 0.1, handle_thickness]);
                        translate([-handle_hole_height/2, 0, 0])
                            cube([0.1, 0.1, handle_thickness]);
                    }
                    // 取手の穴
                    translate([0, handle_hole_width/2 + handle_thickness, -1])
                        cylinder(d = handle_hole_height, h = handle_thickness + 2);
                }
            }
        }
    }
    
    // 内側を削る(飲み物を入れる部分)
    translate([0, 0, bottom_thickness])
        cylinder(d = inner_diameter, h = height);
}
パラメータ (8)
スライダを動かすと openscad-wasm で再レンダリング

prompt

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

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

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

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

variant: thinking

off (default) success
off
9.0s · 330/496t · $0.0084
SCAD (47 lines)
$fn = 100;

// パラメータ
outer_diameter = 80;
inner_diameter = 70;
wall_thickness = 5;
height = 90;
bottom_thickness = 6;

// 取手パラメータ
handle_hole_height = 30;
handle_hole_width = 25;
handle_thickness = 5;
handle_vertical_center = height / 2;

difference() {
    union() {
        // 本体外側
        cylinder(d = outer_diameter, h = height);
        
        // 取手(+X軸方向)
        translate([outer_diameter/2, 0, handle_vertical_center]) {
            rotate([0, 90, 0]) {
                difference() {
                    // 取手の外側形状(Dシェイプ)
                    hull() {
                        // 外側の半円部分
                        translate([0, handle_hole_width/2 + handle_thickness, 0])
                            cylinder(d = handle_hole_height + 2*handle_thickness, h = handle_thickness);
                        // 本体接続部分の上下
                        translate([handle_hole_height/2, 0, 0])
                            cube([0.1, 0.1, handle_thickness]);
                        translate([-handle_hole_height/2, 0, 0])
                            cube([0.1, 0.1, handle_thickness]);
                    }
                    // 取手の穴
                    translate([0, handle_hole_width/2 + handle_thickness, -1])
                        cylinder(d = handle_hole_height, h = handle_thickness + 2);
                }
            }
        }
    }
    
    // 内側を削る(飲み物を入れる部分)
    translate([0, 0, bottom_thickness])
        cylinder(d = inner_diameter, h = height);
}
adaptivenot run
dynamicnot run