jupedsim.geometry_utils
#
Module Contents#
- exception GeometryError(message)[source]#
Bases:
Exception
Class reflecting errors when creating JuPedSim geometry objects.
Create GeometryError with the given message.
- Parameters:
message – Error message
- build_geometry(geometry: list[tuple[float, float]] | shapely.GeometryCollection | shapely.Polygon | shapely.MultiPolygon | shapely.MultiPoint | str, **kwargs: Any) jupedsim.geometry.Geometry [source]#
Create a
Geometry
from different input representations.Note
The geometric data supplied need to form a single “simple” polygon with holes. In case the input contains multiple polygons this must hold true for the union of all polygons.
- Parameters:
geometry (list[tuple[float, float]] | shapely.GeometryCollection | shapely.Polygon | shapely.MultiPolygon | shapely.MultiPoint | str) –
Data to create the geometry out of. Data may be supplied as:
list of 2d points describing the outer boundary, holes may be added with use of excluded_areas kw-argument
GeometryCollection
consisting only out ofPolygons
,MultiPolygons
andMultiPoints
MultiPoint
forming a “simple” polygon when points are interpreted as linear ring without repetition of the start/end point.str with a valid Well Known Text. In this format the same WKT types as mentioned for the shapely types are supported: GEOMETRYCOLLETION, MULTIPOLYGON, POLYGON, MULTIPOINT. The same restrictions as mentioned for the shapely types apply.
kwargs (Any) –
- Keyword Arguments:
excluded_areas – describes exclusions from the walkable area. Only use this argument if geometry was provided as list[tuple[float, float]].
- Return type: