Last active
April 9, 2025 23:53
-
-
Save paco-ruvalcaba/642a0df32457681c86392c2a35af1681 to your computer and use it in GitHub Desktop.
Código para una gráfica circular (gráfica de pastel) en BlocksCAD 3D. Esto se realiza a manera de un sólido de revolución. Se usa un módulo para hacer la gráfica el cuál solicita dos datos de entrada.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//!OpenSCAD | |
module grafica(dato1, dato2) { | |
union(){ | |
for (i = [0 : abs(5) : (dato1 * 360) / (dato1 + dato2)]) { | |
rotate([0, 0, i]){ | |
translate([25, 0, 0]){ | |
rotate([90, 0, 0]){ | |
color([0,0.6,0]) { | |
cylinder(r1=10, r2=10, h=1, center=false); | |
} | |
} | |
} | |
} | |
} | |
for (i = [(dato1 * 360) / (dato1 + dato2) : abs(5) : 360]) { | |
rotate([0, 0, i]){ | |
translate([25, 0, 0]){ | |
rotate([90, 0, 0]){ | |
color([1,0.8,0]) { | |
cylinder(r1=10, r2=10, h=1, center=false); | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
grafica(7, 3); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment