vibe-openscad

tier-1-mug / claude-opus-4-7

10 run / 累計 83.1s / 累計 $0.1807

claude opus 4.7 bare

bare (provider default effort)

run detail →
render
bare render of tier-1-mug
loading STL…
success 6.8s · 225/407t · $0.0113
SCAD (37 lines)
// マグカップ
$fn = 100;

outer_d = 80;      // 外径
height = 100;      // 高さ
wall = 4;          // 肉厚
bottom = 6;        // 底厚
handle_r = 12;     // 取手のリング半径(穴の半径)
handle_thick = 6;  // 取手の太さ

module mug() {
    difference() {
        // 外側
        cylinder(h = height, d = outer_d);
        // 内側くり抜き
        translate([0, 0, bottom])
            cylinder(h = height - bottom + 1, d = outer_d - 2 * wall);
    }
}

module handle() {
    // カップの中心高さに配置
    translate([outer_d / 2, 0, height / 2])
        rotate([90, 0, 0])
            rotate_extrude($fn = 80)
                translate([handle_r, 0, 0])
                    circle(d = handle_thick);
}

union() {
    mug();
    // 取手の一部がカップ内部に被らないよう、外側部分のみ残す
    difference() {
        handle();
        cylinder(h = height + 1, d = outer_d - 0.01);
    }
}
パラメータ (6)
スライダを動かすと openscad-wasm で再レンダリング

prompt

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

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

variant: effort

low success
low
7.2s · 225/283t · $0.0082
SCAD (29 lines)
$fn = 100;

outer_d = 80;
height  = 100;
wall    = 4;
bottom  = 6;
handle_r = 12;       // リング取手の中心半径
handle_tube = 6;     // 取手の太さ(チューブ半径)

module mug() {
    difference() {
        cylinder(d = outer_d, h = height);
        translate([0, 0, bottom])
            cylinder(d = outer_d - 2*wall, h = height);
    }
}

module handle() {
    translate([outer_d/2 + handle_r - handle_tube/2, 0, height/2])
        rotate([90, 0, 0])
            rotate_extrude()
                translate([handle_r, 0, 0])
                    circle(r = handle_tube);
}

union() {
    mug();
    handle();
}
mediumnot run
high (default) render_error render
render_error
9.6s · 225/580t · $0.0156
openscad stl render failed (exit 1): ERROR: Parser error: syntax error in file ../../../../../tmp/render-nuXeAh/input.scad, line 39
Can't parse file '/tmp/render-nuXeAh/input.scad'!

SCAD (49 lines)
// マグカップ パラメータ
outer_d = 80;      // 外径
height  = 100;     // 高さ
wall    = 4;       // 肉厚
bottom  = 6;       // 底厚

handle_r      = 12;  // 取手リングの穴半径(指を通す穴)
handle_thick  = 6;   // 取手の太さ(チューブの半径)
handle_z      = height / 2; // 取手の高さ位置

$fn = 100;

module mug_body() {
    difference() {
        // 外形
        cylinder(h = height, d = outer_d);
        // 内側くり抜き
        translate([0, 0, bottom])
            cylinder(h = height - bottom + 1, d = outer_d - 2 * wall);
    }
}

module handle() {
    // 取手:カップ外側に飛び出すリング(トーラス)
    // 取手の中心を、カップの外周から少し外側に置く
    handle_center_x = outer_d / 2 + handle_r * 0.3;
    
    translate([handle_center_x, 0, handle_z])
        rotate([90, 0, 0])
            rotate_extrude(convexity = 10)
                translate([handle_r, 0, 0])
                    circle(r = handle_thick);
}

module mug() {
    union() {
        mug_body();
        // 取手はカップ本体と交差する部分を残して結合
        intersection_union: 
        difference() {
            handle();
            // カップ内側の空洞には取手が入り込まないようにする
            translate([0, 0, bottom])
                cylinder(h = height - bottom + 1, d = outer_d - 2 * wall);
        }
    }
}

mug();
max success
max
5.2s · 225/345t · $0.0097
SCAD (33 lines)
// マグカップのパラメータ
outer_diameter = 80;
height = 100;
wall_thickness = 4;
bottom_thickness = 6;
handle_radius = 12;
handle_tube_radius = 6;

$fn = 100;

module mug() {
    difference() {
        // 外側の円柱
        cylinder(h = height, d = outer_diameter);
        // 内側をくり抜く
        translate([0, 0, bottom_thickness])
            cylinder(h = height - bottom_thickness + 1, d = outer_diameter - 2 * wall_thickness);
    }
}

module handle() {
    // 取手をカップの中心高さに配置
    translate([outer_diameter / 2 + handle_radius - 2, 0, height / 2])
        rotate([90, 0, 0])
            rotate_extrude()
                translate([handle_radius, 0, 0])
                    circle(r = handle_tube_radius);
}

