All Projects → nepluno → Libwetcloth

nepluno / Libwetcloth

Licence: mpl-2.0
A Multi-Scale Model for Simulating Liquid-Fabric Interactions

Projects that are alternatives of or similar to Libwetcloth

navier-stokes-webgl
Stable fluid simulation on GPU using WebGL.
Stars: ✭ 27 (-91.64%)
Mutual labels:  fluid-simulation
CFD
Basic Computational Fluid Dynamics (CFD) schemes implemented in FORTRAN using Finite-Volume and Finite-Difference Methods. Sample simulations and figures are provided.
Stars: ✭ 89 (-72.45%)
Mutual labels:  fluid-simulation
EggAche-GL
EggAche is a Lightweight, Cross-Platform C++ Graphics (GUI) Library
Stars: ✭ 18 (-94.43%)
Mutual labels:  graphics-library
vtkbool
A new boolean operations filter for VTK
Stars: ✭ 77 (-76.16%)
Mutual labels:  graphics-library
bgracontrols
🆗 BGRA Controls is a set of graphical UI elements that you can use with Lazarus LCL applications.
Stars: ✭ 113 (-65.02%)
Mutual labels:  graphics-library
FluidX12
Authors' implementation of our SIGGRAPH Asia 2021 Technical Communications (Viewport-Resolution Independent Anti-Aliased Ray Marching on Interior Faces in Cube-Map Space) demo I. Fast volume rendering using our novel ray marching with smoke simulations by Eulerian grid method for solving Navier-Stokes equation.
Stars: ✭ 26 (-91.95%)
Mutual labels:  fluid-simulation
Nabla
OpenGL/OpenGL ES/Vulkan/CUDA/OptiX Modular Rendering Framework for PC/Linux/Android
Stars: ✭ 235 (-27.24%)
Mutual labels:  graphics-library
Graphene
A thin layer of graphic data types
Stars: ✭ 268 (-17.03%)
Mutual labels:  graphics-library
stable-fluids
A minimal Stable Fluids inspired fluid solver with Python and NumPy.
Stars: ✭ 148 (-54.18%)
Mutual labels:  fluid-simulation
SNaC
A multi-block solver for massively parallel direct numerical simulations (DNS) of fluid flows
Stars: ✭ 26 (-91.95%)
Mutual labels:  fluid-simulation
PbfVs
Implementation of Macklin, Miles, and Matthias Müller. "Position based fluids.". Visual Studio 2015 + CUDA 8.0
Stars: ✭ 100 (-69.04%)
Mutual labels:  fluid-simulation
DiligentFX
High-level rendering components
Stars: ✭ 116 (-64.09%)
Mutual labels:  graphics-library
Goulib
library of useful Python code for scientific + technical applications
Stars: ✭ 38 (-88.24%)
Mutual labels:  graphics-library
react-fluid-animation
Fluid media animation for React powered by WebGL.
Stars: ✭ 57 (-82.35%)
Mutual labels:  fluid-simulation
Learningdirectx12
This repository is intended to be used as a code repository for learning DirectX 12.
Stars: ✭ 256 (-20.74%)
Mutual labels:  graphics-library
shallow-water
Python model solving the shallow water equations (linear momentum, nonlinear continuity)
Stars: ✭ 78 (-75.85%)
Mutual labels:  fluid-simulation
xfg-rs
eXtensible Framegraph
Stars: ✭ 34 (-89.47%)
Mutual labels:  graphics-library
Webclgl
GPGPU Javascript library 🐸
Stars: ✭ 313 (-3.1%)
Mutual labels:  graphics-library
Gl Water2d
2D liquid simulation in WebGL
Stars: ✭ 260 (-19.5%)
Mutual labels:  fluid-simulation
splashsurf
Surface reconstruction library and CLI for particle data from SPH simulations, written in Rust.
Stars: ✭ 18 (-94.43%)
Mutual labels:  fluid-simulation

libWetCloth

libWetCloth

libWetCloth is an open source project for the physical simulation of liquid and wet cloth or yarns. It is cross-platform (Mac OS X, Linux, Windows, and more), and licensed under the Mozilla Public License v. 2.0.

We would like to hear from you if you appreciate this work.

