Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Algorithm to extract outer SVG path [duplicate]

Tags:

algorithm

svg

I'd like to extract the outer path (red line) of A and B circles (or other paths/shapes), and erase all the inner lines, so there would be only one path (perhaps a little bit of a complicated one). Is there any algorithm that could do this easily?

circles
(source: candelalearning.com)

like image 589
Bart Juriewicz Avatar asked Jan 06 '23 22:01

Bart Juriewicz


1 Answers

The term you are looking for is bezier path boolean operations, specifically union for the case you are presenting (this should help you googling).

Paper.js has a javascript implementation:

You can see the examples here.

enter image description here

like image 92
methodofaction Avatar answered Jan 14 '23 17:01

methodofaction