vibe-openscad

tier-3-butt-hinge / gpt-5.2-codex

5 run / 累計 424.3s / 累計 $0.4360

openai gpt 5.2 codex bare

bare (provider default effort)

run detail →
render
bare render of tier-3-butt-hinge
loading STL…
success 48.6s · 592/4071t · $0.0498
SCAD (34 lines)
$fn = 64;

module knuckle_segment(y0, len){
    difference(){
        translate([0, y0, 1]) rotate([90,0,0]) cylinder(h=len, d=8);
        translate([0, y0-0.1, 1]) rotate([90,0,0]) cylinder(h=len+0.2, d=4.6);
    }
}

module countersink_hole(x, y){
    translate([x, y, -1]) cylinder(h=4, d=3.2);
    translate([x, y, 1]) cylinder(h=1, d1=3.2, d2=6);
}

module leaf(side=1){
    difference(){
        union(){
            translate([side==1 ? 0 : -25, 0, 0]) cube([25,30,2]);
            for(y0 = side==1 ? [6,18] : [0,12,24])
                knuckle_segment(y0,6);
        }
        for(y=[7,15,23])
            countersink_hole(side*20, y);
    }
}

module pin(){
    translate([0,-1,1]) rotate([90,0,0]) cylinder(h=32, d=4);
}

// Assembly
leaf(-1);
leaf(1);
pin();

prompt

OpenSCAD で、家具用の小型バット蝶番(butt hinge)を作ってください。
3 つのパーツ(左板、右板、ピン軸)が組み合わさって動作する完成品を、
「開いた状態(180°)」で 1 つの SCAD ファイルに配置して出力します。

寸法と配置:
- 板(leaf)2 枚: 30mm × 25mm × 厚さ 2mm の鉄板形状
  - 縦 30mm の辺がピン軸に沿う(ヒンジ軸方向)
  - 横 25mm の辺が回転で開く方向に伸びる
- ピン軸: 直径 4mm の円柱、長さ 32mm(両端 1mm ずつ knuckle から飛び出す)
- knuckle(筒部): 縦 30mm を 5 等分(各 6mm)に区切り、左板に 3 個・右板に 2 個を
  互い違いに配置(左板は外側 2 個 + 中央 1 個、右板は中間 2 個)
- knuckle 外径 8mm、内径はピン軸 + 0.3mm クリアランス(= 4.6mm 穴)
- 左板と右板はピン軸を共有して回転可能。180° 開いた状態で、両板の
  平らな面が同一平面に来るように配置する
- 各板の knuckle から離れた側に、M3 用の皿穴を 3 個ずつ
  (穴ピッチは板の縦方向に 8mm 間隔、皿穴は表面から見て直径 6mm × 深さ 1mm
  のテーパ + 直径 3.2mm の貫通穴)

座標系:
- ピン軸の中心線を Y 軸に重ねる(ピン軸は +Y 方向)
- 板の平らな面は Z 軸に直交し、左板が x<0 側、右板が x>0 側に伸びる(180° 開)
- knuckle は X=0 を中心とし、Y 方向に 6mm ずつ並ぶ

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

variant: effort

lownot run
medium (default) success
medium
48.6s · 592/4071t · $0.0498
SCAD (34 lines)
$fn = 64;

module knuckle_segment(y0, len){
    difference(){
        translate([0, y0, 1]) rotate([90,0,0]) cylinder(h=len, d=8);
        translate([0, y0-0.1, 1]) rotate([90,0,0]) cylinder(h=len+0.2, d=4.6);
    }
}

module countersink_hole(x, y){
    translate([x, y, -1]) cylinder(h=4, d=3.2);
    translate([x, y, 1]) cylinder(h=1, d1=3.2, d2=6);
}

module leaf(side=1){
    difference(){
        union(){
            translate([side==1 ? 0 : -25, 0, 0]) cube([25,30,2]);
            for(y0 = side==1 ? [6,18] : [0,12,24])
                knuckle_segment(y0,6);
        }
        for(y=[7,15,23])
            countersink_hole(side*20, y);
    }
}

module pin(){
    translate([0,-1,1]) rotate([90,0,0]) cylinder(h=32, d=4);
}

// Assembly
leaf(-1);
leaf(1);
pin();
highnot run
maxnot run
xhighnot run

