โ† All examples

mesh algorithms

Ramer-Douglas-Peucker polyline simplification

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.

Recorded render of Ramer-Douglas-Peucker polyline simplification

What this component contains

  • ATTRIBUTION.md
  • LICENSE
  • README.md
  • component.json
  • douglas_peucker.py
  • example.gltf
  • meshkit.py
  • preview.png
  • test_package.py
  • verification/native.json

How it works

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

Recorded checks

godot 4.7.2.stable.official.ed1daf0bf

  • generator_runs_system_python
  • generator_runs_verifier_python
  • gltf_strict_structure
  • interpreters_agree
  • example_matches_generator
  • godot_headless_gltf_load
  • godot_compatibility_render

Limits to consider

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.