Repair exact visibility and hole rendering and streamline search state

This commit is contained in:
Jan Petykiewicz 2026-11-28 20:13:00 -08:00
commit 9ee786d138

View file

@ -150,6 +150,15 @@ class RoutingWorld:
def _ensure_static_tree(self) -> None:
self._static_obstacles.ensure_tree()
def corner_segment_visible(self, start: tuple[float, float], end: tuple[float, float]) -> bool:
"""Allow endpoint contact while testing the open segment against keepouts."""
self._ensure_static_tree()
tree = self._static_obstacles.tree
if tree is None:
return True
segment = LineString((start, end))
return all(segment.relate_pattern(tree.geometries[index], "FF*******") for index in tree.query(segment))
def _ensure_static_raw_tree(self) -> None:
self._static_obstacles.ensure_raw_tree()