Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/christophercrouzet/hienoi
2D particle framework.
https://github.com/christophercrouzet/hienoi
2d nani numpy opengl particles
Last synced: 2 months ago
JSON representation
2D particle framework.
- Host: GitHub
- URL: https://github.com/christophercrouzet/hienoi
- Owner: christophercrouzet
- License: mit
- Created: 2017-05-09T01:18:14.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2022-05-15T06:16:05.000Z (over 2 years ago)
- Last Synced: 2024-10-11T09:19:30.265Z (2 months ago)
- Topics: 2d, nani, numpy, opengl, particles
- Language: Python
- Homepage:
- Size: 397 KB
- Stars: 12
- Watchers: 5
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- Changelog: CHANGELOG.rst
- License: LICENSE
Awesome Lists containing this project
README
Hienoi
======.. image:: https://img.shields.io/pypi/v/hienoi.svg
:target: https://pypi.python.org/pypi/hienoi
:alt: PyPI latest version.. image:: https://img.shields.io/pypi/l/hienoi.svg
:target: https://pypi.python.org/pypi/hienoi
:alt: LicenseHienoi is a framework offering an intuitive visual programming experience based
around simple 2D particle physics.Features
--------* 2D particle simulation.
* GUI with OpenGL viewport.
* user-friendly API.
* support for per-particle user attributes.
* fast when directly operating particles through NumPy.
* compatible with both Python 2 and Python 3.Usage
-----.. code-block:: python
>>> import hienoi.application
>>> from hienoi import Vector2f
>>> def initialize_particle_simulation(sim):
... sim.add_particle(position=Vector2f(25.0, 0.0))
>>> def update_particle_simulation(sim):
... particle = sim.particles[0]
... particle.force -= particle.position
>>> hienoi.application.run(
... particle_simulation={
... 'initialize_callback': initialize_particle_simulation,
... 'postsolve_callback': update_particle_simulation,
... })More commented examples can be found in the ``demos`` folder.
Installation
------------.. code-block:: bash
$ pip install hienoi
Demos
-----intro
^^^^^.. image:: img/intro.gif
:alt: introequilibrium
^^^^^^^^^^^.. image:: img/equilibrium.gif
:alt: equilibriumtrail
^^^^^.. image:: img/trail.gif
:alt: trailorbit
^^^^^.. image:: img/orbit.gif
:alt: orbitHotkeys
-------+-----------------------+--------------------------------------------+
| ``space`` + ``LMB`` | move view |
+-----------------------+--------------------------------------------+
| ``space`` + ``RMB`` | zoom view |
+-----------------------+--------------------------------------------+
| ``d`` | change the display mode of the particles |
+-----------------------+--------------------------------------------+
| ``f`` | fit the view to the scene |
+-----------------------+--------------------------------------------+
| ``g`` | show/hide the grid |
+-----------------------+--------------------------------------------+
| ``r`` | reset the view |
+-----------------------+--------------------------------------------+Author
------Christopher Crouzet
<`christophercrouzet.com `_>