Background technology
Reverse-engineering has a wide range of applications in practice.Mainly be because many product design complexity, as the covering of automobile and aircraft, artificial artificial limb, ceramic product, artistic sculpture and various complex partses etc., the design expression of its free form surface or the foundation of mathematical model are all very difficult, and the The existing CAD system still is difficult to carry out strict geometric description.Particularly for our developing country, how carry out on the basis of advanced product abroad suitably and necessary modifications so that the launch products that obtains independent intellectual property right rapidly and efficiently, for cost saving, shorten the R﹠D cycle, enhancing competitiveness and reducing risks has very important meaning.
In reverse-engineering, generally be to obtain mass data point (some cloud) by advanced persons' such as three coordinate measuring machine (CMM), laser measuring machine, raster scanning instrument or industry CT quick measuring system, then to the filtration treatment of these cloud datas and seamless spliced, obtain line-cutting cloud by spliced some cloud mass cutting, structural surface on the point or the basis of line again, thus the digital model of object obtained.By obtaining line-cutting cloud structural attitude curve, and then construct curved surface, to obtain the digital model of object by characteristic curve.And the quality of curve quality and will greatly influence the quality of constructed curved surface and to the reducing degree of original objects to the reducing degree of raw data.Therefore be a ring of forming a connecting link very crucial in the reverse-engineering by line-cutting cloud discrete point formation curve, directly influence the quality of reconstruct success or not and cad model, its follow-up link is played very crucial restrictive function.
At present, the theory of algorithm aspect of representing effectively on computers about the dot generation curve has obtained very big progress, has delivered a considerable amount of documents, the some of them algorithm has obtained to use comparatively widely, mainly contain Bezier, Uniform B-spline, curved line arithmetics such as NURBS.But this several method be known point as the reference mark, are approaching rather than interpolation by the SPL of these dot generation to them.And a requirement of reverse-engineering is exactly accurate reduction original objects feature.Therefore we should allow the curve interpolation that generates in measurement point, that is to say these points that measures as data point.In addition because fast the measuring system actual measurement obtains is the magnanimity discrete data point, data volume is very big, therefore how fast a large amount of point data at random to be converted into stronger and the line information that data volume significantly reduces of ability to express, and its to the quality of the reducing degree of raw data and constructed curved surface and less to the reducing degree influence of original objects be key.
Summary of the invention
The invention provides a kind of curve constructing method that can keep degree of accuracy and can accelerate to be converted into line-cutting cloud in the 3 D scanning system of speed of the stronger and line information that data volume significantly reduces of ability to express by point data at random.
The present invention adopts following technical scheme:
A kind of curve constructing method that is used for 3 D scanning system line-cutting cloud that pretreated some cloud handled:
(1) pretreated some cloud carried out parallel cutting, obtain N parallel cut, respectively a mysorethorn is executed parallel cutting in the above and below of each parallel cut again, obtain N the body that cuts that contains parallel cut, vertical projection is carried out in the parallel cut of point in this section body on the some cloud in each section body, and the vertical projection of parallel cut point in this section body is considered as cutting parallel cut and the section of putting cloud in the body, constitute N bar chain respectively by parallel cut in each section body and the section of putting cloud, select one group of process points in the section in each section body respectively, this process points is the section that meets the following conditions, this condition is that the distance between two process points is spacing or its integral multiple between adjacent 2 in the some cloud, and the N that obtains thus group process points is line-cutting cloud;
(2) be one group with 4~5 continuous data points, n data point is divided into k group data point, generate first group reference mark and generate article one curve by the reference mark by of the definition of first group data point according to the Bezier curve; First reference mark of each bar curve is generated by the definition of data point according to the Bezier curve later on, second reference mark generated by the definition according to the Bezier curve of first reference mark of latter two reference mark of last curve and current curves, all the other reference mark are generated according to the definition of Bezier curve by data point, and the tangent line of tie point is produced by latter two data point of last curve and preceding two data points of current curves;
(3) repeating step (2) constructs curve according to the reference mark then up to the reference mark of obtaining all line-cutting clouds.Compared with prior art, the present invention has following advantage:
The present invention is mainly used in the application scenario that 3 D scanning system is obtained the body surface magnanimity discrete data point data conversion line information that data volume significantly reduces for ability to express is stronger.Utilize the acquisition methods of line-cutting cloud among the present invention, and then handle the line-cutting cloud data one by one, utilize the curve construction algorithm among the present invention, construct the contour curve model of testee.This method mainly contains following advantage:
(1) the present invention is primarily aimed at the original point cloud model that 3 D scanning system obtains, without any need for gridding handle, wide adaptability, speed is fast;
(2) can select the direction of parallel cut point cloud alternately, can make its direction as far as possible, improve the degree of accuracy of reduction original objects greatly along the characteristic curve of a certain direction;
(3) parallel cutting is obtained line-cutting cloud the later line-cutting cloud ordering time is significantly reduced, and make three-dimensional processing become the processing of coplane by getting line-cutting cloud, for adjustment curve processing later on provides huge convenience, avoid the complicacy of three-dimensional regulation curve;
(4) depend primarily on matrix inversion by the anti-efficient quality of reference mark formation curve of asking of data point.And the anti-algorithm of asking that the present invention proposes greatly reduces order of matrix, has therefore also reduced the complicacy of algorithm, makes the anti-reference mark formation curve of asking of data point present very high efficient;
(5) operating process is fairly simple, and the spacing of parallel cut can be taked default value or mutual definite, and ensuing step all can be finished automatically, and speed is fast, and this method has very strong versatility.
Embodiment
Embodiment 1
A kind of curve constructing method that is used for 3 D scanning system line-cutting cloud that pretreated some cloud handled:
(1) pretreated some cloud carried out parallel cutting, obtain N parallel cut, respectively a mysorethorn is executed parallel cutting in the above and below of each parallel cut again, obtain N the body that cuts that contains parallel cut, vertical projection is carried out in the parallel cut of point in this section body on the some cloud in each section body, and the vertical projection of parallel cut point in this section body is considered as cutting parallel cut and the section of putting cloud in the body, constitute N bar chain respectively by parallel cut in each section body and the section of putting cloud, select one group of process points in the section in each section body respectively, this process points is the section that meets the following conditions, this condition is that the distance between two process points is spacing or its integral multiple between adjacent 2 in the some cloud, and the N that obtains thus group process points is line-cutting cloud;
(2) be one group with 4~5 continuous data points, n data point is divided into k group data point, generate first group reference mark and generate article one curve by the reference mark by of the definition of first group data point according to the Bezier curve; First reference mark of each bar curve is generated by the definition of data point according to the Bezier curve later on, second reference mark generated by the definition according to the Bezier curve of first reference mark of latter two reference mark of last curve and current curves, all the other reference mark are generated according to the definition of Bezier curve by data point, and the tangent line of tie point is produced by latter two data point of last curve and preceding two data points of current curves;
(3) repeating step (2) constructs curve according to the reference mark then up to the reference mark of obtaining all line-cutting clouds.
Embodiment 2
In order accurately to reduce the original objects feature, in process, propose a kind of new according to the Bezier curve by the counter method of asking the reference mark of data point by the line-cutting cloud curve construction.It replaces single high-order Bezier curve to the complex curve that the Bezer curve amalgamation by k low order produces, and avoids the problem of inverting of high level matrix.
Therefore, the present invention relates generally to the content of following two aspects:
1) line-cutting cloud obtains
After a cloud pre-service, after translation chose angle by rotation, given series of parallel face was tried to achieve the data point of object (being actually the magnanimity point on the body surface) on this cross section.But mass data disperses, and given a certain arbitrary plane may not have (perhaps having only extremely indivedual points) on the cross section, for this reason, we can only go near real world in the precision tolerance band as much as possible, have so also just produced following algorithm (algorithm flow chart is as shown in Figure 4):
At first obtain a distance, and the mean value that is obtained by the individual distance of such M (M>100) is d by any adjacent a pair of point in the mass data.
(1) cloud is carried out pre-service, go after the impurity point, after translation chooses cutting angle by rotation, given a series of equally spaced parallel surfaces (spacing is defaulted as three times of d) perpendicular to characteristic curve;
(2) respectively make a parallel surface (its spacing is d) that is parallel to given parallel surface up and down at given parallel surface, so just constitute one and cut body by two parallel surfaces that derive from, we then drop on point on the given parallel surface to the point that falls in this section body as the point on the real-world object in that the vertical projection on the given parallel surface is approximate, so just obtain the intersection point (section) of given plane and real-world object.In like manner, we also just obtain the section of object on one group of parallel surface;
(3) to each parallel surface in this group plane, the section on it constitutes a chain.If total N of this group parallel surface then obtains N chain;
(4) each chain is handled: obtain one group of process points by these sections, these process points satisfy condition:
A) distance of point-to-point transmission is the integral multiple of d or d;
B) this point all has the discrete point that closes on up and down for uniform section (in the given section body scope).
(5) this N chain handled the process points that just can obtain N chain.Promptly obtain line-cutting cloud 2) structure of characteristic curve
In order accurately to reduce the original objects feature, in process, propose a kind of new according to the Bezier curve by the counter method of asking the reference mark of data point by the line-cutting cloud curve construction.Data point number on the ordus that is obtained by discrete three-dimensional data points in reverse-engineering may reach ten even tens, and like this, the operand of inverting can be very big, and is just very long for the response time of operation.Character according to the Bezier curve, we propose a kind of n data point to be divided into k group data point (every group of 4~5 points) according to the order of sequence, ask the reference mark respectively by this k group data point, and add the continuous requirement that complex curve that each bar curve that certain constraint generates the reference mark obtained is linked to be satisfies C1.Specific as follows:
(1) earlier n data point is divided into continuous k group data point (every group of 4~5 points) according to the order of sequence;
(2) first groups reference mark is directly generated by the definition according to the Bezier curve of first group data point;
Specific practice is as follows: the reference mark of obtaining first group of data point according to following formula
(3) when asking N (N>1) bar curve control point, second reference mark that adds constraint condition: N (N>1) bar curve obtained by latter two reference mark of last curve and first reference mark of current curves; The tangent line of tie point is by latter two data point of last curve and preceding two data points decision of current curves.
Specific practice is as follows:
Suppose that last group of data point has s+1, is Q
1i(i=0,1 ..., s), second group of data point has t+1, is Q
2i(i=0,1 ..., t), Q
1s=Q
20In conjunction with the definition and the character of Bezier curve,, the Bezier curve is carried out rising rank, t1=t+1 according to the constraint condition that adds.Then have:
Can obtain the reference mark of N (N>1) bar curve, wherein P according to the formula that provides above
1j(j=0,1 ..., s) be the reference mark of last group of data point, P
2j(j=0,1 ..., t1) be the reference mark of second group of data point.
(4) repeat (2) up to the reference mark of obtaining all line-cutting clouds, construct curve according to the reference mark then.
The curve construction process flow diagram as shown in Figure 5.
According to said method, realized the operation that line-cutting cloud and curve construction are obtained in parallel cutting to a cloud with the C++ programming by the VC++6.0 platform.Fig. 6 is through pretreated Little Bear model point cloud data.Fig. 7 is that the given Face Parallel Clearance of acquiescence is the line-cutting cloud data of trying to achieve under three times of situations of consecutive point spacing.Fig. 8 is the one piece of data chain that the line-cutting cloud data pick-up from accompanying drawing 7 goes out.Fig. 8 is according to extracting the curve that the chain data configuration goes out.