Skip to content

Instantly share code, notes, and snippets.

@46bit
Created August 29, 2017 22:47
Show Gist options
  • Select an option

  • Save 46bit/b2adb88324d35b40b6535f8b867064aa to your computer and use it in GitHub Desktop.

Select an option

Save 46bit/b2adb88324d35b40b6535f8b867064aa to your computer and use it in GitHub Desktop.

Markers

  • A marker is represented by a <circle …>.
  • Markers must have a consistent colour such that they can be automatically identified.
  • A marker connects to one or more paths.
  • A marker that does not connect to a path can be considered invalid.
  • A marker connects to a path if the path's line intersects with the marker's circle. Connection location
  • If a path goes through the centre of the circle, the connection is at the centre.
  • If a path goes off-centre through the circle, the connection is at the closest approach.
  • These rules improve on connections being made at the edges of the circle.
  • A marker's connection cost to a marker on a path is the distance from the circle's centre to the line's connection location. Traversal between connections
  • Connections between paths at a marker are traversable. The connection cost is the distance between the two connection locations.
  • This is so that lines obscured by a circle can be traversed.
  • If two paths connect more efficiently than at a connection, pathfinding can be expected to preferentially select that path.

Path

  • A path is represented by a <path …> whose d attribute describes a line with only a start and end location. For instance a path from (3, 1) to (7, 2) represented by <path d="M3,1 L7,2">.
  • A path can also be recognised as an SVG line or polyline, or can have multiple waypoints, but this is implementation-specific.
  • Paths must have a consistent colour such that they can be automatically identified.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment