getSimplifiedPoints(); $length = count($points); $path = $path->move($points[0][0], $points[0][1]); for ($i = 1; $i < $length; ++$i) { $path = $path->line($points[$i][0], $points[$i][1]); } $path = $path->close(); } return $path; } }