Imported .stl files creating stuck tracks

Hello all,

Hopefully this description wont be too vague but I’m not really sure how to narrow down this problem. I am currently attempting to make a geant4 program for measuring the x-ray dose imparted to an object during a CT scan. I am doing this based of example b1 and have been making fast progress until it came to switching the detector geometry to reflect my experimental data.
I use dragonfly to segment my images and convert them to a contour mesh, saving as an stl file which i then import into geant4 using the CADMesh package. I am able to visualise these files in opengl perfectly but when it comes to running an event I experience stuck tracks. Initially I thought this may be related to overlap and mesh hole warnings I was getting so I remade the meshes without decimation/smoothing (using a lower sampling instead) and found this got rid of all the warnings and stuck tracks (yay). Except I have found it still occurs on some of the segmentations despite them giving no warnings.

I have tried using freeCAD to clean up images but it just confirmed that the stl files have no errors or holes. Given my program works for some stls and not others I feel like it must be something to do with the files but I don’t know what. My world volume is much bigger than the bounds of the stl files so that shouldn’t be an issue and I check for overlaps upon placement of the solids but it doesn’t give any warnings.
Can anyone with experience importing stl files into geant4 give any insight into what may be happening? Or otherwise point me in the direction of software that can be reliably used to make stl files from pixelated data volumes?

The error I get is

The current physics model I am using is QBBC which I am not sure is fully valid for energies as low as 45keV but my assumption is that if that was creating this problem it would happen consistently.

Thanks in advance for the help

Do you have in your non-working stl some triangles with very/extremely small aspect ratio?

Thank you for the response!
It could be the case, do you know of a program I could use to check this or revaluate the mesh with more regular triangles?

Out of curiosity though how could oddly shaped triangles create issues with geant4?

could be some algorithms to calculate distances/directions. I had a similar issue:

I would try MeshLab and use the filter “Remeshing: Isotropic Explicit Remeshing”. You will have to play with the parameters to get the best results…

That worked perfectly, thank you!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.