Skip to content

sloper is a set of tools for building and running ASCII/Unicode physic simulations.

License

Notifications You must be signed in to change notification settings

MateuszJanda/sloper

Repository files navigation

sloper 0.9.0

The main goal of this project (sloper.py) was to interpolate ASCII figure surface shape (normal vectors to the surface). In addition it also contains simple physic engine (ascii_engine.py), that make use of surface data to simulate hail (multi rigid bodies). All steps are precalculate before running animation. It use Euler method for integration and "Speculative Contacts" for collision detection.

ascii_engine.py (demos)

Requirements

$ pip install -r requirements.txt

Tested with:

  • numpy 1.16.3
  • tinyarray 1.2.1
  • opencv-python 4.1.0.25
  • Pillow 6.0.0

Description

Sloper use very simple method to find surface shape (at least in this version), that's why any input data must be pre-processed by user. First of all each figure must contain "marker" at the top-left corner in 3x3 area, that help sloper calculate cell and grid size.

_^
^

Secondly, figure must be "drilled" from all characters that are not part of surface.

When grid and markers are calculated, sloper find nearest neighbor to each character, and join them to get figure contour.

Next for each point, where braille dot may appear, sloper calculate normal vector to the surface in this point.

Usage

$ python sloper.py -a ascii_data/umbrella-drilled.txt

References/Credits

About

sloper is a set of tools for building and running ASCII/Unicode physic simulations.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Languages