Skip to content

A simulator for Mylar film with C++, openMP.

Notifications You must be signed in to change notification settings

FIGLAB/MylarFilmSimulator

 
 

Repository files navigation

Mylar Simulator

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

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

A simulator for Mylar film with C++, openMP.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 99.6%
  • C 0.2%
  • Python 0.1%
  • CMake 0.1%
  • MATLAB 0.0%
  • Mako 0.0%