Giter Site home page Giter Site logo

jasondenning / patternfy Goto Github PK

View Code? Open in Web Editor NEW

This project forked from caretdashcaret/patternfy

0.0 1.0 0.0 306 KB

Texture Transformation (for Sewing Pattern Generation)

Home Page: http://makezine.com/projects/make-38-cameras-and-av/video-game-plushies/

License: Other

Python 100.00%

patternfy's Introduction

Patternfy

Video Game Plushie

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.

Credits

Created by Jenny - CaretDashCaret

Jenny

License

Patternfy's code is under GPLv3. A copy of GPLv3 can be found at http://opensource.org/licenses/gpl-3.0.html.

Patternfy's art assets are under Creative Commons Attribution-ShareAlike 3.0. A copy of the license can be found at http://creativecommons.org/licenses/by-sa/3.0/.

Development Environment

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.

To Run

Running requires Python 2.7, PIL, and numpy.

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
  • -g or --original is the original 3D obj model
  • -m or --modified is the 3D obj model with modified UVs
  • -t or --texture is a png of the original texture of the 3D model
  • -s or --save is the name to save the output image as

The objects/output.png should be the same as the objects/expected_output.png.

Testing

Running the tests requires nose.

$ nosetests

patternfy's People

Contributors

caretdashcaret avatar albertyw avatar hrs avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.