---
estimated_steps: 14
estimated_files: 2
skills_used: []
---

# T01: Post-processing: RDP simplification, island detection, open path repair

1. Create engine/pipeline/postprocess.py
2. Implement RDP path simplification:
   - Parse SVG path data into coordinate arrays
   - Apply Ramer-Douglas-Peucker algorithm with tunable epsilon
   - Return simplified path data
3. Implement island detection:
   - Identify interior counter paths (holes in letters, enclosed shapes)
   - Flag with metadata for proper DXF nesting
4. Implement open path detection:
   - Check if path start/end points match
   - Flag open paths in metadata
   - Optional auto-close with straight line segment
5. Implement node count reporting per path
6. Unit tests for each function

## Inputs

- `engine/pipeline/vectorize.py`

## Expected Output

- `engine/pipeline/postprocess.py`
- `engine/tests/test_postprocess.py`

## Verification

cd engine && python -m pytest tests/test_postprocess.py -v
