It has come to my attention that for a STL file, if one looks at at the outward side of an face the order of the vertices should be in counterclock-wise order (right-hand-rule)
Is this also a requirement for a GDML Tessellated Object?
It has come to my attention that for a STL file, if one looks at at the outward side of an face the order of the vertices should be in counterclock-wise order (right-hand-rule)
Is this also a requirement for a GDML Tessellated Object?
Yes, the vertices in G4TriangularFacet and G4QuadrangularFacet should be defined in counterclockwise order.
Thanks. Are there any Geant4 facilities for tracking down a problem with an invalid Tessellated Object?
I assume that by “invalid Tessellated Object” you mean a tessellated object that either:
G4TessellatedSolid itself does not check correctness of its structure.
Orientation of faces can be checked by calculation of volume, it should be positive.
If a tessellated object is closed, then every edge should belong to two faces. Such check is performed at creation of a polyhedron object:
polyhedron->SetReferences();
Seeing this exception
------ Exception----
============================================================
State of Navigator:
The current state of G4Navigator is:
ValidExitNormal= 152
ExitNormal = (0,0,0)
Exiting = 1
Entering = 0
BlockedPhysicalVolume= None
BlockedReplicaNo = -1
LastStepWasZero = 1
Current Localpoint = (-1e-07,0.895,2.8327694e-23)
PreviousSftOrigin = (0,0,0.1800001)
PreviousSafety = 0
Current History:
History depth=1
Level=[0]: Phys Name=[worldVOL_PV] Type=[N]
Level=[1]: Phys Name=[Part] Type=[N]
============================================================
Value obtained from stored global-normal is not a unit vector.
WorldVol_PV contains a World Volume GDMLBox Object and Part contains a GDMLTessellated Object
and we are not understanding the exception.
The exception reports that the normal obtained by the navigator is not a unit vector. Indeed, ExitNormal = (0,0,0). The reason why this happened requires investigation, it could be a bug in G4TessellatedSolid or in the navigator itself.
Any suggestions on how to proceed / progress?
Difficult to advise. Ideally, it would be nice to have a small test case that reproduces the problem.