资 源 简 介
Download latest version: http://www.byronknoll.com/visibilitypolygon1-5.zip
This code is released into the public domain - attribution is appreciated but not required.
Made by Byron Knoll in 2014.
Demo: http://www.byronknoll.com/visibility.html
This library can be used to construct a visibility polygon for a set of line segments.
The time complexity of this implementation is O(N log N) (where N is the total number of line segments). This is the optimal time complexity for this problem.
The following functions should be useful:
1. compute(position, segments):
* Computes a visibility polygon. O(N log N) time complexity (where N is the number of line segments).
* Arguments:
* position - The location of the observer. Must be completely surrounded by line segments (an easy way to enforce this is to create an outer bounding box).
* segments - A list of line segments. Each line segment should be a list of two points. Each point shoul