Graph¶
- class spherical_geometry.graph.Graph(polygons)[source]¶
Bases:
objectA graph of nodes connected by edges. The graph is used to build unions between polygons.
Note
This class is not meant to be used directly. Instead, use
unionandintersection.- Parameters:
- polygonssequence of
SphericalPolygoninstances Build a graph from this initial set of polygons.
- polygonssequence of
Methods Summary
add_polygon(polygon)Add a single polygon to the graph.
add_polygons(polygons)Add more polygons to the graph.
Convert a graph containing cut lines and self intersections into a list of disjoint polygons
Once all of the polygons have been added to the graph, calculate the intersection.
union()Once all of the polygons have been added to the graph, join the polygons together.
Methods Documentation
- add_polygon(polygon)[source]¶
Add a single polygon to the graph.
Note
Must be called before
unionorintersection.- Parameters:
- polygon
SphericalPolygoninstance Polygon to add to the graph
- polygon
- add_polygons(polygons)[source]¶
Add more polygons to the graph.
Note
Must be called before
unionorintersection.- Parameters:
- polygonssequence of
SphericalPolygoninstances Set of polygons to add to the graph
- polygonssequence of
- disjoint_polygons()[source]¶
Convert a graph containing cut lines and self intersections into a list of disjoint polygons