Conversation
Member
|
who are you? this looks like some AI spam to me |
Repository owner
closed this by deleting the head repository
Aug 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds conservative, opt-in recognition of box-shaped OCE/STEP solids during conversion to Geant4.
When nativePrimitives=True, eligible CAD bodies are converted to native Geant4 Box solids instead of TessellatedSolid. The existing tessellated conversion remains the fallback whenever the body cannot be recognised conservatively.
The feature is disabled by default:
oce2Geant4(..., nativePrimitives=False)This is intended as a first step toward broader native primitive recognition; this PR is deliberately limited to boxes.
Recognition
Box recognition checks the OCE surface topology and reconstructs the box from the in-memory tessellated vertices.
Recognition requires six planar faces, exactly eight unique vertices, three mutually orthogonal box axes, reconstruction within a strict numerical tolerance, and a right-handed local basis.
Bodies which do not satisfy these conditions continue to use the existing tessellated representation.
Placement handling
Native reconstruction can introduce a local box centre and basis which must be composed with the original OCE placement.
The conversion applies the corresponding local transform before constructing the PhysicalVolume, with explicit checks that the resulting rotation remains orthonormal and proper.
Tests
Regression coverage includes feature-off compatibility, native box replacement while retaining tessellated fallback, solid-type/count changes, rotated-box reconstruction, and right-handed basis enforcement.
The pure reconstruction/handedness regression is separated from the platform-specific OCE integration test so it can also run on Linux.
Repository pre-commit checks pass for the modified files, and the native-box pytest targets pass locally.
Additional validation
The implementation was also exercised against an arbitrary-3D validation fixture containing 21 transformed box placements. Exact world-coordinate comparison passed for all 21 placements with a maximum discrepancy of approximately 1.3e-13 mm, and recursive Geant4 overlap validation reported zero overlaps.
These external validation checks are additional development evidence rather than part of the upstream test suite.