Chemesthetics V2.0 Manual (C) 1990 by Joerg Fenin 1 What is Chemesthetics Chemesthetics, a symbiose of the words chemistry and esthetics is a program that displays molecules as a calotte model. This kind of display contains a certain esthetic attitude, even extremely poisonous molecules like nicotine or dioxine look quite nice. In June 89 a program that did exactly what was described above, called CDCHEM has been published in the c't computer magazine. It was written by Robert Kaufmann in TurboPascal for an IBM PC. Unfortunately it had two great disadvantages: the input of new data was extremly uncomfortable, and of course, it was written for an IBM PC. So I decided to re-write the program for the Amiga. But it wasn't as easy as I had expected. Function calls in Pascal are being done by 'call by reference' where as in C they are processed by 'call by value'. I didn't like pointer-arithmetic at this time very much, so I had some difficulty in working this over. Finally I was given the deciding kick by a program called P2C that translates Pascal into C automatically. A totaly confusing but *RUNNING* program was generated, but it was even more uncomfortable than the original. So it took me another couple of months and a lot of work to write a resonable user interface and to make the program readable again. 2 Copyright, Distribution etc. Chemesthetics V2.00 is copyrighted (C) 1990 Joerg Fenin / Metalworx The routines of the Arp-library are copyrighted AmigaDos Resource Project. The routines of the IFF-library are copyrighted Christian A. Weber. The palette requester is copyrighted (C) 1989 Jonathan Potter. Chemesthetics is Freeware, that means it may be copied or distributed freely as long as the following rules are obeyed: - The copyright-information remain unchanged - The following files are distributed *TOGETHER*: Chemesthetics (English version) Chem_E.dat Chemesthetics.doc or Chemesthetics (German version) Chem_G.dat Chemesthetics.doc - The copying fee may not be more than DM 5,- rsp. not more than $ 5 in the current currency in foreign (out of Germany) countries. - None of the files listed above or the source file may be part of a commercial product without the (written) permission of the author. Copying and/or distributing is forbidden on PD-series of Stefan Ossowski PD-Versand, Rainer Wolf PD-Versand (OASE), Markt & Technik Verlag AG, Karstadt AG and all other PD-distributors that charge more than DM 5,- / $ 5,- for one disk. I don't see why they should make the big money with my work. As I am very lazy concerning donating money for freeware myself, I don't expect to receive any donation for this program. However I won't reject it; especially not from chemistry teachers. For sending me DM 30,- / $ 20 you can become a registered user. After sending me the money you will recieve the latest version (including serial number) and a *PRINTED* manual. The program may be ordered at: Joerg Fenin Zum Jaegerfeld 19 2100 Hamburg 90 Germany 3 Installation Copy the Arp- and the IFF-Library into your LIBS: drawer. That's it! 4 How to use Chemesthetics The basis for each molecule are atoms. A watermolecule for example consists of one oxygen and two hydrogen atoms. The position of the atoms must be told to the program as well as the position of the light source, the twisting and the reflection of the molecule. Out of this data a calotte model of the molecule is calculated. Entered data may be saved and restored for later use. A completed picture can be saved as an IFF graphics file. 4.1 The entering of data Select 'Molecule data' from the input menu. A new window opens where you can enter the data. To do this switch the edit gadget to ADD. The cursor appears in the first of the input gadgets. Enter here the short sign of the atom, for example O for oxygen. Press and the cursor jumps to the next string gadget, the position field for the x-coordinate. Enter 160 for example. Do this analogly for the coordinates for Y and Z. Finally enter the radius for the atom. The radius describes the size of the atom. The higher the radius the bigger the atom. Size relationships of the atoms can be found in a usual chemistry book. The axises lay in space as follows: ^ _ z | /| | / y | / |/ ------> x You'll find some examples in the .cdm-files. Enter all atoms of a molecule one after another. The locations of the atoms to each other can be also found in chemistry books. In addition you'll find some examples on the disk. With "Project - Load molecule" they may be loaded. After entering all atoms, Chemesthetics needs some data concerning the molecule as a whole: The magnifiction factor (MagnFactor) expresses the magnification of the whole molecule. A magnification facter of 1.0 leaves the molecule unchanged, a magnification factor < 1.0 shrinks, a magnification factor > 1.0 expands the molecule. The following three values express the twisting of the molecule in space. It may be twisted around any of the three axises. Therefore enter the desired values in the string gadgets. Now follow the values for the light source. Chemesthetics uses a kind of ray tracing algorithm to create a three dimensional appearance for the calotte model. Even shadowing is taken into consideration. To do this a vector of the light source has to be entered. A resanoble value is for example X=20000, Y=-100000, Z=20000. All example molecules on the disk use this vector. The last value that has to be entered declares the relexion of the atoms. The higher the reflection the stronger will the light source be reflected in each atom. A value of 100 will reflect the light like a mirror. Is everything correct click on the OK-gadget, to cancel all inputs click the CANCEL-gadget or the closegadget. 4.2 Display a molecule You'll find two menuitems in the menu "Paint", i.e. 'Outline' and 'Calottes'. If you select 'Outline' just a circle will be painted for each molecule. It gives you a quick survey how the molecoule will look like. This mode gives you the chance to experiment with different data (mostly twists) without having to wait for hours just to see it's not what you wanted. Certainly the stereoscopic effect may be lost. If you are satisfied with all the values select 'Calottes'. The molecule will be drawn considering all the data including light and reflection. Because of the mass of data large molecules like dioxine can take up to one hour until they are finished. But the result compensates the efforts. A calotte painting may be interrupted anytime by clicking on the left mouse button. 4.3 Save a molecule In the "Project" menu you'll find, among others, two 'save'- menuitems, i.e. 'Save molecule' and 'Save IFF'. Use the first to save the molecule as a Chemsthetics datafile, it will get, if not changed, the extension .cdm. With 'Save IFF' the screen will be saved as an IFF graphics file. With the menuitem 'IFF compression' you select wether the file will be compressed using the CmpByteRun1 compression algorithm (default) (see the documentation of the IFF-library) or not. Compression can reduce the size of the IFF-file dramatically so it is recommended you do not change the compression default. As far as I know all graphic programs like DPaint or Butcher can read these files. However you can switch compression off. 5 Short menu overview 5.1 Copyright Copyright-Information 5.1.1 Credits Information about who supported the completion of this programm (and who didn't :-( ) 5.2 Project Input and output functions 5.2.1 Load Mol (Amiga-L) Opens the file requester and loads, after selecting the name, the corresponding molecule file. If Chemesthetics detects an error in the data it will display a warning. In this case it is highly recommended that you check the data by selecting "Input...molecular data". 5.2.2 Save Mol (Amiga-S) Opens the file requester and saves, after entering or selecting the name, the current data as a Chemesthetics data file (.cdm). 5.2.3 Save as IFF Saves the screen as an IFF file. This file may be read by any of the current graphic programs (like DPaint or Butcher). ATTENTION: Saving is not possible if the IFF-library is not (properly) installed. In this case an error message will be displayed. The IFF file may be compressed (default). See "Preferences...IFF compression". 5.2.4 End (Amiga-Q) Terminates the program. 5.3 Input Data input and color changing 5.3.1 Molecule data (Amiga-M) The input window will be opened and, if present, the current molecule data will be displayed in a list. You can scroll the list with the arrows or the proportional gadget. The atom's data may be changed if you click on an atom and the mode gadget is switched to "EDIT". You can add new atoms to the molecule if you switch the mode gadget to "ADD". 5.3.2 Palette (Amiga-P) Here you can change all of the 16 colors of Chemesthetics. Please note that most of the colors are used by Chemesthetics to draw the atoms. The color distribution vastly corresponds with Antropow's color distribution for atoms. 5.4 Paint Selection of the paint mode. 5.4.1 Outlines (Amiga-O) Draws only the outlines of each atom. It serves as a quick survey wether the entered data is right or wrong. Reflection, shadowing etc. are not considered. 5.4.2 Calottes (Amiga-K) Draws a calotte model considering ALL entered data. Because of the mass of data it can take up to one hour or more to draw a large molecule. 5.5 Preferences Preferences of Chemesthetics 5.5.1 IFF compression Here you can decide wether the IFF file will be compressed (default) or not. For compression the CmpByteRun1-algorithm is used. Compression may reduce size of the output file dramatically, so it is highly recommended you take advantage of this feature. As far as I know, all standard graphic tools can read this format. However you could switch compression off if you want to. (See also the docs for the IFF-library.) 6 Hints for data selection Most of the needed data may be extracted from simple chemistry books. Calotte models are shown there very often. If they are not too complex they may be taken over easily. Also the size relationships between atoms are shown in tables or outlines, so there is no need to guess. To get a feeling for the data you could also have a look into the example data files that (should) come with this program. You could compare those data easily with the corresponding data in a chemistry book. The water molecule for example can be found almost every chemistry book. May be I will release some more data files later on public domain disks. 7 Miscalleanous I would be very pleased to receive suggestions of any kind (improvements, error reports etc.). If someone modifies the source code I would like to receive a copy. Besides I am interested in modifications concerning the new 5.0 Version of the Aztec C Compiler or the Lattice C Compiler. Chemesthetics automatically recognises if it runs on a NTSC- or PAL-machine. On NTSC-machines circles will appear as ellipses in the current version. This will be fixed in the next version. This program has been written in C and has been compiled with the Aztec C 3.6 compiler. It uses routines of the Arp-Library (FileRequest(), CloseWindowSafely()) and the IFF-Library (SaveBitMap()). The program was tested under the following environment: Amiga500 512 KByte RAM Extension Kickstart 1.2 Arp-Library Version 39.1 IFF-Library Version 16.1 Chemesthetics V2.00 (C) 1990 Metalwox, state: 23. December 1990