|
Line
Link Here
|
| 0 |
-- a/source/geometry/solids/specific/src/G4GenericTrap.cc |
0 |
++ b/source/geometry/solids/specific/src/G4GenericTrap.cc |
|
Lines 252-257
G4GenericTrap::InsidePolygone(const G4ThreeVector& p,
Link Here
|
| 252 |
{ |
252 |
{ |
| 253 |
if(cross*cross<=len2*halfCarTolerance*halfCarTolerance) // Surface check |
253 |
if(cross*cross<=len2*halfCarTolerance*halfCarTolerance) // Surface check |
| 254 |
{ |
254 |
{ |
|
|
255 |
// Check if p lies between the two extrema of the segment |
| 256 |
int iMax; |
| 257 |
int iMin; |
| 258 |
|
| 259 |
if (poly[j].x() > poly[i].x()) { |
| 260 |
iMax = j; |
| 261 |
iMin = i; |
| 262 |
} |
| 263 |
else { |
| 264 |
iMax = i; |
| 265 |
iMin = j; |
| 266 |
} |
| 267 |
if (p.x() > poly[iMax].x() || p.x() < poly[iMin].x()) |
| 268 |
return kOutside; |
| 269 |
|
| 270 |
if (poly[j].y() > poly[i].y()) { |
| 271 |
iMax = j; |
| 272 |
iMin = i; |
| 273 |
} |
| 274 |
else { |
| 275 |
iMax = i; |
| 276 |
iMin = j; |
| 277 |
} |
| 278 |
if (p.y() > poly[iMax].y() || p.y() < poly[iMin].y()) |
| 279 |
return kOutside; |
| 280 |
|
| 255 |
G4double test; |
281 |
G4double test; |
| 256 |
G4int k,l; |
282 |
G4int k,l; |
| 257 |
if ( poly[i].y() > poly[j].y() ) { k=i; l=j; } |
283 |
if ( poly[i].y() > poly[j].y() ) { k=i; l=j; } |