vibe-openscad

tier-1-mug / gpt-5-nano-2025-08-07

7 run / 累計 565.1s / 累計 $0.0366

openai gpt 5 nano 2025-08-07 bare

bare (provider default effort)

run detail →
render
bare render of tier-1-mug
loading STL…
success 69.2s · 168/13488t · $0.0054
SCAD (42 lines)
$fn = 100;

outer_radius = 40;           // 外径 80 mm -> 半径 40 mm
wall_thickness = 4;
bottom_thickness = 6;
height = 100;

inner_radius = outer_radius - wall_thickness;
cavity_height = height - bottom_thickness;

// マグカップの外形と内腔を作成
module mug_shell() {
    difference() {
        // 外形(実体)
        cylinder(h = height, r = outer_radius, center = false);
        // 内腔(くり抜き、底の厚みは bottom_thickness)
        translate([0, 0, bottom_thickness])
            cylinder(h = cavity_height, r = inner_radius, center = false);
    }
}

// トーラス(輪っか)を作成するヘルパー
module torus(R, r) {
    rotate_extrude(angle = 360)
        translate([R, 0, 0])
            circle(r = r);
}

// 取手(リング状のリング)を側面に取り付ける
module ring_handle() {
    // 外周から十分にはみ出すよう、外側に位置させる
    // major radius 12 mm(要求の半径)とし、薄い輪っかにする
    // 取手はカップの中高さ付近に配置
    translate([outer_radius + 12, 0, height/2])
        rotate([0, 90, 0])  // リングを側面の平面に配置
            torus(12, 4);
}

union() {
    mug_shell();
    ring_handle();
}
パラメータ (4)
スライダを動かすと openscad-wasm で再レンダリング

prompt

OpenSCAD で、外径 80mm、高さ 100mm、肉厚 4mm のマグカップを作ってください。
底面の厚みは 6mm とし、内側はくり抜いて飲み物を入れられる形状にしてください。
さらに、側面には外径方向に飛び出す半径 12mm の取手(リング状の取手)を付けてください。
取手はカップの中心高さあたりに付け、外周から十分にはみ出して指を通せる形にしてください。

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

variant: effort

low success
low
20.6s · 168/2765t · $0.0011
SCAD (52 lines)
// 外径 80mm, 高さ 100mm, 肉厚 4mm, 底面厚 6mm, 内側くり抜き
// 側面取手は半径 12mm のリング状

module mug() {
    outer_r = 40;          // 外径/半径
    wall = 4;               // 肉厚
    height = 100;           // 外形高さ
    bottom_thickness = 6;   // 底厚
    inner_h = height - bottom_thickness; // 内部有効高
    inner_r = outer_r - wall; // 内径半径

    // 外形筒
    difference() {
        // 外形の筒
        cylinder(h = height, r = outer_r, center = false);

        // 内部をくり抜く(底厚を確保するため、下方向に底厚分ずらしてくり抜く)
        translate([0, 0, bottom_thickness])
            cylinder(h = inner_h, r = inner_r, center = false);
    }
}

// 指定位置に取手を追加
module handle_ring() {
    // 取手のリングは外周から外にはみ出すように
    // 主半径 R = 外径半径 + 12mm = 40 + 12 = 52
    // チューブの断面半径 r = 6mm
    R = 52;
    r = 6;

    // torus を作成: major radius R, minor radius r
    // torus を z 軸周りに作るには rotate_extrude ベース
    // 現状の中心を cup の中心軸に合わせるため、Z = height/2 = 50 に配置
    translate([0, 0, 50])
        rotate([0, 90, 0])
            torus(R, r);
}

// torus 作成モジュール
// R : major radius(トーラスの中心円の半径)
// r : minor radius(断面半径)
module torus(R, r) {
    // rotate_extrude は 2D を回転して 3D にする。円を X 軸方向に配置して回す
    rotate_extrude($fn = 120)
        translate([R, 0, 0])
            circle(r = r, $fn = 60);
}

union() {
    mug();
    handle_ring();
}
medium (default) success
medium
69.2s · 168/13488t · $0.0054
SCAD (42 lines)
$fn = 100;

outer_radius = 40;           // 外径 80 mm -> 半径 40 mm
wall_thickness = 4;
bottom_thickness = 6;
height = 100;

inner_radius = outer_radius - wall_thickness;
cavity_height = height - bottom_thickness;

// マグカップの外形と内腔を作成
module mug_shell() {
    difference() {
        // 外形(実体)
        cylinder(h = height, r = outer_radius, center = false);
        // 内腔(くり抜き、底の厚みは bottom_thickness)
        translate([0, 0, bottom_thickness])
            cylinder(h = cavity_height, r = inner_radius, center = false);
    }
}

// トーラス(輪っか)を作成するヘルパー
module torus(R, r) {
    rotate_extrude(angle = 360)
        translate([R, 0, 0])
            circle(r = r);
}

// 取手(リング状のリング)を側面に取り付ける
module ring_handle() {
    // 外周から十分にはみ出すよう、外側に位置させる
    // major radius 12 mm(要求の半径)とし、薄い輪っかにする
    // 取手はカップの中高さ付近に配置
    translate([outer_radius + 12, 0, height/2])
        rotate([0, 90, 0])  // リングを側面の平面に配置
            torus(12, 4);
}

union() {
    mug_shell();
    ring_handle();
}
high success
high
170.8s · 168/29431t · $0.0118
SCAD (32 lines)
// OpenSCAD model: 外径 80mm、高さ 100mm、肉厚 4mm のマグカップ
// 底面の厚み 6mm、内側をくり抜き、側面に半径 12mm の取手(リング状)を付ける
// 取手はカップの中心高さ付近に配置

outer_R = 40;      // 外半径(80mmの直径)
inner_R = 36;      // 内半径(肉厚4mmに対応)
cup_h = 100;       // 高さ
bottomThk = 6;     // 底面の厚み

// 取手の torus(リング)設定
handle_major = 46;   // トーラスの major 半径(R)
handle_tube  = 6;    // トーラスの tube 半径(r) -> 外側へ 2*r = 12mm の突出
// 2R方向の内径が外径と一致するよう、R - r = 40

union() {
    // Cup body: 外形と内側をくり抜く
    difference() {
        // 外形
        cylinder(h = cup_h, r = outer_R, $fn = 200);
        // 内側(底から 6mm 上がった位置から高さ cup_h - bottomThk までの円柱をくり抜く)
        translate([0, 0, bottomThk])
            cylinder(h = cup_h - bottomThk, r = inner_R, $fn = 200);
    }

    // ロング取手(リング状)を取付位置に配置:縦方向の中心をカップの中心高さの付近
    translate([0, 0, cup_h/2]) {
        // torus を作成(xy平面上に ring を生成してから z 方向に適用)
        rotate_extrude(angle = 360, $fn = 200)
            translate([handle_major, 0, 0])
                circle(r = handle_tube);
    }
}
maxnot run
xhighnot run

iteration: iter-png

i1 success
iter 1
94.8s · 1340/13046t · $0.0053
diff vs bare: +7/-5
  $fn = 100;
  
  outer_radius = 40;           // 外径 80 mm -> 半径 40 mm
  wall_thickness = 4;
  bottom_thickness = 6;
  height = 100;
  
  inner_radius = outer_radius - wall_thickness;
  cavity_height = height - bottom_thickness;
  
  // マグカップの外形と内腔を作成
  module mug_shell() {
      difference() {
          // 外形(実体)
          cylinder(h = height, r = outer_radius, center = false);
          // 内腔(くり抜き、底の厚みは bottom_thickness)
          translate([0, 0, bottom_thickness])
              cylinder(h = cavity_height, r = inner_radius, center = false);
      }
  }
  
  // トーラス(輪っか)を作成するヘルパー
  module torus(R, r) {
      rotate_extrude(angle = 360)
          translate([R, 0, 0])
              circle(r = r);
  }
  
  // 取手(リング状のリング)を側面に取り付ける
+ // 外周面に接するよう、半径の組み合わせを R + r = 12 に設定
+ ring_major = 8;   // major radius of torus
+ ring_tube  = 4;   // minor radius (tube radius)
+ ring_center_x = outer_radius; // 外周面に接するよう、中心位置を設定
+ 
  module ring_handle() {
-     // 外周から十分にはみ出すよう、外側に位置させる
-     // major radius 12 mm(要求の半径)とし、薄い輪っかにする
-     // 取手はカップの中高さ付近に配置
-     translate([outer_radius + 12, 0, height/2])
+     translate([ring_center_x, 0, height/2])
          rotate([0, 90, 0])  // リングを側面の平面に配置
-             torus(12, 4);
+             torus(ring_major, ring_tube);
  }
  
  union() {
      mug_shell();
      ring_handle();
  }
SCAD (44 lines)
$fn = 100;

outer_radius = 40;           // 外径 80 mm -> 半径 40 mm
wall_thickness = 4;
bottom_thickness = 6;
height = 100;

inner_radius = outer_radius - wall_thickness;
cavity_height = height - bottom_thickness;

// マグカップの外形と内腔を作成
module mug_shell() {
    difference() {
        // 外形(実体)
        cylinder(h = height, r = outer_radius, center = false);
        // 内腔(くり抜き、底の厚みは bottom_thickness)
        translate([0, 0, bottom_thickness])
            cylinder(h = cavity_height, r = inner_radius, center = false);
    }
}

// トーラス(輪っか)を作成するヘルパー
module torus(R, r) {
    rotate_extrude(angle = 360)
        translate([R, 0, 0])
            circle(r = r);
}

// 取手(リング状のリング)を側面に取り付ける
// 外周面に接するよう、半径の組み合わせを R + r = 12 に設定
ring_major = 8;   // major radius of torus
ring_tube  = 4;   // minor radius (tube radius)
ring_center_x = outer_radius; // 外周面に接するよう、中心位置を設定

module ring_handle() {
    translate([ring_center_x, 0, height/2])
        rotate([0, 90, 0])  // リングを側面の平面に配置
            torus(ring_major, ring_tube);
}

union() {
    mug_shell();
    ring_handle();
}
i2 success
iter 2
79.5s · 1356/9961t · $0.0041
diff vs i1: +0/-0
  $fn = 100;
  
  outer_radius = 40;           // 外径 80 mm -> 半径 40 mm
  wall_thickness = 4;
  bottom_thickness = 6;
  height = 100;
  
  inner_radius = outer_radius - wall_thickness;
  cavity_height = height - bottom_thickness;
  
  // マグカップの外形と内腔を作成
  module mug_shell() {
      difference() {
          // 外形(実体)
          cylinder(h = height, r = outer_radius, center = false);
          // 内腔(くり抜き、底の厚みは bottom_thickness)
          translate([0, 0, bottom_thickness])
              cylinder(h = cavity_height, r = inner_radius, center = false);
      }
  }
  
  // トーラス(輪っか)を作成するヘルパー
  module torus(R, r) {
      rotate_extrude(angle = 360)
          translate([R, 0, 0])
              circle(r = r);
  }
  
  // 取手(リング状のリング)を側面に取り付ける
  // 外周面に接するよう、半径の組み合わせを R + r = 12 に設定
  ring_major = 8;   // major radius of torus
  ring_tube  = 4;   // minor radius (tube radius)
  ring_center_x = outer_radius; // 外周面に接するよう、中心位置を設定
  
  module ring_handle() {
      translate([ring_center_x, 0, height/2])
          rotate([0, 90, 0])  // リングを側面の平面に配置
              torus(ring_major, ring_tube);
  }
  
  union() {
      mug_shell();
      ring_handle();
  }
SCAD (44 lines)
$fn = 100;

outer_radius = 40;           // 外径 80 mm -> 半径 40 mm
wall_thickness = 4;
bottom_thickness = 6;
height = 100;

inner_radius = outer_radius - wall_thickness;
cavity_height = height - bottom_thickness;

// マグカップの外形と内腔を作成
module mug_shell() {
    difference() {
        // 外形(実体)
        cylinder(h = height, r = outer_radius, center = false);
        // 内腔(くり抜き、底の厚みは bottom_thickness)
        translate([0, 0, bottom_thickness])
            cylinder(h = cavity_height, r = inner_radius, center = false);
    }
}

// トーラス(輪っか)を作成するヘルパー
module torus(R, r) {
    rotate_extrude(angle = 360)
        translate([R, 0, 0])
            circle(r = r);
}

// 取手(リング状のリング)を側面に取り付ける
// 外周面に接するよう、半径の組み合わせを R + r = 12 に設定
ring_major = 8;   // major radius of torus
ring_tube  = 4;   // minor radius (tube radius)
ring_center_x = outer_radius; // 外周面に接するよう、中心位置を設定

module ring_handle() {
    translate([ring_center_x, 0, height/2])
        rotate([0, 90, 0])  // リングを側面の平面に配置
            torus(ring_major, ring_tube);
}

union() {
    mug_shell();
    ring_handle();
}
i3 success
iter 3
61.0s · 1356/8846t · $0.0036
diff vs i2: +0/-0
  $fn = 100;
  
  outer_radius = 40;           // 外径 80 mm -> 半径 40 mm
  wall_thickness = 4;
  bottom_thickness = 6;
  height = 100;
  
  inner_radius = outer_radius - wall_thickness;
  cavity_height = height - bottom_thickness;
  
  // マグカップの外形と内腔を作成
  module mug_shell() {
      difference() {
          // 外形(実体)
          cylinder(h = height, r = outer_radius, center = false);
          // 内腔(くり抜き、底の厚みは bottom_thickness)
          translate([0, 0, bottom_thickness])
              cylinder(h = cavity_height, r = inner_radius, center = false);
      }
  }
  
  // トーラス(輪っか)を作成するヘルパー
  module torus(R, r) {
      rotate_extrude(angle = 360)
          translate([R, 0, 0])
              circle(r = r);
  }
  
  // 取手(リング状のリング)を側面に取り付ける
  // 外周面に接するよう、半径の組み合わせを R + r = 12 に設定
  ring_major = 8;   // major radius of torus
  ring_tube  = 4;   // minor radius (tube radius)
  ring_center_x = outer_radius; // 外周面に接するよう、中心位置を設定
  
  module ring_handle() {
      translate([ring_center_x, 0, height/2])
          rotate([0, 90, 0])  // リングを側面の平面に配置
              torus(ring_major, ring_tube);
  }
  
  union() {
      mug_shell();
      ring_handle();
  }
SCAD (44 lines)
$fn = 100;

outer_radius = 40;           // 外径 80 mm -> 半径 40 mm
wall_thickness = 4;
bottom_thickness = 6;
height = 100;

inner_radius = outer_radius - wall_thickness;
cavity_height = height - bottom_thickness;

// マグカップの外形と内腔を作成
module mug_shell() {
    difference() {
        // 外形(実体)
        cylinder(h = height, r = outer_radius, center = false);
        // 内腔(くり抜き、底の厚みは bottom_thickness)
        translate([0, 0, bottom_thickness])
            cylinder(h = cavity_height, r = inner_radius, center = false);
    }
}

// トーラス(輪っか)を作成するヘルパー
module torus(R, r) {
    rotate_extrude(angle = 360)
        translate([R, 0, 0])
            circle(r = r);
}

// 取手(リング状のリング)を側面に取り付ける
// 外周面に接するよう、半径の組み合わせを R + r = 12 に設定
ring_major = 8;   // major radius of torus
ring_tube  = 4;   // minor radius (tube radius)
ring_center_x = outer_radius; // 外周面に接するよう、中心位置を設定

module ring_handle() {
    translate([ring_center_x, 0, height/2])
        rotate([0, 90, 0])  // リングを側面の平面に配置
            torus(ring_major, ring_tube);
}

union() {
    mug_shell();
    ring_handle();
}