Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Boolean Operations on Cairo Paths?

Is there any way to build paths in Cairo by combining two paths together through Boolean operations such as Union, Difference, and Intersection? I'm working on a vector graphics application that uses Cairo to do its rendering and would like to give my users the ability to combine paths together in this manner, but I can't find a way to do it in Cairo.

like image 279
Adrian Lopez Avatar asked May 09 '09 16:05

Adrian Lopez


1 Answers

I haven't found a way to do this with the cairo libraries. But it's a feature I've been looking for too. Would definitely be helpful when (for example) stroking the combination of two paths - compositing operators mentioned by ntd don't seem to be able to do this.

In the meantime, I'm trying to write scripts for inkscape, and letting inkscape do the unioning/differencing. Acceptable for the problem I'm working on but definitely not for yours. Have you had any luck, either with cairo or any other svg library? After a couple days of googling, it doesn't seem to be trivial :/

like image 142
ImAlsoGreg Avatar answered Sep 23 '22 19:09

ImAlsoGreg