vibe-openscad

tier-1-mug / gemini-2.5-pro

5 run / 累計 225.3s / 累計 $0.0315

gemini pro 2.5 bare

bare (provider default effort)

run detail →
render
bare render of tier-1-mug
loading STL…
success 53.8s · 142/485t · $0.0050
SCAD (53 lines)
// --- パラメータ定義 ---

// マグカップ本体の寸法
outer_diameter = 80;      // 外径 (mm)
height = 100;             // 高さ (mm)
wall_thickness = 4;       // 側面の肉厚 (mm)
bottom_thickness = 6;     // 底面の厚み (mm)

// 取手の寸法
handle_radius = 12;       // 取手のリング全体の半径 (mm)
handle_pipe_radius = 5;   // 取手を構成するパイプの半径 (mm)

// 曲面の解像度
$fn = 100;


// --- モデル生成 ---

// 計算用変数
outer_radius = outer_diameter / 2;
inner_radius = outer_radius - wall_thickness;

// union() で本体と取手を結合
union() {
    
    // 1. マグカップ本体
    difference() {
        // 外側の円柱
        cylinder(h = height, r = outer_radius);
        
        // 内側をくり抜くための円柱
        // Z軸方向に底面の厚み分だけ移動させる
        translate([0, 0, bottom_thickness]) {
            // 高さを本体と同じか少し高くして、確実に上までくり抜く
            cylinder(h = height, r = inner_radius);
        }
    }
    
    // 2. 取手 (トーラス形状)
    // 本体側面に食い込むように位置を調整
    translate([outer_radius - handle_pipe_radius, 0, height / 2]) {
        // Z軸に平行なリングになるように90度回転
        rotate([90, 0, 0]) {
            // rotate_extrude を使ってトーラス(リング)を作成
            rotate_extrude(convexity = 10) {
                // 回転軸からオフセットした位置に断面の円を描画
                translate([handle_radius, 0, 0]) {
                    circle(r = handle_pipe_radius);
                }
            }
        }
    }
}
パラメータ (6)
スライダを動かすと openscad-wasm で再レンダリング

prompt

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

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

variant: thinking

offnot run
adaptivenot run
dynamic (default) success
dynamic
53.8s · 142/485t · $0.0050
SCAD (53 lines)
// --- パラメータ定義 ---

// マグカップ本体の寸法
outer_diameter = 80;      // 外径 (mm)
height = 100;             // 高さ (mm)
wall_thickness = 4;       // 側面の肉厚 (mm)
bottom_thickness = 6;     // 底面の厚み (mm)

// 取手の寸法
handle_radius = 12;       // 取手のリング全体の半径 (mm)
handle_pipe_radius = 5;   // 取手を構成するパイプの半径 (mm)

// 曲面の解像度
$fn = 100;


// --- モデル生成 ---

// 計算用変数
outer_radius = outer_diameter / 2;
inner_radius = outer_radius - wall_thickness;

// union() で本体と取手を結合
union() {
    
    // 1. マグカップ本体
    difference() {
        // 外側の円柱
        cylinder(h = height, r = outer_radius);
        
        // 内側をくり抜くための円柱
        // Z軸方向に底面の厚み分だけ移動させる
        translate([0, 0, bottom_thickness]) {
            // 高さを本体と同じか少し高くして、確実に上までくり抜く
            cylinder(h = height, r = inner_radius);
        }
    }
    
    // 2. 取手 (トーラス形状)
    // 本体側面に食い込むように位置を調整
    translate([outer_radius - handle_pipe_radius, 0, height / 2]) {
        // Z軸に平行なリングになるように90度回転
        rotate([90, 0, 0]) {
            // rotate_extrude を使ってトーラス(リング)を作成
            rotate_extrude(convexity = 10) {
                // 回転軸からオフセットした位置に断面の円を描画
                translate([handle_radius, 0, 0]) {
                    circle(r = handle_pipe_radius);
                }
            }
        }
    }
}

iteration: iter-png

