SCAD (10 lines)
module pyramid() {
translate([0, 0, 0])
cube([60, 60, 10], center=true);
translate([0, 0, 10])
cube([40, 40, 10], center=true);
translate([0, 0, 20])
cube([20, 20, 10], center=true);
}
pyramid(); claude-sonnet-4-6 8 run / 累計 27.9s / 累計 $0.0384
// 3段の階段状ピラミッド
// 各段のパラメータ [幅, 奥行き, 高さ]
stages = [
[60, 60, 10], // 1段目(底)
[40, 40, 10], // 2段目
[20, 20, 10] // 3段目(頂上)
];
// 各段を中心を揃えて積み上げる
for (i = [0 : len(stages) - 1]) {
z_offset = i * 10; // 各段の高さは10mm
translate([0, 0, z_offset])
cube([stages[i][0], stages[i][1], stages[i][2]], center=true);
} OpenSCAD で、底辺 60mm × 60mm × 高さ 10mm の正方形の板の中央に、それより一回り小さい 40mm × 40mm × 高さ 10mm の板を載せ、さらにその中央に 20mm × 20mm × 高さ 10mm の板を 載せた、3 段の階段状ピラミッドを作ってください。各段は中心を揃えて積み上げます。 完成したコード全体を ```openscad ... ``` のフェンスで囲んで出力してください。コードのみで、追加の説明は不要です。
effort
module pyramid() {
translate([0, 0, 0])
cube([60, 60, 10], center=true);
translate([0, 0, 10])
cube([40, 40, 10], center=true);
translate([0, 0, 20])
cube([20, 20, 10], center=true);
}
pyramid();
// 3段の階段状ピラミッド
module pyramid() {
// 1段目: 60mm × 60mm × 10mm (底辺)
translate([0, 0, 0])
cube([60, 60, 10], center = true);
// 2段目: 40mm × 40mm × 10mm
translate([0, 0, 10])
cube([40, 40, 10], center = true);
// 3段目: 20mm × 20mm × 10mm (頂上)
translate([0, 0, 20])
cube([20, 20, 10], center = true);
}
// 底面がZ=0になるように配置
translate([0, 0, 5])
pyramid(); thinking
// 3段の階段状ピラミッド
module pyramid() {
// 1段目: 60mm × 60mm × 10mm (底辺)
translate([0, 0, 0])
cube([60, 60, 10], center = true);
// 2段目: 40mm × 40mm × 10mm
translate([0, 0, 10])
cube([40, 40, 10], center = true);
// 3段目: 20mm × 20mm × 10mm (頂上)
translate([0, 0, 20])
cube([20, 20, 10], center = true);
}
// 底面がZ=0になるように配置
translate([0, 0, 5])
pyramid();
module pyramid() {
translate([0, 0, 0])
cube([60, 60, 10], center=true);
translate([0, 0, 10])
cube([40, 40, 10], center=true);
translate([0, 0, 20])
cube([20, 20, 10], center=true);
}
pyramid(); iter-png
// 3段の階段状ピラミッド
// 各段のパラメータ [幅, 奥行き, 高さ]
stages = [
[60, 60, 10], // 1段目(底)
[40, 40, 10], // 2段目
[20, 20, 10] // 3段目(頂上)
];
// 各段を中心を揃えて積み上げる
for (i = [0 : len(stages) - 1]) {
z_offset = i * 10; // 各段の高さは10mm
translate([0, 0, z_offset])
cube([stages[i][0], stages[i][1], stages[i][2]], center=true);
}
// 3段の階段状ピラミッド
// 各段のパラメータ [幅, 奥行き, 高さ]
stages = [
[60, 60, 10], // 1段目(底)
[40, 40, 10], // 2段目
[20, 20, 10] // 3段目(頂上)
];
// 各段を中心を揃えて積み上げる
for (i = [0 : len(stages) - 1]) {
z_offset = i * 10; // 各段の高さは10mm
translate([0, 0, z_offset])
cube([stages[i][0], stages[i][1], stages[i][2]], center=true);
}
// 3段の階段状ピラミッド
// 各段のパラメータ [幅, 奥行き, 高さ]
stages = [
[60, 60, 10], // 1段目(底)
[40, 40, 10], // 2段目
[20, 20, 10] // 3段目(頂上)
];
// 各段を中心を揃えて積み上げる
for (i = [0 : len(stages) - 1]) {
z_offset = i * 10; // 各段の高さは10mm
translate([0, 0, z_offset])
cube([stages[i][0], stages[i][1], stages[i][2]], center=true);
}
// 3段の階段状ピラミッド
// 各段のパラメータ [幅, 奥行き, 高さ]
stages = [
[60, 60, 10], // 1段目(底)
[40, 40, 10], // 2段目
[20, 20, 10] // 3段目(頂上)
];
// 各段を中心を揃えて積み上げる
for (i = [0 : len(stages) - 1]) {
z_offset = i * 10; // 各段の高さは10mm
translate([0, 0, z_offset])
cube([stages[i][0], stages[i][1], stages[i][2]], center=true);
}
// 3段の階段状ピラミッド
// 各段のパラメータ [幅, 奥行き, 高さ]
stages = [
[60, 60, 10], // 1段目(底)
[40, 40, 10], // 2段目
[20, 20, 10] // 3段目(頂上)
];
// 各段を中心を揃えて積み上げる
for (i = [0 : len(stages) - 1]) {
z_offset = i * 10; // 各段の高さは10mm
translate([0, 0, z_offset])
cube([stages[i][0], stages[i][1], stages[i][2]], center=true);
}
// 3段の階段状ピラミッド
// 各段のパラメータ [幅, 奥行き, 高さ]
stages = [
[60, 60, 10], // 1段目(底)
[40, 40, 10], // 2段目
[20, 20, 10] // 3段目(頂上)
];
// 各段を中心を揃えて積み上げる
for (i = [0 : len(stages) - 1]) {
z_offset = i * 10; // 各段の高さは10mm
translate([0, 0, z_offset])
cube([stages[i][0], stages[i][1], stages[i][2]], center=true);
}