Is there anyway to clip a svg to a non rectangle?


I have an svg that I want to draw, but I don’t want to draw the entire thing.

I know I can reduce the clipping rect, or set a list of rects. But is there any way to have a non rectangular clipping area? Or is there a way to clip the vectors from the svg before drawing?


Polygon based clipping is very tricky to do right.
Maybe you should clip them in an vector drawing software ?

Anyway, please have a look to AGG renderer, it implements polygon based clipping in one of the samples.
There is some low level renderer in the forum that uses AGG renderer code, you should perform a search here.