A simple interactive marching square simulator with pygame.
Explore the docs »
View Demo
·
Report Bug
·
Request Feature
Table of Contents
A simple interactive simulation of a marching square on binary iso-values. You can draw black and white cells, move the marching square manually around and move it according to the iso-values (set by colors).
Major frameworks/libraries used to bootstrap the project.
python marching_square.py
Optional Arguments:
-h, --help show this help message and exit
--window_height WINDOW_HEIGHT
Change the window height. The default height is set to 500.
--window_width WINDOW_WIDTH
Change the window width. The default height is set to 500.
--block_size BLOCK_SIZE
Change the size of each block which represents isovalues. The default size is set to 20.
--grid_color red_value green_value blue_value
Change the grid color rgb. The default color is grey with the rgb-values: 200 200 200.
--empty_cell_color red_value green_value blue_value
Change the empty cell color rgb. The default color is white with the rgb-values: 255 255 255.
--filled_cell_color red_value green_value blue_value
Change the filled cell color rgb. The default color is white with the rgb-values: 0 0 0.
--square_color_walk red_value green_value blue_value
Change the square color in walk mode. The default color is blue with the rgb-values: 0 0 255.
--square_color_march red_value green_value blue_value
Change the square color in walk mode. The default color is red with the rgb-values: 255 0 0.
MOUSECLICK on cell - change cell color (white <-> black) / iso-value (0 <-> 1)
WASD - move marching square freely
SPACE - move marching square by iso-values. Inspired by Wiki-Figure
- Add Changelog
See the open issues for a full list of proposed features (and known issues).
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE.txt
for more information.
Jan Thomas Müller
Project Link: https://github.com/janthmueller/marching-square-simulator