Problem 2519 - G4GenericPolycone is incorrectly subtracted in G4SubtractionSolid
Summary: G4GenericPolycone is incorrectly subtracted in G4SubtractionSolid
Status: CLOSED INVALID
Alias: None
Product: Geant4
Classification: Unclassified
Component: geometry/solids (show other problems)
Version: 11.0
Hardware: All All
: P4 normal
Assignee: Evgueni.Tcherniaev
URL:
Depends on:
Blocks:
 
Reported: 2022-12-02 11:03 CET by Egor Frolov
Modified: 2022-12-02 16:50 CET (History)
0 users

See Also:


Attachments
File with bugged geometry (3.41 KB, model/vrml)
2022-12-02 11:03 CET, Egor Frolov
Details
Minimal code reproducing the problem (8.92 KB, application/zip)
2022-12-02 11:12 CET, Egor Frolov
Details
G4GenericPolycone (91.12 KB, image/png)
2022-12-02 16:39 CET, Evgueni.Tcherniaev
Details
G4Polycone (68.24 KB, image/png)
2022-12-02 16:41 CET, Evgueni.Tcherniaev
Details

Note You need to log in before you can comment on or make changes to this problem.
Description Egor Frolov 2022-12-02 11:03:44 CET
Created attachment 792 [details]
File with bugged geometry

In my geometry I need a plate with biconical hole. For this I initially created G4Box and G4GenericPolycone solids (specific values are not important):
  G4Box* solidPlateTMP = new G4Box("solidPlateTMP", 5, 5, 2);
  double Zs[] = { -2.1, 0, 2.1};
  double Rs[] = {2, 1, 2};
  G4GenericPolycone* solidHole = new G4GenericPolycone("solidHole", 177.*deg, 273.*deg, 3, Rs, Zs);
And then create the solid I need:
  G4SubtractionSolid* solidPlate = new G4SubtractionSolid("solidPlate", solidPlateTMP, solidHole, 0, G4ThreeVector(5, 5, 0)); // hole center axis is at the plate's corner.
Comment 1 Egor Frolov 2022-12-02 11:12:54 CET
Created attachment 793 [details]
Minimal code reproducing the problem

(Sorry, accidentally sent unfinished bug report)

As said earlier, G4GenericPolycone resulted in incorrect geometry shown in the attachment#1 [details].
Using G4Polycone with the same parameters instead, however, gives expected result. In the attachment#2 [details] is the minimal code which reproduces the problem. After compilation running ./Geant4_bug produces .wrl geometry file with the bug. If program is run with -f option it will produce .wrl file with correct geometry.
Comment 2 Evgueni.Tcherniaev 2022-12-02 16:39:59 CET
Created attachment 794 [details]
G4GenericPolycone
Comment 3 Evgueni.Tcherniaev 2022-12-02 16:41:44 CET
Created attachment 795 [details]
G4Polycone
Comment 4 Evgueni.Tcherniaev 2022-12-02 16:48:48 CET
Geant4 worked correctly, the reason of the issue is that the solids constructed with G4GenericPolycone and G4Polycone have different shape, please see the images in the attachments.