diff --git a/apps/golfview/golfview.js b/apps/golfview/golfview.js index 93d70e31c..0ec55f28c 100644 --- a/apps/golfview/golfview.js +++ b/apps/golfview/golfview.js @@ -1,7 +1,8 @@ -let course = require("Storage").readJSON("course_data_hole1.json"); +let course = require("Storage").readJSON("course_data(3).json"); console.log(Object.keys(course)); +g.setBgColor(0,0,0); g.clear(); for (var feature of course.features) { diff --git a/apps/golfview/index.html b/apps/golfview/index.html index 24016ccbd..c018756ed 100644 --- a/apps/golfview/index.html +++ b/apps/golfview/index.html @@ -2,6 +2,7 @@ + @@ -75,13 +76,14 @@ return course_processed; } - function preprocessCoords(course_input) { + function preprocessCoords(course_input) { //todo posibly remove other coordinates for ~0.5 size reduction // first do the high-level way for (var hole in course_input.holes) { course_input.holes[hole].nodesXY = arraytoXY(course_input.holes[hole].nodes, course_input.holes[hole].nodes[0]) // then do the shapes in the features for (var feature in course_input.holes[hole].features) { - course_input.holes[hole].features[feature].nodesXY = arraytoXY(course_input.holes[hole].features[feature].nodes, course_input.holes[hole].nodes[0]); + many_points = arraytoXY(course_input.holes[hole].features[feature].nodes, course_input.holes[hole].nodes[0]); + course_input.holes[hole].features[feature].nodesXY = simplify(many_points,3,true); // from simplify-js } // find out how the hole is angled