namosim.utils package
Submodules
namosim.utils.collision module
namosim.utils.connectivity module
namosim.utils.conversion module
- namosim.utils.conversion.add_shapely_geometry_to_svg(*, shape: Polygon | LineString | Point, uid: str, style: str, svg_data: Document, ymax_meters: float, svg_group: Element | None = None, namo_type: str | None = None)[source]
- namosim.utils.conversion.concave_hull_polygon(polygon: BaseGeometry, alpha: float) Polygon | MultiPolygon [source]
- namosim.utils.conversion.dom2dict(element)[source]
Converts DOM elements to dictionaries of attributes.
- namosim.utils.conversion.ellipse2pathd(ellipse)[source]
converts the parameters from an ellipse or a circle to a string for a Path object d-attribute
- namosim.utils.conversion.polygon2pathd(polyline)[source]
converts the string from a polygon points-attribute to a string for a Path object d-attribute. Note: For a polygon made from n points, the resulting path will be composed of n lines (even if some of these lines have length zero).
- namosim.utils.conversion.polygon_to_triangle_vertices(shapely_geometry)[source]
Convert a Shapely Polygon or MultiPolygon to a list of triangle vertices. Returns a list of triangles, where each triangle is a list of 3 vertex coordinates.
- namosim.utils.conversion.polyline2pathd(polyline, is_polygon=False)[source]
converts the string from a polyline points-attribute to a string for a Path object d-attribute
- namosim.utils.conversion.rect2pathd(rect)[source]
Converts an SVG-rect element to a Path d-string.
The rectangle will start at the (x,y) coordinate specified by the rectangle object and proceed counter-clockwise.