Skip to content

davepagurek/jalgorithm

 
 

Repository files navigation

A Jalgorithm for Japplying Jeans to Jobjects

teaser

Read the paper

For years, society has been plagued by the lack of a conclusive answer to the question of how arbitrary things would wear jeans, if they wore jeans. This paper proposes a jalgorithm to determine the mathematically optimal configuration of pants on a silhouette, leveraging recent insights in the fields of computer vision and differentiable rendering.

This is based off of the diffvg differential vector graphics renderer. It uses a customized loss function to optimize the vertices of pants, based on the following rules:

  1. Duality of man: Pants should bisect the silhouette of the wearer through its center, covering half its area.
  2. No-stretch jeans: Pants, when applied to the wearer in rest position, should not be so deformed that they no longer resemble prototypical jeans.
  3. (Topologically) torn jean avoidance: Limbs should only go through the open ends of pants, and similarly, closed ends of pants should not intersect limbs.
  4. Dress code compliance: Pants should be on the body of the wearer, not off of it.

Read the paper for more details!

You really shouldn't look at the code for this as I wrote it at 1am really quickly and hackily, but if you really want to, it's in apps/pants.py.

Results

Running the Code

  1. Follow the setup instructions from BachiLi/diffvg
  2. cd apps
  3. python pants.py

About

A Jalgorithm for Japplying Jeans to Jobjects

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 66.1%
  • C++ 27.9%
  • C 3.3%
  • TeX 1.8%
  • Other 0.9%