Skip to content

Instantly share code, notes, and snippets.

@Parithi
Last active June 6, 2017 13:14
Show Gist options
  • Save Parithi/7789d7f8c7d8cc8467907d0873a652a8 to your computer and use it in GitHub Desktop.
Save Parithi/7789d7f8c7d8cc8467907d0873a652a8 to your computer and use it in GitHub Desktop.
START
SET numExhibits = Total number of exhibits
FOR each exhibit e = 1 to numExhibits
Find midpoint m
Find adjacent exhibits of e by doing this
FOR every other exhibit a = 1 to numExhibits do the following
IF e is sharing coordinate(s) with a, add a.
ELSE Line l drawn between e.m and a.m intersects any side s of exhibit
FOR each exhibit x = 1 to numExhibits do the following
Use LeMothe’s algorithm to find intersection point of two line segments l and s.
IF they do not intersect add x,
ELSE CONTINUE.
Find pathway points of e, let’s limit them to 8 points (in 8 directions) per exhibit
Choose pathway point p close to exhibit
FOR every adjacent exhibit of e
IF p is inside e CONTINUE
ELSE IF p is on e CONTINUE
ELSE add p
Last step is to find points that each pathway point e.p is connected to. FOR each pathway point e.p do the following
FOR each adjacent exhibit j in e.a do the following
FOR every other exhibit k = 1 to numExhibits do the following
IF a line drawn between j.c and e.c does not intersect with any sides of k using LeMothe’s algorithm, add j.c
END
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment