vibe-openscad

tier-2-l-bracket / google/gemma-4-12b-qat

4 run / 累計 969.1s / 累計 $0

google (self-hosted) gemma-4-12b-qat bare

bare (provider default effort)

run detail →
render
no render
render_error 232.3s · 266/9464t
openscad stl render failed (exit 1): ERROR: Parser error: syntax error in file ../../../../../tmp/render-i4hCqU/input.scad, line 15
Can't parse file '/tmp/render-i4hCqU/input.scad'!

SCAD (89 lines)
// L-bracket parameters
width = 50;
depth = 40;
thickness = 3;

// Hole parameters
hole_diameter = 4.5;
countersink_diameter = 8;
countersink_depth = 2;

// The L-bracket geometry
// Horizontal face: X=50 (width), Y=40 (depth), Z=3 (thickness)
// Vertical face: X=50 (width), Y=3 (thickness), Z=40 (height)
// They share a corner at the origin (inner corner)
bracket = union() {
    cube([width, depth, thickness]); // Horizontal plate
    cube([width, thickness, depth]); // Vertical plate
};

// Hole placement
// Centerline of width is X = 25. 
// Symmetrical positions: 25 - 10 = 15 and 25 + 10 = 35.
x_pos = [15, 35];

// Horizontal face holes (on the top surface Z=thickness)
// Placed 10mm from outer edge (Y=depth)
y_pos = depth - 10; 
horizontal_holes = [for (x = x_pos) translate([x, y_pos, thickness]) 
    difference() {
        // Countersink seat
        cylinder(d1=countersink_diameter, d2=hole_diameter, h=countersink_depth, $fn=32);
        // Through hole
        translate([0, 0, -thickness]) cylinder(d=hole_diameter, h=thickness + countersink_depth, $fn=32);
    }];

// Vertical face holes (on the side surface Y=thickness)
// Placed 10mm from outer edge (Z=depth)
z_pos = depth - 10;
vertical_holes = [for (x = x_pos) translate([x, thickness, z_pos]) 
    difference() {
        // Countersink seat (facing outward in +Y direction)
        cylinder(d1=countersink_diameter, d2=hole_diameter, h=countersink_depth, $fn=32);
        // Through hole
        translate([0, -thickness, 0]) cylinder(d=hole_diameter, h=thickness + countersink_depth, $fn=32);
    }];

// Final Assembly
difference() {
    bracket;
    // Subtract holes from the bracket
    // Note: The difference logic for the vertical face needs to account for 
    // the coordinate system. The "outward" face is Y=thickness.
    
    // Horizontal holes subtraction
    for (h = horizontal_holes) {
        translate([h[0], h[1], h[2]]) {
            // This is slightly wrong in the loop above because I used translate inside the list.
            // Let's simplify the logic for the final output.
        }
    }
}

// Corrected clean logic for final output:
module bracket_final() {
    difference() {
        union() {
            cube([width, depth, thickness]); 
            cube([width, thickness, depth]);
        }
        
        // Subtract Horizontal Holes
        for (x = x_pos) {
            translate([x, y_pos, thickness]) {
                cylinder(d1=countersink_diameter, d2=hole_diameter, h=countersink_depth, $fn=32);
                translate([0, 0, -thickness]) cylinder(d=hole_diameter, h=thickness + countersink_depth, $fn=32);
            }
        }
        
        // Subtract Vertical Holes
        for (x = x_pos) {
            translate([x, thickness, z_pos]) {
                cylinder(d1=countersink_diameter, d2=hole_diameter, h=countersink_depth, $fn=32);
                translate([0, -thickness, 0]) cylinder(d=hole_diameter, h=thickness + countersink_depth, $fn=32);
            }
        }
    }
}

bracket_final();

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 ... ``` のフェンスで囲んで出力してください。コードのみで、追加の説明は不要です。

iteration: iter-png

i1 success →
iter 1
87.7s · 1322/6529t
diff vs bare: +30/-73
  // L-bracket parameters
  width = 50;
  depth = 40;
  thickness = 3;
  
  // Hole parameters
  hole_diameter = 4.5;
  countersink_diameter = 8;
  countersink_depth = 2;
  
- // The L-bracket geometry
- // Horizontal face: X=50 (width), Y=40 (depth), Z=3 (thickness)
- // Vertical face: X=50 (width), Y=3 (thickness), Z=40 (height)
- // They share a corner at the origin (inner corner)
- bracket = union() {
-     cube([width, depth, thickness]); // Horizontal plate
-     cube([width, thickness, depth]); // Vertical plate
- };
- 
- // Hole placement
- // Centerline of width is X = 25. 
- // Symmetrical positions: 25 - 10 = 15 and 25 + 10 = 35.
- x_pos = [15, 35];
- 
- // Horizontal face holes (on the top surface Z=thickness)
- // Placed 10mm from outer edge (Y=depth)
- y_pos = depth - 10; 
- horizontal_holes = [for (x = x_pos) translate([x, y_pos, thickness]) 
-     difference() {
-         // Countersink seat
-         cylinder(d1=countersink_diameter, d2=hole_diameter, h=countersink_depth, $fn=32);
-         // Through hole
-         translate([0, 0, -thickness]) cylinder(d=hole_diameter, h=thickness + countersink_depth, $fn=32);
-     }];
- 
- // Vertical face holes (on the side surface Y=thickness)
- // Placed 10mm from outer edge (Z=depth)
- z_pos = depth - 10;
- vertical_holes = [for (x = x_pos) translate([x, thickness, z_pos]) 
-     difference() {
-         // Countersink seat (facing outward in +Y direction)
-         cylinder(d1=countersink_diameter, d2=hole_diameter, h=countersink_depth, $fn=32);
-         // Through hole
-         translate([0, -thickness, 0]) cylinder(d=hole_diameter, h=thickness + countersink_depth, $fn=32);
-     }];
- 
- // Final Assembly
+ // Final assembly
  difference() {
-     bracket;
-     // Subtract holes from the bracket
-     // Note: The difference logic for the vertical face needs to account for 
-     // the coordinate system. The "outward" face is Y=thickness.
-     
-     // Horizontal holes subtraction
-     for (h = horizontal_holes) {
-         translate([h[0], h[1], h[2]]) {
-             // This is slightly wrong in the loop above because I used translate inside the list.
-             // Let's simplify the logic for the final output.
-         }
+     // Bracket geometry
+     union() {
+         // Horizontal plate: X=width, Y=depth, Z=thickness
+         cube([width, depth, thickness]);
+         // Vertical plate: X=width, Y=thickness, Z=depth
+         cube([width, thickness, depth]);
      }
- }
  
- // Corrected clean logic for final output:
- module bracket_final() {
-     difference() {
-         union() {
-             cube([width, depth, thickness]); 
-             cube([width, thickness, depth]);
+     // Holes on the Horizontal face (Top surface: Z = thickness)
+     // X positions: 10mm and 40mm (Symmetrical, 10mm from edges 0 and 50)
+     // Y position: 30mm (10mm from edge 40)
+     for (x = [10, 40]) {
+         translate([x, depth - 10, thickness]) {
+             // Countersink seat (outward in +Z direction)
+             cylinder(d1=countersink_diameter, d2=hole_diameter, h=countersink_depth, $fn=32);
+             // Through hole (inward in -Z direction)
+             translate([0, 0, -thickness]) 
+                 cylinder(d=hole_diameter, h=thickness + 1, $fn=32);
          }
-         
-         // Subtract Horizontal Holes
-         for (x = x_pos) {
-             translate([x, y_pos, thickness]) {
-                 cylinder(d1=countersink_diameter, d2=hole_diameter, h=countersink_depth, $fn=32);
-                 translate([0, 0, -thickness]) cylinder(d=hole_diameter, h=thickness + countersink_depth, $fn=32);
-             }
-         }
-         
-         // Subtract Vertical Holes
-         for (x = x_pos) {
-             translate([x, thickness, z_pos]) {
-                 cylinder(d1=countersink_diameter, d2=hole_diameter, h=countersink_depth, $fn=32);
-                 translate([0, -thickness, 0]) cylinder(d=hole_diameter, h=thickness + countersink_depth, $fn=32);
-             }
-         }
      }
- }
  
- bracket_final();
+     // Holes on the Vertical face (Side surface: Y = thickness)
+     // X positions: 10mm and 40mm
+     // Z position: 30mm (10mm from edge 40)
+     for (x = [10, 40]) {
+         translate([x, thickness, depth - 10]) {
+             // Countersink seat (outward in +Y direction)
+             cylinder(d1=countersink_diameter, d2=hole_diameter, h=countersink_depth, $fn=32);
+             // Through hole (inward in -Y direction)
+             translate([0, -thickness, 0]) 
+                 cylinder(d=hole_diameter, h=thickness + 1, $fn=32);
+         }
+     }
+ }
SCAD (46 lines)
// L-bracket parameters
width = 50;
depth = 40;
thickness = 3;

// Hole parameters
hole_diameter = 4.5;
countersink_diameter = 8;
countersink_depth = 2;

// Final assembly
difference() {
    // Bracket geometry
    union() {
        // Horizontal plate: X=width, Y=depth, Z=thickness
        cube([width, depth, thickness]);
        // Vertical plate: X=width, Y=thickness, Z=depth
        cube([width, thickness, depth]);
    }

    // Holes on the Horizontal face (Top surface: Z = thickness)
    // X positions: 10mm and 40mm (Symmetrical, 10mm from edges 0 and 50)
    // Y position: 30mm (10mm from edge 40)
    for (x = [10, 40]) {
        translate([x, depth - 10, thickness]) {
            // Countersink seat (outward in +Z direction)
            cylinder(d1=countersink_diameter, d2=hole_diameter, h=countersink_depth, $fn=32);
            // Through hole (inward in -Z direction)
            translate([0, 0, -thickness]) 
                cylinder(d=hole_diameter, h=thickness + 1, $fn=32);
        }
    }

    // Holes on the Vertical face (Side surface: Y = thickness)
    // X positions: 10mm and 40mm
    // Z position: 30mm (10mm from edge 40)
    for (x = [10, 40]) {
        translate([x, thickness, depth - 10]) {
            // Countersink seat (outward in +Y direction)
            cylinder(d1=countersink_diameter, d2=hole_diameter, h=countersink_depth, $fn=32);
            // Through hole (inward in -Y direction)
            translate([0, -thickness, 0]) 
                cylinder(d=hole_diameter, h=thickness + 1, $fn=32);
        }
    }
}
i2 success →
iter 2
354.2s · 1086/25877t
diff vs i1: +14/-11
  // L-bracket parameters
  width = 50;
  depth = 40;
+ height = 40;
  thickness = 3;
  
  // Hole parameters
  hole_diameter = 4.5;
  countersink_diameter = 8;
  countersink_depth = 2;
  
  // Final assembly
  difference() {
      // Bracket geometry
      union() {
          // Horizontal plate: X=width, Y=depth, Z=thickness
+         // The face is the Z=thickness surface (50x40)
          cube([width, depth, thickness]);
-         // Vertical plate: X=width, Y=thickness, Z=depth
-         cube([width, thickness, depth]);
+         // Vertical plate: X=width, Y=thickness, Z=height
+         // The face is the Y=thickness surface (50x40)
+         cube([width, thickness, height]);
      }
  
      // Holes on the Horizontal face (Top surface: Z = thickness)
-     // X positions: 10mm and 40mm (Symmetrical, 10mm from edges 0 and 50)
-     // Y position: 30mm (10mm from edge 40)
-     for (x = [10, 40]) {
-         translate([x, depth - 10, thickness]) {
+     // Center line of depth is Y = depth / 2 = 20
+     // Symmetrical X positions: 10mm and (width - 10) = 40mm
+     for (x = [10, width - 10]) {
+         translate([x, depth / 2, thickness]) {
              // Countersink seat (outward in +Z direction)
              cylinder(d1=countersink_diameter, d2=hole_diameter, h=countersink_depth, $fn=32);
              // Through hole (inward in -Z direction)
              translate([0, 0, -thickness]) 
                  cylinder(d=hole_diameter, h=thickness + 1, $fn=32);
          }
      }
  
-     // Holes on the Vertical face (Side surface: Y = thickness)
-     // X positions: 10mm and 40mm
-     // Z position: 30mm (10mm from edge 40)
-     for (x = [10, 40]) {
-         translate([x, thickness, depth - 10]) {
+     // Holes on the Vertical face (Front surface: Y = thickness)
+     // Center line of height is Z = height / 2 = 20
+     // Symmetrical X positions: 10mm and (width - 10) = 40mm
+     for (x = [10, width - 10]) {
+         translate([x, thickness, height / 2]) {
              // Countersink seat (outward in +Y direction)
              cylinder(d1=countersink_diameter, d2=hole_diameter, h=countersink_depth, $fn=32);
              // Through hole (inward in -Y direction)
              translate([0, -thickness, 0]) 
                  cylinder(d=hole_diameter, h=thickness + 1, $fn=32);
          }
      }
  }
SCAD (49 lines)
// L-bracket parameters
width = 50;
depth = 40;
height = 40;
thickness = 3;

// Hole parameters
hole_diameter = 4.5;
countersink_diameter = 8;
countersink_depth = 2;

// Final assembly
difference() {
    // Bracket geometry
    union() {
        // Horizontal plate: X=width, Y=depth, Z=thickness
        // The face is the Z=thickness surface (50x40)
        cube([width, depth, thickness]);
        // Vertical plate: X=width, Y=thickness, Z=height
        // The face is the Y=thickness surface (50x40)
        cube([width, thickness, height]);
    }

    // Holes on the Horizontal face (Top surface: Z = thickness)
    // Center line of depth is Y = depth / 2 = 20
    // Symmetrical X positions: 10mm and (width - 10) = 40mm
    for (x = [10, width - 10]) {
        translate([x, depth / 2, thickness]) {
            // Countersink seat (outward in +Z direction)
            cylinder(d1=countersink_diameter, d2=hole_diameter, h=countersink_depth, $fn=32);
            // Through hole (inward in -Z direction)
            translate([0, 0, -thickness]) 
                cylinder(d=hole_diameter, h=thickness + 1, $fn=32);
        }
    }

    // Holes on the Vertical face (Front surface: Y = thickness)
    // Center line of height is Z = height / 2 = 20
    // Symmetrical X positions: 10mm and (width - 10) = 40mm
    for (x = [10, width - 10]) {
        translate([x, thickness, height / 2]) {
            // Countersink seat (outward in +Y direction)
            cylinder(d1=countersink_diameter, d2=hole_diameter, h=countersink_depth, $fn=32);
            // Through hole (inward in -Y direction)
            translate([0, -thickness, 0]) 
                cylinder(d=hole_diameter, h=thickness + 1, $fn=32);
        }
    }
}
i3 success →
iter 3
294.9s · 1130/21641t
diff vs i2: +15/-13
  // L-bracket parameters
  width = 50;
  depth = 40;
  height = 40;
  thickness = 3;
  
  // Hole parameters
  hole_diameter = 4.5;
  countersink_diameter = 8;
  countersink_depth = 2;
  
  // Final assembly
  difference() {
      // Bracket geometry
      union() {
-         // Horizontal plate: X=width, Y=depth, Z=thickness
-         // The face is the Z=thickness surface (50x40)
+         // Horizontal plate: occupies X [0,50], Y [0,40], Z [0,3]
+         // The large face is the top surface (XY plane at Z=thickness)
          cube([width, depth, thickness]);
-         // Vertical plate: X=width, Y=thickness, Z=height
-         // The face is the Y=thickness surface (50x40)
+         
+         // Vertical plate: occupies X [0,50], Y [0,3], Z [0,40]
+         // The large face is the front surface (XZ plane at Y=0)
          cube([width, thickness, height]);
      }
  
      // Holes on the Horizontal face (Top surface: Z = thickness)
-     // Center line of depth is Y = depth / 2 = 20
+     // Center line of Depth (Y) is depth / 2 = 20
      // Symmetrical X positions: 10mm and (width - 10) = 40mm
      for (x = [10, width - 10]) {
          translate([x, depth / 2, thickness]) {
-             // Countersink seat (outward in +Z direction)
+             // Countersink seat (pointing outward in +Z direction)
              cylinder(d1=countersink_diameter, d2=hole_diameter, h=countersink_depth, $fn=32);
              // Through hole (inward in -Z direction)
              translate([0, 0, -thickness]) 
                  cylinder(d=hole_diameter, h=thickness + 1, $fn=32);
          }
      }
  
-     // Holes on the Vertical face (Front surface: Y = thickness)
-     // Center line of height is Z = height / 2 = 20
+     // Holes on the Vertical face (Front surface: Y = 0)
+     // Center line of Height (Z) is height / 2 = 20
      // Symmetrical X positions: 10mm and (width - 10) = 40mm
      for (x = [10, width - 10]) {
-         translate([x, thickness, height / 2]) {
-             // Countersink seat (outward in +Y direction)
-             cylinder(d1=countersink_diameter, d2=hole_diameter, h=countersink_depth, $fn=32);
-             // Through hole (inward in -Y direction)
-             translate([0, -thickness, 0]) 
+         translate([x, 0, height / 2]) {
+             // Countersink seat (pointing outward in -Y direction)
+             translate([0, -countersink_depth, 0])
+                 cylinder(d1=countersink_diameter, d2=hole_diameter, h=countersink_depth, $fn=32);
+             // Through hole (inward in +Y direction)
+             translate([0, 0, -thickness]) 
                  cylinder(d=hole_diameter, h=thickness + 1, $fn=32);
          }
      }
  }
SCAD (51 lines)
// L-bracket parameters
width = 50;
depth = 40;
height = 40;
thickness = 3;

// Hole parameters
hole_diameter = 4.5;
countersink_diameter = 8;
countersink_depth = 2;

// Final assembly
difference() {
    // Bracket geometry
    union() {
        // Horizontal plate: occupies X [0,50], Y [0,40], Z [0,3]
        // The large face is the top surface (XY plane at Z=thickness)
        cube([width, depth, thickness]);
        
        // Vertical plate: occupies X [0,50], Y [0,3], Z [0,40]
        // The large face is the front surface (XZ plane at Y=0)
        cube([width, thickness, height]);
    }

    // Holes on the Horizontal face (Top surface: Z = thickness)
    // Center line of Depth (Y) is depth / 2 = 20
    // Symmetrical X positions: 10mm and (width - 10) = 40mm
    for (x = [10, width - 10]) {
        translate([x, depth / 2, thickness]) {
            // Countersink seat (pointing outward in +Z direction)
            cylinder(d1=countersink_diameter, d2=hole_diameter, h=countersink_depth, $fn=32);
            // Through hole (inward in -Z direction)
            translate([0, 0, -thickness]) 
                cylinder(d=hole_diameter, h=thickness + 1, $fn=32);
        }
    }

    // Holes on the Vertical face (Front surface: Y = 0)
    // Center line of Height (Z) is height / 2 = 20
    // Symmetrical X positions: 10mm and (width - 10) = 40mm
    for (x = [10, width - 10]) {
        translate([x, 0, height / 2]) {
            // Countersink seat (pointing outward in -Y direction)
            translate([0, -countersink_depth, 0])
                cylinder(d1=countersink_diameter, d2=hole_diameter, h=countersink_depth, $fn=32);
            // Through hole (inward in +Y direction)
            translate([0, 0, -thickness]) 
                cylinder(d=hole_diameter, h=thickness + 1, $fn=32);
        }
    }
}