Conversation
Sync mesh_bugs from main CI dev
…mesh_overlaps_mesh
…f Moeller Trumbore intersections
…intersection checks in mesh_overlaps_mesh
…. Also add test instrument to check for the edge intersection
Collaborator
Author
Collaborator
Author
Collaborator
Author
|
@willend @mads-bertelsen This is almost ready for getting review. I only have one issue which seems to not be connected with this patch. Using the --c-linter on the new test instrument, I get these warnings: |
Contributor
|
@Lomholy, thanks for the update. There seems to be a merge-conflict in union-lib.c: |
Collaborator
Author
You are very welcome. |
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.





Free-form text area
Please describe what your PR is adding in terms of features or bugfixes:
Fixes the bugs mentioned in #2421 .
The errors in the mentioned bug were two fold. Firstly, when placing two boxes such that neithers vertices were within the other, the algorithm for checking what geometries overlaps with which failed.
The fix for this was to add an extra check in the overlap algorithm, to check if the edges of a mesh overlaps with another geometry.
Secondly, when placing a mesh in relation to one arm that is rotated, and placing the master in relation to another arm, the algorithm for checking overlaps would also fail. This was due to the rotation of shell points in the allocate_shell_points function being performed after moving the shell points to the current position, rather than before. This has been fixed.
A new test instrument that previously failed on both these accounts have been added. Thank you to Sam Lambrick for finding these bugs!
Furthermore this PR performs some Quality of life improvements to the Mesh code. Most notable among these is the switch from representing vertices as 9 double arrays, to 1 Coords array, and the addition of an error messages in case the mesh file cannot be opened.
Development OS / boundary conditions
Please describe what OS you developed and tested your additions on, and if any special dependencies are required:
MacOS Tahoe 26.4.1
PR Checklist for contributing to McStas/McXtrace
For a coherent and useful contribution to McStas/McXtrace, please fill in relevant parts of the checklist:
My contribution includes patches to an existing component file
mcdocutility and rendered a reasonable documentation page for the component (please attach as screenshot in comments!)mctestutility to test one or more instruments making use of the component (please attachmcviewtestreport as screenshot in comments)mccode-clangformattool to apply the standard McCode component indentation schememcrun --c-lint"linter" and followed advice to remove most / all warnings that are raisedMy contribution includes a new instrument file
mcdocutility and rendered a reasonable documentation page for the instrument (please attach as screenshot in comments!)%Example:line to describe expected behaviourmcrun --c-lint"linter" and followed advice to remove most / all warnings that are raisedexampleshierarchy in a folder in the style ofexamples/ESS/New_stuff/New_stuff.instrexamplefolder, but if general use I have placed it in the globaldatafolder.My PR is meant to fix a specific, existing issue
My contribution contains something else