bare/gemma-4-31b-it / tier-2-offset-handle-mug
success tier 2
bare (gemma 4 31b)
render
$fn = 100;
// Parameters
outer_dia = 80;
inner_dia = 70;
height = 90;
bottom_thickness = 6;
wall_thickness = (outer_dia - inner_dia) / 2;
handle_void_h = 30;
handle_void_w = 25;
handle_thickness = 10; // thickness of the handle "wire"
union() {
// --- Mug Body ---
difference() {
// Outer shell
cylinder(h = height, d = outer_dia);
// Inner hollow
translate([0, 0, bottom_thickness])
cylinder(h = height - bottom_thickness + 1, d = inner_dia);
}
// --- Handle ---
// Positioned at +X axis, centered vertically
translate([outer_dia / 2, 0, height / 2])
rotate([0, 90, 0])
// Scale the X-axis (which is the handle's width extension)
// to achieve the specific void width while keeping height circular
scale([handle_void_w / (handle_void_h / 2), 1, 1])
difference() {
// Outer shape of the handle ring
cylinder(h = handle_thickness, r = (handle_void_h / 2) + (handle_thickness / 2), center = true);
// Inner void of the handle ring
cylinder(h = handle_thickness + 2, r = handle_void_h / 2, center = true);
// Cut off the half that would be inside the mug to create the D-shape
// Offset the cube to ensure a clean cut and slight overlap for manifold union
translate([-(handle_void_h / 2), 0, 0])
cube([handle_void_h, handle_void_h * 2, handle_thickness + 2], center = true);
}
} パラメータ (7) —
スライダを動かすと openscad-wasm で再レンダリング
prompt
OpenSCAD で、向きが指定されたマグカップを作ってください。 本体: - 外径 80mm、内径 70mm(肉厚 5mm)、高さ 90mm の円筒形マグ - 底面の厚みは 6mm - 内側は飲み物を入れられるよう中空 取手(handle): - マグの **+X 軸方向の側面のみ** に付ける(他の方向には付けない) - 取手は D 字形状(外側が半円、本体側が直線)で、本体外周にしっかり接続する - 取手の内側の空間は高さ 30mm × 幅 25mm(指 3 本ぐらい入る) - 取手はマグの高さ方向の中央付近に付ける - 本体と取手は確実に union され、マニフォールド(隙間や宙吊りなし)を保つ 完成したコード全体を ```openscad ... ``` のフェンスで囲んで出力してください。コードのみで、追加の説明は不要です。