SCAD (11 lines)
// 50mm角の立方体に、直径20mmのZ軸方向貫通穴
$fn = 100;
difference() {
// 50mm角の立方体(中心を原点に配置)
cube([50, 50, 50], center = true);
// 中央を貫通する直径20mmの穴(Z軸方向)
cylinder(h = 60, d = 20, center = true);
} claude-opus-5 7 run / 累計 25.8s / 累計 $0.0322
// 50mm角の立方体の中央に直径20mmのZ軸方向貫通穴
$fn = 100;
cube_size = 50;
hole_d = 20;
difference() {
// 50mm角の立方体(原点中心)
cube([cube_size, cube_size, cube_size], center = true);
// 中央を z 軸方向に貫通する直径20mmの穴
cylinder(h = cube_size + 2, d = hole_d, center = true);
} OpenSCAD で、50mm 角の立方体の中央に、直径 20mm の貫通穴を z 軸方向に開けたモデルを作成してください。 完成したコード全体を ```openscad ... ``` のフェンスで囲んで出力してください。コードのみで、追加の説明は不要です。
effort
// 50mm角の立方体に、直径20mmのZ軸方向貫通穴
$fn = 100;
difference() {
// 50mm角の立方体(中心を原点に配置)
cube([50, 50, 50], center = true);
// 中央を貫通する直径20mmの穴(Z軸方向)
cylinder(h = 60, d = 20, center = true);
}
// 50mm角の立方体に、直径20mmの貫通穴(z軸方向)
difference() {
// 50mm角の立方体(中心を原点に配置)
cube([50, 50, 50], center = true);
// 直径20mmの貫通穴(z軸方向)
cylinder(h = 60, d = 20, center = true, $fn = 100);
}
// 50mm角の立方体に、中央をZ軸方向に貫通する直径20mmの穴を開けたモデル
$fn = 100;
cube_size = 50;
hole_d = 20;
difference() {
// 50mm角の立方体(原点を中心に配置)
cube([cube_size, cube_size, cube_size], center = true);
// 中央をZ軸方向に貫通する穴(余裕を持たせて長めにする)
cylinder(h = cube_size + 2, d = hole_d, center = true);
}
// 50mm角の立方体の中央に直径20mmの貫通穴(z軸方向)
cube_size = 50;
hole_d = 20;
difference() {
// 立方体(原点中心)
cube([cube_size, cube_size, cube_size], center = true);
// z軸方向の貫通穴(両端を少し延長して確実に貫通させる)
cylinder(h = cube_size + 2, d = hole_d, center = true, $fn = 100);
} thinking
// 50mm角の立方体に、直径20mmの貫通穴(z軸方向)
difference() {
// 50mm角の立方体(中心を原点に配置)
cube([50, 50, 50], center = true);
// 直径20mmの貫通穴(z軸方向)
cylinder(h = 60, d = 20, center = true, $fn = 100);
}
// 50mm角の立方体に、中央をZ軸方向に貫通する直径20mmの穴を開けたモデル
$fn = 100;
cube_size = 50;
hole_d = 20;
difference() {
// 50mm角の立方体(原点を中心に配置)
cube([cube_size, cube_size, cube_size], center = true);
// 中央をZ軸方向に貫通する穴(余裕を持たせて長めにする)
cylinder(h = cube_size + 2, d = hole_d, center = true);
}