[xcrysden] Print in vector format + anti-aliasing using scripting

Fadjar Fathurrahman break_the_calculus at yahoo.com
Fri Jun 7 11:58:17 CEST 2013


Thank you very much for nice trick to turn on the anti-aliasing, Tone.


I tried to turn off lighting and then try to print the eps file.
I got the following error:

.......

Error in startup script: can't read "toglEPS(pointsize)": no such variable
    while executing
"$togl cry_gl2psPrintTogl GL2PS_EPS GL2PS_NO_SORT  $toglEPS(pointsize) $toglEPS(linewidth) $filename"
    (procedure "scripting::printToFile" line 39)
    invoked from within
"scripting::printToFile view1.eps"
.......

I tried to modify file Tcl/scripting.tcl:

#
# ligting-OFF mode
#
set toglEPS(pointsize) 2.0
set toglEPS(linewidth) 2.0
$togl cry_gl2psPrintTogl GL2PS_EPS GL2PS_NO_SORT \
    $toglEPS(pointsize) $toglEPS(linewidth) $filename

and got the following error:

Error in startup script: wrong # args: should be "toglname cry_gl2psPrintTogl format sort options pointsize linewidth filename"
    while executing
"$togl cry_gl2psPrintTogl GL2PS_EPS GL2PS_NO_SORT  $toglEPS(pointsize) $toglEPS(linewidth) $filename"
    (procedure "scripting::printToFile" line 39)
    invoked from within
"scripting::printToFile view1.eps"

I'm sorry that I don' have familiarity with Tcl language, but how to set the value of 
$toglEPS(pointsize) $toglEPS(linewidth)in this script?


Best regards.

Fadjar


Graduate Student
Department of Precision Science and Applied Physics
Graduate School of Engineering
Osaka University, Suita, Osaka 565-0871, Japan


----- Original Message -----
From: Tone Kokalj <tone.kokalj at ijs.si>
To: xcrysden at democritos.it
Cc: 
Sent: Thursday, June 6, 2013 9:59 PM
Subject: Re: [xcrysden] Print in vector format + anti-aliasing using
scripting

On Thu, 2013-06-06 at 04:59 -0700, Tom Marvollo Riddle wrote:
> Dear all,
> 
> I intend to produce images from several pwscf output files.
> I already used produced some png files using scripting features
> of XCrysden (a very nice feature).
> 
> Unfortunately somehow I need the picture files in vector format.

I would strongly advice against it (unless you will print a few meter
wide picture, you don't need it). The reason is that the vectorial EPS
files are huge (easily over 100 MB unless the number of atoms is really
small).

My recommendation would be: 
1. maximize xcrysden's display window
2. maximize the displayed structure 
3. turn on antialiasing (play a bit with anti-alias settings
Modify->.../Antialias Parameters for good result)
4. print in PNG

> The problem is I cannot find documentation about how to print to
> vector graphics format such as eps using scripting. 

It automatically prints vectorial EPS for "Lighting-Off" mode and a
bitmap one for "Lighting-On" mode (for the above reason). You will have
to modify or write a new procedure/routine (see "proc
scripting::printToFile" in file Tcl/scripting.tcl). If you write a new
routine just embed it into your scripting file.

> I also cannot find a way to turn on anti-aliasing.

There is a clever trick of how to do various features via scripting
(invented by Hande Ustunel Toffoli) and it goes as follows:

1. save the scripting file (File-->Save Current State and Structure)
without the feature turned on. 
2. turn the feature on
3. save a new scripting file
4. compare the two scripting files and find the difference ....

Regards,
-- 
Anton Kokalj
J. Stefan Institute, Jamova 39, 1000 Ljubljana, Slovenia 
(tel: +386-1-477-3523 // fax:+386-1-477-3822)

Please, if possible, avoid sending me Word or PowerPoint attachments.
See:  http://www.gnu.org/philosophy/no-word-attachments.html

_______________________________________________
XCrySDen mailing list
XCrySDen at democritos.it
http://www.democritos.it/mailman/listinfo/xcrysden
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.democritos.it/pipermail/xcrysden/attachments/20130607/5b7a3e24/attachment.htm 


More information about the XCrySDen mailing list