Problem 1452 - OpenGL driver fails to show orbs, tubes and spheres with radius below 1 nm
Summary: OpenGL driver fails to show orbs, tubes and spheres with radius below 1 nm
Status: RESOLVED FIXED
Alias: None
Product: Geant4
Classification: Unclassified
Component: visualization/OpenGL (show other problems)
Version: 9.6
Hardware: All All
: P5 normal
Assignee: John.Allison
URL:
Depends on:
Blocks:
 
Reported: 2013-03-01 17:36 CET by Václav Štěpán
Modified: 2013-03-06 12:32 CET (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this problem.
Description Václav Štěpán 2013-03-01 17:36:08 CET
OpenGL visualization driver fails to draw HepPolyhedron based solids, namely G4Orb, G4Tubs, G4Sphere with radius less then 1 nm.

In most case a redraw attempt is accompanied by following error message:

Polyhedron::RotateAroundZ: number of generated faces (0) is not equal to the number of allocated faces (24)

This is a message from file source/graphics_reps/src/HepPolyhedron.cc.

John Allison further identified the issue as being related to use of CLHEP::perMillion constant for checking the radius.

Namely, in RotateAroundZ in HepPolyhedron.cc, line 470 the r[i] radii are compared with perMillion and once the user requests r < 1 nm, here it's set to zero.

Setting perMillion=1e-9 for HepPolyhedron, or just changing occurence of perMillion on line 470 to 1.0e-3*perMillion allows us to use r < 1 nm.

(Which is of high importance for detailed DNA models.)
Comment 1 John.Allison 2013-03-06 11:47:37 CET
- HepPolyhedron.cc:
  o Introduced const G4double spatialTolerance = 0.01*nm;
  o Used in RotateAroundZ and in HepPolyhedronSphere and HepPolyhedronTorus
    constructors.
  o Allows creation of nm-sized objects.

Note: This now allows the creation of polyhedral representations of nm-sized volumes for visualisation, but one may still have issues at very high zoom.  For example, if one wishes to see a nm-sized volume in a normal-sized geometry one might wish to zoom in by factors of 1e9 or more.  This stretches the capability of systems that convert to 32-bit floats for internal representation, for example, OpenGL.  If you get a problem, e.g., not drawn at high zoom, try splitting the zoom between "zoom" and "scale".  For example, to achieve a magnification of 1e10, try:

  /vis/viewer/zoomTo 1e5
  /vis/viewer/scaleTo 1e5 1e5 1e5

At high zooms, it is often not easy to find things.  If you know where they are try using "/vis/viewer/set/targetPoint".
Comment 2 Václav Štěpán 2013-03-06 12:32:49 CET
Thank you very much, John.