0

I have several svg paths, and I'd like to get the outmost path of the combined shape. For instance for the following paths:

<path d="M 90 10 L 50 50 L 50 10 z"/>
<path d="M 130 50 L 130 90 L 90 90 z"/>
<path d="M 50 50 L 90 10 L 90 50 L 70 70 z"/>
<path d="M 10 90 L 10 50 L 50 50 L 70 70 L 50 90 z"/>
<path d="M 70 110 L 70 130 L 50 130 L 50 90 z"/>
<path d="M 90 50 L 130 50 L 70 110 L 50 90 z"/>
<path d="M 90 90 L 90 130 L 70 130 L 70 110 z"/>

I'd like to get

<path d="M 50 10 L 90 10 L 90 50 L 130 50 L 130 90 L 90 90 L 90 130 L 50 130 L 50 90 L 10 90 L 10 50 L 50 50 z"/>

What would be a good algorithm to get to this path?

clapin
  • 39
  • 5
  • Possible duplicate of http://stackoverflow.com/questions/7150766/union-of-many-more-than-two-polygons-without-holes – Paul LeBeau Apr 25 '16 at 10:43
  • @PaulLeBeau Not exactly a duplicate, that question was about polygons. I believe SVG paths are more general than polygonal chains. – Rafał Dowgird Apr 25 '16 at 13:39
  • OPs paths were all effectively polygons. I took a chance that that was good enough for him/her. – Paul LeBeau Apr 25 '16 at 13:55
  • Possible duplicate of [How do I combine complex polygons?](http://stackoverflow.com/questions/2667748/how-do-i-combine-complex-polygons) – Michael Mullany Apr 25 '16 at 23:58

0 Answers0