union() {
    mug();
    handle();
}
xhigh render_error render
render_error
12.7s · 225/1156t · $0.0300
openscad stl render failed (exit 1): ERROR: Parser error: syntax error in file ../../../../../tmp/render-du5bFW/input.scad, line 43
Can't parse file '/tmp/render-du5bFW/input.scad'!

SCAD (44 lines)
// マグカップ パラメータ
outer_diameter = 80;     // 外径
height = 100;            // 高さ
wall_thickness = 4;      // 肉厚
bottom_thickness = 6;    // 底面の厚み

outer_radius = outer_diameter / 2;
inner_radius = outer_radius - wall_thickness;

// 取手パラメータ
handle_ring_radius = 12;  // リング取手の半径(穴の半径)
handle_tube_radius = 4;   // 取手の太さ
handle_height = height / 2;  // 取手の高さ位置(カップの中心)

$fn = 100;

module mug_body() {
    difference() {
        // 外側の円筒
        cylinder(h = height, r = outer_radius);
        // 内側をくり抜く
        translate([0, 0, bottom_thickness])
            cylinder(h = height - bottom_thickness + 1, r = inner_radius);
    }
}

module handle() {
    // リング状の取手をカップの側面に取り付ける
    // 取手の中心を、カップ外周から少し離した位置に配置
    handle_center_x = outer_radius + handle_ring_radius - handle_tube_radius / 2;
    
    translate([handle_center_x, 0, handle_height])
        rotate([90, 0, 0])
            rotate_extrude($fn = 100)
                translate([handle_ring_radius, 0, 0])
                    circle(r = handle_tube_radius, $fn = 50);
}

// 完成形
union() {
    mug_body();
    // 取手はカップ本体と重なる部分も含めて配置
    intersection_or_union: handle();
}

variant: thinking

off render_error render
render_error
9.6s · 225/580t · $0.0156
openscad stl render failed (exit 1): ERROR: Parser error: syntax error in file ../../../../../tmp/render-nuXeAh/input.scad, line 39
Can't parse file '/tmp/render-nuXeAh/input.scad'!

SCAD (49 lines)
// マグカップ パラメータ
outer_d = 80;      // 外径
height  = 100;     // 高さ
wall    = 4;       // 肉厚
bottom  = 6;       // 底厚

handle_r      = 12;  // 取手リングの穴半径(指を通す穴)
handle_thick  = 6;   // 取手の太さ(チューブの半径)
handle_z      = height / 2; // 取手の高さ位置

$fn = 100;

module mug_body() {
    difference() {
        // 外形
        cylinder(h = height, d = outer_d);
        // 内側くり抜き
        translate([0, 0, bottom])
            cylinder(h = height - bottom + 1, d = outer_d - 2 * wall);
    }
}

module handle() {
    // 取手:カップ外側に飛び出すリング(トーラス)
    // 取手の中心を、カップの外周から少し外側に置く
    handle_center_x = outer_d / 2 + handle_r * 0.3;
    
    translate([handle_center_x, 0, handle_z])
        rotate([90, 0, 0])
            rotate_extrude(convexity = 10)
                translate([handle_r, 0, 0])
                    circle(r = handle_thick);
}

module mug() {
    union() {
        mug_body();
        // 取手はカップ本体と交差する部分を残して結合
        intersection_union: 
        difference() {
            handle();
            // カップ内側の空洞には取手が入り込まないようにする
            translate([0, 0, bottom])
                cylinder(h = height - bottom + 1, d = outer_d - 2 * wall);
        }
    }
}

mug();
adaptive (default) render_error render
render_error
12.7s · 225/1156t · $0.0300
openscad stl render failed (exit 1): ERROR: Parser error: syntax error in file ../../../../../tmp/render-du5bFW/input.scad, line 43
Can't parse file '/tmp/render-du5bFW/input.scad'!

SCAD (44 lines)
// マグカップ パラメータ
outer_diameter = 80;     // 外径
height = 100;            // 高さ
wall_thickness = 4;      // 肉厚
bottom_thickness = 6;    // 底面の厚み

outer_radius = outer_diameter / 2;
inner_radius = outer_radius - wall_thickness;

// 取手パラメータ
handle_ring_radius = 12;  // リング取手の半径(穴の半径)
handle_tube_radius = 4;   // 取手の太さ
handle_height = height / 2;  // 取手の高さ位置(カップの中心)

$fn = 100;

module mug_body() {
    difference() {
        // 外側の円筒
        cylinder(h = height, r = outer_radius);
        // 内側をくり抜く
        translate([0, 0, bottom_thickness])
            cylinder(h = height - bottom_thickness + 1, r = inner_radius);
    }
}

