Skip to content

Commit

Permalink
portal: PR feedback round 2
Browse files Browse the repository at this point in the history
  • Loading branch information
paulgessinger committed Aug 28, 2024
1 parent 15462e8 commit 0292e99
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions Core/include/Acts/Definitions/Algebra.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,6 @@ using AngleAxis3 = Eigen::AngleAxis<ActsScalar>;
using Transform2 = Eigen::Transform<ActsScalar, 2, Eigen::AffineCompact>;
using Transform3 = Eigen::Transform<ActsScalar, 3, Eigen::Affine>;

constexpr ActsScalar s_transformEquivalentTolerance = 1e-9;

} // namespace Acts
6 changes: 4 additions & 2 deletions Core/src/Geometry/Portal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

#include "Acts/Geometry/Portal.hpp"

#include "Acts/Definitions/Algebra.hpp"
#include "Acts/Geometry/GeometryContext.hpp"
#include "Acts/Geometry/PortalLinkBase.hpp"
#include "Acts/Geometry/TrivialPortalLink.hpp"
Expand Down Expand Up @@ -143,7 +144,7 @@ Result<const TrackingVolume*> Portal::resolveVolume(
const Vector3& direction) const {
assert(m_surface != nullptr);
const Vector3 normal = m_surface->normal(gctx, position);
Direction side = Direction::fromScalar(normal.dot(direction));
Direction side = Direction::fromScalarZeroAsPositive(normal.dot(direction));

const PortalLinkBase* link = side == Direction::AlongNormal
? m_alongNormal.get()
Expand Down Expand Up @@ -303,7 +304,8 @@ bool Portal::isSameSurface(const GeometryContext& gctx, const Surface& a,
return false;
}

if (!a.transform(gctx).isApprox(b.transform(gctx), 1e-9)) {
if (!a.transform(gctx).isApprox(b.transform(gctx),
s_transformEquivalentTolerance)) {
return false;
}

Expand Down

0 comments on commit 0292e99

Please sign in to comment.