The RDP Algorithm: How Path Simplification Works
The Ramer-Douglas-Peucker (RDP) algorithm is the mathematical foundation of Pathhaus's node reduction. Understanding how it works will help you choose the right epsilon value and predict how simplification affects your fonts.
The core idea
Given a curve approximated by a series of points, RDP finds a simpler curve with fewer points that stays within a maximum distance (epsilon) of the original. The algorithm works recursively: take the start and end points of the curve, draw a straight line between them, and find the point furthest from that line. If the furthest point is within epsilon distance, remove all intermediate points — the straight line is "good enough". If the furthest point exceeds epsilon, split the curve at that point and recurse on both halves.
How epsilon controls simplification
A smaller epsilon preserves more points (less simplification, more accurate to the original). A larger epsilon removes more points (more simplification, smoother but less precise). In Pathhaus, epsilon is measured in font units — 1000 units per em. At 1000 units/em, an epsilon of 2 means a maximum deviation of 0.002em, which at a 12mm cap height is 0.024mm — invisible to any machine. An epsilon of 10 means 0.12mm deviation at the same size, which is noticeable on tight curves in display fonts.
Why the Laser preset uses epsilon=2
Laser engravers are precise. CO₂ lasers have beam widths of 0.1–0.3mm; diode lasers 0.05–0.15mm. At these scales, a 0.024mm deviation (epsilon=2 at 12mm cap height) is well within the beam width and invisible in the output. The Laser preset removes redundant points while preserving all meaningful geometry. This gives laser engravers the smoothest possible motion without sacrificing letter quality.
When to use custom epsilon
The built-in presets cover most use cases, but custom epsilon is valuable for edge cases. If you're engraving at very large sizes (100mm+ cap height), reduce epsilon to 0.5–1 to preserve fine curves. If you're working with hobbyist machines that stutter even with the Laser preset, try epsilon=3–4. Pathhaus Studio shows a live node count and preview as you adjust epsilon, letting you find the right balance for your specific font and size combination.
Try it in Pathhaus Studio
Free to start — optimize and export your first font file in under 5 minutes.