Delicious Voxel worlds in Python
Project description
VoxelWorld
3d Numpy array in -> Voxel world out
Install
From PyPi
pip3 install voxel_world
From source
git clone https://github.com/jackparmer/VoxelWorld.git
cd VoxelWorld
python3 -m pip install .
from voxel_world import VoxelWorld
About
For physics simulation, computer vision, games, art, whatever
Features!
- Automatic GIF generation
- Simple! Numpy 3d ones array in -> Voxel world out
- Portable! Outputs images or standalone HTML files with Vixel
- Notebooks! Works well in the Jupyter notebook ecosystem
- Eye candy! Ambient occlusion, ray tracing from Vixel, etc
Examples
Surfaces API
from voxel_world import Volume, Surface;
volume = Volume(Volume.purlin_matrix(32)); surf = Surface(volume)
surf.color = (255,0,0)
volume.add(surf).show()
Random world
import random
from voxel_world import Volume
Volume(
Volume.purlin_matrix(16),
theme=random.choice(list(Volume.themes.keys())),
viewing_angle=(random.randint(0, 90), random.randint(0, 90)),
).render().show()
Ray tracing + WebGL renderer
from voxel_world import Volume, Vixel; vw = Volume(); vix = Vixel(vw); vix.html()
Animations
from voxel_world import Volume, Surface, Agent, Sequence
volume = Volume(Volume.purlin_matrix(64));
surf = Surface(volume);
agents = [Agent(surf, mask) for mask in Sequence.snake(grid_size=64, num_steps=1000)];
seq = Sequence(agents);
seq2 = seq.apply_bg(volume)
seq2.save('voxel_animation64_v2.gif')
examples/color_matrix/sand_world.py
examples/lighting/light_source.py
Publishing to pip
python3 -m build
python3 -m twine upload --repository-url https://upload.pypi.org/legacy/ dist/*
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
voxel_world-0.1.4.tar.gz
(11.8 MB
view hashes)
Built Distribution
Close
Hashes for voxel_world-0.1.4-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f7864f980625d31bdc70cac9d87bef7ad65a93f42a603387aec9304f89a9fa3c |
|
MD5 | 56fe4fef59256132e0876a004cadc75e |
|
BLAKE2b-256 | b7c7e2ccee73e0cb59e37f05e5a167192c248fa21ed49f6f54d96f4dbba140dc |