Development of the method of creation of the 3d model of topology of the surface by means of the optical microscope

In article the question of three-dimensional visualization of topology of a volume body on its parallel cutoffs, the dynamic processes received by means of an optical microscope for the subsequent display is considered.


Introduction
Rapid development of new methods of processing of a surface of materials [1] by means of plasma methods requires creation of new, simple and cheap control methods. At the moment more and more the method of plasma and electrolytic formation of a microrelief of a surface is widely adopted [2]. As the method of plasma and electrolytic processing has a large number of the various modes of processing in case of which use big variety of morphological surfaces [3] turns out, there is a need of creation of a mathematical model of dependence of the received surfaces on the processing modes.
It can be reached, having received empirical dependence of system of equations, describing a surface, from the processing mode. For receiving system of equations, describing surface morphology, it is necessary to develop a method of creation of a 3D model of topology of a surface. This technique will be based on research of a standard laboratory optical microscope of the optical camera. At the initial stage of visualization there is a focusing of a microscope at surface "peaks". Selection of the focused "even" sections and record of their location in data array happens by a program method in the image. Thus, we received the first cutoff of a surface. Further with a certain step scanning of a surface is made. As a result we receive a large number of cutoffs from which it is necessary to create a 3D model. Development of a new technique of creation of a 3D model from parallel cutoffs of a surface is the purpose of this article. Problem definition. There is a collection of the parallel cutoffs received as a result of research of a standard laboratory optical microscope of the optical camera which is stored in the file in the form of coordinates of points of each of cutoffs. It is necessary to construct three-dimensional model on these cutoffs, using: a method of polygon grids, a set of APIYAPRANA libraries for achievement of independence of three-dimensional display of a platform.

Experimental
The algorithm was realized in the ActionScript 3 language as one of conditions of an objective was use of API YAPRANA libraries which are the cross-platform tool for development of three- dimensional dynamic browser online applications of real time and are a packet of high level class libraries in the ActionScript 3 language for use in Flash (ver.CS5 above) and Flex (ver.3.5 or above). We will enter determination of some distances used in algorithm: Determination 1. The distance from a point of one cutoff to an edge of other cutoff is calculated as the amount of distances from this point to each of the ends of the considered edge. Theoretical proofs to these statements it isn't found yet, but use of these axioms proves correctness of their assumptions in practice.
The developed algorithm has possibility of restoration of three-dimensional model of the researched object on the cutoffs located parallel to three main projectional planes accepted in medicine: sagittal (OXZ), frontal (OYZ) and axial (OXY), thanks to the appropriate matrixes of transition from "real" coordinate system to "worker" as whom the axial plane is accepted. As coordinate system of algorithm the left Cartesian rectangular coordinate system is selected.
The projectional plane is determined by a normal vector of the plane constructed on three any points of one of model cutoffs. So, for example, the normal vector of the axial Oxy plane has appearance (0,0,const), sagittal Oxz-(0,const,0), frontal Oyz-(const,0,0), respectively.
One of the principal advantages of algorithm is visualization of three-dimensional nonconvex and/or porous object on a collection of parallel cutoffs, to each of which there corresponds the different quantity of peaks.
The basis of the solution of the initial task was formed by the principle of coercion of cutoffs to the generalized cylinders provided in Zhizher P article. In "Methods and algorithms of creation of 3-D models on cutoffs" [4], but with some corrections. In particular, the method described in [4] assumes equal quantity of points on cutoffs, and conditions of an objective don't provide restrictions on quantity of points, and it means that the quantity of points of cutoffs can be different. Owing to adjustment of this algorithm of restoration of objects according to conditions of the initial task, there was a row of problems which were solved as follows: Connection of two cutoffs with different quantity of points, connection of type «1:1» We will designate a cutoff with the greatest number of points as cut1, and with the smallest, respectively, as cut2. We move the beginning of coordinate system to center of masses of a cutoff of cut1, and the beginning of coordinate system of a cutoff of cut2 -to the point which is precisely over center of masses of a cutoff of cut1.
Note: The center of masses of system of points is calculated on a formula: where masses of points,their radius vectors (setting their situation concerning origin of coordinates), andthe required radius vector of center of masses.
At first we will consider all points of a cutoff of cut2, for each of which we will select the closest edge of a cutoff of cut1, remembering thus compliance of peaks. Then we consider the remained edges of a cutoff of cut1 and for each of them we select the next cut2 cutoff peak, adjacent to it, remembering again thus compliance of peaks. The final stage is restoration of missing edges according to the received list of compliances from which the peak of a cutoff of cut1 is selected and Ramifying implementation -connection of cutoffs of type «1:т», «m:n» This problem is solved with the help of an additional cutoff which is located between the initial cutoffs from each of group of cutoffs equally spaced and built by paired combining of a set of cutoffs through points of their centers of masses. In the course of creation of an auxiliary cutoff the special vector which components are the copies of cutoffs participating in combining procedure is created. The appropriate centers of masses are added to each cutoff of this vector. The additional cutoff plays a role of the intermediary and c the initial cutoffs as follows connects: with the single cutoff as connection «1:1» for connection with group of cutoffs the special vector which each cutoff connects on the «1:1» type to the appropriate cutoff from a set of the initial is used.