It is the original implementation of paper A Multi-Scale Model for Simulating Liquid-Fabric Interactions ( refer to our project page for more details: http://libWetCloth.info, or http://www.cs.columbia.edu/cg/wetcloth/ ). This code base contains the following parts:

  • A liquid simulator implementing the affine-particle-in-cell method.
  • A cloth simulator implementing the elastic thin shell model.
  • A yarn simulator implementing the discrete elastic rod (DER) / viscous thread model.
  • A cloth/yarn collision handler based on anisotropic elastoplasticity, discretized with augmented, moving least sqaures material point method (AMLS-MPM).
  • A two-way coupling method based on mixture theory, between the cloth, yarn and liquid, handling dragging, buoyancy, capturing and dripping effect.

Directories

The directories of this code repository are structured as following:

libwetcloth
│
└───assets: files to define scenarios
│   │
│   └───buoyancy_tests: scenarios to test buoyancy effects
│   │
│   └───drag_tests: scenarios to test different drag models
│   │
│   └───general_examples: scenarios used in the paper as demos
│   │
│   └───parameter_tests: scenarios to test various liquid materials 
│   │                    and yarn settings
│   │
│   └───ring_tests: the ring test scenario used in the paper
│   │
│   └───unit_tests: simple scenarios to test dynamics and collisions 
│                   (including dry yarn/cloth)
│
└───cmake: CMake files to find packages
│
└───houdini: Houdini scenes to produce renderings used in the paper
│
└───include: thirdparty libraries (Eigen, libIGL, etc.)
│
└───libWetCloth
    │
    └───App: user-interface to interact with simulation
    │
    └───Core: actual simulation code
        │
        └───DER: code for the discrete elastic rods (for yarns/hairs)
        │   │
        │   └───Dependencies: computing the geometric information
        │   │                 used in the discrete elastic rods
        │   │                 model, including the reference/material
        │   │                 frames, reference/material twists, and
        │   │                 the material curvatures.
        │   │
        │   └───Forces: computing the stretching, bending, and twisting
        │               forces and their Jacobians.
        │
        └───ThinShell: code for the discrete elastic thin shell
        │   │          (for triangular clothes) 
        │   │
        │   └───Forces: computing the stretching and bending forces, as
        │               well as their Jacobians.
        │
        └───PCGSolver: PCG solver with the MIC preconditioner

Dependencies

libWetCloth depends on following libraries (some of them have been included in the code base for all platforms, marked with an asterisk):

On Mac OS X or Linux-based systems, most of the dependencies are either included, or can be easily installed with Homebrew (https://brew.sh) or the APT package handling utility. For Intel TBB, you may download and install from the link provided above, or from Intel website (https://software.intel.com/en-us/parallel-studio-xe/choose-download).

On Windows you may need manually download and compile some of them (e.g. AntTweakBar, TBB, libPNG). For the ease of compilation, we provide a package containing all the headers and pre-compiled thirdparty libraries (except for those that have been included for all platforms). Please refer to the On Windows section below for more details.

You may also compile a version that directly run simulation in the console, by turning off the USE_OPENGL switch in the CMake settings. When this switch is turned off, dependencies such as GLUT, libPNG, zlib, and AntTweakBar are no longer necessary to compile libWetCloth.

For more details, please refer to the compilation section below.

Compilation

libWetCloth has been tested with Clang (under Mac OS X), GCC 4.8+ (under Linux), and Microsoft Visual Studio (under Windows 10).

To compile libWetCloth, you'll need CMake on Mac OS X or Linux, or CMake-GUI (https://cmake.org) on Windows.

On Mac OS X or Linux:

  1. make a <build> directory, say, just build, with mkdir build, enter the <build> directory, type cmake ..
  2. Optionally you can adjust the options with ccmake .. In some cases there can be some packages that cmake cannot find. You need to manually specify their paths through ccmake then.
  3. type make to compile the code. For speeding up the compilation process you may use make -j.

On Windows:

You may download the pre-compiled package (http://www.cs.columbia.edu/cg/raymond/libwetcloth_thirdparty_win64.zip) that contains the x64 pre-compiled binaries for AntTweakBar, Intel TBB, GLUT, libPNG and zlib, unpack it somewhere, and then specify the missing directories to the path containing the headers or the compiled libraries. If you compile it manually, please make sure you have picked the libraries corresponding to the architecture you have selected (say, 32-bit libraries for x86, and 64-bit libraries for x64).

If our provided third-party libraries are used, the following CMake variables should be set before configuration (replace the <libwetcloth_thirdparty_win64> with the actual unpacked directory path):

  • ANT_TWEAK_BAR_INCLUDE_DIR: <libwetcloth_thirdparty_win64>/include/AntTweakBar
  • ANT_TWEAK_BAR_LIBRARY: <libwetcloth_thirdparty_win64>/lib/AntTweakBar64.lib
  • GLUT_INCLUDE_DIR: <libwetcloth_thirdparty_win64>/include
  • GLUT_glut_LIBRARY_DEBUG: <libwetcloth_thirdparty_win64>/lib/glut32.lib
  • GLUT_glut_LIBRARY_RELEASE: <libwetcloth_thirdparty_win64>/lib/glut32.lib
  • PNG_LIBRARY_DEBUG: <libwetcloth_thirdparty_win64>/lib/libpng16_static.lib
  • PNG_LIBRARY_RELEASE: <libwetcloth_thirdparty_win64>/lib/libpng16_static.lib
  • PNG_PNG_INCLUDE_DIR: <libwetcloth_thirdparty_win64>/include/libpng
  • TBB_INCLUDE_DIRS: <libwetcloth_thirdparty_win64>/include
  • TBB_tbb_LIBRARY_DEBUG: <libwetcloth_thirdparty_win64>/lib/tbb_debug.lib
  • TBB_tbb_LIBRARY_RELEASE: <libwetcloth_thirdparty_win64>/lib/tbb.lib
  • ZLIB_INLCUDE_DIR: <libwetcloth_thirdparty_win64>/include/zlib
  • ZLIB_LIBRARY_DEBUG: <libwetcloth_thirdparty_win64>/lib/zlibstatic.lib
  • ZLIB_LIBRARY_RELEASE: <libwetcloth_thirdparty_win64>/lib/zlibstatic.lib
  1. open CMake-GUI, enter the correct directory for source code and build. Then click Configure, choose your installed version of the Microsoft Visual Studio.
  2. after configuration you may find several libraries not found (with notifications of errors), check the Advanced box and specify those missing header path and libraries manually. For example, if Eigen is missing, then please specify the EIGEN3_INCLUDE_DIR to the path of directory we provided.
  3. click generate after fixing all missing variables to generate your Visual Studio solution.
  4. open the Visual Studio solution and compile the code.
  5. before running the demo, all the compiled dynamic linking libraries (DLLs) for your dependencies should be accessible from the executable. The DLLs should be either in the same directory with the executable, or your PATH environment variable that can be changed in system settings. You may copy the DLLs (we include them in <libwetcloth_thirdparty_win64>/bin as the pre-compiled version) to the path of the compiled executable (<build>/libWetCloth/App/Release or <build>/libWetCloth/App/Debug) or you may simply copy them into your System32 (x64) or SysWOW64 (x86) directories.

Run the Demo

To run the demo of libWetCloth, you may simply use the command line argument -s [scene_file] to specify the scene to be loaded. Besides of the WetCloth library, we also have a user interface named WetClothApp where you may watch and tune the simulation interactively. For example, you may type

./WetClothApp -s ../assets/general_examples/splash_cloth_small.xml

under the <build>/libWetCloth/App directory to run the simulation of the scene containing a water ball splashes on a small cloth.

All the parameters can be modified offline in the scene description XML files. Some can be changed online in the user interface provided by the demo program.

USAGE:

   ./WetClothApp -s <string> [-i <string>] [-o <integer>] [-g <integer>] [-d <boolean>] [-p <boolean>] [--] [--version] [-h]

Where: 
   -s <string>,  --scene <string>
     (required)  Simulation to run; an xml scene file

   -i <string>,  --inputfile <string>
     Binary file to load simulation pos from

   -o <integer>,  --outputfile <integer>
     Binary file to save simulation state to

   -g <integer>,  --generate <integer>
     Generate PNG if 1, not if 0

   -d <boolean>,  --display <boolean>
     Run the simulation with display enabled if 1, without if 0

   -p <boolean>,  --paused <boolean>
     Begin the simulation paused if 1, running if 0

   --,  --ignore_rest
     Ignores the rest of the labeled arguments following this flag.

   --version
     Displays version information and exits.

   -h,  --help
     Displays usage information and exits.

Surface Reconstruction and Rendering with Houdini

The Houdini projects are also provided in the "houdini" folder, which are used for surface reconstruction and rendering purposes. Our simulator can generate data that can be read back by the Python script in our Houdini projects.

You may run the demo with the "-o" option, under the folder containing Houdini projects (by default, [project source]/houdini/). For example, you may type

../build/libWetCloth/App/WetClothApp -s ../assets/parameter_tests/pore_test_mid.xml -o 20

under the folder containing Houdini projects to generate data per 20 time steps (for this example we use 0.0002s for the simulation time step, and 0.004s for the rendering time step. Hence 20 time steps is taken for the data generation). The simulation code will create a folder with the name of the scene file under this folder ([project source]/houdini/pore_test_mid for this example), which can be read back by the Houdini project with the same name.

After some data generated, you may open the corresponding Houdini project to watch and operate on them. We use the nodes with suffix "bake" to indicate the usage of baking. For example in the "fluids_bake" node, the fluid particles will be read and used to reconstruct a polygonal liquid surface, which will then be stored as Houdini geometry files.

The baked geometries are then read back by the nodes with prefix "geo", which can be used for rendering.

You may check the Mantra nodes in the output classifier for the rendering settings. You can also connect these nodes to HQueue nodes for distributed rendering on a render farm.

Houdini 16.5 is used for our case. You may need an equivalent or higher version to open the project files. For more information and tutorials of Houdini, please visit the SideFX website (https://www.sidefx.com/).

Contact

Please contact the author ([email protected]) for questions and bug report, or consulting for the usage of this code base.

BibTex Citation

@article{Fei:2018:MMS:3197517.3201392
author = {Fei, Yun (Raymond) and Batty, Christopher and Grinspun, Eitan and Zheng, Changxi},
title = {A Multi-scale Model for Simulating Liquid-fabric Interactions},
journal = {ACM Trans. Graph.},
issue_date = {Aug 2018},
volume = {37},
number = {4},
month = aug,
year = {2018},
pages = {51:1--51:16},
articleno = {51},
numpages = {16},
url = {http://doi.acm.org/10.1145/3197517.3201392},
doi = {10.1145/3197517.3201392},
acmid = {3201392},
publisher = {ACM},
address = {New York, NY, USA},
keywords = {fluid dynamics, particle-in-cell, mixture theory, two-way coupling, wet cloth},
}

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].