Problem 1177 - Visualization of G4Polyhedra with HepRepFile and OGLIX gets stuck in g4.9.4
Summary: Visualization of G4Polyhedra with HepRepFile and OGLIX gets stuck in g4.9.4
Status: RESOLVED LATER
Alias: None
Product: Geant4
Classification: Unclassified
Component: visualization (show other problems)
Version: 9.4
Hardware: PC Linux
: P5 normal
Assignee: perl
URL:
Depends on:
Blocks:
 
Reported: 2011-02-23 11:28 CET by Alex
Modified: 2012-09-07 09:01 CEST (History)
0 users

See Also:


Attachments
The union of 5 rails (10.23 KB, image/png)
2011-11-08 11:03 CET, Alex
Details
A single rail zoomed (3.64 KB, image/png)
2011-11-08 11:04 CET, Alex
Details
Source code of a simple test program to reproduce the bug (4.66 KB, application/octet-stream)
2011-11-08 11:05 CET, Alex
Details

Note You need to log in before you can comment on or make changes to this problem.
Description Alex 2011-02-23 11:28:52 CET
Hello.

I have some G4Polyhedra in my geometry, also I use a box subtraction from the polyhedron. I used to visualize my geometry using HepRepFile system. It worked fine in g4.9.3 (up to patch-02) and now in 4.9.4 it gets stuck with no messages. I tried to trace the problem with gdb/ddd.

I end up somewhere around HepPolyhedronProcessor::execute1. Then I tried also OGLIX and this time it was somewhere around BooleanProcessor::takePolyhedron(). I didn't try the other systems. These functions are called many times (constantly?). I think it comes somehow from the recursive boolean processing announced in 4.9.4. I have to mention that the event simulation seems to work fine, no warnings/stuck.

This is all the information I have at the moment. Unfortunately, I don't have time to dig even deeper. I would appreciate if you can give a hint where the problems can come from, or if you are not able to reproduce the problem, then I could try to provide a small test program that gets stuck (not sure how much time would take this though).

Thank you very much.
Comment 1 Alex 2011-04-11 17:17:38 CEST
Any news on this bug? It still remains in G4.9.4.p01.
Comment 2 Alex 2011-11-08 11:03:27 CET
Created attachment 139 [details]
The union of 5 rails
Comment 3 Alex 2011-11-08 11:04:17 CET
Created attachment 140 [details]
A single rail zoomed
Comment 4 Alex 2011-11-08 11:05:45 CET
Created attachment 141 [details]
Source code of a simple test program to reproduce the bug
Comment 5 Alex 2011-11-08 11:07:01 CET
Hello again,

I tried to dig deeper and found out the source of the problem. We have series of solid unions. The first union is of the rail shape (three united boxes). The 4 of rails are positions in parallel, and then 8 more perpendicular with intersections. It creates a complicated volume and as far as I understood this solid is internally converted to G4Polyhedra for visualization. I guess there appear too many vertices/edges that the BooleanProcessor goes to a very long loop, and cannot handle it (or at least does it very slow). However, if I put 4 parallel and 1 perpendicular rail, it works. Putting 2 perpendicular may work, I did not wait enough, but this outputs warnings:

BooleanProcessor::createPolyhedron : too many edges

Maybe this is not a very good way to create solids, I simplified that in our geometry, but if you consider this as a problem in G4, then I created a very simple test program based on exampleN01+exampleN02. I made comments in src/ExN01DetectorConstruction.cc to explain what cases work and what don't. There is also a vis.mac macro to create a HepRep file. I also attach two pictures of
a) the single rail and
b) the union of 4+1 of them (the maximum that works).

Alex.
Comment 6 perl 2012-09-07 09:01:24 CEST
Because we are aware that the boolean visualization is imperfect, we will save this as a test case for whatever future time when we have sufficient resources to significantly revise the boolean visualization. We thank the user for providing a clear test case.