iteration: iter-png

i1 success
iter 1
53.1s · 1451/4545t · $0.0569
diff vs bare: +6/-6
  $fn = 64;
  
  module knuckle_segment(y0, len){
      difference(){
-         translate([0, y0, 1]) rotate([90,0,0]) cylinder(h=len, d=8);
-         translate([0, y0-0.1, 1]) rotate([90,0,0]) cylinder(h=len+0.2, d=4.6);
+         translate([0, y0, 0]) rotate([90,0,0]) cylinder(h=len, d=8);
+         translate([0, y0-0.1, 0]) rotate([90,0,0]) cylinder(h=len+0.2, d=4.6);
      }
  }
  
  module countersink_hole(x, y){
-     translate([x, y, -1]) cylinder(h=4, d=3.2);
-     translate([x, y, 1]) cylinder(h=1, d1=3.2, d2=6);
+     translate([x, y, -2]) cylinder(h=4, d=3.2);
+     translate([x, y, 0]) cylinder(h=1, d1=3.2, d2=6);
  }
  
  module leaf(side=1){
      difference(){
          union(){
-             translate([side==1 ? 0 : -25, 0, 0]) cube([25,30,2]);
+             translate([side==1 ? 0 : -25, 0, -1]) cube([25,30,2]);
              for(y0 = side==1 ? [6,18] : [0,12,24])
                  knuckle_segment(y0,6);
          }
          for(y=[7,15,23])
              countersink_hole(side*20, y);
      }
  }
  
  module pin(){
-     translate([0,-1,1]) rotate([90,0,0]) cylinder(h=32, d=4);
+     translate([0,-1,0]) rotate([90,0,0]) cylinder(h=32, d=4);
  }
  
  // Assembly
  leaf(-1);
  leaf(1);
  pin();
SCAD (34 lines)
$fn = 64;

module knuckle_segment(y0, len){
    difference(){
        translate([0, y0, 0]) rotate([90,0,0]) cylinder(h=len, d=8);
        translate([0, y0-0.1, 0]) rotate([90,0,0]) cylinder(h=len+0.2, d=4.6);
    }
}

module countersink_hole(x, y){
    translate([x, y, -2]) cylinder(h=4, d=3.2);
    translate([x, y, 0]) cylinder(h=1, d1=3.2, d2=6);
}

module leaf(side=1){
    difference(){
        union(){
            translate([side==1 ? 0 : -25, 0, -1]) cube([25,30,2]);
            for(y0 = side==1 ? [6,18] : [0,12,24])
                knuckle_segment(y0,6);
        }
        for(y=[7,15,23])
            countersink_hole(side*20, y);
    }
}

module pin(){
    translate([0,-1,0]) rotate([90,0,0]) cylinder(h=32, d=4);
}

// Assembly
leaf(-1);
leaf(1);
pin();
i2 success
iter 2
228.8s · 1451/19250t · $0.2333
diff vs i1: +3/-3
  $fn = 64;
  
  module knuckle_segment(y0, len){
      difference(){
-         translate([0, y0, 0]) rotate([90,0,0]) cylinder(h=len, d=8);
-         translate([0, y0-0.1, 0]) rotate([90,0,0]) cylinder(h=len+0.2, d=4.6);
+         translate([0, y0, 0]) rotate([-90,0,0]) cylinder(h=len, d=8);
+         translate([0, y0-0.1, 0]) rotate([-90,0,0]) cylinder(h=len+0.2, d=4.6);
      }
  }
  
  module countersink_hole(x, y){
      translate([x, y, -2]) cylinder(h=4, d=3.2);
      translate([x, y, 0]) cylinder(h=1, d1=3.2, d2=6);
  }
  
  module leaf(side=1){
      difference(){
          union(){
              translate([side==1 ? 0 : -25, 0, -1]) cube([25,30,2]);
              for(y0 = side==1 ? [6,18] : [0,12,24])
                  knuckle_segment(y0,6);
          }
          for(y=[7,15,23])
              countersink_hole(side*20, y);
      }
  }
  
  module pin(){
-     translate([0,-1,0]) rotate([90,0,0]) cylinder(h=32, d=4);
+     translate([0,-1,0]) rotate([-90,0,0]) cylinder(h=32, d=4);
  }
  
  // Assembly
  leaf(-1);
  leaf(1);
  pin();
SCAD (34 lines)
$fn = 64;

module knuckle_segment(y0, len){
    difference(){
        translate([0, y0, 0]) rotate([-90,0,0]) cylinder(h=len, d=8);
        translate([0, y0-0.1, 0]) rotate([-90,0,0]) cylinder(h=len+0.2, d=4.6);
    }
}

module countersink_hole(x, y){
    translate([x, y, -2]) cylinder(h=4, d=3.2);
    translate([x, y, 0]) cylinder(h=1, d1=3.2, d2=6);
}

module leaf(side=1){
    difference(){
        union(){
            translate([side==1 ? 0 : -25, 0, -1]) cube([25,30,2]);
            for(y0 = side==1 ? [6,18] : [0,12,24])
                knuckle_segment(y0,6);
        }
        for(y=[7,15,23])
            countersink_hole(side*20, y);
    }
}

module pin(){
    translate([0,-1,0]) rotate([-90,0,0]) cylinder(h=32, d=4);
}

// Assembly
leaf(-1);
leaf(1);
pin();
i3 success
iter 3
45.4s · 1451/3661t · $0.0463
diff vs i2: +10/-7
  $fn = 64;
  
  module knuckle_segment(y0, len){
      difference(){
-         translate([0, y0, 0]) rotate([-90,0,0]) cylinder(h=len, d=8);
-         translate([0, y0-0.1, 0]) rotate([-90,0,0]) cylinder(h=len+0.2, d=4.6);
+         translate([0, y0, 1]) rotate([-90,0,0]) cylinder(h=len, d=8);
+         translate([0, y0-0.1, 1]) rotate([-90,0,0]) cylinder(h=len+0.2, d=4.6);
      }
  }
  
  module countersink_hole(x, y){
-     translate([x, y, -2]) cylinder(h=4, d=3.2);
-     translate([x, y, 0]) cylinder(h=1, d1=3.2, d2=6);
+     // through hole
+     translate([x, y, -0.1]) cylinder(h=2.2, d=3.2);
+     // countersink from top surface (z=2) down 1mm
+     translate([x, y, 1]) cylinder(h=1, d1=6, d2=3.2);
  }
  
  module leaf(side=1){
+     x0 = (side==1) ? 4 : -29;
      difference(){
          union(){
-             translate([side==1 ? 0 : -25, 0, -1]) cube([25,30,2]);
-             for(y0 = side==1 ? [6,18] : [0,12,24])
+             translate([x0, 0, 0]) cube([25,30,2]);
+             for(y0 = (side==1) ? [6,18] : [0,12,24])
                  knuckle_segment(y0,6);
          }
          for(y=[7,15,23])
              countersink_hole(side*20, y);
      }
  }
  
  module pin(){
-     translate([0,-1,0]) rotate([-90,0,0]) cylinder(h=32, d=4);
+     translate([0,-1,1]) rotate([-90,0,0]) cylinder(h=32, d=4);
  }
  
  // Assembly
  leaf(-1);
  leaf(1);
  pin();
SCAD (37 lines)
$fn = 64;

module knuckle_segment(y0, len){
    difference(){
        translate([0, y0, 1]) rotate([-90,0,0]) cylinder(h=len, d=8);
        translate([0, y0-0.1, 1]) rotate([-90,0,0]) cylinder(h=len+0.2, d=4.6);
    }
}

module countersink_hole(x, y){
    // through hole
    translate([x, y, -0.1]) cylinder(h=2.2, d=3.2);
    // countersink from top surface (z=2) down 1mm
    translate([x, y, 1]) cylinder(h=1, d1=6, d2=3.2);
}

module leaf(side=1){
    x0 = (side==1) ? 4 : -29;
    difference(){
        union(){
            translate([x0, 0, 0]) cube([25,30,2]);
            for(y0 = (side==1) ? [6,18] : [0,12,24])
                knuckle_segment(y0,6);
        }
        for(y=[7,15,23])
            countersink_hole(side*20, y);
    }
}

module pin(){
    translate([0,-1,1]) rotate([-90,0,0]) cylinder(h=32, d=4);
}

// Assembly
leaf(-1);
leaf(1);
pin();