| Summary: | GetPointOnSurface() does not return proper distributions for Boolean solids | ||
|---|---|---|---|
| Product: | Geant4 | Reporter: | Michael Kelsey <kelsey> |
| Component: | geometry/solids | Assignee: | Gabriele Cosmo <Gabriele.Cosmo> |
| Status: | RESOLVED DUPLICATE | ||
| Severity: | major | CC: | tatiana.nikitina |
| Priority: | P5 | ||
| Version: | 9.5 | ||
| Hardware: | All | ||
| OS: | All | ||
I repeat here what stated in #1074 ... GetPointOnSurface() is NOT meant to generate a uniform distribution of points on the surface, but allow the fastest possible way to generate them for overlaps checking and debug purposes! What suggested in reports #1074 and #1294 can be considered, but still they're introducing a penalty. In many cases it is practically impossible to have a uniform distribution, or it would require too much CPU time. Boolean solids is one of these, as any possible solid can be part of it and especially when more than two Boolean operations are involved! The current algorithm for Boolean solids is more than reasonable in respect to its specifications. It should be also noticed that for some solids the current approach allows for the generation of more points close to edges or vertices, which is just good for the use which is made of it and for facilitating debugging on critical areas. *** This problem has been marked as a duplicate of problem 1074 *** |
In addition to report #1294, we find that G4BooleanSolid does not generate a proper distribution of surface points either: while(condition) { rand = G4UniformRand(); if(rand > 0.5) { p = fPtrSolidA->GetPointOnSurface(); } else { p = fPtrSolidB->GetPointOnSurface(); } if(Inside(p) == kSurface) { break; } } The "0.5" cut is not correct, since the two constituent solids may well have different surface areas (it doesn't take account of the details of overlap, either, but that could be a performance hit).