Patternify

Patternify

by: Aslan Noorghasemi
Dec. 6, 2019
last update: March 28, 2021

Converting images to beautiful vector-based patterns, useful for 2D and 3D design. Exceptionally useful for artistic laser and water jet cutting projects.

Installation


Clone the repo:

git clone https://github.com/aslan-ng/patternify.git

(My project on Github)

Usage


1. Put your "image.jpg" file in the "input" directory. It is advisable that use high contrast, greyscale pictures to get the best result. The size of the image does not matter that much in that sense.

2. Run "main.py" with your desired parameters. You have to specify some options such as sampling sizes.
As a result, a "pattern_{filter name}.svg" and a "pattern_{filter name}.txt" file will be generated in the project's "result" directory.

3. Use the "pattern_{filter name}.svg" file in your project pipeline.

4. (Optional) The "pattern_{filter name}.svg" file is ready to use, however sometimes some incompatibilities occur in some software, especially 3D modeling criteria. Therefore, the "pattern_{filter name}.txt" file will help carry the necessary information for drawing the shapes. Many modeling software has scripting ability, so a proper script with acquiring the right inputs will result in a native drawing of the shapes. Use your 2D/3D modeling software to run its specific script in the "external support" folder. The script will use the "pattern_{filter name}.txt" file from the last step to draw the shapes. Currently, only Rhino is supported.

Examples


Here is a sample input:
input
"The input sample I've used for my examples"


• Linear Pattern:
This filter, uses closed spline curves to demonstrate the whole picture. These closed curves are structured in a row-based logic.

"Running patternify script in Rhino (linear pattern)"

"A simple animation, model made by patternify in Rhino and rendered in KeyShot"


The result can be used for laser cutting and water jet and any other methods. However, there are lots of use cases in modeling and simulation fields.

laser cut

"Cutting the sample with laser"

"Cutting the sample with laser"


• Circular Pattern:
This is a simple method that uses the radius of circles to demonstrate the luminosity of the group of pixels on the input image.

circular

"Sample of circular pattern .svg (vector) output"

"Running patternify script in Rhino (circular pattern)"


Keywords: