https://github.com/morvanzhou/marchingsquares
https://github.com/morvanzhou/marchingsquares
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/morvanzhou/marchingsquares
- Owner: MorvanZhou
- License: mit
- Created: 2022-11-29T01:59:04.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-12-02T06:14:47.000Z (over 3 years ago)
- Last Synced: 2025-03-24T12:55:32.723Z (about 1 year ago)
- Language: Python
- Size: 1.84 MB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Marching Squares
Marching Squares to generate random contour.
# Install
```python
pip install masq
```
# Usage
## Generate image
A random graph can be generated by using `masq.random()`.
```python
import masq
masq.random(n_row=20, n_col=30, bound=0.5)
```

## A simplex noise image
Use `masq.simplex_noise()` function. You can display all points by set `show_point=True`.
```python
import masq
masq.simplex_noise(n_row=20, n_col=30, bound=0.5, wavelength=6, show_point=False)
```

## Play movement
Use `masq.loop_simplex_noise()` or `masq.loop_random()` function.
```python
import masq
masq.loop_simplex_noise(20, 30, bound=0.5, wavelength=6, increment=0.01)
```

## Display points
Turn on the `show_point=True`.
```python
import masq
masq.simplex_noise(20, 30, bound=0.5, wavelength=6, show_point=True)
```