Skip to content

Commit

Permalink
Fixed subframes inversion in rotation for python
Browse files Browse the repository at this point in the history
  • Loading branch information
pariterre committed Jun 26, 2024
1 parent a35c545 commit 4bd161b
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions binding/python3/ezc3d_python.i
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,11 @@ PyObject * _get_analogs(const ezc3d::c3d& c3d, const std::vector<int>& analogs)
for (size_t f = 0; f < nFrames; ++f)
for (size_t sf = 0; sf < nSubframes; ++sf)
for (int a = 0; a < nAnalogs; ++a)
data[nSubframes*nFrames*a + sf+nSubframes*f] = c3d.data().frame(f).analogs().subframe(sf).channel(analogs[a]).data();
data[
f * nSubframes +
sf +
a * nSubframes * nFrames
] = c3d.data().frame(f).analogs().subframe(sf).channel(analogs[a]).data();

// Export them to Python Object
int nArraySize = 3;
Expand Down Expand Up @@ -168,8 +172,8 @@ PyObject * _get_rotations(
for (size_t i = 0; i<4; ++i){
for (size_t j = 0; j<4; ++j){
data[
f +
sf * nFrames +
f * nSubframes +
sf +
r * nSubframes * nFrames +
j * nRotations * nSubframes * nFrames +
i * 4 * nRotations * nSubframes * nFrames
Expand Down

0 comments on commit 4bd161b

Please sign in to comment.