https://github.com/cadin/plotter-canvas
An empty canvas for building plotter art in Processing
https://github.com/cadin/plotter-canvas
creative-coding plotter-art processing
Last synced: 6 months ago
JSON representation
An empty canvas for building plotter art in Processing
- Host: GitHub
- URL: https://github.com/cadin/plotter-canvas
- Owner: cadin
- License: unlicense
- Created: 2023-06-15T22:12:55.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-03-03T20:50:15.000Z (about 2 years ago)
- Last Synced: 2024-03-03T21:38:57.325Z (about 2 years ago)
- Topics: creative-coding, plotter-art, processing
- Language: Processing
- Homepage:
- Size: 41 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# plotter-canvas
An empty canvas for building plotter art in Processing.
This projects runs full screen (optional) with a proportional canvas showing your sketch in context of the target print size. Output your sketch as plot-ready SVG with optional PNG preview.
## Getting Started
### đș [Video Walkthrough](https://youtu.be/P2iipcsJoCA)
### Requirements
- [Processing 4](https://processing.org/download)
### Setup
Put your sketch code in the `Sketch.pde` file.
The main app will call your sketch's `draw` method once per frame.
#### Config
Set your paper size, pen thickness, and display scaling in the `config.pde` file.
## Usage
Any drawing commands in your sketch's `draw` method will be output to SVG when saving.
Use the `w`, `h`, and `ppi` variables in to your sketch to position your drawing on the canvas.
### Mouse & Keyboard Input
You can use these Processing functions in your sketch to access mouse and keyboard input:
[`mousePressed()`](https://processing.org/reference/mousePressed_.html)
[`mouseReleased()`](https://processing.org/reference/mouseReleased_.html)
[`keyPressed()`](https://processing.org/reference/keyPressed_.html)
[`keyReleased()`](https://processing.org/reference/keyReleased_.html)
Use `canvasMouseX` and `canvasMouseY` to get mouse coordinates relative to the canvas.
### Responding to Canvas Size Changes
If you need to do something in your project to respond to a change in canvas size, you can implement the `setDimensions` function:
```java
void setDimensions(int _w, int _h, float _ppi, float _strokeWeight) {
super.setDimensions(_w, _h, _ppi, _strokeWeight); // you must call super
// your code here...
}
```
This function will be called by `app.pde` any time the canvas size changes. Be sure to call super in order to have the parent class correctly update the canvas values.
### Key Commands
**`s`** : Save a plot-ready SVG. This also saves a PNG preview image if you have that flag set in the config file.
**`g`** : Toggle a visual grid that represents the maximum plot area.
## Support
This is a personal project and is mostly unsupported, but I'm happy to hear feedback or answer questions.
## License
This project is licensed under the Unlicense - see the [LICENSE](LICENSE) file for details.
---
đšđ»âđŠČâ€ïžđ