scene_service.geometry

Geometry helpers shared by Scene room rendering and navigation.

Functions

disc_inside_polygon(x, y, radius, points[, ...])

Require a circular robot footprint, not just its centre, inside a room.

point_in_polygon(x, y, points)

Return whether a point lies inside a polygon using even-odd crossings.

polygon_centroid(points)

Return the area-weighted centroid of a non-self-intersecting polygon.

scene_service.geometry.disc_inside_polygon(x: float, y: float, radius: float, points: Sequence[tuple[float, float]], samples: int = 16) bool[source]

Require a circular robot footprint, not just its centre, inside a room.

scene_service.geometry.point_in_polygon(x: float, y: float, points: Sequence[tuple[float, float]]) bool[source]

Return whether a point lies inside a polygon using even-odd crossings.

scene_service.geometry.polygon_centroid(points: Sequence[tuple[float, float]]) tuple[float, float][source]

Return the area-weighted centroid of a non-self-intersecting polygon.