static PtBuffer onePathToIntervalsOfFixedLength(OnePath path, double segmentLength) { if (path == null) null; new PtBuffer out; int iPath = 0, lPath = path.size(); var it = path.pointIterator(); Pt p = it.next(), lastPoint = p; while true { int iPath2 = iPath; while (it.hasNext() && (iPath2 == iPath || p.minus(lastPoint).length()+.5 < segmentLength)) { p = it.next(); iPath2++; } if (iPath2 == iPath) break; out.add(p); lastPoint = p; } ret out; }