namosim.utils package

Submodules

namosim.utils.collision module

namosim.utils.connectivity module

namosim.utils.conversion module

namosim.utils.conversion.add_group(svg_data, group_id, parent=None, is_layer=True)[source]
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.clean_attributes(xml_doc)[source]
namosim.utils.conversion.color_clamp(x)[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.line2pathd(l)[source]
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.

namosim.utils.conversion.rgb_tuple_to_hex(rgb)[source]
namosim.utils.conversion.set_all_id_attributes_as_ids(xml_doc)[source]
namosim.utils.conversion.shapely_geometry_to_svg_pathd(*, shape: Polygon | LineString | Point, ymax_meters: float)[source]
namosim.utils.conversion.svg_pathd_to_shapely_geometry(*, svg_path: str, ymax_meters: float, precision: float = 1000000000.0, scale: float = 0.01) Polygon | LineString | Point[source]

namosim.utils.stats_utils module

namosim.utils.svg_to_png module

namosim.utils.utils module

Module contents