bare-think-off/gemini-2.5-flash / tier-2-offset-handle-mug
success tier 2
bare (gemini 2.5 flash)
render
// Mug body parameters
outer_radius = 80 / 2;
inner_radius = 70 / 2;
wall_thickness = outer_radius - inner_radius; // Should be 5mm
height = 90;
bottom_thickness = 6;
// Handle parameters
handle_inner_height = 30;
handle_inner_width = 25;
handle_thickness = wall_thickness; // Same thickness as mug wall
// Calculate handle outer dimensions
handle_outer_radius = handle_inner_width / 2 + handle_thickness;
handle_outer_height = handle_inner_height + 2 * handle_thickness;
// Position handle in the middle of the mug height
handle_z_offset = (height - handle_outer_height) / 2;
module mug_body() {
difference() {
// Outer cylinder
cylinder(h = height, r = outer_radius, $fn = 64);
// Inner cylinder (for hollow space)
translate([0, 0, bottom_thickness])
cylinder(h = height - bottom_thickness, r = inner_radius, $fn = 64);
}
}
module mug_handle() {
// Position handle on the +X side of the mug
// The handle's 'straight' side will be aligned with the mug's outer radius
translate([outer_radius, 0, handle_z_offset]) {
difference() {
// Outer handle shape (rounded rectangle / half-cylinder extrusion)
linear_extrude(height = handle_outer_height) {
union() {
circle(r = handle_outer_radius, $fn = 32);
// Square to connect half-circle to straight edge, ensuring full arc
square([handle_outer_radius, 2 * handle_outer_radius], center = false);
}
}
// Inner handle shape (to create the D-shape hole)
translate([handle_thickness, 0, 0]) // Shift inner shape to the right to create the D
linear_extrude(height = handle_inner_height) {
union() {
circle(r = handle_inner_width / 2, $fn = 32);
square([handle_inner_width / 2, handle_inner_width], center = false);
}
}
}
}
}
union() {
mug_body();
mug_handle();
} パラメータ (4) —
スライダを動かすと openscad-wasm で再レンダリング
prompt
OpenSCAD で、向きが指定されたマグカップを作ってください。 本体: - 外径 80mm、内径 70mm(肉厚 5mm)、高さ 90mm の円筒形マグ - 底面の厚みは 6mm - 内側は飲み物を入れられるよう中空 取手(handle): - マグの **+X 軸方向の側面のみ** に付ける(他の方向には付けない) - 取手は D 字形状(外側が半円、本体側が直線)で、本体外周にしっかり接続する - 取手の内側の空間は高さ 30mm × 幅 25mm(指 3 本ぐらい入る) - 取手はマグの高さ方向の中央付近に付ける - 本体と取手は確実に union され、マニフォールド(隙間や宙吊りなし)を保つ 完成したコード全体を ```openscad ... ``` のフェンスで囲んで出力してください。コードのみで、追加の説明は不要です。