Add SVG export examples for various scenarios#1291
Add SVG export examples for various scenarios#1291hxrshxz wants to merge 2 commits intoprocessing:mainfrom
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds example code files for the Processing SVG library, demonstrating five different approaches to exporting SVG graphics from Processing sketches.
Key Changes:
- Created examples directory with 5 complete, working SVG export examples
- Each example demonstrates a distinct use case: no display, with display, single frame capture, 3D geometry export, and programmatic creation
- Examples are based on official Processing reference documentation
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| NoScreenDisplay/NoScreenDisplay.pde | Demonstrates SVG export without opening a display window |
| WithScreenDisplay/WithScreenDisplay.pde | Shows how to export SVG while displaying on screen using beginRecord() |
| SingleFrameFromAnimation/SingleFrameFromAnimation.pde | Captures a single frame from an animated sketch |
| ThreeDGeometry/ThreeDGeometry.pde | Exports 3D geometry as flattened SVG using beginRaw() |
| UsingCreateGraphics/UsingCreateGraphics.pde | Creates SVG files programmatically using createGraphics() |
|
Hi @SableRaf could you check if these examples are solid enough to explain how to use the SVG library? |
SableRaf
left a comment
There was a problem hiding this comment.
Looks good overall. I requested small changes.
| /** | ||
| * Single Frame from an Animation (With Screen Display) | ||
| * | ||
| * It's also possible to save one frame from a program with |
There was a problem hiding this comment.
"It's also possible to..." made sense in the context of the tutorial but it is confusing in an example that needs to stand on its own.
| @@ -0,0 +1,17 @@ | |||
| /** | |||
| * Using createGraphics() to Create an SVG File | |||
There was a problem hiding this comment.
It would be helpful to mention that this code won't display anything in the sketch window.
Description
Added 5 complete examples for the Processing SVG library based on the official reference documentation. These examples were previously listed on the Processing website but not bundled with the library.
Changes
Created
examplesdirectory with 5 working examples:beginRecord()beginRaw()createGraphics()Closes
Fixes #1290