Did I find the right examples for you? yes no

All Samples(5)  |  Call(5)  |  Derive(0)  |  Import(0)

src/c/h/chirp-1.2.2/chirp/gui/chirpgui.py   chirp(Download)
            for p in self.selections:
                p2 = wxgeom.path_to_poly(p).difference(val)
                if not p2.is_empty: newgeoms.extend(geom.polygon_components(p2))
            self.delete_selections()
            for p in newgeoms: self.add_geometry(p)
                if p2.intersects(val):
                    p2 = p2.union(val)
                    newgeoms.extend(geom.polygon_components(p2))
            self.delete_selections()
            for p in newgeoms: self.add_geometry(p)
            self.spec.delete_selection(*i)
            # if polygons are disjoint, may return a multipolygon; split into separate segments
            new_elem = [self.spec.add_geometry(p) for p in geom.polygon_components(p2)]
            self.spec.draw()
            self.status.SetStatusText("Merged elements %s into %s" % (list(i for i, p in polys), new_elem))
            i2, p2 = geom.subtract_polygons([wxgeom.path_to_poly(p) for p in p1])
            self.spec.delete_selection(*i1)
            new_elem = [self.spec.add_geometry(p) for p in geom.polygon_components(p2)]
            self.status.SetStatusText("Subtracted %d elements from element %d" % (len(i1) - 1, i1[i2]))
 
            else:
                new_polys = geom.split_polygons(p1, p2)
                new_elem = [self.spec.add_geometry(p) for p in geom.polygon_components(*new_polys)]
                self.spec.delete_selection(polys[1][0], polys[0][0])
                self.spec.draw()