Skip to content

Commit

Permalink
Merge pull request #160 from OpenBioSim/fix_159
Browse files Browse the repository at this point in the history
Fix issue #159

[ci skip]
  • Loading branch information
chryswoods authored Feb 9, 2024
2 parents cd2fbc6 + 4f72077 commit a74c91b
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions corelib/src/libs/SireVol/triclinicbox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,27 @@ void TriclinicBox::rotate(double precision)
this->is_rotated = false;
}

// Some codes assert reduced form by checking that certain box vector
// components are exactly zero. As such, we need to convert any that
// are sufficiently close to exactly zero.

// First vector must lie along the x-axis.
if (std::abs(this->v0.y()) < 1e-8)
{
this->v0.setY(0);
}
if (std::abs(this->v0.z()) < 1e-8)
{
this->v0.setZ(0);
}

// Second must lie in the x-y plane.
if (std::abs(this->v1.z()) < 1e-8)
{
this->v1.setZ(0);
}


// Now set the box attributes.
this->setAttributes();
}
Expand Down

0 comments on commit a74c91b

Please sign in to comment.