This is an example of how to use the netdem library.
#include <iostream>
#include <string>
using namespace std;
int GeometricSolver(int argc, char **argv);
int GJKSolver(int argc, char **argv);
int SDFSolver(int argc, char **argv);
int HybridSolver(int argc, char **argv);
int main(
int argc,
char **argv) {
if (argc == 1) {
cout << "please specify the id of the task. \n"
<< "e.g.: netdem_example_random_packing i" << endl;
cout << ">> 0: sphere" << endl;
cout << ">> 1: convex triangle mesh based on gjk" << endl;
cout << ">> 2: concave triangle mesh based on sdf" << endl;
cout << ">> 3: hybrid solver by automatically selecting geometric, gjk and "
"sdf solver"
<< endl;
return -1;
}
int id = atof(argv[1]);
switch (id) {
case 0:
GeometricSolver(argc, argv);
break;
case 1:
GJKSolver(argc, argv);
break;
case 2:
SDFSolver(argc, argv);
break;
case 3:
HybridSolver(argc, argv);
break;
default:
break;
}
return 0;
}
int main(int argc, char *argv[])
Definition main.cpp:18