vibe-openscad

bare-low/gpt-5 / tier-2-offset-handle-mug

success tier 2

bare (gpt 5)

render
bare render of tier-2-offset-handle-mug
loading STL…
success 70.3s · 273/4236t · $0.0427
SCAD (58 lines)
// Parameters
outer_d = 80;        // outer diameter (mm)
inner_d = 70;        // inner diameter (mm)
height  = 90;        // mug height (mm)
bottom_thick = 6;    // bottom thickness (mm)
r_outer = outer_d/2;
r_inner = inner_d/2;

// Handle parameters
handle_inner_w = 25; // inner space width (mm)
handle_inner_h = 30; // inner space height (mm)
handle_thick   = 5;  // ring thickness around inner space (mm)
handle_depth   = 16; // extrusion depth along Y (mm)
z_mid = height/2;    // center height

// Construct mug with handle and inner cavity
difference() {
  // Solid: body + handle
  union() {
    // Mug outer solid
    cylinder(h=height, r=r_outer, $fn=128);

    // D-shaped handle on +X side
    // Build 2D profile in X-Y (Y used as Z), then extrude along Z and rotate to Y
    // Ensure strong union by intruding flat side slightly into the mug (x0 < r_outer)
    handle_2d_zmid(z_mid);
  }

  // Hollow interior (leaves 6mm bottom)
  translate([0,0,bottom_thick])
    cylinder(h=height - bottom_thick, r=r_inner, $fn=128);
}

// Handle module
module handle_2d_zmid(zc) {
  H  = handle_inner_h + 2*handle_thick;  // outer D height
  R  = H/2;                               // radius for semicircle
  x0 = r_outer - 6;                       // flat side position (slightly inside mug to ensure union)
  rectW = handle_inner_w + 2*handle_thick;

  // 2D D-shape in X-Y (Y corresponds to Z), then extrude along Z and rotate to Y
  rotate([90,0,0])  // Z -> -Y
    linear_extrude(height=handle_depth, center=true, convexity=10)
      difference() {
        union() {
          // Flat section
          square([rectW, H], center=false)
            translate([x0, zc - H/2]);

          // Semicircular outer end
          translate([x0 + rectW + R, zc])
            circle(r=R, $fn=96);
        }
        // Inner opening (rectangular void)
        translate([x0 + handle_thick, zc - handle_inner_h/2])
          square([handle_inner_w, handle_inner_h], center=false);
      }
}
パラメータ (8)
スライダを動かすと openscad-wasm で再レンダリング

meta

runIdbare-low_gpt-5-3a3b41340cd1-2026-04-28T18-50-09-520Z
matrixIdbare-low/gpt-5
signature3a3b41340cd1e767…
provideropenai
modelgpt-5-2025-08-07
harnessbare
statussuccess
duration70.34s (wallclock: load + prompt eval + generation + network)
tokens273 in / 4236 out
wallclock tok/s60.2 tok/s (end-to-end)
cost$0.0427
createdAt2026-04-28T18:50:09.520Z
gitCommit781e6c683dda
openscadOpenSCAD version 2026.04.27

prompt

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

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

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

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