mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-23 23:03:23 +02:00
refactor
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
use <pixel/px_gray.scad>;
|
use <pixel/px_gray.scad>;
|
||||||
use <experimental/pt_to_sphere.scad>;
|
use <experimental/pt_to_sphere.scad>;
|
||||||
|
|
||||||
|
photo_size = [100, 100];
|
||||||
levels = [
|
levels = [
|
||||||
[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],
|
[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],
|
||||||
[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],
|
[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],
|
||||||
@@ -109,14 +110,14 @@ dots = px_gray(levels, center = true, normalize = true);
|
|||||||
|
|
||||||
color("white")
|
color("white")
|
||||||
for(dot = dots) {
|
for(dot = dots) {
|
||||||
translate(pt_to_sphere([100, 100], dot[0] + [50, 50], 50, [180, 180]))
|
translate(pt_to_sphere(photo_size, dot[0] + [50, 50], 50, [180, 180]))
|
||||||
square(dot[1] * 2.5);
|
square(dot[1] * 2.5);
|
||||||
}
|
}
|
||||||
|
|
||||||
rotate([180, 0, 0])
|
rotate([180, 0, 0])
|
||||||
color("white")
|
color("white")
|
||||||
for(dot = dots) {
|
for(dot = dots) {
|
||||||
translate(pt_to_sphere([100, 100], dot[0] + [50, 50], 50, [180, 180]))
|
translate(pt_to_sphere(photo_size, dot[0] + [50, 50], 50, [180, 180]))
|
||||||
square(dot[1] * 2.5);
|
square(dot[1] * 2.5);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user