vibe-openscad

tier-2-l-bracket / gpt-5.1-codex

5 run / 累計 1007.5s / 累計 $0.4121

openai gpt 5.1 codex bare

bare (provider default effort)

run detail →
render
bare render of tier-2-l-bracket
loading STL…
success 425.5s · 294/9278t · $0.1025
SCAD (48 lines)
width = 50;
depth = 40;
height = 40;
thickness = 3;
hole_d = 4.5;
cs_d = 8;
cs_depth = 2;
edge_offset = 10;

horizontal_holes = [edge_offset, depth - edge_offset];
vertical_holes = [edge_offset, height - edge_offset];

module horizontal_flange() {
    translate([-width / 2, 0, 0])
        cube([width, depth, thickness]);
}

module vertical_flange() {
    translate([-width / 2, 0, 0])
        cube([width, thickness, height]);
}

module cs_hole_z(x = 0, y = 0) {
    translate([x, y, -0.1])
        cylinder(h = thickness + 0.2, d = hole_d, $fn = 96);
    translate([x, y, thickness - cs_depth - 0.1])
        cylinder(h = cs_depth + 0.2, d = cs_d, $fn = 96);
}

module cs_hole_y(x = 0, z = 0) {
    translate([x, -0.1, z])
        rotate([-90, 0, 0])
            cylinder(h = thickness + 0.2, d = hole_d, $fn = 96);
    translate([x, thickness - cs_depth - 0.1, z])
        rotate([-90, 0, 0])
            cylinder(h = cs_depth + 0.2, d = cs_d, $fn = 96);
}

difference() {
    union() {
        horizontal_flange();
        vertical_flange();
    }
    for (ypos = horizontal_holes)
        cs_hole_z(0, ypos);
    for (zpos = vertical_holes)
        cs_hole_y(0, zpos);
}
パラメータ (8)
スライダを動かすと openscad-wasm で再レンダリング

prompt

OpenSCAD で、L 字に折れた金具(L-bracket)を作ってください。

形状:
- 水平面と垂直面の 2 つのフランジが直角に繋がっている
- 水平面は 50mm × 40mm(幅 × 奥行き)
- 垂直面は 50mm × 40mm(幅 × 高さ)
- 板厚はどちらも 3mm
- 内側コーナーが原点になるように配置(水平面は +Y 方向、垂直面は +Z 方向に伸びる)

皿穴(countersunk holes):
- 各面に 2 個ずつ、合計 4 個
- M4 ねじ用(貫通穴 Φ4.5mm + 皿座面 Φ8mm × 深さ 2mm)
- 各面の中心線上で、面の縁から 10mm 内側、左右対称に 2 個並べる
- 皿座面は外側(ボルト頭が当たる側)に向ける

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

variant: effort

lownot run
medium (default) success
medium
425.5s · 294/9278t · $0.1025
SCAD (48 lines)
width = 50;
depth = 40;
height = 40;
thickness = 3;
hole_d = 4.5;
cs_d = 8;
cs_depth = 2;
edge_offset = 10;

horizontal_holes = [edge_offset, depth - edge_offset];
vertical_holes = [edge_offset, height - edge_offset];

module horizontal_flange() {
    translate([-width / 2, 0, 0])
        cube([width, depth, thickness]);
}

module vertical_flange() {
    translate([-width / 2, 0, 0])
        cube([width, thickness, height]);
}

module cs_hole_z(x = 0, y = 0) {
    translate([x, y, -0.1])
        cylinder(h = thickness + 0.2, d = hole_d, $fn = 96);
    translate([x, y, thickness - cs_depth - 0.1])
        cylinder(h = cs_depth + 0.2, d = cs_d, $fn = 96);
}

module cs_hole_y(x = 0, z = 0) {
    translate([x, -0.1, z])
        rotate([-90, 0, 0])
            cylinder(h = thickness + 0.2, d = hole_d, $fn = 96);
    translate([x, thickness - cs_depth - 0.1, z])
        rotate([-90, 0, 0])
            cylinder(h = cs_depth + 0.2, d = cs_d, $fn = 96);
}

difference() {
    union() {
        horizontal_flange();
        vertical_flange();
    }
    for (ypos = horizontal_holes)
        cs_hole_z(0, ypos);
    for (zpos = vertical_holes)
        cs_hole_y(0, zpos);
}
highnot run
maxnot run
xhighnot run

iteration: iter-png

i1 success
iter 1
32.7s · 1425/3796t · $0.0438
diff vs bare: +7/-6
  width = 50;
  depth = 40;
  height = 40;
  thickness = 3;
  hole_d = 4.5;
  cs_d = 8;
  cs_depth = 2;
  edge_offset = 10;
  
