Open abey79 opened 1 year ago
As a first iteration, I'm splitting the drawer API in a separate, long-term DrawState
structure (which contains the transform, color, etc.) and a short-term Draw
structure, which is linked to a target layer and implements the actual drawing API. This makes it easier to handle reference to target layers.
Initial implementation in b5e49c2339a1c74158f42017bc31cad3d27513b1
Much better take in the vsvg-sketch
crate.
Currently, vpype's offer in terms of drawing primitive is very weak: just a few functions to create corresponding
np.array(dtype=complex)
:vpype.rect()
,vpype.circle()
, etc. To complement that, significant additional work is done by vsketch to implement its Processing-like API. Given the relative simplicity of the basic path type, this works relatively well.The present work introduces a more complex path type that include cubic Bézier. Proper conversion from primitive (circle, arcs, elliptic arcs, rounded rects, etc.) has consequently become a bit more complex. To address that, I propose a plan to introduce a "Drawer API" to
vpype-core
with the following functionalities:Advantages: