Program crashes with the following error messages when visualizing geometry consisting of a boolean intersection of a boolean subtraction of two CSG solids (box & tube). While attempting to draw with OGLIX: ------------------------------------ BooleanProcessor: corrapted input polyhedron BooleanProcessor: intersection with empty polyhedron HepPolyhedron::GetNormal: irrelevant index 1 Segmentation fault While performing ray tracing on same object: -------------------------------------------- Invalid call in G4SubtractionSolid::SurfaceNormal(p), point p is inside rather than on surface *** G4Exception: Aborting execution *** Abort
Problem re-opened. The fix on CSG has been introduced and will be available in the next release. The problem in visualization of Boolean solids is still under investigation...
From Evgeni Chernaev: From first sight it looks like an error in the USER data. Why I think so: - the Ray Tracer and the Boolean Processor are absolutely independed but both failed to render the data; - first message from the BooleanProcessor is: "BooleanProcessor: corrapted input polyhedron" it means that in the subtraction one of the polyhedra (or may be both) had wrong stucture. For this reason the subtraction and then the intersection both returned an empty polyhedron. (John, it seems that there is no protection from attempt to draw an empty polyherdron: HepPolyhedron::GetNormal: irrelevant index 1 Segmentation fault ) That is all what I can say. Unfortunately there is no enough information in the report. Absence of real data does not allow to reproduce the problem and thus to say something certainly.
Fix for protection against empty G4Polyhedron is be submitted shortly.
Additional information from Marc Kippen: The problem with boolean solids that I originally reported also causes errors when tracking particles. The geometry code segment given below shows an example (cylinder clipped by two boxes). I can provide the full source code if needed. //------------------------------ (world volume) G4Box* solidOrig = new G4Box("Orig", 100*cm, 100*cm, 100*cm); G4LogicalVolume* logicOrig = new G4LogicalVolume(solidOrig, Vac, "Orig", 0, 0, 0); G4VPhysicalVolume* physiOrig = new G4PVPlacement(0, G4ThreeVector(0.0, 0.0, 0.0), logicOrig, "Orig", 0, false, 0); (*logicOrig).SetVisAttributes(G4VisAttributes::Invisible); //------------------------------ a detector tube G4RotationMatrix Rot1; G4Transform3D T3D; G4double off = 8.0*cm; G4Tubs* Tubs1 = new G4Tubs("Tubs1", 0.0*cm, 10.0*cm, 5.0*cm, 0.0*pi, 2.0*pi); G4Box* Box1 = new G4Box("Box1", 20.0*cm, 5.0*cm, 10.0*cm); G4Box* Box2 = new G4Box("Box2", 5.0*cm, 20.0*cm, 10.0*cm); T3D = G4Transform3D(Rot1, G4ThreeVector(0.0, off, 0.0)); G4VSolid* dBox1 = new G4DisplacedSolid("Box1", Box1, T3D); T3D = G4Transform3D(Rot1, G4ThreeVector(off, 0.0, 0.0)); G4VSolid* dBox2 = new G4DisplacedSolid("Box2", Box2, T3D); G4VSolid* Bool1 = new G4SubtractionSolid("Bool1", Tubs1, dBox1); G4VSolid* Bool2 = new G4IntersectionSolid("Bool1", Bool1, dBox2); G4LogicalVolume* lBool2 = new G4LogicalVolume(Bool2, matSi,"Bool2", 0, 0, 0); G4VPhysicalVolume* pBool2 = new G4PVPlacement(0, G4ThreeVector(0.0, 0.0, 0.0), lBool2, "Bool2", logicOrig, false, 0); //------------------------------------------------------------------ When this geometry is visualized using the commands /vis/open OGLIX /vis/drawVolume the following error message is produced and nothing is drawn in the graphics window. BooleanProcessor: corrapted input polyhedron Furthermore, if one shoots particles in particular directions, the tracking enters an infinate loop where the particle skips back and forth between two different volumes. Below is an example: /gun/particle geantino /gun/position 0 0 0 cm /gun/direction 0.731 0.629 -0.265 /run/beamOn ### Run 0 start. (printed within UserSteppingAction) PosX PosY PosZ Vol Material ----- ----- ----- ---- -------- 3 2.58 -1.09 Orig Vacuum 3.49 3 -1.26 Bool2 Si 3.49 3 -1.26 Orig Vacuum 3.49 3 -1.26 Bool2 Si 3.49 3 -1.26 Orig Vacuum 3.49 3 -1.26 Bool2 Si 3.49 3 -1.26 Orig Vacuum 3.49 3 -1.26 Bool2 Si 3.49 3 -1.26 Orig Vacuum ... infinite
We believe the current graphics reps handles Marc's geometry. This only addresses the graphics side of his report. The tracking problem might still be outstanding.
We propose the following fixes (extracts from History files): 11th April 2001 John Allison (greps-V03-01-00) - Some code has been added to cover unforeseen earlier situation during preselection of faces without intersection (Evgeni). May 30 2001 Vladimir Grichine geom-solid-bool-V03-01-00 - G4IntersectionSolid: fix in DistanceToIn(p,v) resolving bug observed in problem report #153.