Alexandre B A Villares 2021-06-22 22:47:51 -03:00
rodzic 10ba491a93
commit 935c458c0d
3 zmienionych plików z 39 dodań i 0 usunięć

Plik binarny nie jest wyświetlany.

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 792 KiB

Wyświetl plik

@ -0,0 +1,33 @@
from itertools import product
from itertools import combinations
add_library('peasycam')
def setup():
global nodes, pairs
size(600, 600, P3D)
cam = PeasyCam(this, 1000)
row = range(-300, 301, 200)
nodes = list(product(row, repeat=3))
pairs = [(a, b) for a, b
in combinations(nodes, 2)
if a[2] == b[2]
and abs(a[0] - b[0]) <= 200
and abs(a[1] - b[1]) <= 200
]
def draw():
rotateX(HALF_PI)
background(200)
fill(200, 0, 0)
for x, y, z in nodes:
node(x, y, z)
for (xa, ya, za), (xb, yb, zb) in pairs:
line(xa, ya, za, xb, yb, zb)
def node(x, y, z):
pushMatrix()
translate(x, y, z),
box(10)
popMatrix()

Wyświetl plik

@ -26,6 +26,12 @@ Here are listed some of the tools I have been using:
---
![sketch_2021_06_22a](2021/sketch_2021_06_22a/sketch_2021_06_22a.gif)
[sketch_2021_06_22a](https://github.com/villares/sketch-a-day/tree/master/2021/sketch_2021_06_22a) [[Py.Processing](https://villares.github.io/como-instalar-o-processing-modo-python/index-EN)]
---
![sketch_2021_06_21c_noise_terrain](2021/sketch_2021_06_21c_noise_terrain/sketch_2021_06_21c_noise_terrain.gif)
[sketch_2021_06_21c_noise_terrain](https://github.com/villares/sketch-a-day/tree/master/2021/sketch_2021_06_21c_noise_terrain) [[Py.Processing](https://villares.github.io/como-instalar-o-processing-modo-python/index-EN)]