vibe-openscad

tier-2-offset-handle-mug / gpt-5.2-codex

5 run / 累計 158.4s / 累計 $0.1589

openai gpt 5.2 codex bare

bare (provider default effort)

run detail →
render
bare render of tier-2-offset-handle-mug
loading STL…
success 51.8s · 273/4206t · $0.0509
SCAD (34 lines)
$fn = 100;

module d2(width, height){
    r = height/2;
    rect_w = width - r;
    union(){
        translate([0, -height/2]) square([rect_w, height]);
        translate([rect_w, 0]) circle(r=r);
    }
}

module handle(){
    outer_w = 35;
    outer_h = 40;
    inner_w = 25;
    inner_h = 30;
    depth = 12;
    difference(){
        rotate([90,0,0]) linear_extrude(height=depth, center=true) d2(outer_w, outer_h);
        rotate([90,0,0]) linear_extrude(height=depth+0.2, center=true) d2(inner_w, inner_h);
    }
}

module mug(){
    difference(){
        cylinder(h=90, r=40);
        translate([0,0,6]) cylinder(h=84, r=35);
    }
}

union(){
    mug();
    translate([39,0,45]) handle();
}

prompt

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

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

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

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

variant: effort

lownot run
medium (default) success
medium
51.8s · 273/4206t · $0.0509
SCAD (34 lines)
$fn = 100;

module d2(width, height){
    r = height/2;
    rect_w = width - r;
    union(){
        translate([0, -height/2]) square([rect_w, height]);
        translate([rect_w, 0]) circle(r=r);
    }
}

module handle(){
    outer_w = 35;
    outer_h = 40;
    inner_w = 25;
    inner_h = 30;
    depth = 12;
    difference(){
        rotate([90,0,0]) linear_extrude(height=depth, center=true) d2(outer_w, outer_h);
        rotate([90,0,0]) linear_extrude(height=depth+0.2, center=true) d2(inner_w, inner_h);
    }
}

module mug(){
    difference(){
        cylinder(h=90, r=40);
        translate([0,0,6]) cylinder(h=84, r=35);
    }
}

union(){
    mug();
    translate([39,0,45]) handle();
}
highnot run
maxnot run
xhighnot run

iteration: iter-png

i1 success
iter 1
17.4s · 1073/1363t · $0.0181
diff vs bare: +2/-2
  $fn = 100;
  
  module d2(width, height){
      r = height/2;
      rect_w = width - r;
      union(){
          translate([0, -height/2]) square([rect_w, height]);
          translate([rect_w, 0]) circle(r=r);
      }
  }
  
  module handle(){
      outer_w = 35;
      outer_h = 40;
      inner_w = 25;
      inner_h = 30;
      depth = 12;
      difference(){
          rotate([90,0,0]) linear_extrude(height=depth, center=true) d2(outer_w, outer_h);
          rotate([90,0,0]) linear_extrude(height=depth+0.2, center=true) d2(inner_w, inner_h);
      }
  }
  
  module mug(){
      difference(){
          cylinder(h=90, r=40);
-         translate([0,0,6]) cylinder(h=84, r=35);
+         translate([0,0,6-0.1]) cylinder(h=84+0.2, r=35);
      }
  }
  
  union(){
      mug();
-     translate([39,0,45]) handle();
+     translate([40-0.5,0,45]) handle();
  }
SCAD (34 lines)
$fn = 100;

module d2(width, height){
    r = height/2;
    rect_w = width - r;
    union(){
        translate([0, -height/2]) square([rect_w, height]);
        translate([rect_w, 0]) circle(r=r);
    }
}

module handle(){
    outer_w = 35;
    outer_h = 40;
    inner_w = 25;
    inner_h = 30;
    depth = 12;
    difference(){
        rotate([90,0,0]) linear_extrude(height=depth, center=true) d2(outer_w, outer_h);
        rotate([90,0,0]) linear_extrude(height=depth+0.2, center=true) d2(inner_w, inner_h);
    }
}

module mug(){
    difference(){
        cylinder(h=90, r=40);
        translate([0,0,6-0.1]) cylinder(h=84+0.2, r=35);
    }
}

