Skip to content

Commit

Permalink
fixes and ref updates
Browse files Browse the repository at this point in the history
  • Loading branch information
andiwand committed Dec 19, 2024
1 parent 5727270 commit c6a4219
Show file tree
Hide file tree
Showing 3 changed files with 395 additions and 385 deletions.
4 changes: 4 additions & 0 deletions Core/include/Acts/Surfaces/BoundaryTolerance.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ class BoundaryTolerance {
throw std::invalid_argument(
"AbsoluteBound: Tolerance must be non-negative");
}
if ((tolerance0 == 0) != (tolerance1 == 0)) {
throw std::invalid_argument(
"AbsoluteBound: Both tolerances must be zero or non-zero");
}
}
};

Expand Down
9 changes: 7 additions & 2 deletions Core/src/Surfaces/TrapezoidBounds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,17 @@ Vector2 TrapezoidBounds::closestPoint(
const double hlXnY = get(TrapezoidBounds::eHalfLengthXnegY);
const double hlXpY = get(TrapezoidBounds::eHalfLengthXposY);
const double hlY = get(TrapezoidBounds::eHalfLengthY);
const double rotAngle = get(TrapezoidBounds::eRotationAngle);

const Vector2 extPosition = Eigen::Rotation2Dd(rotAngle) * lposition;

Vector2 vertices[] = {
{-hlXnY, -hlY}, {hlXnY, -hlY}, {hlXpY, hlY}, {-hlXpY, hlY}};

return detail::VerticesHelper::computeClosestPointOnPolygon(
lposition, vertices, metric.value_or(SquareMatrix2::Identity()));
Vector2 extClosest = detail::VerticesHelper::computeClosestPointOnPolygon(
extPosition, vertices, metric.value_or(SquareMatrix2::Identity()));

return Eigen::Rotation2Dd(-rotAngle) * extClosest;
}

std::vector<Vector2> TrapezoidBounds::vertices(
Expand Down
Loading

0 comments on commit c6a4219

Please sign in to comment.