Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix trapezoid construction for negative phi and older Geant4 #1227

Merged
merged 5 commits into from
May 8, 2024

Conversation

sethrj
Copy link
Member

@sethrj sethrj commented May 8, 2024

Thanks to @mrguilima for pointing out that there was an error in the calculation.

Also fixes #1223 (comment) .

@sethrj sethrj added bug Something isn't working orange Work on ORANGE geometry engine labels May 8, 2024
@sethrj sethrj requested a review from mrguilima May 8, 2024 12:43
src/orange/orangeinp/ConvexRegion.cc Outdated Show resolved Hide resolved
src/orange/orangeinp/ConvexRegion.cc Outdated Show resolved Hide resolved
@sethrj
Copy link
Member Author

sethrj commented May 8, 2024

@mrguilima I've removed the validation checking from phi:

  • Any value is valid and just wraps around as one would expect from sin/cos.
  • Unlike InfWedge, the value is used to construct the shape as opposed to actually being stored on the shape.

If the value were part of the shape's data, we should regularize it so that there's a one-to-one correspondence between values and shapes produced. However, since phi just gets preprocessed into the same points, there's no need to impose extra effort on the user (e.g. it's ok if they want to specify the rotation as 3/4 turn instead of -1/4 turn).

@sethrj sethrj requested review from mrguilima and amandalund May 8, 2024 16:25
@sethrj
Copy link
Member Author

sethrj commented May 8, 2024

Is the proposed removal of validation satisfactory @mrguilima ?

@mrguilima
Copy link
Contributor

Yes, it looks good!
Thanks

Copy link
Contributor

@mrguilima mrguilima left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@sethrj sethrj merged commit d8b245c into celeritas-project:develop May 8, 2024
28 checks passed
@sethrj sethrj deleted the trap-fix branch May 9, 2024 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working orange Work on ORANGE geometry engine
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants