Ramer-Douglas-Peucker (rdp) algorithm

by scrawach

9

Ramer-Douglas-Peucker algorithm

The Ramer-Douglas-Peucker algorithm implementation for Godot 4 on gdscript.

Example

Example

Usage

Call static calculate function from RamerDouglasPeucker:

var simplified_points = RamerDouglasPeucker.calculate(points, epsilon) # return reduced points

In example:

var points := PackedVector2Array([Vector2(0, 0), Vector2(0, 1), Vector2(0, 2), Vector2(0, 3)])
print(RamerDouglasPeucker.calculate(points, 0.5)) # [(0, 0), (0, 3)]

Screenshots

Example Screen 0 Example Screen 1

Version

1.1

Engine

4.0

Category

Scripts

Download

Version1.1
Download Now

Support

If you need help or have questions about this plugin, please contact the author.

Contact Author