union(){
    mug();
    translate([40-0.5,0,45]) handle();
}
i2 success
iter 2
13.0s · 1085/952t · $0.0132
diff vs i1: +0/-0
  $fn = 100;
  
  module d2(width, height){
      r = height/2;
      rect_w = width - r;
      union(){
          translate([0, -height/2]) square([rect_w, height]);
          translate([rect_w, 0]) circle(r=r);
      }
  }
  
  module handle(){
      outer_w = 35;
      outer_h = 40;
      inner_w = 25;
      inner_h = 30;
      depth = 12;
      difference(){
          rotate([90,0,0]) linear_extrude(height=depth, center=true) d2(outer_w, outer_h);
          rotate([90,0,0]) linear_extrude(height=depth+0.2, center=true) d2(inner_w, inner_h);
      }
  }
  
  module mug(){
      difference(){
          cylinder(h=90, r=40);
          translate([0,0,6-0.1]) cylinder(h=84+0.2, r=35);
      }
  }
  
  union(){
      mug();
      translate([40-0.5,0,45]) handle();
  }
SCAD (34 lines)
$fn = 100;

module d2(width, height){
    r = height/2;
    rect_w = width - r;
    union(){
        translate([0, -height/2]) square([rect_w, height]);
        translate([rect_w, 0]) circle(r=r);
    }
}

module handle(){
    outer_w = 35;
    outer_h = 40;
    inner_w = 25;
    inner_h = 30;
    depth = 12;
    difference(){
        rotate([90,0,0]) linear_extrude(height=depth, center=true) d2(outer_w, outer_h);
        rotate([90,0,0]) linear_extrude(height=depth+0.2, center=true) d2(inner_w, inner_h);
    }
}

module mug(){
    difference(){
        cylinder(h=90, r=40);
        translate([0,0,6-0.1]) cylinder(h=84+0.2, r=35);
    }
}

union(){
    mug();
    translate([40-0.5,0,45]) handle();
}
i3 success
iter 3
24.3s · 1085/2009t · $0.0258
diff vs i2: +3/-2
  $fn = 100;
+ eps = 0.1;
  
  module d2(width, height){
      r = height/2;
      rect_w = width - r;
      union(){
          translate([0, -height/2]) square([rect_w, height]);
          translate([rect_w, 0]) circle(r=r);
      }
  }
  
  module handle(){
      outer_w = 35;
      outer_h = 40;
      inner_w = 25;
      inner_h = 30;
      depth = 12;
      difference(){
          rotate([90,0,0]) linear_extrude(height=depth, center=true) d2(outer_w, outer_h);
-         rotate([90,0,0]) linear_extrude(height=depth+0.2, center=true) d2(inner_w, inner_h);
+         rotate([90,0,0]) linear_extrude(height=depth+eps, center=true) d2(inner_w, inner_h);
      }
  }
  
  module mug(){
      difference(){
          cylinder(h=90, r=40);
-         translate([0,0,6-0.1]) cylinder(h=84+0.2, r=35);
+         translate([0,0,6]) cylinder(h=84+eps, r=35);
      }
  }
  
  union(){
      mug();
      translate([40-0.5,0,45]) handle();
  }
SCAD (35 lines)
$fn = 100;
eps = 0.1;

module d2(width, height){
    r = height/2;
    rect_w = width - r;
    union(){
        translate([0, -height/2]) square([rect_w, height]);
        translate([rect_w, 0]) circle(r=r);
    }
}

module handle(){
    outer_w = 35;
    outer_h = 40;
    inner_w = 25;
    inner_h = 30;
    depth = 12;
    difference(){
        rotate([90,0,0]) linear_extrude(height=depth, center=true) d2(outer_w, outer_h);
        rotate([90,0,0]) linear_extrude(height=depth+eps, center=true) d2(inner_w, inner_h);
    }
}

module mug(){
    difference(){
        cylinder(h=90, r=40);
        translate([0,0,6]) cylinder(h=84+eps, r=35);
    }
}

union(){
    mug();
    translate([40-0.5,0,45]) handle();
}