vcg-uvic / viper

Open-source code for VIPER -- Volume Invariant Position-based Elastic Rods
Apache License 2.0
903 stars 105 forks source link

Understanding and extending the repo #9

Closed daniekpo closed 3 years ago

daniekpo commented 4 years ago

I'm working on a project that could benefit from Viper. We'd like to use Viper in our research project but I'm having trouble understanding your code since there are so many single-name variables with no documentation. Is there a naming convention that can help me understand the codebase better?

There seems to be some consistency with the two-letters variable names though, but I'm still not sure how to interpret those or what they represent.

drebain commented 4 years ago

The local variables in the constraint implementations are too numerous and complicated to provide meaningful documentation for beyond referring you to the math in the paper, but the variables that hold the simulation state follow a general pattern:

Prefixes:

Suffixes:

Other:

daniekpo commented 4 years ago

Ok. That's helpful. I'll refer to the paper as well. Thanks.

Entongsu commented 3 years ago

Hi, I have problem in understanding the code . Because in the "Viper" part, ' a ','b' and 'c' appear frequently. I am not sure what is the meaning of this parameter. Could you give me some hints over this. Looking forward to your reply. Thank you.

drebain commented 3 years ago

a, b, and c will usually refer to the indices of the elements that a particular constraint acts on. For example in C_distance_solve, a and b are the indices of the two spheres which are being constrained to have a particular separation.

Entongsu commented 3 years ago

Thank you for your reply. I still have a question for the "Mesh::fromPill" part. I am not sure whether this part is used to create the pills or do another thing? Thank you.

drebain commented 3 years ago

The fromPill function can be used to create a triangle mesh that has the same shape as a given pill. I don't think we are actually using it though.

Entongsu commented 3 years ago

Thank you!

Entongsu commented 3 years ago

Hi, I have a question that the "pills" data contains the position of the triangle mesh points or any other information? Thank you.

drebain commented 3 years ago

Generally, a "pill" primitive consists of two positions and two radii, which together define two spheres. In the simulation code, each pill is also associated with a quaternion which makes it possible to model twisting effects. You can see how the pills are initialized in the simulation here.

Entongsu commented 3 years ago

Thank you for your clarification. And I wonder the "group" means the combination of pills? Looking forward to your reply.

drebain commented 3 years ago

The group id is used to disable self-collision between pills in the same object.

Entongsu commented 3 years ago

Thank you!