diff --git a/examples/maze/sphere_maze.scad b/examples/maze/sphere_maze.scad index f8e17602..56f26fc1 100644 --- a/examples/maze/sphere_maze.scad +++ b/examples/maze/sphere_maze.scad @@ -2,7 +2,7 @@ use ; use ; use ; use ; -use ; +use ; r = 10; rows = 24; @@ -26,7 +26,7 @@ module sphere_maze() { for(wall_pts = walls) { rxpts = [ for(p = wall_pts) - pt_to_sphere(size, mr * [p[0], p[1], 0, 0] + p_offset, r) + pt2sphere(size, mr * [p[0], p[1], 0, 0] + p_offset, r) ]; hull_polyline3d(rxpts, wall_thickness, $fn = 6); } diff --git a/examples/photo_sphere.scad b/examples/photo_sphere.scad index 4b81cd8c..98d93f82 100644 --- a/examples/photo_sphere.scad +++ b/examples/photo_sphere.scad @@ -1,5 +1,5 @@ use ; -use ; +use ; photo_size = [100, 100]; levels = [ @@ -110,14 +110,14 @@ dots = px_gray(levels, center = true, normalize = true); color("white") for(dot = dots) { - translate(pt_to_sphere(photo_size, dot[0] + [50, 50], 50, [180, 180])) + translate(pt2sphere(photo_size, dot[0] + [50, 50], 50, [180, 180])) square(dot[1] * 2.5); } rotate([180, 0, 0]) color("white") for(dot = dots) { - translate(pt_to_sphere(photo_size, dot[0] + [50, 50], 50, [180, 180])) + translate(pt2sphere(photo_size, dot[0] + [50, 50], 50, [180, 180])) square(dot[1] * 2.5); } diff --git a/src/experimental/pt_to_sphere.scad b/src/experimental/pt2sphere.scad similarity index 89% rename from src/experimental/pt_to_sphere.scad rename to src/experimental/pt2sphere.scad index 2a2187eb..e6213053 100644 --- a/src/experimental/pt_to_sphere.scad +++ b/src/experimental/pt2sphere.scad @@ -6,7 +6,7 @@ use ; r: sphere radius. angle: [za, xa] mapping angles. */ -function pt_to_sphere(size, p, r, angle = [180, 360]) = +function pt2sphere(size, p, r, angle = [180, 360]) = let( x = p[0], y = p[1],