Tool to create animation files for Wilson
Project description
Wilson Python Package
Python package for creating Wilson animations. See notebooks
folder for example.
Usage
A simple example for creating an animation:
import numpy as np
import wilson
r = 5.0
t = np.linspace(0, 2*np.pi)
x = r * np.cos(t)
y = r * np.sin(t)
z = np.zeros_like(t)
path = np.column_stack((t, x, y, z))
orbit = wilson.Path(path, name='Moon Orbit')
earth = wilson.Sphere('Earth', description="That's our planet!", radius=1.0, color='blue')
moon = wilson.Sphere('Moon', description='Our oldest pal!', radius=0.27, color='grey')
moon.position = orbit
project = wilson.Project('Earth Moon',
author='wilson',
description='The Moon orbiting around the Earth.',
animationSpeed=2*np.pi / 5.0,
animatables=[earth, moon])
wilson.saveProject(project, '../examples/earth_moon.wlsn')
Known Issues
Parsing a project and immediately serializing it again might produce a different result. This is due to protobuf returning default values for missing properties of a built-in type (i.e. string, float, etc.).
While it is possible to circumvent this, it would bloat the protobuf files and was thus not done.
TODO
The package lacks early type check which might makes debugging software using a bit more tedious. Nevertheless, the output is guaranteed to meet the protocol as this is assured by protobuf.
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
Built Distribution
File details
Details for the file wilson3d-0.4.1.tar.gz
.
File metadata
- Download URL: wilson3d-0.4.1.tar.gz
- Upload date:
- Size: 2.5 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 557df388de616e2cd403b99d08a4be7d303b300999be247fe29488c1428ad20d |
|
MD5 | 723edd12c939f071715d4479924044be |
|
BLAKE2b-256 | 6d05a2a446fa75be8741a25802537395f39be5298f4d86e39b5649954e93406c |
File details
Details for the file wilson3d-0.4.1-py3-none-any.whl
.
File metadata
- Download URL: wilson3d-0.4.1-py3-none-any.whl
- Upload date:
- Size: 2.5 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2124e59e848e7d98a1885e8edaabdda12694d242d17c6cb86cec1afd592fc791 |
|
MD5 | 29b1b24b642e0b14a174025d2df8ae19 |
|
BLAKE2b-256 | 4c4c0f156d406be1e618320cdd916481fe9d9269701ecb65a7df5bddf63eec0f |