- horizontal_holes = [edge_offset, depth - edge_offset];
- vertical_holes = [edge_offset, height - edge_offset];
+ hole_x = [-(width / 2 - edge_offset), (width / 2 - edge_offset)];
+ horizontal_center_y = depth / 2;
+ vertical_center_z = height / 2;
  
  module horizontal_flange() {
      translate([-width / 2, 0, 0])
          cube([width, depth, thickness]);
  }
  
  module vertical_flange() {
      translate([-width / 2, 0, 0])
          cube([width, thickness, height]);
  }
  
  module cs_hole_z(x = 0, y = 0) {
      translate([x, y, -0.1])
          cylinder(h = thickness + 0.2, d = hole_d, $fn = 96);
      translate([x, y, thickness - cs_depth - 0.1])
          cylinder(h = cs_depth + 0.2, d = cs_d, $fn = 96);
  }
  
  module cs_hole_y(x = 0, z = 0) {
      translate([x, -0.1, z])
          rotate([-90, 0, 0])
              cylinder(h = thickness + 0.2, d = hole_d, $fn = 96);
      translate([x, thickness - cs_depth - 0.1, z])
          rotate([-90, 0, 0])
              cylinder(h = cs_depth + 0.2, d = cs_d, $fn = 96);
  }
  
  difference() {
      union() {
          horizontal_flange();
          vertical_flange();
      }
-     for (ypos = horizontal_holes)
-         cs_hole_z(0, ypos);
-     for (zpos = vertical_holes)
-         cs_hole_y(0, zpos);
+     for (xpos = hole_x)
+         cs_hole_z(xpos, horizontal_center_y);
+     for (xpos = hole_x)
+         cs_hole_y(xpos, vertical_center_z);
  }
SCAD (49 lines)
width = 50;
depth = 40;
height = 40;
thickness = 3;
hole_d = 4.5;
cs_d = 8;
cs_depth = 2;
edge_offset = 10;

hole_x = [-(width / 2 - edge_offset), (width / 2 - edge_offset)];
horizontal_center_y = depth / 2;
vertical_center_z = height / 2;

module horizontal_flange() {
    translate([-width / 2, 0, 0])
        cube([width, depth, thickness]);
}

module vertical_flange() {
    translate([-width / 2, 0, 0])
        cube([width, thickness, height]);
}

module cs_hole_z(x = 0, y = 0) {
    translate([x, y, -0.1])
        cylinder(h = thickness + 0.2, d = hole_d, $fn = 96);
    translate([x, y, thickness - cs_depth - 0.1])
        cylinder(h = cs_depth + 0.2, d = cs_d, $fn = 96);
}

module cs_hole_y(x = 0, z = 0) {
    translate([x, -0.1, z])
        rotate([-90, 0, 0])
            cylinder(h = thickness + 0.2, d = hole_d, $fn = 96);
    translate([x, thickness - cs_depth - 0.1, z])
        rotate([-90, 0, 0])
            cylinder(h = cs_depth + 0.2, d = cs_d, $fn = 96);
}

difference() {
    union() {
        horizontal_flange();
        vertical_flange();
    }
    for (xpos = hole_x)
        cs_hole_z(xpos, horizontal_center_y);
    for (xpos = hole_x)
        cs_hole_y(xpos, vertical_center_z);
}
i2 success
iter 2
71.1s · 1440/8269t · $0.0930
diff vs i1: +0/-0
  width = 50;
  depth = 40;
  height = 40;
  thickness = 3;
  hole_d = 4.5;
  cs_d = 8;
  cs_depth = 2;
  edge_offset = 10;
  
  hole_x = [-(width / 2 - edge_offset), (width / 2 - edge_offset)];
  horizontal_center_y = depth / 2;
  vertical_center_z = height / 2;
  
  module horizontal_flange() {
      translate([-width / 2, 0, 0])
          cube([width, depth, thickness]);
  }
  
  module vertical_flange() {
      translate([-width / 2, 0, 0])
          cube([width, thickness, height]);
  }
  
  module cs_hole_z(x = 0, y = 0) {
      translate([x, y, -0.1])
          cylinder(h = thickness + 0.2, d = hole_d, $fn = 96);
      translate([x, y, thickness - cs_depth - 0.1])
          cylinder(h = cs_depth + 0.2, d = cs_d, $fn = 96);
  }
  
  module cs_hole_y(x = 0, z = 0) {
      translate([x, -0.1, z])
          rotate([-90, 0, 0])
              cylinder(h = thickness + 0.2, d = hole_d, $fn = 96);
      translate([x, thickness - cs_depth - 0.1, z])
          rotate([-90, 0, 0])
              cylinder(h = cs_depth + 0.2, d = cs_d, $fn = 96);
  }
  
  difference() {
      union() {
          horizontal_flange();
          vertical_flange();
      }
      for (xpos = hole_x)
          cs_hole_z(xpos, horizontal_center_y);
      for (xpos = hole_x)
          cs_hole_y(xpos, vertical_center_z);
  }
SCAD (49 lines)
width = 50;
depth = 40;
height = 40;
thickness = 3;
hole_d = 4.5;
cs_d = 8;
cs_depth = 2;
edge_offset = 10;

hole_x = [-(width / 2 - edge_offset), (width / 2 - edge_offset)];
horizontal_center_y = depth / 2;
vertical_center_z = height / 2;

module horizontal_flange() {
    translate([-width / 2, 0, 0])
        cube([width, depth, thickness]);
}

module vertical_flange() {
    translate([-width / 2, 0, 0])
        cube([width, thickness, height]);
}

module cs_hole_z(x = 0, y = 0) {
    translate([x, y, -0.1])
        cylinder(h = thickness + 0.2, d = hole_d, $fn = 96);
    translate([x, y, thickness - cs_depth - 0.1])
        cylinder(h = cs_depth + 0.2, d = cs_d, $fn = 96);
}

module cs_hole_y(x = 0, z = 0) {
    translate([x, -0.1, z])
        rotate([-90, 0, 0])
            cylinder(h = thickness + 0.2, d = hole_d, $fn = 96);
    translate([x, thickness - cs_depth - 0.1, z])
        rotate([-90, 0, 0])
            cylinder(h = cs_depth + 0.2, d = cs_d, $fn = 96);
}

difference() {
    union() {
        horizontal_flange();
        vertical_flange();
    }
    for (xpos = hole_x)
        cs_hole_z(xpos, horizontal_center_y);
    for (xpos = hole_x)
        cs_hole_y(xpos, vertical_center_z);
}
i3 success
iter 3
52.8s · 1440/6216t · $0.0704
diff vs i2: +4/-4
  width = 50;
  depth = 40;
  height = 40;
  thickness = 3;
  hole_d = 4.5;
  cs_d = 8;
  cs_depth = 2;
  edge_offset = 10;
  
  hole_x = [-(width / 2 - edge_offset), (width / 2 - edge_offset)];
  horizontal_center_y = depth / 2;
  vertical_center_z = height / 2;
  
  module horizontal_flange() {
      translate([-width / 2, 0, 0])
          cube([width, depth, thickness]);
  }
  
  module vertical_flange() {
      translate([-width / 2, 0, 0])
          cube([width, thickness, height]);
  }
  
  module cs_hole_z(x = 0, y = 0) {
      translate([x, y, -0.1])
          cylinder(h = thickness + 0.2, d = hole_d, $fn = 96);
-     translate([x, y, thickness - cs_depth - 0.1])
-         cylinder(h = cs_depth + 0.2, d = cs_d, $fn = 96);
+     translate([x, y, thickness - cs_depth])
+         cylinder(h = cs_depth + 0.1, d1 = cs_d, d2 = hole_d, $fn = 96);
  }
  
  module cs_hole_y(x = 0, z = 0) {
      translate([x, -0.1, z])
          rotate([-90, 0, 0])
              cylinder(h = thickness + 0.2, d = hole_d, $fn = 96);
-     translate([x, thickness - cs_depth - 0.1, z])
+     translate([x, thickness - cs_depth, z])
          rotate([-90, 0, 0])
-             cylinder(h = cs_depth + 0.2, d = cs_d, $fn = 96);
+             cylinder(h = cs_depth + 0.1, d1 = cs_d, d2 = hole_d, $fn = 96);
  }
  
  difference() {
      union() {
          horizontal_flange();
          vertical_flange();
      }
      for (xpos = hole_x)
          cs_hole_z(xpos, horizontal_center_y);
      for (xpos = hole_x)
          cs_hole_y(xpos, vertical_center_z);
  }
SCAD (49 lines)
width = 50;
depth = 40;
height = 40;
thickness = 3;
hole_d = 4.5;
cs_d = 8;
cs_depth = 2;
edge_offset = 10;

hole_x = [-(width / 2 - edge_offset), (width / 2 - edge_offset)];
horizontal_center_y = depth / 2;
vertical_center_z = height / 2;

module horizontal_flange() {
    translate([-width / 2, 0, 0])
        cube([width, depth, thickness]);
}

module vertical_flange() {
    translate([-width / 2, 0, 0])
        cube([width, thickness, height]);
}

module cs_hole_z(x = 0, y = 0) {
    translate([x, y, -0.1])
        cylinder(h = thickness + 0.2, d = hole_d, $fn = 96);
    translate([x, y, thickness - cs_depth])
        cylinder(h = cs_depth + 0.1, d1 = cs_d, d2 = hole_d, $fn = 96);
}

module cs_hole_y(x = 0, z = 0) {
    translate([x, -0.1, z])
        rotate([-90, 0, 0])
            cylinder(h = thickness + 0.2, d = hole_d, $fn = 96);
    translate([x, thickness - cs_depth, z])
        rotate([-90, 0, 0])
            cylinder(h = cs_depth + 0.1, d1 = cs_d, d2 = hole_d, $fn = 96);
}

difference() {
    union() {
        horizontal_flange();
        vertical_flange();
    }
    for (xpos = hole_x)
        cs_hole_z(xpos, horizontal_center_y);
    for (xpos = hole_x)
        cs_hole_y(xpos, vertical_center_z);
}