bare-xhigh/gpt-6.1-sol / tier-2-offset-handle-mug
success tier 2
bare (gpt 6.1 sol)
render
$fn = 160;
// 本体寸法(mm)
outer_diameter = 80;
inner_diameter = 70;
cup_height = 90;
bottom_thickness = 6;
// 取手寸法(mm)
handle_inner_width = 25;
handle_inner_height = 30;
handle_depth = 8;
handle_web_thickness = 6;
handle_outer_thickness = 6;
attachment_overlap = 2;
epsilon = 0.1;
handle_base_x = outer_diameter / 2 - attachment_overlap;
handle_center_z = cup_height / 2;
// 外側を真の半円にし、指定寸法の開口と十分な肉厚を確保
handle_outer_radius =
handle_web_thickness
+ handle_inner_width
+ handle_outer_thickness;
// +X 側の半円。直線側は x = 0。
module right_half_disk(radius) {
intersection() {
circle(r = radius);
translate([0, -radius])
square([radius, 2 * radius]);
}
}
module mug_body() {
difference() {
cylinder(d = outer_diameter, h = cup_height);
// 上面まで貫通させ、底面を6mm残す
translate([0, 0, bottom_thickness])
cylinder(
d = inner_diameter,
h = cup_height - bottom_thickness + epsilon
);
}
}
module handle_profile() {
difference() {
right_half_disk(handle_outer_radius);
// 開口の最大寸法:幅25mm、高さ30mm
translate([handle_web_thickness, 0])
scale([
handle_inner_width,
handle_inner_height / 2
])
right_half_disk(1);
}
}
module mug_handle() {
// 2DのX・Yを、それぞれ実空間のX・Zへ対応させる
translate([handle_base_x, 0, handle_center_z])
rotate([90, 0, 0])
linear_extrude(
height = handle_depth,
center = true,
convexity = 10
)
handle_profile();
}
// 取手の直線側を本体外壁へ食い込ませ、一体化する
render(convexity = 10)
union() {
mug_body();
mug_handle();
} パラメータ (11) —
スライダを動かすと openscad-wasm で再レンダリング
prompt
OpenSCAD で、向きが指定されたマグカップを作ってください。 本体: - 外径 80mm、内径 70mm(肉厚 5mm)、高さ 90mm の円筒形マグ - 底面の厚みは 6mm - 内側は飲み物を入れられるよう中空 取手(handle): - マグの **+X 軸方向の側面のみ** に付ける(他の方向には付けない) - 取手は D 字形状(外側が半円、本体側が直線)で、本体外周にしっかり接続する - 取手の内側の空間は高さ 30mm × 幅 25mm(指 3 本ぐらい入る) - 取手はマグの高さ方向の中央付近に付ける - 本体と取手は確実に union され、マニフォールド(隙間や宙吊りなし)を保つ 完成したコード全体を ```openscad ... ``` のフェンスで囲んで出力してください。コードのみで、追加の説明は不要です。