| Summary: | Bug vertexMap writing Tesselated solids | ||
|---|---|---|---|
| Product: | Geant4 | Reporter: | henri <henri.payno> |
| Component: | persistency/gdml | Assignee: | Gabriele Cosmo <Gabriele.Cosmo> |
| Status: | RESOLVED FIXED | ||
| Severity: | minor | ||
| Priority: | P5 | ||
| Version: | 9.6 | ||
| Hardware: | All | ||
| OS: | All | ||
Thanks for reporting this and for the proposed solution. The fix is now introduced in the development trunk and will be included in the next patch release. |
During exportation of a mesh it seems that some "wanted" vertices are ignored. And the vertexMap is mismatching some relationship. This is due by the fact that the vertexMap define vertices as G4ThreeVector. And the map is based on the G4ThreeVector operator '<'. But this operator simply use the length of each vector to make the comparaison. So we can have different vector (Vertex) but which are evaluated as "equal" by this operator. So during the exportation we can skip a vertex and match with a previous one without correspondence. The problem has been discovered on the Geant4 9.6. version but from what I saw is still present on the 4.10 version. A quick way to fix it is to redefine the operator of comparison by something like : class compareG4_3Vect { public: bool operator()(const G4ThreeVector& t1, const G4ThreeVector& t2 ) { if(t1.x() < t2.x()) return true; if(t1.y() < t2.y()) return true; if(t1.z() < t2.z()) return true; return false; }; }; and modifying the vertexMap by : std::map<G4ThreeVector, G4String, compareG4_3Vect> vertexMap;