Problem 2401

Summary: Sample points in G4TessellatedSolid not on surface
Product: Geant4 Reporter: weller <goodluck>
Component: geometryAssignee: Evgueni.Tcherniaev
Status: RESOLVED FIXED    
Severity: minor    
Priority: P4    
Version: 10.7   
Hardware: All   
OS: All   

Description weller 2021-07-21 09:27:43 CEST
Hi,
after importing several parts as ply-files via cadmesh (https://github.com/christopherpoole/CADMesh), I sometimes get geometry warnings even for simple parts such as this box.

Makes it difficult to distinguish between actual overlaps, as for some parts generated points are not inside as in this example but outside

Checking overlaps for volume mesh105 (G4TessellatedSolid) ... 
-------- WWWW ------- G4Exception-START -------- WWWW -------
*** G4Exception : GeomVol1002
      issued by : G4PVPlacement::CheckOverlaps()
Sample point is not on the surface !
          The issue is detected for volume mesh105:0 (G4TessellatedSolid)
          generated point (625.785,-506.69,-149.825) is inside
*** This is just a warning message. ***
-------- WWWW -------- G4Exception-END --------- WWWW -------

mesh105:

ply
format ascii 1.0
comment Created by Blender 2.91.0 - www.blender.org
element vertex 8
property float x
property float y
property float z
property uchar red
property uchar green
property uchar blue
property uchar alpha
element face 12
property list uchar uint vertex_indices
end_header
627.047363 -506.954254 -1.275000 255 255 255 255
627.047363 -77.454247 -530.775024 255 255 255 255
627.047363 -77.454247 -1.275000 255 255 255 255
625.047363 -506.954254 -530.775024 255 255 255 255
625.047363 -77.454247 -530.775024 255 255 255 255
625.047363 -77.454247 -1.275000 255 255 255 255
625.047363 -506.954254 -1.275000 255 255 255 255
627.047363 -506.954254 -530.775024 255 255 255 255
3 0 1 2
3 1 3 4
3 2 4 5
3 0 5 6
3 3 5 4
3 7 6 3
3 0 7 1
3 1 7 3
3 2 1 4
3 0 2 5
3 3 6 5
3 7 0 6
Comment 1 Evgueni.Tcherniaev 2021-07-22 09:46:02 CEST
Thank you for reporting the issue!

The code in G4TriangularFacet::Distance(p) has been improved to have better precision of calculation.