modenaxe / msk-bone-deformation

Bone deformation tool designed for applying torsional profiles to bones of musculoskeletal models used in OpenSim
https://simtk.org/projects/bone_deformity
GNU General Public License v3.0
9 stars 2 forks source link

[VTP writer] sometimes indices and coordinates are messed up #2

Open modenaxe opened 3 years ago

modenaxe commented 3 years ago

The model is correct, but the visualization is not.

E.g. bug when fibula_r of Rajagopal model is processed

modenaxe commented 2 years ago

User Axel Koussou (not on GitHub) provided a solution:

% Thus, to fix the bug, you just have to add new_points=[]; before the loop : 

    for n = 1:size(points,1) 
        % compute torsion matrix
        TorsRotMat = RotMat(torsion_angle_func_rad(points(n,axis_ind)));

        % New points and axis
        new_points(n,:) = (TorsRotMat*points(n,:)')';
        new_normals(n,:) = (TorsRotMat*normals(n,:)')';
    end
modenaxe commented 2 years ago

working on this on branch v0.3