riceroll / inflatStrings

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Mylar Simulator

C++-based simulator for Mylar film, with electrostatic energy, edge length energy, bending energy, boosted with openMP.

To run the code, follow the three steps.

1. Dependency

# install homebrew if not installed
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Install openMP
brew install llvm
brew install libomp
brew upgrade libomp
# Install python dependencies (for svg preprocessing)
# use pip3 if your pip is binded to python2
pip install -r requirements.txt

2. Build

mkdir build
cd build
cmake ..
make
cd ..

3. Run

sh ./run.sh [svg_dir] [resolution] [seam_width]
  • Replace "[svg_dir]" with directory to the svg file.
  • Replace "[resolution]" with the ideal length of triangle edge (default 2).
  • Replace "[seam_width]" with the ideal seam width (default 1).

Example:

sh run.sh ./data/svg/rose.svg 8 0.1

The above script will load a rose pattern, with 8 as triangle edge length and 0.1 as the width of the seams(non-closed curve) on the rose.

The svg can be editted at real-time, the change will be automatically detected and the triangle mesh will be remeshed.

About


Languages

Language:C++ 82.5%Language:Makefile 9.7%Language:CMake 3.4%Language:Python 2.4%Language:C 1.9%Language:MATLAB 0.1%Language:Mako 0.0%Language:C# 0.0%Language:Java 0.0%Language:SWIG 0.0%Language:Shell 0.0%Language:M 0.0%