Grafik vektor bagus untuk tujuan ilustrasi. Molekul terdiri dari atom yang dihubungkan oleh ikatan. Saya ingin operasi pengeditan gambar struktur kimia dilakukan sesuai dengan struktur fisik molekul: pilih atom, transfer, putar fragmen molekul, tanda ... Hampir semua visualisator ekspor struktur atom tampilan ke raster, yang mempersulit persiapan ilustrasi. Dalam posting ini, saya akan menjelaskan cara merender struktur 3D dalam format vektor, dan bagaimana PostScript dapat membantu Anda dalam hal ini .
Cukup banyak program yang dapat mengekspor struktur ke grafik vektor: SVG, PDF, EPS. Namun, ini sering dilakukan hanya secara formal - gambar yang dihasilkan terdiri dari banyak gambar primitif, hampir tidak mungkin untuk membongkar mereka dengan atom dan ikatan. Ukuran file vektor semacam itu juga besar, singkatnya, ini bencana. Dari sekian banyak konstruktor molekuler, hanya dua yang memenuhi kualitas kode gambar vektor: GaussView dan Molden . Program terakhir tersedia untuk semua orang, jadi contoh dibuat dengan bantuannya, namun, semua resep di bawah ini dapat diterapkan (dengan beberapa modifikasi) pada ilustrasi vektor yang dibuat oleh program GaussView. Jadi Molden!
, PostScript.
PostScript
:
%!PS-Adobe-2.0 EPSF-2.0
%%Title: Molden
%%For: Schaft
%%Creator: Drs G Schaftenaar
%%DocumentFonts: Courier
%%Pages (atend)
%%BoundingBox: 0 0 612 792
%%EndComments
%
%###### User Preferences ############
%
%---- SIZE AND ORIENTATION OF THE PLOT ---
%
/size { 0.24 } def
%---- These number can be negative -------
/originx { 39.0 } def
/originy { 753.0 } def
/angle { -90.0 } def
%For Portrait use
%/originx { 40.0 } def
%/originy { 240.0 } def
%/angle { 0.0 } def
%and BoundingBox: 25 255 535 765
- \doatom
, - \dorod
. Molden.
%---- Include Tabel & Logo, Fontsize -----
/tabel {true} def
/titleandlogo {true} def % false!
, 4082 . .
.
%---- SET BOND RENDERING: ---------------
%---- shadedrod, whiterod, blackrod -----
%
/doatom { dosketchysmoothatom } def
/dorod { sketchyshadedrod } def
%
% ( )
/dosketchysmoothatom % doatom
{ gsave
rx ry translate
90 -15 1 % 90 1 1 -
{ gsave
dup cos hue exch satu exch sethsbcolor sin dup scale
newpath
0 0 rad 0 360 arc
closepath fill grestore } for
grestore } def
/sketchyshadedrod
{ gsave
x1 y1 translate
x2 x1 neg add
y2 y1 neg add
{atan neg rotate} stopped not {
85 -15 0 % 87 -3 0 -
{dup
gsave
newpath
cos 1.0 cosb 0.5 mul neg add mul
hue exch satu exch sethsbcolor
sin 1.0 scale
1 cosb scale
0 0 hd 0 180 arcn
x2 x1 neg add dup mul
y2 y1 neg add dup mul
add sqrt
0 cosb eq {/cosb 1.0 def} if 0 exch cosb div translate
0 0 hd 180 360 arc
closepath fill
grestore } for
} if
grestore } def
!
/doatom { docirclecoloratom } def
/dorod { dostick } def
% , ,
/stickwidth {16} def
/stickgreycolor {0} def
/strokelinewidth {4} def
/docirclecoloratom
{ gsave
strokelinewidth setlinewidth
rx ry translate
newpath 0 0 rad 0 360 arc closepath
gsave
hue satu 1.0 sethsbcolor fill
grestore
stroke
0 0 rad 0.75 mul -60 0 arc
stroke
grestore
} def
% dostick Molden
:
, . - 3 . , , . - . .
/docircleatom
{ gsave
strokelinewidth setlinewidth
rx ry translate
newpath 0 0 rad 0 360 arc closepath
gsave
1 setgray fill
grestore
stroke
gsave
1.00 0.55 scale
0 0 rad 0 180 arc
stroke
grestore
0.55 1.00 scale
0 0 rad -90 90 arcn
stroke
grestore
} def
Kode ini secara radikal akan mengurangi gambar menjadi hitam dan putih. Seperti di buku-buku lama.
Kesimpulan
PostScript sangat bagus dalam membuat ilustrasi. Mudah dipelajari. Dalam posting ini, saya memberikan cara untuk melakukan hal-hal sederhana, tetapi terkadang sangat, sangat diperlukan saat menyiapkan publikasi atau poster untuk konferensi. Namun, Anda bisa melangkah lebih jauh! Saya sangat merekomendasikan buku Ilustrasi Matematika .