Tool for three-dimensional animations of geometries like FE meshes
Project description
Visualizer-3D
Tool for three-dimensional animations of geometries like FE meshes.
Features
This repository implements a OpenGL-based gui for three-dimensional animations of geometries like FE meshes. It can be used to visualize results, e.g. from transient simulations or to inspect the geometry itself. Moreover, it can be used to export the animations for presentations or publications.
Installation
You can either clone the repository and install the package locally or install it directly from PyPI.
PyPI
pip install visualizer-3d
Local
Clone this repository and install it to your local environment as package using pip:
git clone git@github.com:jkneifl/Visualizer.git
cd Visualizer
pip install -e .
Usage
The base class Visualizer
serves as tool for the visualization with its main method animate
that can be used to create and export animations of geometries.
from visualizer import Visualizer
coordinates = ...
faces = ...
colors = ...
# create a visualizer object
visualizer = Visualizer()
visualizer.animate(
coordinates=coordinates,
)
It can animate point clouds, or meshes if the corresponding faces are provided.
For a detailed description of the parameters, see the docstring of the animate
method.
You can also visualize multiple objects with different colors (specified by rgb values for every coordinate, by a string, or by error_values over an color map) and e.g. as points
random_colors = np.random.rand(*coordinates.shape[0:2])
visualizer.animate([coordinates, coordinates, coordinates],
faces=[None, faces, faces],
color=["blue", colors, random_colors],
shift=True,
camera_distance=1000,
)
In the examples
folder, you can find an example script with according data on how to use the Visualizer
class.
You can also export the animations as gif or mp4 files. An example is shown below:
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
Hashes for visualizer_3d-0.3.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fe6167dc56e5301c91ab64e93d8cc7ecb71172f57452075f6f3d18102111a02c |
|
MD5 | 389feb0c30aec248333a6e5c8f01a746 |
|
BLAKE2b-256 | 4a2ad32efbc99df315ef171685f61d0a6de4c43137c3f68fe4339f972b0ca6e4 |