1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-22 06:13:10 +02:00

add params

This commit is contained in:
Justin Lin
2020-10-27 07:14:54 +08:00
parent cbeb8bc5d4
commit 9bd899f189

View File

@@ -5,17 +5,21 @@ txt = "3.14159265358979323846264338327950288419716939937510582097494459230781640
radius = 20; radius = 20;
font_name = "Liberation Sans:style=Bold"; font_name = "Liberation Sans:style=Bold";
font_size = 2.5; font_size = 2.5;
txt_extrude = radius * 0.125;
txt_scale = 1.15;
ball = true;
$fn = 48; $fn = 48;
bauer_text_sphere(radius, font_name, font_size); bauer_text_sphere(radius, font_name, font_size, txt_extrude, txt_scale, ball);
module bauer_text_sphere(radius, font_name, font_size) { module bauer_text_sphere(radius, font_name, font_size, txt_extrude, txt_scale, ball) {
n = len(txt); n = len(txt);
pts = bauer_spiral(n, radius); pts = bauer_spiral(n, radius);
if(ball) {
render() render()
sphere(radius * 0.9); sphere(radius * 0.9);
}
/* /*
Based on Bauer's spiral: Based on Bauer's spiral:
Bauer R. Distribution of points on a sphere with application to star catalogs. Journal of Guidance, Control, and Dynamics. 2000;23(1):130137 Bauer R. Distribution of points on a sphere with application to star catalogs. Journal of Guidance, Control, and Dynamics. 2000;23(1):130137
@@ -31,7 +35,7 @@ module bauer_text_sphere(radius, font_name, font_size) {
translate(pts[i]) translate(pts[i])
rotate([0, -ya, za]) rotate([0, -ya, za])
rotate([90, 0, -90]) rotate([90, 0, -90])
linear_extrude(radius * 0.125, scale = 1.15) linear_extrude(txt_extrude, scale = txt_scale)
mirror([-1, 0, 0]) mirror([-1, 0, 0])
text(txt[i], size = font_size, font = font_name, valign = "center", halign = "center"); text(txt[i], size = font_size, font = font_name, valign = "center", halign = "center");
} }