Program for generating segments of a cut cone.


Please also see the powerful option for users to use their own equations to define electrode shapes.

 

Program 31 generates the segments of a cone that has an end cut at an angle, for insertion into a data file for CPO3D.

 

See also program 26, program for generating segments of a cut cylinder.

 

This program is supplied with the CPO package and is called prog31.f90. A compiled version is also included, called prog31.exe. It can be called by the command prog31.

 

The data file that holds the controlling data must be called tempin.dat and must be in the same directory as prog31.exe. The output data will be put into file tempout.dat. An example of the data file is called prog31.dat.

 

Follow this procedure:

(1) Copy prog31.dat to tempin.dat.

(2) Edit tempin.dat.

(3) Use the command prog31 (or in some other way call prog31.exe).

(4) Copy the contents of tempout.dat and paste them into a suitable data file for CPO3D.

(5) Add the remaining uncut part of the cone.

(6) If the y=0 plane is not a plane of reflection symmetry then add the segments at y < 0 by using the 'reflect' option of the 'transform' option.

(7) Use the 'transform' option to scale and/or shift and/or reflect and/or rotate the object.

 

An example is given by shap3d31.dat, which has been generated by using prog31.dat as tempin.dat and following the above procedure.

 

It will be assumed that:

(1) The z axis is the axis of the cylinder.

(2) The radius of the cone increases as z increases.

(3) The centre of the cut end is at (x,y,z) = (0,0,0).

(4) Before cutting, the radius of the cone at z = 0 is r.

(5) The narrow end of the cone is at zn (< 0) and has radius rn (which is zero if this is the point of the cone).

(6) The semi-angle of the cone is alpha.

(7) The angle of the cut is beta (with respect to the z axis) and the cut is in a plane that contains the y azis. The cut slopes from z < 0 at x < 0 to z > 0 at x > 0.

(8) The xz plane is a plane of reflection symmetry, so therefore only the segments that have y >= 0 will be generated.

 

This program will generate triangles of the type 'conical triangle' and 'end conical triangle'.

 

If the xz plane is not a plane of reflection symmetry then the segments that have y <= 0 can be generated by reflection, using the 'transform' option of the CPO3D program.

 

The cut cylinder can be scaled and/or shifted and/or reflected and/or rotated by the using the 'transform' option of the CPO3D program.

 

The contents of the controlling input file, which must be called tempin.dat and which must be in the same directory as cpo3d.exe:

1.0 =radius of cone at the position of the cut

0.5 =radius rn at the narrow end of the cone

-1 =value zn of z at the radius rn

26.56505 =alpha, angle of the cone in degrees

45 =beta, angle of the cut in degrees

200 =requested total number of segments

1 =voltage number

3 =colour number

 

An example of this data file is included in the CPO package -it is called prog31.dat.

 

We do not guaranty that this program will work in all circumstances. In particular it might fail if one or more of the 5 triangles has a very small area.

 

The files prog31.f90, prog31.exe and prog31.dat are included with the CPO package.

The source file prog31.f90 can of course be edited to modify or extend it.