Polyline Uniform Distance Resampler

Resample a finite polyline at regular arc-distance spacing with an explicit optional final vertex, bounded to 10,000 samples.

Description

Resample a finite polyline at regular arc-distance spacing with an explicit optional final vertex, bounded to 10,000 samples.

Uniform-distance resampling follows polyline arc length rather than spacing samples uniformly by vertex index.

When to use this tool

Resample a finite polyline at regular arc-distance spacing with an explicit optional final vertex, bounded to 10,000 samples.

  • Prepare the supplied points, spacing, includeFinal fields for this operation.
  • Compare the complete example with the representation used by your own input before carrying the result into another step.

How to use the tool and how it works

  1. Enter points, spacing, includeFinal. Use the exact text syntax, units and index conventions explained below.
  2. Run the tool. If input validation fails, correct the supplied fields before interpreting any result.
  3. Read result.distances, result.points. Interpret false, null and empty lists using the distinctions below; they can be valid outputs.

Require at least two x/y points and positive spacing. Sum Euclidean segment lengths, generate distances 0,spacing,2*spacing through the last fitting step and optionally append total length. Interpolate each distance on the polyline.1

Input fieldMeaning and representationAccepted input
pointspoints.Numeric rows; at most 128 rows and 128 values per row
spacingspacing.Finite number; greater than zero
includeFinalExplicit choice for include final; supply a boolean rather than a text label.true or false
Output fieldInterpretation
resultObject containing the named outputs below.
result.distancesThe distances list in the ordering and representation described above.
result.pointsThe points list in the ordering and representation described above.
json
{
  "input": {
    "points": [
      [
        0,
        0
      ],
      [
        3,
        0
      ]
    ],
    "spacing": 2,
    "includeFinal": true
  },
  "output": {
    "result": {
      "distances": [
        0,
        2,
        3
      ],
      "points": [
        [
          0,
          0
        ],
        [
          2,
          0
        ],
        [
          3,
          0
        ]
      ]
    }
  }
}

Limitations and assumptions

  • No extrapolation or curved-segment fitting occurs. Consecutive duplicate points are tolerated; the regular sample count is bounded and a final appended sample can be additional.
  • Point pairs use [x,y], rectangles and viewBox use [x,y,width,height], and all coordinate units must be consistent. This tool does not read, render or modify an SVG document.
  • Every declared top-level field is required and unexpected fields are rejected. Numeric inputs must be finite; ordinary text fields are bounded to 8,192 UTF-16 code units, with tighter operation-specific limits where stated.
  • String lists have at most 128 entries of at most 128 code units; matrices have at most 128 rows and columns. Larger numeric lists and parsed JSON have separate bounded budgets. Nonfinite results and excessively large serialized outputs are rejected.
  • Indexes are zero-based and spans have an exclusive end unless explicitly stated otherwise. A valid false, null or empty-list result is distinct from malformed input.

Alternative or Complementary methods

Use a full SVG parser or rendering engine when the task includes commands and CSS values outside the documented branch. Compare coordinates and transforms under the same units and viewport convention.

References

  1. Tool behavior and example: Polyline Uniform Distance Resampler — tool.io

Similar or alternative tools

  • Polyline Distance Point Lookup

    Interpolate a point by Euclidean cumulative polyline distance without extrapolation; zero-length segments are skipped for interpolation.

  • Polyline Collinear Middle Pruner

    Prune middle vertices lying within a supplied perpendicular distance of the enclosing segment and between endpoints; reversals are preserved.

Don't forget to set a bookmark for tool.io!
Privacy | Imprint | Cookies