Style Guide¶
This document provides a guide to the style used in this project.
Code Formatting¶
We utilize ClangFormat to automate code formatting. Please format your code before pushing and/or creating a pull request.
Additionally, ensure that your code adheres to the project’s linting rules. Use the provided linting tools to check for any issues before committing your changes.
Naming conventions¶
General¶
In general, we stick to the following naming conventions:
snake_casefor variables, functions, and filenamesPascalCasefor classes and structsALL_CAPSfor constants and enum membersm_prefix for class member variables (if the member is not public)member()to get a class member variable (if the member is not public)set_member()to set a class member variable (if the member is not public)
Specific¶
Vertex positions:
verticesorpositionsVertex displacements:
displacementsVertex rest positions/material coordinates:
rest_positionsVertex velocities:
velocitiesMesh edge matrix:
edgesMesh face matrix:
facesElement vertices: Use a numeral suffix (e.g.,
e0ande1for the end-points of an edge).Edge-edge pairings: Use suffixes
aandb.Continuous collision detection pairs: Use the suffix
_t0for starting values and_t1for end values.Favor the term “collision” over “contact” (but this is not a hard rule).
Prefer the term “potential” over “constraint” when referring to collisions and friction.
Documentation¶
We use Doxygen to generate documentation. Please document your code before pushing and/or creating a pull request.