Triangulation of cutoffs
The circuit of a nonconvex cutoff breaks into convex circuits, each of which then pass a triangulation which results integrate in uniform result.
The triangulation of a convex cutoff consists in processing of a vector of indexes of the peaks written as their sequential numbering of a cutoff: If the considered vector contains odd quantity of peaks, we pass to point 2, in an opposite caseto point 3. If the circuit consists of three peaks, it is considered a triangulated edge and indexes of its peaks are simply added to a total vector of a triangulation of model.
We integrate peaks in groups on three and every time we move on 2 line items in a vector, saving thus the first peaks of each similar group in a special auxiliary vector which is processed similarly, starting with point 1 (thus the last peak of the initial vector is considered the first peak of group and also it is added to an auxiliary vector). This auxiliary vector every time is updated and processed until begins to contain <=3 components. If length of an auxiliary vector becomes equal we rub, it is entirely added to a total vector of a triangulation. The total of a triangulation are the received groups of indexes which are added to a total vector of a triangulation of model.
We add its first component to vector head and further we process it similar to point 2, except for processing of an auxiliary vector -in which before processing it is necessary to delete the last element.

Creation of porous model
For determination of a type of model according to input data it is necessary to clarify layout of cutoffs relatively each other. The principal condition of the input file is superiority of an external cutoff in relation to the remaining internal cutoffs -"holes" belonging one plane in case of porous model of the researched object. Therefore when processing the input file with a set of coordinates of peaks of cutoffs there is a processing of each similar peak based on the complex analysis to the purpose to clarify, whether it gets to a circuit of an external cutoff. If all peaks of the considered cutoff get to a circuit of an external cutoff with which they lie in one plane, this cutoff is considered internal.
For a case of porous model of the researched object connection of cutoffs happens as follows: internal cutoffs of one plane connect to internal cutoffs of other parallel plane corresponding to it, and connection can be several types: one to one, one-to-many and many to many. External cutoffs connect to the external cutoffs of the parallel plane corresponding to them. In case of implementation of similar connection of cutoffs it is necessary to observe the correct bypass of peaks of circuits for saving visibility of model in the conditions of use of ActionScript 3 as the main programming language.
The triangulation of a porous cutoff can pass on one of the following options If the external cutoff has one internal cutoff: Total triangulation = a triangulation of connection of the «1:1» type of an external cutoff with internal ∪ a triangulation of an internal cutoff.
If the external cutoff has more than one internal cutoff: Total triangulation = a triangulation of connection of combining of internal cutoffs through centers of masses of system of points of their two edges closest to each other with an external cutoff ∪ a triangulation of combining of internal cutoffs through centers of masses of system of points of their two edges closest to each other.

Inference
Uniqueness of the developed algorithm consists in possibility of simulation of both the convex, and nonconvex researched objects, and also in creation of three-dimensional treelike model on coordinates of points of parallel cutoffs in the conditions of absence of any restrictions on quantity of peaks of each of cutoffs. The method of polygon simulation used thus is simple in implementation and allows to avoid in case of creation as shadows, and mirror flares. Thanks to it transmission quality of the form of object, and consequently also quality of researches increases. Use of API YAPRANA libraries allows to create on the basis of the developed algorithm the online instrument of three-dimensional visualization of objects on a collection of parallel cutoffs for the subsequent display of dynamic processes without restrictions on quantity of polygons, which is calculated automatically in the course of creation of a 3D model. Besides API YAPRANA libraries allow to reach platform independence of the final product and, as a result, promote its active implementation and distribution in different spheres of researches.