# Cairo-fortran 1.1.0 released

**URL:** <https://fortran-lang.discourse.group/t/cairo-fortran-1-1-0-released/5897>\
**Category:** Announcements\
**Created:** [June 2, 2023, 2:58pm UTC](https://fortran-lang.discourse.group/t/cairo-fortran-1-1-0-released/5897 "2023-06-02T14:58:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![vmagnin](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/vmagnin/32/28_2.png) [@vmagnin](https://fortran-lang.discourse.group/u/vmagnin)\
**Post date:** [June 2, 2023, 2:58pm UTC](https://fortran-lang.discourse.group/t/cairo-fortran-1-1-0-released/5897/1 "2023-06-02T14:58:54Z")

</div>

Cairo-fortran offers Fortran bindings for the [Cairo](https://cairographics.org/) vector graphics library. It was originally created by @brocolis as a lightweight gtk-fortran derived project. I have decided to adopt the orphan and updated it with Cairo 1.17.8. I have also modified the three examples to respectively generate a PNG, a SVG and a PDF files. And added a purple logo…

> **[GitHub - vmagnin/cairo-fortran: Fortran bindings for the Cairo vector...](https://github.com/vmagnin/cairo-fortran)**
>
> Fortran bindings for the Cairo vector graphics library - GitHub - vmagnin/cairo-fortran: Fortran bindings for the Cairo vector graphics library

---

<div class="post-metadata">

**Author:** ![vmagnin](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/vmagnin/32/28_2.png) [@vmagnin](https://fortran-lang.discourse.group/u/vmagnin)\
**Post date:** [June 2, 2023, 3:01pm UTC](https://fortran-lang.discourse.group/t/cairo-fortran-1-1-0-released/5897/2 "2023-06-02T15:01:41Z")

</div>

The hat\_polykite toy project generates a SVG file including a batch of hat polykites, using the cairo-fortran bindings as a fpm dependency. The ultimate goal will be to use laser cutting to create an aperiodic puzzle.

> **[GitHub - vmagnin/hat\_polykite: This project generates SVG files containing a...](https://github.com/vmagnin/hat_polykite)**
>
> This project generates SVG files containing a batch of aperiodic monotiles, using the cairo-fortran bindings as a fpm dependency. The ultimate goal will be to use laser cutting to create an aperiod...

> On March 20, 2023, David Smith and mathematicians Joseph Samuel Myers, Craig S. Kaplan and Chaim Goodman-Strauss posted a preprint on ArXiv describing a monotile with 13 sides that, used with its reflected version, admits aperiodic tilings of the plane: the “hat” polykite.

> **[An aperiodic monotile](https://arxiv.org/abs/2303.10798)**
>
> A longstanding open problem asks for an aperiodic monotile, also known as an "einstein": a shape that admits tilings of the plane, but never periodic tilings. We answer this problem for topological disk tiles by exhibiting a continuum of...

---

<div class="post-metadata">

**Author:** ![vmagnin](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/vmagnin/32/28_2.png) [@vmagnin](https://fortran-lang.discourse.group/u/vmagnin)\
**Post date:** [June 6, 2023, 7:10pm UTC](https://fortran-lang.discourse.group/t/cairo-fortran-1-1-0-released/5897/3 "2023-06-06T19:10:48Z")

</div>

I have created two more small fpm projects using cairo-fortran to explore two good old recursive algorithms and see what SVG vector drawing can bring.

The first one draws a von Koch snowflake, using the classical recursive algorithm: [https://github.com/vmagnin/von\_koch\_snowflake](https://github.com/vmagnin/von_koch_snowflake)

 ![von_koch_snowflake](https://global.discourse-cdn.com/free1/uploads/fortran_lang/original/2X/f/fcba374c15278c54ce4c148f414793b2af7792f9.png)

The second one draws a Penrose tiling (aperiodic tiling of the plane with two tiles): [https://github.com/vmagnin/penrose\_tiling](https://github.com/vmagnin/penrose_tiling)  
The algorithm is interesting as it uses two interlaced recursive procedures: A calls A & A & B, and B calls A & B.

 ![penrose_tiling_10](https://global.discourse-cdn.com/free1/uploads/fortran_lang/original/2X/b/b1b85ef66f7ed63de83cfc882e357fdb8f5fd297.png)

Drawing a fractal in a SVG file is interesting as you can zoom at several scales. But the drawback is that SVG is rather verbose (it is an XML format): for example a line segment is coded with ~200 bytes (and whatever its length!). In the von Koch case, the SVG file is growing like 3 \times 4^n where n is the number of recursions. And with Penrose tiling, it is growing like the Fibonacci sequence. **Be careful with the number of recursions,** your SVG viewer might not appreciate a 100 Mio SVG file!

---

<div class="post-metadata">

**Author:** ![vmagnin](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/vmagnin/32/28_2.png) [@vmagnin](https://fortran-lang.discourse.group/u/vmagnin)\
**Post date:** [April 15, 2024, 2:57pm UTC](https://fortran-lang.discourse.group/t/cairo-fortran-1-1-0-released/5897/4 "2024-04-15T14:57:31Z")

</div>

> [@vmagnin](#):
>
> [GitHub - vmagnin/hat\_polykite: This project generates SVG files containing a batch of aperiodic monotiles, using the cairo-fortran bindings as a fpm dependency. A laser cutting machine was used to create aperiodic puzzles.](https://github.com/vmagnin/hat_polykite)

Finally, I have cut some tens of Hat and Tile(1,1) using a laser cutting machine Trotec Speedy 400 in poplar plywood (3 and 5 mm thick). We made a stand at the 50 years of our Materials Science teaching department. I was surprised by some “circular” patterns found by our students, as I was focused only on aperiodic puzzles:

 ![discourse_hat_polykite](https://global.discourse-cdn.com/free1/uploads/fortran_lang/original/2X/a/a1736b90e1663837b84d9fa4452370bdd9cb30be.jpeg)

Of course, thinking afterwards, it is no so surprising as all the angles used to build those polygons are multiples of 30°.
