Skip to content

Fix tessellated solid#47

Merged
sethrj merged 1 commit into
celeritas-project:mainfrom
SeverinDiederichs:fix_tessellated
Jun 11, 2026
Merged

Fix tessellated solid#47
sethrj merged 1 commit into
celeritas-project:mainfrom
SeverinDiederichs:fix_tessellated

Conversation

@SeverinDiederichs

Copy link
Copy Markdown
Collaborator

This PR fixes a nasty little bug in the conversion of the tessellated solid:

The VecGeom function AddTriangularFacet differs from the G4TriangularFacet:
In the VecGeom function, the final argument is a simple boolean:

 bool AddTriangularFacet(Vector3D<Precision> const &vt0, Vector3D<Precision> const &vt1,
                          Vector3D<Precision> const &vt2, bool absolute = true)

passing the Geant4 enum ABSOLUTE evaluates to 0:

enum G4FacetVertexType { ABSOLUTE, RELATIVE };

so in this case, it was always set to absolute = false, leading to a bug.

A unit test with a ray is added to make sure the result is as expected.

@SeverinDiederichs SeverinDiederichs added the bug Something isn't working label Jun 11, 2026
@SeverinDiederichs SeverinDiederichs requested a review from sethrj June 11, 2026 14:54

@sethrj sethrj left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Excellent! Thanks for the fix and test.

@sethrj sethrj merged commit 1a6619c into celeritas-project:main Jun 11, 2026
4 checks passed
@SeverinDiederichs SeverinDiederichs deleted the fix_tessellated branch June 11, 2026 15:07
@SeverinDiederichs

Copy link
Copy Markdown
Collaborator Author

Thank you for the quick merge @sethrj. Would it be possible to stamp a new version with the fix in? Then we can update AdePT / Celeritas to pull the latest version including the fix :)
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants