Baltor Get started

Gallery / Mesh algorithms

Ramer-Douglas-Peucker polyline simplification

In your harnessMesh algorithmMIT

Simplify 2D or 3D polylines by keeping only points farther than a tolerance from the simplified line, with a measure of the largest deviation. Use it for GPS tracks, contours, strokes and paths.

Render of Ramer-Douglas-Peucker polyline simplification
The render its check recorded in Godot 4.7.2, 256 by 256 pixels.

What it takes and gives

Entry points
simplify, max_deviation, demo_curve, build, main
Parameters
tolerance, samples
Complexity
O(n log n) typical, O(n^2) worst case
Axes
+Y up, metres

Limits. Distances are measured to chord segments, and the result keeps the original end points. The simplified line can cross itself or other lines (no topology preservation). Not suited to closed rings without choosing a split point first.

Details

Kind
Mesh algorithm
Engine
Python 3.10 or later
Files
10 files, 300.3 KB
Licence
MIT
Declared effects
reads files, runs commands, writes files
Checked with
Godot 4.7.2, gl_compatibility, OpenGL 3 driver, Mesa llvmpipe under Xvfb
Checks
generator runs system python, generator runs verifier python, gltf strict structure, interpreters agree, example matches generator, godot headless gltf load, godot compatibility render
Techniques
Ramer-Douglas-Peucker algorithm (1972, 1973), Point to segment distance
Tags
simplification, douglas-peucker, polyline, decimation, gps, contours
Identity
library.supply.creative_originals.ccbed6c9c02469805014b93d.f8cbb6ec0a8bbc1a
Version
f8cbb6ec0a8bbc1a169dd6d9e856d8e0d3c2655f7b57b77937bac51a437e280b

The version is the SHA-256 of the item your harness downloads; every file in it names its own checksum.

Something wrong with this item, its rights or its safety? Report it on the support page, or from your harness after a download.