-
Notifications
You must be signed in to change notification settings - Fork 14
Instructions
To use the DSC method, simply follow these few steps:
The easy solution is to use the setup provided in the DEMO folder (the demo.cpp, user_interface.h, user_interface.cpp and draw.h source files). If you choose this solution, you only have to change the motion functions (motion1(), motion2() etc. in user_interface.cpp) to load the model you want to use and to use your own velocity function (see step 2).
If you want to use your own setup, feel free to do so. You only need to load a model, create a DeformableSimplicialComplex object and a velocity function object to start using the method.
Create a your own velocity function class which extends the VelocityFunc class. This class should as minimum override the get_name() and deform() functions. The get_name() function should return a string with the name of the velocity function and the deform() function should have the following signature:
-
For each interface node **n** in the dsc-
Calculate a new position **p** according to the velocity function -
Call _set_destination_( **n**, **p** )
-
-
Call _deform_()
Three examples of velocity functions can be found in the repository in the DEMO folder: A rotation function (rotate_function.h), a function which smooths the model (average_function.h) and a function which moves the interface in the normal direction (normal_function.h).
When the DeformableSimplicialComplex object is constructed, several parameters are set to control the min/max edge length, min/max angle etc. of the simplicial complex. You can change these parameters by extending the DeformableSimplicialComplex class and override the constructor.