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

Implement second-order convex regions #1125

Merged
merged 4 commits into from
Feb 27, 2024

Conversation

sethrj
Copy link
Member

@sethrj sethrj commented Feb 23, 2024

Follow-on to #1119. This implements:

  • Cone
  • Cylinder
  • Ellipsoid
  • Sphere

There is a bugfix in the deduplication code (adding + 0.0 to clear any potential negative zero flag) to prevent simplified surfaces from having negative zeroes. This will make output more robust and hopefully do the same if -ffast-math is enabled.

@sethrj sethrj requested a review from elliottbiondo February 23, 2024 16:19
@sethrj sethrj added enhancement New feature or request orange Work on ORANGE geometry engine labels Feb 23, 2024
@sethrj sethrj force-pushed the more-convex-regions branch from d39222a to 74bc044 Compare February 26, 2024 21:13
@sethrj sethrj marked this pull request as ready for review February 26, 2024 21:13
@sethrj
Copy link
Member Author

sethrj commented Feb 26, 2024

@elliottbiondo Thanks for reviewing the convex region work! This PR is the next on the list.

src/orange/orangeinp/ConvexRegion.hh Outdated Show resolved Hide resolved
src/orange/orangeinp/ConvexRegion.hh Show resolved Hide resolved
src/orange/orangeinp/ConvexRegion.cc Outdated Show resolved Hide resolved
src/orange/orangeinp/ConvexRegion.cc Outdated Show resolved Hide resolved
src/orange/orangeinp/ConvexRegion.hh Outdated Show resolved Hide resolved
src/orange/orangeinp/ConvexRegion.cc Outdated Show resolved Hide resolved
{
insert_surface(Sense::outside, PlaneZ{-hh_});
insert_surface(Sense::inside, PlaneZ{hh_});
insert_surface(CCylZ{radius_});
Copy link
Contributor

Choose a reason for hiding this comment

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

Why aren't you inserting an interior and exterior bounding box for the cylinder region?

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah, the "known closed" quadric/planar surfaces (axis aligned cylinders, spheres, and planes) automatically generate the correct bounding boxes using the surface clipper. I'll add a note to the convex region builder pointing out the relationship.

src/orange/orangeinp/ConvexRegion.cc Show resolved Hide resolved
@sethrj sethrj enabled auto-merge (squash) February 27, 2024 13:23
@sethrj sethrj merged commit 9e42bd8 into celeritas-project:develop Feb 27, 2024
20 of 21 checks passed
@sethrj sethrj deleted the more-convex-regions branch March 7, 2024 21:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request orange Work on ORANGE geometry engine
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants