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[ 10.5.p1 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]

  1 
  2 #//////////////////////////////////////////////////////////////////////
  3 #//////////////////////////////////////////////////////////////////////
  4 #//////////////////////////////////////////////////////////////////////
  5 
  6 #  Default file format is zb_png. Then a picture produced by using the
  7 # tools::sg offscreen zbuffer, and put in a png file with the tools::fpng png
  8 # file writer.
  9 
 10 #  Default file name is:
 11 #   g4tsg_offscreen_[format]_[index].[suffix]
 12 # with:
 13 # - index: starting at one and incremented at each file production.
 14 # - format:
 15 #     zb_png: tools::sg offscreen zbuffer put in a png file.
 16 #     zb_jpeg: tools::sg offscreen zbuffer put in a jpeg file.
 17 #     zb_ps: tools::sg offscreen zbuffer put in a PostScript file.
 18 #     gl2ps_eps: gl2ps producing eps
 19 #     gl2ps_ps:  gl2ps producing ps
 20 #     gl2ps_pdf: gl2ps producing pdf
 21 #     gl2ps_svg: gl2ps producing svg
 22 #     gl2ps_tex: gl2ps producing tex
 23 #     gl2ps_pgf: gl2ps producing pgf
 24 # - suffix: according to the choosen file format: eps, ps, pdf, svg, tex, pgf, png, jpeg.
 25 
 26 #  You can change the file name with:
 27 #   /vis/tsg/offscreen/set/file <file name>
 28 #  You can change the automatic file name construction with:
 29 #   /vis/tsg/offscreen/set/file auto <prefix> <true|false to reset the index>
 30 
 31 #  Default picture size, in pixels, is the one given when doing a:
 32 #   /vis/open TSG_OFFSCREEN [width]x[height]
 33 # for example:
 34 #   /vis/open TSG_OFFSCREEN 1200x1200
 35 # or by taking the default G4/vis viewer size (600x600):
 36 #   /vis/open TSG_OFFSCREEN
 37 
 38 #  About the picture size, note that the gl2ps files will grow with the number of primitives
 39 # (gl2ps does not have a zbuffer logic). The "zb" files will not grow with the number of
 40 # primitives, but with the size of the viewer. It should be preferred for scenes with
 41 # a lot of objects to render. With zb, to have a better rendering, do not hesitate to
 42 # have a large viewer size.
 43 
 44 #  About transparency, the zb formats handle it. The gl2ps formats don't, in this case you can use:
 45 #   /vis/tsg/offscreen/set/transparency false
 46 # to not draw the transparent objects.
 47 
 48 #//////////////////////////////////////////////////////////////////////
 49 #//////////////////////////////////////////////////////////////////////
 50 #//////////////////////////////////////////////////////////////////////
 51 #  Below is a sequence to produce files at the various formats
 52 # (execute vis.mac first to have some scene to visualize).
 53 #  Note that a TSG offscreen viewer is not an "auto refresh" one, then
 54 # to produce a picture, you have to do:
 55 #   /vis/viewer/rebuild
 56 # (a /vis/viewer/refresh or flush may not be sufficient, for example with plotting).
 57 
 58 /vis/verbose confirmations
 59 
 60 /vis/open TSG_OFFSCREEN
 61 /vis/viewer/rebuild  # to produce the default g4tsg_offscreen_zb_png_1.png file.
 62 /run/beamOn 10
 63 /vis/viewer/rebuild  # to produce g4tsg_offscreen_zb_png_2.png file.
 64 
 65 /vis/tsg/offscreen/set/file auto B5_ true  #true is to reset the index.
 66 /vis/viewer/rebuild  # to produce B5_1.png file.
 67 /run/beamOn 10
 68 /vis/viewer/rebuild  # to produce B5_2.png file.
 69 
 70 /vis/tsg/offscreen/set/format zb_png
 71 /vis/tsg/offscreen/set/file B5_zb.png
 72 /vis/viewer/rebuild
 73 
 74 /vis/tsg/offscreen/set/format zb_jpeg
 75 /vis/tsg/offscreen/set/file B5_zb.jpeg
 76 /vis/viewer/rebuild
 77 
 78 /vis/tsg/offscreen/set/format gl2ps_ps
 79 /vis/tsg/offscreen/set/file B5_gl2ps.ps
 80 /vis/viewer/rebuild
 81 
 82 # gl2ps does not handle transparency, it could
 83 # be usefull to not draw the transparent objects:
 84 /vis/tsg/offscreen/set/transparency false
 85 /vis/tsg/offscreen/set/file B5_no_transparency_gl2ps.ps
 86 /vis/viewer/rebuild
 87 /vis/tsg/offscreen/set/transparency true
 88 
 89 # change picture size:
 90 /vis/tsg/offscreen/set/size 2000 1500
 91 /vis/tsg/offscreen/set/format zb_jpeg
 92 /vis/tsg/offscreen/set/file B5_2000_1500_zb.jpeg
 93 /vis/viewer/rebuild
 94 
 95 # return to the "/vis/open" (/vis/viewer/create in fact) picture size:
 96 /vis/tsg/offscreen/set/size 0 0
 97 
 98 /vis/tsg/offscreen/set/format zb_jpeg
 99 /vis/tsg/offscreen/set/file B5_600_600_zb.jpeg
100 /vis/viewer/rebuild
101 
102 /vis/verbose warnings