Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
CMakeLists.txt.user
CMakeCache.txt
CMakeFiles
CMakeScripts
Testing
Makefile
cmake_install.cmake
install_manifest.txt
compile_commands.json
CTestTestfile.cmake
_deps
CMakeUserPresets.json
build

4 changes: 1 addition & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
cmake_minimum_required(VERSION 3.13 FATAL_ERROR)

find_package(CUDAToolkit 11 REQUIRED)

project(TinyVBD LANGUAGES CXX)

## Use C++11
set (CMAKE_CXX_STANDARD 11)
set (CMAKE_CXX_STANDARD 17)
find_package(Eigen3 REQUIRED)
include_directories(${EIGEN3_INCLUDE_DIR})

Expand Down
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ A tiny version of VBD, focused on mass spring strand simulation.
This code is a tiny demo of our Siggraph 2024 paper: <br />
[Vertex Block Descent](https://arxiv.org/abs/2403.06321 "The NEXT simulator")

The only dependency is Eigen3.
The only dependency is Eigen3. https://eigen.tuxfamily.org/index.php?title=Main_Page

If you compile and run it, it will output the simulation results as a series of JSON files to C:\Data\Test_20Verts_30degree_withSkip_stiffness1e8.
You can use the VisualizeStrand.blend to convert them to obj files for visualization.
If you compile and run it, it will output the simulation results as a series of JSON files to a subdirectory of where it is run.

You can use the VisualizeStrand.blend to convert those to fbx files for visualization. This is a Blender python scripting file that is used to convert the JSON output of the program into geometry.

The default configuration will run the high mass ratio experiment.
Except for the default configuration, there are other experiment configs that you can try, all you need is to uncomment those options.
Except for the default configuration, there are other experiment configs that you can try, all you need is to uncomment those options.

Binary file modified VisualizeStrand.blend
Binary file not shown.
9 changes: 7 additions & 2 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@
#endif

inline bool saveJson(std::string filePath, nlohmann::json& j, int indent = -1) {
std::filesystem::path path(filePath);

std::filesystem::create_directories(path.parent_path());

std::ofstream ofs(filePath);

if (ofs.is_open())
{
try
Expand Down Expand Up @@ -120,7 +125,7 @@ struct StrandSim
std::vector<float> ls;
float m0 = 1;
float m1 = 1000;
params.outPath = "C:\\Data\\Test4_20Verts_30degree_withSkip_stiffness1e8";
params.outPath = "Test4_20Verts_30degree_withSkip_stiffness1e8"; // this is a multi-platform toy app, let the files land where they do

std::vector<float> ms;

Expand Down Expand Up @@ -159,7 +164,7 @@ struct StrandSim
bool addSkipSpring = true;
float skipSpringStrength = 100;
float tanAngle = 0.57735f; // 30 deg
params.outPath = "C:\\Data\\Test4_20Verts_30degree_withSkip_stiffness1e8";
params.outPath = "Test4_20Verts_30degree_withSkip_stiffness1e8"; // this is a multi-platform toy app, let the files land where they do

params.useAcceleration = false;
params.accelerationRho = 0.5;
Expand Down