Skip to content

compgeomTU/FSDvis

Repository files navigation

Graph By Curve Free Space Diagram

Traversal Distance Python Library Visualizer

Installation

Download zip package and dependencies from GitHub.

Dependencies

  • NumPy is used to calculate dimensions of free space diagrams.
  • Free space diagrams are stored using Shapleys Polygon and Multipolygon classes.
  • The GUI of the free space diagram is built using matplotlib.

Command Line

To run the program, run a command line execution in the package with format:

python3 main.py <graph filename: str> <curve filename: str>

Flags:

  • -e type: float | specifies the Epsilon value for the free space diagram.

  • -n type: int | number of area approximation terms (Δ) of each cells free space.

  • -f type: str | saves plot as a type of file.

  • -l type: str logged computation of Traversal Distance and free space diagram as a .log file.

  • -a type: float given Epsilon, prints the area of the free space diagram.

  • -p plots graph and curve in 2D.

Sample Inputs

Sample graph and curve files can be copied and pasted into the command line.

  1. samples/A samples/B
  2. samples/H samples/G
  3. samples/P samples/Q
  4. samples/arc_de_triomphe samples/vehicle_path

Example of 3D Free Space Diagram

This image shows the Arc de Triomphe is Paris, France. It is surrounded by twelve intersecting roads and one pedestrian tunnel. arc_de_triomphe.jpg: Image

Given a roadmap, we can build the road network surrounding the monument and a path for any given vehicle.

python3 main.py samples/arc_de_triomphe samples/vehicle_path -f docs/arc_de_triomphe_.png

arc_de_triomphe_freespace.png: Image

In this plot, the road network is defined as a graph (colored black) and the vehicle path is defined as a curve (colored dashed gray). By computing the Traversal Distance of the graph and curve, we can visualize the free space diagram is 3D space.

python3 main.py samples/arc_de_triomphe samples/vehicle_path -e 5.0 -f docs/arc_de_triomphe_graphpng

arc_de_triomphe.png: Image The free space is shown where epsilon equals five.

Example of N Approximations of Free Space

To approximate the smoothness of the an elliptical free space diagram, compute the Traversal Distance on a set of sub divided edges from each edge of a curve and graph.

python3 main.py samples/P samples/Q -e 5.0 -n 5

n_approximation_0.png: Image The free space shown has no approximation, the following free space shown has an approximation of 5. n_approximation_5.png: Image When the number of approximations increases in the following free space from 5 to 50, the curvature of the free space becomes smoother. n_approximations_50.png: Image

Example of Logging Traversal Distance Computations

To Save the data generated by the Traversal Distance and free space diagram, create a log as the program runs.

python3 main.py samples/P samples/Q -e 5.0 -n 50

arc_de_triomphe.log: Image

Author

Contributors

Version History

1.0. 12-8-2022 1.1. 12-23-2022

Lisence

MIT License • Copyright (c) 2022 Computational Geometry @ Tulane