module handle() {
    // リング状の取手をカップの側面に取り付ける
    // 取手の中心を、カップ外周から少し離した位置に配置
    handle_center_x = outer_radius + handle_ring_radius - handle_tube_radius / 2;
    
    translate([handle_center_x, 0, handle_height])
        rotate([90, 0, 0])
            rotate_extrude($fn = 100)
                translate([handle_ring_radius, 0, 0])
                    circle(r = handle_tube_radius, $fn = 50);
}

// 完成形
union() {
    mug_body();
    // 取手はカップ本体と重なる部分も含めて配置
    intersection_or_union: handle();
}
dynamicnot run

iteration: iter-png

i1 success
iter 1
6.9s · 1390/508t · $0.0197
diff vs bare: +8/-6
  // マグカップ
  $fn = 100;
  
  outer_d = 80;      // 外径
  height = 100;      // 高さ
  wall = 4;          // 肉厚
  bottom = 6;        // 底厚
- handle_r = 12;     // 取手のリング半径(穴の半径)
- handle_thick = 6;  // 取手の太さ
+ handle_r = 20;     // 取手のリング半径(穴の半径)→指が通るサイズに拡大
+ handle_thick = 8;  // 取手の太さを増やしてしっかりした取手に
  
  module mug() {
      difference() {
          // 外側
          cylinder(h = height, d = outer_d);
          // 内側くり抜き
          translate([0, 0, bottom])
              cylinder(h = height - bottom + 1, d = outer_d - 2 * wall);
      }
  }
  
  module handle() {
-     // カップの中心高さに配置
-     translate([outer_d / 2, 0, height / 2])
+     // 取手の中心を、リングがカップ外周にしっかり接続される位置に配置
+     // カップ外周(x = outer_d/2)にリング内側が来るように、中心を外側にオフセット
+     translate([outer_d / 2 + handle_r - handle_thick/2, 0, height / 2])
          rotate([90, 0, 0])
              rotate_extrude($fn = 80)
                  translate([handle_r, 0, 0])
                      circle(d = handle_thick);
  }
  
  union() {
      mug();
-     // 取手の一部がカップ内部に被らないよう、外側部分のみ残す
+     // 取手のうちカップ内部に入り込む部分はカット
      difference() {
          handle();
-         cylinder(h = height + 1, d = outer_d - 0.01);
+         translate([0, 0, -1])
+             cylinder(h = height + 2, d = outer_d - 0.01);
      }
  }
SCAD (39 lines)
// マグカップ
$fn = 100;

outer_d = 80;      // 外径
height = 100;      // 高さ
wall = 4;          // 肉厚
bottom = 6;        // 底厚
handle_r = 20;     // 取手のリング半径(穴の半径)→指が通るサイズに拡大
handle_thick = 8;  // 取手の太さを増やしてしっかりした取手に

module mug() {
    difference() {
        // 外側
        cylinder(h = height, d = outer_d);
        // 内側くり抜き
        translate([0, 0, bottom])
            cylinder(h = height - bottom + 1, d = outer_d - 2 * wall);
    }
}

module handle() {
    // 取手の中心を、リングがカップ外周にしっかり接続される位置に配置
    // カップ外周(x = outer_d/2)にリング内側が来るように、中心を外側にオフセット
    translate([outer_d / 2 + handle_r - handle_thick/2, 0, height / 2])
        rotate([90, 0, 0])
            rotate_extrude($fn = 80)
                translate([handle_r, 0, 0])
                    circle(d = handle_thick);
}

union() {
    mug();
    // 取手のうちカップ内部に入り込む部分はカット
    difference() {
        handle();
        translate([0, 0, -1])
            cylinder(h = height + 2, d = outer_d - 0.01);
    }
}
i2 success
iter 2
5.6s · 1491/464t · $0.0191
diff vs i1: +4/-4
  // マグカップ
  $fn = 100;
  
  outer_d = 80;      // 外径
  height = 100;      // 高さ
  wall = 4;          // 肉厚
  bottom = 6;        // 底厚
- handle_r = 20;     // 取手のリング半径(穴の半径)→指が通るサイズに拡大
- handle_thick = 8;  // 取手の太さを増やしてしっかりした取手に
+ handle_r = 12;     // 取手のリング半径(課題指定どおり)
+ handle_thick = 8;  // 取手の太さ
  
  module mug() {
      difference() {
          // 外側
          cylinder(h = height, d = outer_d);
          // 内側くり抜き
          translate([0, 0, bottom])
              cylinder(h = height - bottom + 1, d = outer_d - 2 * wall);
      }
  }
  
  module handle() {
-     // 取手の中心を、リングがカップ外周にしっかり接続される位置に配置
-     // カップ外周(x = outer_d/2)にリング内側が来るように、中心を外側にオフセット
+     // リングがカップ外周から十分はみ出すように、
+     // リングの内側端をカップ外周に少しめり込ませて接続する
      translate([outer_d / 2 + handle_r - handle_thick/2, 0, height / 2])
          rotate([90, 0, 0])
              rotate_extrude($fn = 80)
                  translate([handle_r, 0, 0])
                      circle(d = handle_thick);
  }
  
  union() {
      mug();
      // 取手のうちカップ内部に入り込む部分はカット
      difference() {
          handle();
          translate([0, 0, -1])
              cylinder(h = height + 2, d = outer_d - 0.01);
      }
  }
SCAD (39 lines)
// マグカップ
$fn = 100;

outer_d = 80;      // 外径
height = 100;      // 高さ
wall = 4;          // 肉厚
bottom = 6;        // 底厚
handle_r = 12;     // 取手のリング半径(課題指定どおり)
handle_thick = 8;  // 取手の太さ

module mug() {
    difference() {
        // 外側
        cylinder(h = height, d = outer_d);
        // 内側くり抜き
        translate([0, 0, bottom])
            cylinder(h = height - bottom + 1, d = outer_d - 2 * wall);
    }
}

module handle() {
    // リングがカップ外周から十分はみ出すように、
    // リングの内側端をカップ外周に少しめり込ませて接続する
    translate([outer_d / 2 + handle_r - handle_thick/2, 0, height / 2])
        rotate([90, 0, 0])
            rotate_extrude($fn = 80)
                translate([handle_r, 0, 0])
                    circle(d = handle_thick);
}

union() {
    mug();
    // 取手のうちカップ内部に入り込む部分はカット
    difference() {
        handle();
        translate([0, 0, -1])
            cylinder(h = height + 2, d = outer_d - 0.01);
    }
}
i3 success
iter 3
6.9s · 1447/567t · $0.0214
diff vs i2: +6/-5
  // マグカップ
  $fn = 100;
  
  outer_d = 80;      // 外径
  height = 100;      // 高さ
  wall = 4;          // 肉厚
  bottom = 6;        // 底厚
- handle_r = 12;     // 取手のリング半径(課題指定どおり)
- handle_thick = 8;  // 取手の太さ
+ handle_r = 18;     // 取手リングの中心半径(指が通るサイズに拡大)
+ handle_thick = 7;  // 取手の太さ
  
  module mug() {
      difference() {
          // 外側
          cylinder(h = height, d = outer_d);
          // 内側くり抜き
          translate([0, 0, bottom])
              cylinder(h = height - bottom + 1, d = outer_d - 2 * wall);
      }
  }
  
  module handle() {
-     // リングがカップ外周から十分はみ出すように、
-     // リングの内側端をカップ外周に少しめり込ませて接続する
-     translate([outer_d / 2 + handle_r - handle_thick/2, 0, height / 2])
+     // リングをカップ側面にしっかり接続するため、
+     // リング内端をカップ外周に少しめり込ませる
+     overlap = 3;
+     translate([outer_d/2 + handle_r - overlap, 0, height/2])
          rotate([90, 0, 0])
              rotate_extrude($fn = 80)
                  translate([handle_r, 0, 0])
                      circle(d = handle_thick);
  }
  
  union() {
      mug();
      // 取手のうちカップ内部に入り込む部分はカット
      difference() {
          handle();
          translate([0, 0, -1])
              cylinder(h = height + 2, d = outer_d - 0.01);
      }
  }
SCAD (40 lines)
// マグカップ
$fn = 100;

outer_d = 80;      // 外径
height = 100;      // 高さ
wall = 4;          // 肉厚
bottom = 6;        // 底厚
handle_r = 18;     // 取手リングの中心半径(指が通るサイズに拡大)
handle_thick = 7;  // 取手の太さ

module mug() {
    difference() {
        // 外側
        cylinder(h = height, d = outer_d);
        // 内側くり抜き
        translate([0, 0, bottom])
            cylinder(h = height - bottom + 1, d = outer_d - 2 * wall);
    }
}

module handle() {
    // リングをカップ側面にしっかり接続するため、
    // リング内端をカップ外周に少しめり込ませる
    overlap = 3;
    translate([outer_d/2 + handle_r - overlap, 0, height/2])
        rotate([90, 0, 0])
            rotate_extrude($fn = 80)
                translate([handle_r, 0, 0])
                    circle(d = handle_thick);
}

union() {
    mug();
    // 取手のうちカップ内部に入り込む部分はカット
    difference() {
        handle();
        translate([0, 0, -1])
            cylinder(h = height + 2, d = outer_d - 0.01);
    }
}