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.
Naming conventions¶
General¶
In general, we stick to the following naming conventions:
snake_case
for variables, functions, and filenamesPascalCase
for classes and structsALL_CAPS
for 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:
vertices
orpositions
vertex displacements:
displacements
vertex rest positions/material coordinates:
rest_positions
vertex velocities:
velocities
mesh edge matrix:
edges
mesh face matrix:
faces
element vertices: we use a numeral suffix (e.g.,
e0
ande1
for the end-points of an edge)edge-edge pairings: suffix of
a
andb
continuous collision detection pairs: suffix of
_t0
for starting values and_t1
for end valuesfavor the term “collision” over “contact” (but this is not a hard rule)
we prefer the term “potential” over “constraint” when referring to the collisions and friction
Documentation¶
We use Doxygen to generate documentation. Please document your code before pushing and/or creating a pull request.