BachiLi / diffvg

Differentiable Vector Graphics Rasterization
https://people.csail.mit.edu/tzumao/diffvg/
Apache License 2.0
902 stars 152 forks source link

Creating polylines directly from numpy arrays of 2d points? #65

Closed tristanryerparke closed 9 months ago

tristanryerparke commented 1 year ago

In the single_curve.py and painterly_rendering.py examples I see that paths can be created from numpy arrays, with the points in the array representing end points and control points of a chain of quadratic bezier curves. In the single_path.py example a cubic bezier is specified from an svg string. However I don't see anywhere in the examples where a polyline is passed to the pydiffvg.Path() constructor. I'd like to avoid converting my numpy array of points to an svg string and then using pydiffvg.from_svg_path(). Is this possible? Thanks