Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gallery of examples #39

Merged
merged 8 commits into from
May 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 27 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,27 +104,39 @@ d = sierpinski(5, 4).fill_color(papaya)

![sierpinski](https://raw.githubusercontent.com/danoneata/chalk/master/examples/output/intro-04.png)

For more examples, please check the `examples` folder.
### Gallery of examples

For more examples, please check the `examples` folder;
their output is illustrated below:

<table>
<tr>
<td align="center"><img src="doc/imgs/squares.png"><br><code><a href="https://github.com/danoneata/chalk/tree/master/examples/squares.py">squares.py</a></code></td>
<td align="center"><img src="doc/imgs/logo.png"><br><code><a href="https://github.com/danoneata/chalk/tree/master/examples/logo.py">logo.py</a></code></td>
<td align="center"><img src="doc/imgs/escher-square-limit.png"><br><code><a href="https://github.com/danoneata/chalk/tree/master/examples/escher_square.py">escher_square.py</a></code></td>
</tr>
<tr>
<td align="center"><img src="doc/imgs/hilbert.png"><br><code><a href="https://github.com/danoneata/chalk/tree/master/examples/hilbert.py">hilbert.py</a></code></td>
<td align="center"><img src="doc/imgs/koch.png"><br><code><a href="https://github.com/danoneata/chalk/tree/master/examples/koch.py">koch.py</a></code></td>
<td align="center"><img src="doc/imgs/hex-variation.png"><br><code><a href="https://github.com/danoneata/chalk/tree/master/examples/hex_variation.py">hex-variation.py</a></code></td>
</tr>
<tr>
<td align="center"><img src="doc/imgs/lenet.png"><br><code><a href="https://github.com/danoneata/chalk/tree/master/examples/lenet.py">lenet.py</a></code></td>
<td align="center"><img src="doc/imgs/tensor.png"><br><code><a href="https://github.com/danoneata/chalk/tree/master/examples/tensor.py">tensor.py</a></code></td>
<td align="center"><img src="doc/imgs/hanoi.png"><br><code><a href="https://github.com/danoneata/chalk/tree/master/examples/hanoi.py">hanoi.py</a></code></td>
</tr>
<!--<tr>
<td align="center"><img src="doc/imgs/latex.svg"><br><code><a href="https://github.com/danoneata/chalk/tree/master/examples/latex.py">latex.py</a></code></td>
</tr>
-->
</table>

These scripts can be run as follows:

```bash
python examples/squares.py
```

![squares](https://raw.githubusercontent.com/danoneata/chalk/master/examples/output/squares.png)

```bash
python examples/escher_square_limit.py
```

![escher](https://raw.githubusercontent.com/danoneata/chalk/master/examples/output/escher-square-limit.png)

```bash
python examples/hanoi.py
```

![hanoi](https://raw.githubusercontent.com/danoneata/chalk/master/examples/output/hanoi.png)

## Authors

- [Dan Oneață](http://doneata.bitbucket.io/)
Expand Down
4 changes: 4 additions & 0 deletions doc/crop-images.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
for img in squares hanoi escher-square-limit lenet logo hilbert koch tensor hex-variation; do
# convert examples/output/${img}.png -gravity center -crop 200x200+0+0 +repage doc/imgs/${img}.png
convert -define png:size=200x200 examples/output/${img}.png -thumbnail 200x200^ -gravity center -extent 200x200 doc/imgs/${img}.png
done
Binary file added doc/imgs/escher-square-limit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/imgs/hanoi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/imgs/hex-variation.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/imgs/hilbert.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/imgs/koch.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/imgs/lenet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/imgs/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/imgs/squares.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/imgs/tensor.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.