-
-
Notifications
You must be signed in to change notification settings - Fork 307
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add SVG render and export #778
base: master
Are you sure you want to change the base?
Conversation
This PR is at the point where it can render the @mitchmindtree, would you mind taking a look? |
Hi I've tried making my own program to generate a Sierpinski triangle SVG file and it works really well! One thing I didn't realise is it only renders whats been drawn by the See here: https://gist.github.com/fenjalien/bc9fa8ca765470308ea311ea68fb499a Unfortunately I'm very new to nannou so I can't really suggest any changes 😅 |
Thanks for checking it out! I see what you mean about it rendering only whats drawn by the I don't know if it would be practical to store previous draw commands indefinitely because it can grow without bounds if not cleared with a background. Maybe it could be opt-in? It could also be useful to redraw everything when the render texture is lost due to a window resize. |
draw::renderer::RenderPrimitive
to enable alternative renderers
It probably does make sense to constrain the SVG render to the commands within a single There are many situations that would have to be handled otherwise, e.g.:
|
Great work on this so far! SVG rendering will be an excellent enhancement. Looking to seeing it integrated soon. |
I wanted to leave a nudge here. I'm currently setting up to use nannou to generate some input files for a laser marking system. I would like to export svgs... and so this PR would be immensely helpful. I'm currently working off my own fork of this PR in the meantime. If the underlying abstractions are still sound and this has potential to be merged with a reduced scope (e.g. ignoring meshes and stroke end cap stuff), I may be able to sponsor someone to work on it. I've not been involved in the nannou project, so I'm not sure how many active contributors there are, or if that is a possible or desirable arrangement. |
Fixes: #379
Creates a
PrimitiveRenderer
trait to allow separation of the lyon tesselation and wgpu rendering from the general preparation and finalization of the different primitives, which allows alternative renderers to avoid duplicating existing code that normalizes the nannou primitives into simpler rendering primitives.Implements an SVG renderer using above renderer abstractions.
Checklist:
PrimitiveRenderer
point_mode
,line_mode
)points_textured
points_colored