This projects simulates yarn interactions.
The dependencies are STL, GLM (for upstream code) , Eigen (for matrix calculations), spdlog (for logging) and libigl (for visualization). An optional dependency is Easy Profiler.
Since many dependencies are included as git submodules, you need to run the following commands after you clone the repo.
cd knit-simulation/
git submodule update --init --recursive
git clone https://github.com/g-truc/glm.git # if you don't have GLM installed before
Easy Profiler is used to time the program and help with algorithm optimization. It's intended for developers and not useful for the user.
If you want to avoid this dependency, change set(ENABLE_EASY_PROFILER TRUE)
to FALSE
in CMakeList.txt
.
To insall Easy Profiler, follow the documentation on the project page,
Or follow the following instruction: (source)
git clone https://github.com/yse/easy_profiler.git
cd easy_profiler && mkdir build && cd build
cmake-gui ..
make -j8
sudo make install
Download the release version of easy_profiler here and extract it somewhere. Change the path in set(EASY_PROFILER_DIR "${PROJECT_SOURCE_DIR}/../easy-profiler")
in CMakeLists.txt
to match your easy_profiler folder location.
Compile this project using the standard cmake routine:
mkdir build
cd build
cmake ..
cmake --build .
This should find and build the dependencies and create a knit-simulator
binary.
./knit-simulator <yarns-filename> [-r,--restore] [--no-gui]
[-o,--output-dir <output-directory>] [-v,--verbose] [--quiet]
-r,--restore
: (optional) The simulator will not restore the state and history located in the output directory.--no-gui
: (optional) Start the simulator without GUI. (useful when running on a remote machine)-o,--output-dir <output-directory>
: (optional, default =output/
) Specify the output directory.-v,--verbose
: (optional) Show all logs.--quiet
: (optional) Don't show any logs.
The output directory consists of viewer-state.txt
, position-xxxxx.yarns
, and velocity-xxxxx.yarns
.
The viewer-state.txt
contains number of frames and all the parameters used by the simulator.
This file will be updated at every frame.