meerk40t / svgelements

SVG Parsing for Elements, Paths, and other SVG Objects.
MIT License
135 stars 29 forks source link

Iterative Looping for the `.line()`, `vertical()`, `horizontal()`, `quad()`, `cubic()` and `arc()` is required. #222

Closed tatarize closed 1 year ago

tatarize commented 1 year ago

The path commands for line, vertical, horizontal, quad, cubic, and arc are allowed to submit any number of point values and work. However, above 1000 items the current recursive calls will cap out and throw an error. While this works for smaller values, or for repeated calls to line() it should work iteratively without recursive calls.

    def test_iterative_loop_building_line(self):
        path = Path()
        path.move(0)
        path.line(*([complex(1, 1)] * 2000))