How to determine if a polygon is inside another?

I have a simple example ( SVG source ), as you can see below. path with identifier rect2816 "described in d :

m 140.53571,188.625 0,148.1875 273.9375,0 0,-148.1875 -273.9375,0 z 
m 132.25,42.03125 c 3.64586,0.0236 7.47296,0.12361 11.5,0.28125 36.65941,1.43507 57.84375,15.88072 57.84375,32.84375 0,7.41614 -1.94981,21.58652 -13.28125,24.09375 -14.58711,3.2276 -40.46224,-5.35276 -53.125,6.625 -26.65285,25.21104 -48.00843,-19.04537 -57.875,-32.84375 -12.16196,-17.00847 0.24962,-31.35357 54.9375,-31 z

Here, the first line describes the parent polygon, the second describes the hole (as you can see). But how can I find this program with holes? I am using Python. Maybe there is some library for a simple solution?

A polygon inside other polygon

+3
source share
2 answers

Convert the paths into pairs (x, y) and apply this function for each point of the second polygon.

http://www.ariel.com.au/a/python-point-int-poly.html

+2
source

, :

B A, B B A.

, () , - "". "" - , . , (, ). ( , ( ).)

, B A, , A.

, , .

, . , , .

+1

All Articles