pathfinding3d.core.util module
- pathfinding3d.core.util.backtrace(node)[source]
Backtrace according to the parent records and return the path. (including both start and end nodes)
- pathfinding3d.core.util.bi_backtrace(node_a, node_b)[source]
Backtrace from start and end node, returns the path for bi-directional A* (including both start and end nodes)
- pathfinding3d.core.util.raytrace(coords_a, coords_b)[source]
Given the start and end coordinates, return all the coordinates lying on the line formed by these coordinates, based on ray tracing.
- Parameters:
coords_a (Coords) – start coordinates
coords_b (Coords) – end coordinates
- Returns:
list of coordinates
- Return type:
List[List[float]]
- pathfinding3d.core.util.bresenham(coords_a, coords_b)[source]
Given the start and end coordinates, return all the coordinates lying on the line formed by these coordinates, based on Bresenham’s algorithm.
- Parameters:
coords_a (Coords) – start coordinates
coords_b (Coords) – end coordinates
- Returns:
list of coordinates
- Return type:
List[List[float]]
- pathfinding3d.core.util.expand_path(path)[source]
Given a compressed path, return a new path that has all the segments in it interpolated.
- Parameters:
path (List[Coords]) – path to expand
- Returns:
expanded path
- Return type:
List[Coords]
- pathfinding3d.core.util.smoothen_path(grid, path, use_raytrace=False)[source]
Given an uncompressed path, return a new path that has less turnings and looks more natural.