kaplibs: Fix autogrid algorithm when all points are on a straight line