SCAD (15 lines)
$fn = 50;
// カップ本体
difference() {
cylinder(d=80, h=100);
translate([0, 0, 6])
cylinder(d=72, h=95);
}
// 取手
translate([40, 0, 50])
rotate([0, 90, 0])
rotate_extrude()
translate([20, 0, 0])
circle(r=6); claude-opus-4-5-20251101 7 run / 累計 37.4s / 累計 $0.0911
// マグカップのパラメータ
outer_diameter = 80;
outer_radius = outer_diameter / 2;
height = 100;
wall_thickness = 4;
bottom_thickness = 6;
inner_radius = outer_radius - wall_thickness;
inner_height = height - bottom_thickness;
// 取手のパラメータ
handle_ring_radius = 12; // 取手リングの半径
handle_tube_radius = 5; // 取手の太さ(断面半径)
handle_center_height = height / 2; // 取手の中心高さ
module cup_body() {
difference() {
// 外側の円柱
cylinder(r = outer_radius, h = height, $fn = 100);
// 内側のくり抜き
translate([0, 0, bottom_thickness])
cylinder(r = inner_radius, h = inner_height + 1, $fn = 100);
}
}
module handle() {
// 取手の位置(カップの外周から取手リングの中心までの距離)
handle_offset = outer_radius + handle_ring_radius - handle_tube_radius / 2;
translate([handle_offset, 0, handle_center_height])
rotate([0, 90, 0])
rotate_extrude(angle = 360, $fn = 60)
translate([handle_ring_radius, 0, 0])
circle(r = handle_tube_radius, $fn = 30);
}
// マグカップ本体
cup_body();
// 取手
handle(); OpenSCAD で、外径 80mm、高さ 100mm、肉厚 4mm のマグカップを作ってください。 底面の厚みは 6mm とし、内側はくり抜いて飲み物を入れられる形状にしてください。 さらに、側面には外径方向に飛び出す半径 12mm の取手(リング状の取手)を付けてください。 取手はカップの中心高さあたりに付け、外周から十分にはみ出して指を通せる形にしてください。 完成したコード全体を ```openscad ... ``` のフェンスで囲んで出力してください。コードのみで、追加の説明は不要です。
effort
$fn = 50;
// カップ本体
difference() {
cylinder(d=80, h=100);
translate([0, 0, 6])
cylinder(d=72, h=95);
}
// 取手
translate([40, 0, 50])
rotate([0, 90, 0])
rotate_extrude()
translate([20, 0, 0])
circle(r=6);
// マグカップのパラメータ
outer_diameter = 80;
outer_radius = outer_diameter / 2;
height = 100;
wall_thickness = 4;
bottom_thickness = 6;
inner_radius = outer_radius - wall_thickness;
inner_height = height - bottom_thickness;
// 取手のパラメータ
handle_ring_radius = 12; // 取手リングの半径
handle_tube_radius = 5; // 取手の太さ(断面半径)
handle_center_height = height / 2; // 取手の中心高さ
module cup_body() {
difference() {
// 外側の円柱
cylinder(r = outer_radius, h = height, $fn = 100);
// 内側のくり抜き
translate([0, 0, bottom_thickness])
cylinder(r = inner_radius, h = inner_height + 1, $fn = 100);
}
}
module handle() {
// 取手の位置(カップの外周から取手リングの中心までの距離)
handle_offset = outer_radius + handle_ring_radius - handle_tube_radius / 2;
translate([handle_offset, 0, handle_center_height])
rotate([0, 90, 0])
rotate_extrude(angle = 360, $fn = 60)
translate([handle_ring_radius, 0, 0])
circle(r = handle_tube_radius, $fn = 30);
}
// マグカップ本体
cup_body();
// 取手
handle(); thinking
$fn = 50;
// カップ本体
difference() {
cylinder(d=80, h=100);
translate([0, 0, 6])
cylinder(d=72, h=95);
}
// 取手
translate([40, 0, 50])
rotate([0, 90, 0])
rotate_extrude()
translate([20, 0, 0])
circle(r=6); iter-png
// マグカップのパラメータ
outer_diameter = 80;
outer_radius = outer_diameter / 2;
height = 100;
wall_thickness = 4;
bottom_thickness = 6;
inner_radius = outer_radius - wall_thickness;
inner_height = height - bottom_thickness;
// 取手のパラメータ
handle_ring_radius = 12; // 取手リングの半径
handle_tube_radius = 5; // 取手の太さ(断面半径)
handle_center_height = height / 2; // 取手の中心高さ
module cup_body() {
difference() {
// 外側の円柱
cylinder(r = outer_radius, h = height, $fn = 100);
// 内側のくり抜き
translate([0, 0, bottom_thickness])
cylinder(r = inner_radius, h = inner_height + 1, $fn = 100);
}
}
module handle() {
// 取手の位置(カップの外周から取手リングの中心までの距離)
- handle_offset = outer_radius + handle_ring_radius - handle_tube_radius / 2;
+ handle_offset = outer_radius + handle_ring_radius;
+ // 縦向きのリング状取手(YZ平面上のトーラス)
translate([handle_offset, 0, handle_center_height])
rotate([0, 90, 0])
- rotate_extrude(angle = 360, $fn = 60)
- translate([handle_ring_radius, 0, 0])
- circle(r = handle_tube_radius, $fn = 30);
+ rotate([90, 0, 0])
+ rotate_extrude(angle = 360, $fn = 60)
+ translate([handle_ring_radius, 0, 0])
+ circle(r = handle_tube_radius, $fn = 30);
}
// マグカップ本体
cup_body();
// 取手
handle();
// マグカップのパラメータ
outer_diameter = 80;
outer_radius = outer_diameter / 2;
height = 100;
wall_thickness = 4;
bottom_thickness = 6;
inner_radius = outer_radius - wall_thickness;
inner_height = height - bottom_thickness;
// 取手のパラメータ
handle_ring_radius = 12; // 取手リングの半径
handle_tube_radius = 5; // 取手の太さ(断面半径)
handle_center_height = height / 2; // 取手の中心高さ
module cup_body() {
difference() {
// 外側の円柱
cylinder(r = outer_radius, h = height, $fn = 100);
// 内側のくり抜き
translate([0, 0, bottom_thickness])
cylinder(r = inner_radius, h = inner_height + 1, $fn = 100);
}
}
module handle() {
// 取手の位置(カップの外周から取手リングの中心までの距離)
handle_offset = outer_radius + handle_ring_radius;
// 縦向きのリング状取手(YZ平面上のトーラス)
translate([handle_offset, 0, handle_center_height])
rotate([0, 90, 0])
rotate([90, 0, 0])
rotate_extrude(angle = 360, $fn = 60)
translate([handle_ring_radius, 0, 0])
circle(r = handle_tube_radius, $fn = 30);
}
// マグカップ本体
cup_body();
// 取手
handle();
// マグカップのパラメータ
outer_diameter = 80;
outer_radius = outer_diameter / 2;
height = 100;
wall_thickness = 4;
bottom_thickness = 6;
inner_radius = outer_radius - wall_thickness;
inner_height = height - bottom_thickness;
// 取手のパラメータ
handle_ring_radius = 12; // 取手リングの半径
handle_tube_radius = 5; // 取手の太さ(断面半径)
handle_center_height = height / 2; // 取手の中心高さ
module cup_body() {
difference() {
// 外側の円柱
cylinder(r = outer_radius, h = height, $fn = 100);
// 内側のくり抜き
translate([0, 0, bottom_thickness])
cylinder(r = inner_radius, h = inner_height + 1, $fn = 100);
}
}
module handle() {
- // 取手の位置(カップの外周から取手リングの中心までの距離)
+ // 取手の位置(カップの外周に接するように配置)
handle_offset = outer_radius + handle_ring_radius;
- // 縦向きのリング状取手(YZ平面上のトーラス)
+ // 縦向きのリング状取手(XZ平面に平行、指を通せる向き)
translate([handle_offset, 0, handle_center_height])
- rotate([0, 90, 0])
- rotate([90, 0, 0])
- rotate_extrude(angle = 360, $fn = 60)
- translate([handle_ring_radius, 0, 0])
- circle(r = handle_tube_radius, $fn = 30);
+ rotate([90, 0, 90])
+ rotate_extrude(angle = 360, $fn = 60)
+ translate([handle_ring_radius, 0, 0])
+ circle(r = handle_tube_radius, $fn = 30);
}
// マグカップ本体
cup_body();
// 取手
handle();
// マグカップのパラメータ
outer_diameter = 80;
outer_radius = outer_diameter / 2;
height = 100;
wall_thickness = 4;
bottom_thickness = 6;
inner_radius = outer_radius - wall_thickness;
inner_height = height - bottom_thickness;
// 取手のパラメータ
handle_ring_radius = 12; // 取手リングの半径
handle_tube_radius = 5; // 取手の太さ(断面半径)
handle_center_height = height / 2; // 取手の中心高さ
module cup_body() {
difference() {
// 外側の円柱
cylinder(r = outer_radius, h = height, $fn = 100);
// 内側のくり抜き
translate([0, 0, bottom_thickness])
cylinder(r = inner_radius, h = inner_height + 1, $fn = 100);
}
}
module handle() {
// 取手の位置(カップの外周に接するように配置)
handle_offset = outer_radius + handle_ring_radius;
// 縦向きのリング状取手(XZ平面に平行、指を通せる向き)
translate([handle_offset, 0, handle_center_height])
rotate([90, 0, 90])
rotate_extrude(angle = 360, $fn = 60)
translate([handle_ring_radius, 0, 0])
circle(r = handle_tube_radius, $fn = 30);
}
// マグカップ本体
cup_body();
// 取手
handle();
// マグカップのパラメータ
outer_diameter = 80;
outer_radius = outer_diameter / 2;
height = 100;
wall_thickness = 4;
bottom_thickness = 6;
inner_radius = outer_radius - wall_thickness;
inner_height = height - bottom_thickness;
// 取手のパラメータ
handle_ring_radius = 12; // 取手リングの半径
handle_tube_radius = 5; // 取手の太さ(断面半径)
handle_center_height = height / 2; // 取手の中心高さ
module cup_body() {
difference() {
// 外側の円柱
cylinder(r = outer_radius, h = height, $fn = 100);
// 内側のくり抜き
translate([0, 0, bottom_thickness])
cylinder(r = inner_radius, h = inner_height + 1, $fn = 100);
}
}
module handle() {
- // 取手の位置(カップの外周に接するように配置)
+ // 取手の位置(カップの外周から外側に飛び出すように配置)
handle_offset = outer_radius + handle_ring_radius;
- // 縦向きのリング状取手(XZ平面に平行、指を通せる向き)
+ // 縦向きのリング状取手(YZ平面に平行、指を縦に通せる向き)
translate([handle_offset, 0, handle_center_height])
- rotate([90, 0, 90])
+ rotate([0, 90, 0])
rotate_extrude(angle = 360, $fn = 60)
translate([handle_ring_radius, 0, 0])
circle(r = handle_tube_radius, $fn = 30);
}
// マグカップ本体
cup_body();
// 取手
handle();
// マグカップのパラメータ
outer_diameter = 80;
outer_radius = outer_diameter / 2;
height = 100;
wall_thickness = 4;
bottom_thickness = 6;
inner_radius = outer_radius - wall_thickness;
inner_height = height - bottom_thickness;
// 取手のパラメータ
handle_ring_radius = 12; // 取手リングの半径
handle_tube_radius = 5; // 取手の太さ(断面半径)
handle_center_height = height / 2; // 取手の中心高さ
module cup_body() {
difference() {
// 外側の円柱
cylinder(r = outer_radius, h = height, $fn = 100);
// 内側のくり抜き
translate([0, 0, bottom_thickness])
cylinder(r = inner_radius, h = inner_height + 1, $fn = 100);
}
}
module handle() {
// 取手の位置(カップの外周から外側に飛び出すように配置)
handle_offset = outer_radius + handle_ring_radius;
// 縦向きのリング状取手(YZ平面に平行、指を縦に通せる向き)
translate([handle_offset, 0, handle_center_height])
rotate([0, 90, 0])
rotate_extrude(angle = 360, $fn = 60)
translate([handle_ring_radius, 0, 0])
circle(r = handle_tube_radius, $fn = 30);
}
// マグカップ本体
cup_body();
// 取手
handle();