Problem 1029 - Possible bug in geometry/solids/specific/src/G4ExtrudedSolid.cc
Summary: Possible bug in geometry/solids/specific/src/G4ExtrudedSolid.cc
Status: RESOLVED FIXED
Alias: None
Product: Geant4
Classification: Unclassified
Component: geometry/solids (show other problems)
Version: 9.1
Hardware: All All
: P5 trivial
Assignee: Ivana Hrivnacova
URL:
Depends on:
Blocks:
 
Reported: 2008-10-29 19:04 CET by Guilherme Lima
Modified: 2008-10-30 12:52 CET (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this problem.
Description Guilherme Lima 2008-10-29 19:04:41 CET
A piece of code looks pretty suspicious around line 543 of geometry/solid/specific/src/G4ExtrudedSolid.cc:

----------
    good = AddFacet( new G4QuadrangularFacet( GetVertex(fNz-1, 3), GetVertex(fNz-1, 2), 
                                              GetVertex(fNz-1, 1), GetVertex(1, 0),
                                              ABSOLUTE) );
-----------

I think that to be consistent, the first argument to GetVertex() should be always fNz-1, otherwise the vertices returned may belong to distinct, inconsistent polygons.

Therefore, my proposed patch is here:

----------
    good = AddFacet( new G4QuadrangularFacet( GetVertex(fNz-1, 3), GetVertex(fNz-1, 2), 
                                              GetVertex(fNz-1, 1), GetVertex(fHz-1, 0),
                                              ABSOLUTE) );
-----------

Thanks,
Guilherme
Comment 1 Guilherme Lima 2008-10-29 19:06:34 CET
A typo: obviously the patch should write fNz-1 rather than fHz.

Sorry for the confusion.
Guilherme
Comment 2 Gabriele Cosmo 2008-10-30 11:05:05 CET
Thanks for the report.
Problem now assigned to the author of G4ExtrudedSolid.
Comment 3 Ivana Hrivnacova 2008-10-30 12:52:19 CET
The proposed fix is correct; the bug was introduced when we moved from a solid
with 2 z-sides only to a general case.
Now corrected in CVS.