Lining-draw
Processing script that creates shapes from lines only
Look it on GitHub:
Summary
What is it?
Lining-draw is Processing project that can draw various shapes from border-to-border lines only.
All you can draw are curves, by increasing or decreasing the coordinates of the lines.
What it looks like
Here are two examples of pre-recorded figures:
How to use
Processing is required.
- Download or clone the repository
- In the
drawing/
directory, rundrawing.pde
- Click the run button to execute
Code explanation
In the drawing/
directory, there are three scripts:
drawing.pde
is the script you will have to execute, it calls afigure
function in a switch structure and defines thestep
andmaxVal
valuesfigures.pde
is where are defines all the figures, you can find the basic shape and the four-ray star shape shown above, and a few others, and this is where you are willing to create your own figuresfonctions.pde
provides functions for the four up/down left/right corners that are called for every figure
What you can change
In the drawing.pde
script, you can modify the size of the result window. By changing the step value, you change how dense it is filled. The figure variable is only used in the switch that makes you changing the figure quickly.
You can add you own figures in the figures.pde
script. Make sure you understand how the others work.
Repository status: Finished
The project was a short one, the author worked alone on this for a short time. The code is given to the GitHub Community for free, only under th MIT License, that is not too restrictive.
If you want to add some features, just fork the repository. There is no plan to accept Pull Requests, but who knows.
Processing compatibility
As it is a small project, the code has only been tested under Processing 3 (3.5.4). I hope it will work with every older and newer versions.