Patternfy is a script that transforms the textures from one OBJ to another, given two OBJs with the same vertexes and faces, but different UVs.
It can be used for pattern drafting, (creating printable fabric patterns), if the OBJs represent the final sewed object, UVs represent the sewing pattern, and the textures represent the fabric print.
I created this script to turn 3D models (extracted from video games) into stuffed animals, with a procedurally generated sewing pattern that preserves the model's original shape and coloration.
For examples/tutorials see MAKE magazine Vol 38 - DIY Video Game Plushies from 3D Models.
Created by Jenny - CaretDashCaret
It's generally cleaner to set up a development environment. However, you can skip straight to the Run section. Setting up an environment requires virtualenv. Directories may vary depending on operating system.
$ virtualenv ~/.virtualenvs/patternfy $ . ~/.virtualenvs/patternfy/bin/activate $ pip install -r requirements.txt
The requirements.txt contains
numpy for solving matrices,
Pillow for PIL, and
nose for testing.
Pass the appropriate arguments into run.py from the command line.
$ python run.py -g "objects/original.obj" -m "objects/modified.obj" -t "objects/original_texture.png" -s "objects/output.png" $ Patternfy - 2014-03-30 17:13:40,715 - loading texture $ Patternfy - 2014-03-30 17:13:40,741 - loading original OBJ $ Patternfy - 2014-03-30 17:13:40,742 - loading modified OBJ $ Patternfy - 2014-03-30 17:13:40,742 - seam equilizing $ Patternfy - 2014-03-30 17:13:40,743 - transforming image $ Patternfy - 2014-03-30 17:13:41,106 - saving $ Patternfy - 2014-03-30 17:13:41,408 - success
--originalis the original 3D obj model
--modifiedis the 3D obj model with modified UVs
--textureis a png of the original texture of the 3D model
--saveis the name to save the output image as
objects/output.png should be the same as the
Running the tests requires nose.