diff options
| author | Jules Laplace <jules@okfoc.us> | 2015-08-20 13:21:44 -0400 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2015-08-20 13:21:44 -0400 |
| commit | a4a001668f9f05272a4fbc28567b259ee45ada97 (patch) | |
| tree | 3305df11136b46a97d8c1e8e34342f881e308239 /public/assets/javascripts/rectangles/engine/shapes/regionlist.js | |
| parent | 69e8123f2fb6fb46ad3889ce906692160ca46a80 (diff) | |
RegionList
Diffstat (limited to 'public/assets/javascripts/rectangles/engine/shapes/regionlist.js')
| -rw-r--r-- | public/assets/javascripts/rectangles/engine/shapes/regionlist.js | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/public/assets/javascripts/rectangles/engine/shapes/regionlist.js b/public/assets/javascripts/rectangles/engine/shapes/regionlist.js new file mode 100644 index 0000000..1f2810f --- /dev/null +++ b/public/assets/javascripts/rectangles/engine/shapes/regionlist.js @@ -0,0 +1,37 @@ +var RegionList = (function(){ + + var RegionList = {} + var regions = RegionList.regions + + RegionList.init = function(){ + } + + RegionList.build = function(){ + var segments = shapes.getAllSegments() + segments.forEach(function(segment){ + if (segment[0][0] == segment[1][0]) { + if (segment[0][1] > segment[1][1]) { + segment.push(segment.shift()) + } + } + else if (segment[0][1] == segment[1][1]) { + if (segment[0][0] > segment[1][0]) { + segment.push(segment.shift()) + } + } + }) + segments = segments.sort(function(a,b){ + return a[0][0] < b[0][0] + }) + + console.log(segments) + + // get a list of all segments from these polylines + // re-orientate them so they're either facing up or right + // loop over them from left to right + // + } + + return RegionList + +})()
\ No newline at end of file |