i1 success
iter 1
25.0s · 947/587t · $0.0071
diff vs bare: +4/-4
  // --- パラメータ定義 ---
  
  // マグカップ本体の寸法
  outer_diameter = 80;      // 外径 (mm)
  height = 100;             // 高さ (mm)
  wall_thickness = 4;       // 側面の肉厚 (mm)
  bottom_thickness = 6;     // 底面の厚み (mm)
  
  // 取手の寸法
  handle_radius = 12;       // 取手のリング全体の半径 (mm)
  handle_pipe_radius = 5;   // 取手を構成するパイプの半径 (mm)
  
  // 曲面の解像度
  $fn = 100;
  
  
  // --- モデル生成 ---
  
  // 計算用変数
  outer_radius = outer_diameter / 2;
  inner_radius = outer_radius - wall_thickness;
  
  // union() で本体と取手を結合
  union() {
      
      // 1. マグカップ本体
      difference() {
          // 外側の円柱
          cylinder(h = height, r = outer_radius);
          
          // 内側をくり抜くための円柱
          // Z軸方向に底面の厚み分だけ移動させる
          translate([0, 0, bottom_thickness]) {
              // 高さを本体と同じか少し高くして、確実に上までくり抜く
              cylinder(h = height, r = inner_radius);
          }
      }
      
      // 2. 取手 (トーラス形状)
-     // 本体側面に食い込むように位置を調整
-     translate([outer_radius - handle_pipe_radius, 0, height / 2]) {
-         // Z軸に平行なリングになるように90度回転
-         rotate([90, 0, 0]) {
+     // リングの中心が本体側面に接するように位置を調整
+     translate([outer_radius, 0, height / 2]) {
+         // リングの穴が側面と垂直になるようにY軸周りに90度回転
+         rotate([0, 90, 0]) {
              // rotate_extrude を使ってトーラス(リング)を作成
              rotate_extrude(convexity = 10) {
                  // 回転軸からオフセットした位置に断面の円を描画
                  translate([handle_radius, 0, 0]) {
                      circle(r = handle_pipe_radius);
                  }
              }
          }
      }
  }
SCAD (53 lines)
// --- パラメータ定義 ---

// マグカップ本体の寸法
outer_diameter = 80;      // 外径 (mm)
height = 100;             // 高さ (mm)
wall_thickness = 4;       // 側面の肉厚 (mm)
bottom_thickness = 6;     // 底面の厚み (mm)

// 取手の寸法
handle_radius = 12;       // 取手のリング全体の半径 (mm)
handle_pipe_radius = 5;   // 取手を構成するパイプの半径 (mm)

// 曲面の解像度
$fn = 100;


// --- モデル生成 ---

// 計算用変数
outer_radius = outer_diameter / 2;
inner_radius = outer_radius - wall_thickness;

// union() で本体と取手を結合
union() {
    
    // 1. マグカップ本体
    difference() {
        // 外側の円柱
        cylinder(h = height, r = outer_radius);
        
        // 内側をくり抜くための円柱
        // Z軸方向に底面の厚み分だけ移動させる
        translate([0, 0, bottom_thickness]) {
            // 高さを本体と同じか少し高くして、確実に上までくり抜く
            cylinder(h = height, r = inner_radius);
        }
    }
    
    // 2. 取手 (トーラス形状)
    // リングの中心が本体側面に接するように位置を調整
    translate([outer_radius, 0, height / 2]) {
        // リングの穴が側面と垂直になるようにY軸周りに90度回転
        rotate([0, 90, 0]) {
            // rotate_extrude を使ってトーラス(リング)を作成
            rotate_extrude(convexity = 10) {
                // 回転軸からオフセットした位置に断面の円を描画
                translate([handle_radius, 0, 0]) {
                    circle(r = handle_pipe_radius);
                }
            }
        }
    }
}
i2 success
iter 2
67.1s · 947/586t · $0.0070
diff vs i1: +18/-10
  // --- パラメータ定義 ---
  
  // マグカップ本体の寸法
  outer_diameter = 80;      // 外径 (mm)
  height = 100;             // 高さ (mm)
  wall_thickness = 4;       // 側面の肉厚 (mm)
  bottom_thickness = 6;     // 底面の厚み (mm)
  
  // 取手の寸法
  handle_radius = 12;       // 取手のリング全体の半径 (mm)
  handle_pipe_radius = 5;   // 取手を構成するパイプの半径 (mm)
  
  // 曲面の解像度
  $fn = 100;
  
  
  // --- モデル生成 ---
  
  // 計算用変数
  outer_radius = outer_diameter / 2;
  inner_radius = outer_radius - wall_thickness;
  
  // union() で本体と取手を結合
  union() {
      
      // 1. マグカップ本体
      difference() {
          // 外側の円柱
          cylinder(h = height, r = outer_radius);
          
          // 内側をくり抜くための円柱
          // Z軸方向に底面の厚み分だけ移動させる
          translate([0, 0, bottom_thickness]) {
              // 高さを本体と同じか少し高くして、確実に上までくり抜く
              cylinder(h = height, r = inner_radius);
          }
      }
      
-     // 2. 取手 (トーラス形状)
-     // リングの中心が本体側面に接するように位置を調整
-     translate([outer_radius, 0, height / 2]) {
-         // リングの穴が側面と垂直になるようにY軸周りに90度回転
-         rotate([0, 90, 0]) {
-             // rotate_extrude を使ってトーラス(リング)を作成
-             rotate_extrude(convexity = 10) {
-                 // 回転軸からオフセットした位置に断面の円を描画
-                 translate([handle_radius, 0, 0]) {
-                     circle(r = handle_pipe_radius);
+     // 2. 取手
+     // 取っ手がカップ内部に突き抜けないように、内側の円柱でくり抜く
+     difference() {
+         // 2a. トーラス形状の取手本体
+         // リングの中心が本体側面に接するように位置を調整
+         translate([outer_radius, 0, height / 2]) {
+             // リングの穴が側面と垂直になるようにY軸周りに90度回転
+             rotate([0, 90, 0]) {
+                 // rotate_extrude を使ってトーラス(リング)を作成
+                 rotate_extrude(convexity = 10) {
+                     // 回転軸からオフセットした位置に断面の円を描画
+                     translate([handle_radius, 0, 0]) {
+                         circle(r = handle_pipe_radius);
+                     }
                  }
              }
          }
+         
+         // 2b. カップの内側部分をくり抜くための円柱
+         // 取っ手の高さに関わらず確実にくり抜けるよう、上下に十分な高さで作成
+         cylinder(h = height * 2, center = true, r = inner_radius);
      }
  }
SCAD (61 lines)
// --- パラメータ定義 ---

// マグカップ本体の寸法
outer_diameter = 80;      // 外径 (mm)
height = 100;             // 高さ (mm)
wall_thickness = 4;       // 側面の肉厚 (mm)
bottom_thickness = 6;     // 底面の厚み (mm)

// 取手の寸法
handle_radius = 12;       // 取手のリング全体の半径 (mm)
handle_pipe_radius = 5;   // 取手を構成するパイプの半径 (mm)

// 曲面の解像度
$fn = 100;


// --- モデル生成 ---

// 計算用変数
outer_radius = outer_diameter / 2;
inner_radius = outer_radius - wall_thickness;

// union() で本体と取手を結合
union() {
    
    // 1. マグカップ本体
    difference() {
        // 外側の円柱
        cylinder(h = height, r = outer_radius);
        
        // 内側をくり抜くための円柱
        // Z軸方向に底面の厚み分だけ移動させる
        translate([0, 0, bottom_thickness]) {
            // 高さを本体と同じか少し高くして、確実に上までくり抜く
            cylinder(h = height, r = inner_radius);
        }
    }
    
    // 2. 取手
    // 取っ手がカップ内部に突き抜けないように、内側の円柱でくり抜く
    difference() {
        // 2a. トーラス形状の取手本体
        // リングの中心が本体側面に接するように位置を調整
        translate([outer_radius, 0, height / 2]) {
            // リングの穴が側面と垂直になるようにY軸周りに90度回転
            rotate([0, 90, 0]) {
                // rotate_extrude を使ってトーラス(リング)を作成
                rotate_extrude(convexity = 10) {
                    // 回転軸からオフセットした位置に断面の円を描画
                    translate([handle_radius, 0, 0]) {
                        circle(r = handle_pipe_radius);
                    }
                }
            }
        }
        
        // 2b. カップの内側部分をくり抜くための円柱
        // 取っ手の高さに関わらず確実にくり抜けるよう、上下に十分な高さで作成
        cylinder(h = height * 2, center = true, r = inner_radius);
    }
}
i3 success
iter 3
25.6s · 1048/604t · $0.0074
diff vs i2: +2/-2
  // --- パラメータ定義 ---
  
  // マグカップ本体の寸法
  outer_diameter = 80;      // 外径 (mm)
  height = 100;             // 高さ (mm)
  wall_thickness = 4;       // 側面の肉厚 (mm)
  bottom_thickness = 6;     // 底面の厚み (mm)
  
  // 取手の寸法
  handle_radius = 12;       // 取手のリング全体の半径 (mm)
  handle_pipe_radius = 5;   // 取手を構成するパイプの半径 (mm)
  
  // 曲面の解像度
  $fn = 100;
  
  
  // --- モデル生成 ---
  
  // 計算用変数
  outer_radius = outer_diameter / 2;
  inner_radius = outer_radius - wall_thickness;
  
  // union() で本体と取手を結合
  union() {
      
      // 1. マグカップ本体
      difference() {
          // 外側の円柱
          cylinder(h = height, r = outer_radius);
          
          // 内側をくり抜くための円柱
          // Z軸方向に底面の厚み分だけ移動させる
          translate([0, 0, bottom_thickness]) {
              // 高さを本体と同じか少し高くして、確実に上までくり抜く
              cylinder(h = height, r = inner_radius);
          }
      }
      
      // 2. 取手
      // 取っ手がカップ内部に突き抜けないように、内側の円柱でくり抜く
      difference() {
          // 2a. トーラス形状の取手本体
-         // リングの中心が本体側面に接するように位置を調整
-         translate([outer_radius, 0, height / 2]) {
+         // リングが本体に少しめり込み、接合部が滑らかになるように位置を調整
+         translate([outer_radius - handle_pipe_radius / 2, 0, height / 2]) {
              // リングの穴が側面と垂直になるようにY軸周りに90度回転
              rotate([0, 90, 0]) {
                  // rotate_extrude を使ってトーラス(リング)を作成
                  rotate_extrude(convexity = 10) {
                      // 回転軸からオフセットした位置に断面の円を描画
                      translate([handle_radius, 0, 0]) {
                          circle(r = handle_pipe_radius);
                      }
                  }
              }
          }
          
          // 2b. カップの内側部分をくり抜くための円柱
          // 取っ手の高さに関わらず確実にくり抜けるよう、上下に十分な高さで作成
          cylinder(h = height * 2, center = true, r = inner_radius);
      }
  }
SCAD (61 lines)
// --- パラメータ定義 ---

// マグカップ本体の寸法
outer_diameter = 80;      // 外径 (mm)
height = 100;             // 高さ (mm)
wall_thickness = 4;       // 側面の肉厚 (mm)
bottom_thickness = 6;     // 底面の厚み (mm)

// 取手の寸法
handle_radius = 12;       // 取手のリング全体の半径 (mm)
handle_pipe_radius = 5;   // 取手を構成するパイプの半径 (mm)

// 曲面の解像度
$fn = 100;


// --- モデル生成 ---

// 計算用変数
outer_radius = outer_diameter / 2;
inner_radius = outer_radius - wall_thickness;

// union() で本体と取手を結合
union() {
    
    // 1. マグカップ本体
    difference() {
        // 外側の円柱
        cylinder(h = height, r = outer_radius);
        
        // 内側をくり抜くための円柱
        // Z軸方向に底面の厚み分だけ移動させる
        translate([0, 0, bottom_thickness]) {
            // 高さを本体と同じか少し高くして、確実に上までくり抜く
            cylinder(h = height, r = inner_radius);
        }
    }
    
    // 2. 取手
    // 取っ手がカップ内部に突き抜けないように、内側の円柱でくり抜く
    difference() {
        // 2a. トーラス形状の取手本体
        // リングが本体に少しめり込み、接合部が滑らかになるように位置を調整
        translate([outer_radius - handle_pipe_radius / 2, 0, height / 2]) {
            // リングの穴が側面と垂直になるようにY軸周りに90度回転
            rotate([0, 90, 0]) {
                // rotate_extrude を使ってトーラス(リング)を作成
                rotate_extrude(convexity = 10) {
                    // 回転軸からオフセットした位置に断面の円を描画
                    translate([handle_radius, 0, 0]) {
                        circle(r = handle_pipe_radius);
                    }
                }
            }
        }
        
        // 2b. カップの内側部分をくり抜くための円柱
        // 取っ手の高さに関わらず確実にくり抜けるよう、上下に十分な高さで作成
        cylinder(h = height * 2, center = true, r = inner_radius);
    }
}