| Summary: | Clipping box behaviour with scene handler seems strange | ||
|---|---|---|---|
| Product: | Geant4 | Reporter: | Michael Kelsey <kelsey> |
| Component: | visualization | Assignee: | Laurent Garnier <laurent.garnier> |
| Status: | ASSIGNED --- | ||
| Severity: | minor | CC: | John.Allison |
| Priority: | P4 | ||
| Version: | 10.5 | ||
| Hardware: | All | ||
| OS: | All | ||
| Attachments: |
complete detector disk with mask pattern, zoomed x3
clipped (1 x 1 x .27 cm) section of mask and detector, zoomed x3 |
||
Created attachment 542 [details]
clipped (1 x 1 x .27 cm) section of mask and detector, zoomed x3
Hi Mike My attention has been drawn to this old bug report. You and I have been working on improving visualisation of fields - does it help solve the problems? John Sorry. That last message was meant for another bug report. Sorry again. No it *was* meant for you, Mike. May I close this report now? John I'm not able to reproduce either the problem or success using G4 10.6. With the "clipping" macro fragment, I'm getting errors:
-------- WWWW ------- G4Exception-START -------- WWWW -------
*** G4Exception : visman0202
issued by : G4Scene::CalculateExtent
Scene has no extent. Please activate or add something.
The camera needs to have something to point at!
Add a volume. (You may need "/run/initialize".)
Or use "/vis/scene/add/extent".
"/vis/scene/list" to see list of models.
*** This is just a warning message. ***
-------- WWWW -------- G4Exception-END --------- WWWW -------
-------- WWWW ------- G4Exception-START -------- WWWW -------
*** G4Exception : visman0106
issued by : G4VSceneHandler::ProcessScene
The scene has no extent.
*** This is just a warning message. ***
-------- WWWW -------- G4Exception-END --------- WWWW -------
I have tried using both the PV name and the LV name for the detector, both give the same message as above. Have the visualization commands really changed?
Some more focussed information: The visman0202 G4Scene::CalculateExtent() error happens immediately after the line /vis/scene/add/volume Detector ! ! *box cm -2 -1 1 2 1.4 2.0 in my macro. The is the same line which worked fine in G4 10.5 (which I used to create the "clipped section" attachment). The same visman0202 error occurs if I have no configuration arguments, and just try to add the full volume. It seems like something has changed between 10.5 and 10.6, such that I not only cannot verify that the original problem is fixed, but even the basic volume drawing now fails. I can say that the basic "wrapper" command, /vis/drawVolume, works fine. This behaviour makes no sense. I just found and read G4VisCommandDrawVolume::SetNewValue() (in G4VisCommandsCompound.cc). The /vis/drawVolume command is exactly identical with the three primitive commands I quoted above. Why does the compound command work where the individual commands, in exactly the same session, do not? |
Created attachment 541 [details] complete detector disk with mask pattern, zoomed x3 I am trying to get a magnified (not "zoomTo") view of a portion of my geometry, including some detailed field vectors. Because of the way the field visualization is done, I need to have a Vis scene with a limited extent. I cannot do this with the /vis/scene/add/extent command, because the world volume being drawn will take precedence when computing the overall extent. I have tried using /vis/scene/add/volume, with a clipping box. The clipping box "should" produce a limited extent and visualize the limited piece of my geometry properly, but it doesn't seem to do so. My geometry consists of a 10 x 10 x 3.3 cm disk, with a pattern of rectangles on the top surface (generated using G4PVParameterised), which is a daughter of the overall "Detector" volume. The "full_mask" drawing attached shows /vis/drawVolume Detector /vis/viewer/zoomTo 3 /vis/viewer/panTo -1 3 cm /vis/viewer/flush My goal is to cut out a small rectangle from the upper surface of the disk, so I can see the details of the electric field in that region only. I used the commands /vis/scene/create /vis/scene/add/volume Detector ! ! *box cm -2 -1 1 2 1.4 2.0 /vis/sceneHandler/attach /vis/viewer/zoomTo 3 /vis/viewer/panTo -1 3 cm /vis/viewer/flush which are shown in the "clip-mask" drawing. 1) With the same zoomTo factor, the two pictures are not at the same scale (the clipped version is magnified more). 2) The parameterized pattern is kind of weird inside the clipping region: some rectangles are clipped off as I'd expect, while others along the edge are missing entirely. 3) Some of the parameterized pattern is drawing outside the clipping region, but not the whole disk. Not shown here, but when I try to do the field visualization, the clipping box is _not_ used as the scene extent. Instead, the full Detector volume is used, which means I don't get the field sampled inside the clipping box the way I want it to be. I am not sure that the volume clipping is being propagated to the scene extent values the way that I'd expect.