Get number of samples to use for bend detection based on path length
int getSampleCount(double pathLength) { return math.min(15, math.max(3, (pathLength / 30).ceil())); }