bare/gpt-5.4-nano / tier-1-mug
success tier 1
bare (gpt 5.4 nano)
render
// Mug with hollow interior and ring handle
$fn = 128;
outer_d = 80;
outer_r = outer_d/2;
body_h = 100;
wall_t = 4;
bottom_t = 6;
handle_r = 12; // radius of the ring handle (extrudes outward from the cup)
handle_th = 10; // handle ring thickness (in the Z direction after rotation)
handle_z = 50; // center height of the handle on the mug
inner_r = outer_r - wall_t;
inner_h = body_h - bottom_t; // hollow starts above the bottom thickness
module ring_handle(r=12, z=50, ring_th=10, hole_d=18){
// A ring (torus-like) oriented so it protrudes radially from the cup wall.
// We'll create it by rotating a 2D annulus profile around the X axis direction.
// In this construction, the ring's center is at the mug's side (x = outer_r),
// so we translate it outward by r.
rotate([0,90,0]) // rotate so ring is in Y-Z plane and protrudes in +X
translate([0,0,0])
difference(){
// Outer torus (generated by revolving a circle)
torus( rOuter=r + ring_th, rInner=r + ring_th - 1, z=z);
}
}
// Helper: create a torus by sweeping a circle along a radius
module torus(rOuter, rInner, z=0){
// rOuter: major radius, rInner: minor radius (approx using outer circle - inner circle)
// We'll implement as a difference of two spheres swept by linear_extrude? Instead use rotate_extrude annulus:
// Use rotate_extrude with an annulus cross-section positioned at radius rOuter.
// Minor radius approximated: use (rOuter - rInner) as thickness; if small, still fine.
minor = max(0.1, (rOuter - rInner));
// Cross-section: circle(s) of radius minor about origin, then translate out by rOuter
// We'll build as an annulus torus: outer and inner subtraction.
difference(){
rotate_extrude(angle=360)
translate([rOuter, 0, z])
circle(r=minor);
// inner cut to form ring hole (if ring thickness enough)
if (minor - 3 > 0)
rotate_extrude(angle=360)
translate([rOuter, 0, z])
circle(r=minor-3);
}
}
module mug(){
difference(){
// Outer body
cylinder(h=body_h, r=outer_r);
// Hollow interior
translate([0,0,bottom_t])
cylinder(h=inner_h, r=inner_r);
}
}
difference(){
// Mug body
mug();
// No subtractive operations beyond the hollow are needed here;
// keep handle addition outside this difference to remain simple.
}
// Add handle as a union with the mug
union(){
mug();
// Handle ring placement:
// Place ring so it protrudes outward from the cup side.
// We'll position the ring center at (x=outer_r + handle_r/2, y=0, z=handle_z),
// with the ring's axis along the radial direction via rotation.
//
// Use a torus created from an annulus profile with major radius = handle_r
// and minor radius controlled by handle_th.
//
// We'll center the ring at the cup's side by translating its major radius beyond outer_r.
translate([outer_r + (handle_r/2), 0, handle_z])
rotate([0,90,0])
difference(){
// Outer ring (torus-like)
rotate_extrude(angle=360)
translate([handle_r, 0, 0])
circle(r=handle_th/2);
// Inner hole
rotate_extrude(angle=360)
translate([handle_r, 0, 0])
circle(r=handle_th/2 - 2.5);
}
} パラメータ (7) —
スライダを動かすと openscad-wasm で再レンダリング
iteration chain
各 iteration step は独立した benchmark run です。parentRunId で前段にリンクします。
→ children (1)
prompt
OpenSCAD で、外径 80mm、高さ 100mm、肉厚 4mm のマグカップを作ってください。 底面の厚みは 6mm とし、内側はくり抜いて飲み物を入れられる形状にしてください。 さらに、側面には外径方向に飛び出す半径 12mm の取手(リング状の取手)を付けてください。 取手はカップの中心高さあたりに付け、外周から十分にはみ出して指を通せる形にしてください。 完成したコード全体を ```openscad ... ``` のフェンスで囲んで出力してください。コードのみで、追加の説明は不要です。