alecjacobson / gptoolbox

Matlab toolbox for Geometry Processing.
MIT License
628 stars 166 forks source link

Consistent index ordering in regular_tetrahedral_mesh #128

Closed sgsellan closed 2 years ago

sgsellan commented 2 years ago

Previously, the ordering convention in the tetrahedral output of this function when choosing the "rotationally symmetric scheme" was inconsistent with the convention used in the rest of this library or even by this function with other schemes.

See, for example:

>> [V,T] = regular_tetrahedral_mesh(2,2,2,'Method','rotationally-symmetric');volume(V,T)

ans =

    -0.1667
    -0.1667
    -0.1667
    -0.1667
    -0.1667
    -0.1667

whereas using another tet division scheme

>> [V,T] = regular_tetrahedral_mesh(2,2,2,'Method','reflectionally-symmetric');volume(V,T)

ans =

    0.1667
    0.1667
    0.1667
    0.1667
    0.1667
    0.1667

After the small change in this PR all the indexing is consistent

>> [V,T] = regular_tetrahedral_mesh(2,2,2,'Method','rotationally-symmetric');volume(V,T)

ans =

    0.1667
    0.1667
    0.1667
    0.1667
    0.1667
    0.1667