Programs for (1) converting a ‘dxf’ file to a 2D data file, (2) for converting a 2D data file to a 3D file and (3) converting a txt data file to a 2D data file.
Program for converting a ‘dxf’ file to a 2D data file:
A compiled version of this program is included in the CPO package, convdxf.exe. The user is asked, on the screen, to specify the name of the dxf file, the name of the required output file and various other parameters. The output file has the format of a 2D primary data file and so can be run by CPO2D.
The conversion program works out the number of segments n for each electrode by (1) in planar symmetry making n proportional to the length of the electrode, (2) in cylindrical symmetry making n proportional to the ratio (length of electrode)/(mean radius).
The program looks to see if any of the electrodes have free ends (that is, not touching any other electrode), in which case it assigns a ‘concentratioin factor’ of 2 or -2. If an electrode has 2 free ends it is divided into 2 touching electrodes.
No attempt is made to look for electrodes that overlap.
All electrodes are given the same voltage number 1.
Inevitably, the output file will need considerable editing.
(1) CPO Ltd do not guarantee that all forms of dxf files can be read.
(2) If warning notices concerning overlapping or close electrodes appear when the output file is run then disable the tests temporarily, but it is important to restore these checks later.
(3) Some electrodes might need to be removed, for example the line that marks the axis.
(4) Voltage numbers will need to be individually assigned.
(5) All the segment numbers and concentrations should be inspected, for example by creating viewing gaps between segments.
CPO regrets that because the format of 3D dxf files is so very different from that of CPO files, it has not been possible to write a conversion program.
Program for converting a 2D data file to a 3D file:
A compiled version of this program is included in the CPO package, called conv2to3.exe.
(1) The output file should be tidied up by opening it with CPO3D and 'saving' it.
(2) It is usually necessary to make several changes to the subdivision numbers.
(3) Initially it might be necessary to disable the ‘side-to-length ratio’ check and the 'overlapping' check (see Help for how to do this). But it is important to restore these checks later.
There are several limitations to the present program:
(1) Only cylindrical symmetry is allowed.
(2) The inscribing correction is never used.
(3) Discs that have a hole at the centre are always unevenly divided radially.
(4) Cones are always subdivided unevenly in the radial direction.
(5) Where there are two subdivision numbers the second is entered as 0 (to let the main program partition the first number) if the user does not specify the number of axial subdivisions.
(6) The 'type of subdivision' is ignored.
(7) The final total number of segments is always entered as 0, so that main program can simply add the numbers for individual electrodes. Therefore 'iterative subdivision' is not triggered.
(8) Only constant voltages are allowed.
(9) No ray or potential information is converted.
Program for converting a text file to a 2D data file:
A compiled version of this program is included in the CPO package, called convtxt.exe.
The txt file should be renamed tempin1.dat. This file should contain only the (r,z) coordinates of the points that lie on a single electrode, with each set of coordinates on a separate line, as in:
The last line of the file should be the last data line.
If another line is added it must start with 'e', for example 'end of file'
There must be another file called tempin2.dat that contains:
(1) the required maximum number of segments on the first line and
(2) the voltage number on the second line (maximum value 10).
The converted data file is output as tempout.dat, which can be tidied-up afterwards by running with CPO2D and saving it.
The first 8 lines and the last 8 lines are arbitrary, and should be edited. But BE CAREFUL that the 'number of different voltages' in line 7 is correct.
Note that the voltage number is always 1 and that each new segment is output as an electrode that has only one subdivision.
If there are two or more electrodes in the text file then they should be separated and dealt with separately.