# Strategy for drawing tree contour

**URL:** <https://discourse.processing.org/t/strategy-for-drawing-tree-contour/33127>\
**Category:** Project Guidance\
**Created:** [October 28, 2021, 1:00pm UTC](https://discourse.processing.org/t/strategy-for-drawing-tree-contour/33127 "2021-10-28T13:00:00Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![micycle](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/micycle/32/201_2.png) [@micycle](https://discourse.processing.org/u/micycle)\
**Post date:** [October 28, 2021, 1:53pm UTC](https://discourse.processing.org/t/strategy-for-drawing-tree-contour/33127/2 "2021-10-28T13:53:48Z")

</div>

What exactly is your aim here? Are you looking to create a tree from a contour, or compute the contour of a tree?

If the latter, this contour is known as the _medial axis_ of a shape. One way to think about finding this is place the largest circles possible (at different points) within the shape such that the circles are **flush with at least 2 edges** , and then join up circle centers. Fortunately, computing a Delaunay triangulation of the shape’s vertices will provide the circles (which are found by computing the _circumcircle_ of each resulting triangle).

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/c/cc40d1cbf5936647b3028802dd3341afd26b4380.jpeg)

* * *

[Processing Geometry Suite](https://discourse.processing.org/t/processing-geometry-suite/29924) provides a method to find the _medial axis_ of a PShape (and [supports](https://micycle1.github.io/PGS/micycle/pgs/PGS_Contour.html#medialAxis(processing.core.PShape,double,double,double)) medial axis pruning to reject small/noisy segments, as seen below).

![medialAxis](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/e/e5fc50f2908842b41348e436b4af5b9bbbf1ebf3.gif)

---

_[View the full topic](https://discourse.processing.org/t/strategy-for-drawing-tree-contour/33127)._
