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; double carry = 0; while true { int iPath2 = iPath; double len = 0; while (it.hasNext() && (iPath2 == iPath || (len = p.minus(lastPoint).length()+carry)+.5 < segmentLength)) { p = it.next(); iPath2++; } if (iPath2 == iPath) break; out.add(p); carry = segmentLength-len; printVars ifdef onePathToIntervalsOfFixedLength_debug(+segmentLength, +len, +lastPoint, +p, +carry); lastPoint = p; } ret out; }