CN104268942A - Bezier curve surface fitting method and system based on de Casteljau algorithm - Google Patents

Bezier curve surface fitting method and system based on de Casteljau algorithm Download PDF

Info

Publication number
CN104268942A
CN104268942A CN201410469987.1A CN201410469987A CN104268942A CN 104268942 A CN104268942 A CN 104268942A CN 201410469987 A CN201410469987 A CN 201410469987A CN 104268942 A CN104268942 A CN 104268942A
Authority
CN
China
Prior art keywords
bezier
curve
matching
data point
control coefrficient
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201410469987.1A
Other languages
Chinese (zh)
Inventor
郭大勇
成佳颐
姜国军
阙开良
吴越
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tsinghua University
Original Assignee
Tsinghua University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tsinghua University filed Critical Tsinghua University
Priority to CN201410469987.1A priority Critical patent/CN104268942A/en
Publication of CN104268942A publication Critical patent/CN104268942A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T17/00Three dimensional [3D] modelling, e.g. data description of 3D objects
    • G06T17/30Polynomial surface description

Landscapes

  • Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Pure & Applied Mathematics (AREA)
  • Mathematical Optimization (AREA)
  • Mathematical Physics (AREA)
  • Mathematical Analysis (AREA)
  • Algebra (AREA)
  • Computer Graphics (AREA)
  • Geometry (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Image Generation (AREA)

Abstract

The invention discloses a bezier curve surface fitting method and system based on the de Casteljau algorithm. The method includes the steps of obtaining n data points of a Bezier curve, obtaining 2*(n-2) control points through the n data points of the Bezier curve according to the de Casteljau algorithm, setting control coefficients at the control points, and obtaining the Bezier curve by adjusting the curvature, at the data points, of the Bezier curve by changing the control coefficients, and by determining the control coefficients when the curvature is the target curvature. According to the method, fitting is conducted on the Bezier curve surface by changing the control coefficients, the Bezier curve which is high in profile modeling degree can be obtained through fitting when a small number of data points are selected according to actual application, it is ensured that the curve can pass through all the data points, continuity of the curve is ensured at the data points, and on the aspect of curve fitting, complexity is lowered, and fitting efficiency is improved.

Description

Based on Bezier curved surface fitting method and the system of moral Castries algorithm difficult to understand
Technical field
The present invention relates to field of Computer Graphics, be specifically related to a kind of Bezier curved surface fitting method based on moral Castries algorithm difficult to understand and system.
Background technology
Bezier Bezier curve be one by initial, the curve at reference mark, end, and the shape adjusting curve by intermediate control point.When number of times along with Bezier curve increases, when namely having multiple reference mark, can there is unstable phenomenon in curve, and can not carry out local amendment, and flexibility ratio is not high enough.So in the research field of computer graphics, researcher can use B-spline curves.It is a kind of curve model based on Bezier curve, and while ensure that Bezier curve advantage, its local characteristics can increase than Bezier curve with approximation ratio.And in surface fitting, the algorithm of Bezier curved surface and B-spline surface is all respectively at u, definition curve in v direction, from the angle of curved surface formula, is all be multiplied by corresponding transposed matrix respectively again on the basis of virgin curve formula.
But, find in the process using B-spline, this curve model uses comparatively complicated, the actual demand of project cannot be met, in addition in order to pass through known data point, existing algorithm is when asking Control point, often adopt the method for direct solution system of linear equations, this makes the increase along with data point quantity, the exponent number of system of equations can increase, and causes calculated amount very large, and the reference mark obtained by this algorithm is non-adjustable, the Bezier curve after matching is caused to have jump phenomena in local, can not be spacing.
Summary of the invention
For defect of the prior art, the invention provides a kind of Bezier curved surface fitting method based on moral Castries algorithm difficult to understand and system, achieve Bezier curved surface and when reference mark changes, matching can be carried out by changing control coefrficient to Bezier curved surface.
First aspect, the invention provides a kind of Bezier approximating method based on moral Castries algorithm difficult to understand, comprising:
Obtain n data point of Bezier, by n data point of described Bezier, obtain 2 × (n-2) individual reference mark according to moral Castries algorithm difficult to understand;
Described reference mark arranging control coefrficient, regulating described Bezier in the curvature at described data point place by changing described control coefrficient, and control coefrficient when determining that described curvature is target curvature;
According to the described control coefrficient after determining, obtain the Bezier after matching.
Optionally, n data point of described acquisition Bezier, by n data point of described Bezier, obtains 2 × (n-2) individual reference mark according to moral Castries algorithm difficult to understand, comprising:
Corresponding two reference mark of each known data point, this data point does not comprise starting point and the terminal of described Bezier.
Optionally, the span of described control coefrficient is [0,2].
Optionally, described according to the described control coefrficient after determining, obtain the Bezier after matching, comprising:
According to the described control coefrficient after determining, obtain the function expression of the described Bezier of m section;
According to the function expression of the described Bezier of described m section, utilize Langrange interpolation polynomial algorithm, obtain k section Bezier;
Wherein, k is total hop count of Bezier, and k=n-1, described m are the m section in k section Bezier, 1≤m≤n-1.
Second aspect, present invention also offers a kind of bezier surface approximating method based on moral Castries algorithm difficult to understand, comprising:
Treat u, v direction of matching bezier surface described in determining, the Bezier on u direction is quadratured, obtain the total length of described u direction Bezier;
The total length of described u direction Bezier is segmented, and obtains the coordinate of segmentation point;
According to u direction, segment coordinate a little, the total length of v direction Bezier is segmented;
According to many Beziers of u direction matching and the matching of v direction many Beziers, obtain the bezier surface after matching.
The third aspect, present invention also offers a kind of Bezier matching system based on moral Castries algorithm difficult to understand, comprising:
Reference mark acquisition module, for obtaining n data point of Bezier, by n data point of described Bezier, obtains 2 × (n-2) individual reference mark according to moral Castries algorithm difficult to understand;
Control coefrficient determination module, for arranging control coefrficient on described reference mark, regulates described Bezier in the curvature at described data point place by changing described control coefrficient, and control coefrficient when determining that described curvature is target curvature;
Curve fitting module, for according to the described control coefrficient after determining, obtains the Bezier after matching.
Optionally, corresponding two reference mark of each known data point in the acquisition module of described reference mark, this data point does not comprise starting point and the terminal of described Bezier.
Optionally, the span of described control coefrficient is [0,2].
Optionally, described curve fitting module, for:
According to the described control coefrficient after determining, obtain the function expression of the described Bezier of m section;
According to the function expression of the described Bezier of described m section, utilize Langrange interpolation polynomial algorithm, obtain k section Bezier;
Wherein, k is total hop count of Bezier, and k=n-1, described m are the m section in k section Bezier, 1≤m≤n-1.
Fourth aspect, present invention also offers a kind of bezier surface matching system based on moral Castries algorithm difficult to understand, comprising:
Curve determination module, for treating u, v direction of matching bezier surface described in determining, quadraturing to the Bezier on u direction, obtaining the total length of described u direction Bezier;
First Curve Subdivision module, for segmenting the total length of described u direction Bezier, and obtains the coordinate of segmentation point;
Second Curve Subdivision module, for segmenting coordinate a little according to u direction, segments the total length of v direction Bezier;
Surface fitting module, for according to many Beziers of u direction matching and the matching of v direction many Beziers, obtain the bezier surface after matching.
As shown from the above technical solution, Bezier curved surface fitting method based on moral Castries algorithm difficult to understand provided by the invention and system, the method achieving Bezier curved surface can when reference mark changes, by changing control coefrficient, matching is carried out to Bezier curved surface, can while choosing less data point, simulate the Bezier curve that profiling degree is high, and this curve can pass through all data points, ensure that the continuity of this curve, in surface fitting, reduce complexity, improve Fitting efficiency.
In instructions of the present invention, describe a large amount of detail.But can understand, embodiments of the invention can be put into practice when not having these details.In some instances, be not shown specifically known method, structure and technology, so that not fuzzy understanding of this description.
Last it is noted that above each embodiment is only in order to illustrate technical scheme of the present invention, be not intended to limit; Although with reference to foregoing embodiments to invention has been detailed description, those of ordinary skill in the art is to be understood that: it still can be modified to the technical scheme described in foregoing embodiments, or carries out equivalent replacement to wherein some or all of technical characteristic; And these amendments or replacement, do not make the essence of appropriate technical solution depart from the scope of various embodiments of the present invention technical scheme, it all should be encompassed in the middle of the scope of claim of the present invention and instructions.
Accompanying drawing explanation
The matched curve figure of 2 Bezier curves that Fig. 1 provides for one embodiment of the invention;
The matched curve figure of 3 Bezier curves that Fig. 2 provides for one embodiment of the invention;
The process schematic of adjustment 3 Bezier curvature of curves that Fig. 3 provides for one embodiment of the invention;
The schematic flow sheet of the Bezier approximating method based on moral Castries algorithm difficult to understand that Fig. 4 provides for one embodiment of the invention;
The different curve map that the change control coefrficient that Fig. 5 provides for one embodiment of the invention obtains;
Curve map during the control coefrficient C=0.7 that Fig. 6 provides for one embodiment of the invention;
The schematic flow sheet of the bezier surface approximating method based on moral Castries algorithm difficult to understand that Fig. 7 provides for one embodiment of the invention;
The structural representation of the Bezier matching system based on moral Castries algorithm difficult to understand that Fig. 8 provides for one embodiment of the invention;
The structural representation of the bezier surface matching system based on moral Castries algorithm difficult to understand that Fig. 9 provides for one embodiment of the invention;
The approximating method of the curve of the present invention that Figure 10 provides for one embodiment of the invention and the correlation curve figure of sin function curve;
The correlation curve figure of the approximating method of the curve of the present invention that Figure 11 provides for one embodiment of the invention and the sin function curve of special spacing;
The graph of a relation of the data point number that Figure 12 A to 12B provides for one embodiment of the invention and error of fitting;
The graph of a relation of the data point number that Figure 13 A to 13C provides for another embodiment of the present invention and error of fitting;
Figure 14 is that in prior art, schematic diagram is chosen at reference mark;
Figure 15 adopts the curve comparison diagram of moral Castries algorithm difficult to understand and other interpolation algorithms for employing the present invention that one embodiment of the invention provides;
The surface chart of employing this method matching that Figure 16 A to 16B provides for one embodiment of the invention;
Surface chart after employing this method segmentation that Figure 17 A to 17B provides for one embodiment of the invention.
Embodiment
Below in conjunction with accompanying drawing, the embodiment of invention is further described.Following examples only for technical scheme of the present invention is clearly described, and can not limit the scope of the invention with this.
The present invention mainly passes through according to moral Castries de Casteljau difficult to understand algorithm the controlling polygon repeatedly splitting Bezier curve in proportion, make the line segment of last segmentation and Bezier contact of a curve in impact point, i.e. corresponding ratio point on Bezier curve.Detailed derivation below for carrying out studying in this deCasteljau algorithm application to the problem of matching Bezier curve and surface.
Fig. 1 shows the matched curve figure of 2 Bezier curves that the embodiment of the present invention provides, and 2 Bezier curves as shown in Figure 1, reference mark is A, B, C.The shape of curve negotiating A and C, B adjustable curve.When B point moves along BC, the mid point of Bezier curve also can move to AC, and the curvature of curve at Control point place is in reduction.
Fig. 2 shows the matched curve figure of 3 Bezier curves that the embodiment of the present invention provides, and 3 Bezier curves as shown in Figure 2, reference mark is A, B, C, D.Curve negotiating A, D, B, C can be used for adjusting curve shape.When B point moves along BA direction, mid point of curve is also moving to AD, and curve also reduces in the curvature at Control point B place.
Fig. 3 shows the process schematic of adjustment 3 Bezier curvature of curves that the embodiment of the present invention provides, and as shown in Figure 3, by changing the distance of reference mark to starting point or terminal, can adjust the curvature of Bezier curve at corresponding reference mark place.Wherein, Bezier curve and controlling polygon play initial line and limit, end is tangential on starting point and end point respectively.
As the individual data point A of n (n>=3) in known three dimensions 0, A 1, A 2a n-1time.In order to ensure that curve has continuity and limit function, 2 × (n-2) reference mark: B can be found in conjunction with above-mentioned rule 0, B 1, B 2b 2 × (n-2)-2and introduce control coefrficient C (0≤C≤2).The derivation at reference mark, for n=4:
If data point is A 0, A 1, A 2, A 3, connect A 0a 2, at A 0a 2on look for a C 0make make A 0a 2a is moved to along vectorial c 1, obtain B 0b 1, at B 0b 1on look for a B ' 0make control coefrficient in like manner, can in the hope of reference mark B 2, B 3.So A 1a 2just become by A 1b 1b 2a 23 the Bezier curves controlled.And at two Bezier curves at tie point place, there is common tangential, ensure that the C1 of curve is continuous.At starting point and destination county, we give tacit consent to these 2 respectively corresponding reference mark, and are set to itself, can change its value according to demand in practice, to realize adjusting the corresponding tangential direction of starting point and destination county.
Based on above-mentioned derivation, Fig. 4 shows the schematic flow sheet of the Bezier approximating method based on moral Castries algorithm difficult to understand that the embodiment of the present invention provides, and as shown in Figure 4, this Bezier approximating method comprises the steps:
401, obtain n data point of Bezier, by n data point of described Bezier, obtain 2 × (n-2) individual reference mark according to moral Castries algorithm difficult to understand;
For example, corresponding two reference mark of each known data point, this data point does not comprise starting point and the terminal of described Bezier.
402, control coefrficient being set on described reference mark, regulating described Bezier in the curvature at described data point place by changing described control coefrficient, and control coefrficient when determining that described curvature is target curvature.
For example, another five data points are (0,0,0), (1,1,0), (2,2.5,0), (3,0,0), (4,0.5,0), C gets respectively: 0,0.2,0.4,0.6,0.8,1,1.2,1.4,1.6,1.8,2 can obtain figure as shown in Figure 5, the span of described control coefrficient is [0,2], and wherein, carry out matched curve by 4 line segments when C gets 0, during C=2, institute's matching curve local curvature is out excessive.By many experiments, when C=0.7, be defined as control coefrficient during target curvature, effect curve as shown in Figure 6.
Therefore, if there be n known data point, a curve be made up of n-1 section 3 Bezier curves can be obtained.This curve feature is as follows: while a curve negotiating n data point, ensure that C1 is continuous; For each known data point (starting point, except terminal), the reference mark that two corresponding can be found, and control coefrficient C (0≤C≤2) is set, for the curvature of adjustment curve at data point place; Make use of the thinking of piecewise interpolation, for any n (n >=3) individual data point, connect with 3 Bezier curves between two continuity points.And the cutting arrow and can adjust of starting point and destination county; For any continuous print three data point A on curve, B, C, ensure that B is at the peak being horizontal axis with line segment AC all the time, play spacing effect, prevent shake.
403, according to the described control coefrficient after determining, the Bezier after matching is obtained.
For example, above-mentioned steps 403 comprises unshowned sub-step in Fig. 4:
4031, according to the described control coefrficient after determining, the function expression of the described Bezier of m section is obtained;
4032, according to the function expression of the described Bezier of described m section, utilize Langrange interpolation polynomial algorithm, obtain k section Bezier;
Wherein, k is total hop count of Bezier, and k=n-1, described m are the m section in k section Bezier, 1≤m≤n-1.
In order to the approximating method of the above-mentioned Bezier curve of clearer explanation, be described in detail by following concrete computation process.
On standard Bezier curve, any point can be provided by formula: wherein p ifor the summit of controlling polygon, B i,nt () is Bernstein basis function.For n reference mark p i(i=0,1,2 ... n-1), C is control coefrficient, and the reference mark of m (1≤m≤n-1) the section Bezier curve of known formation is: and have:
p ‾ 3 m - 3 = p m - 1 p ‾ 3 m - 2 = p m - 1 + C p m - 2 p m → p m - 1 p m ‾ p m - 2 p m - 1 ‾ + p m - 1 p m ‾ p ‾ 3 m - 1 = p m + C p m + 1 p m - 1 → p m - 1 p m ‾ p m p m + 1 ‾ + p m - 1 p m ‾ p ‾ 3 m = p m
As m=1, as m=n-1, this 2 values can be changed according to actual conditions.
Utilize the thinking of interpolation, by Lagrange interpolation polynomial, the formula of trying to achieve m (1≤m≤n-1) section 3 Bezier curves is: s ( m , t ) = Σ i = 0 3 p i + 3 m - 3 B i , 3 ( t ) , t ∈ [ 0,1 ] Launch: s (m, t)=p 3m-3b 0,3(t)+p 3m-2b 1,3(t)+p 3m-1b 2,3(t)+p 3mb 3,3(t), t ∈ [0,1], wherein: B 0,3 ( t ) = ( 1 - t ) 3 B 1,3 ( t ) = 3 t ( 1 - t ) 2 B 2,3 ( t ) = 3 t 2 ( 1 - t ) B 3,3 ( t ) = t 3 , Being write s (m, t) as matrix form is:
s ( m , t ) = t 3 t 2 t 1 1 - 1 3 - 3 1 3 - 6 3 0 - 3 3 0 0 1 0 0 0 p ‾ 3 m - 3 p ‾ 3 m - 2 p ‾ 3 m - 1 p ‾ 3 m , t ∈ [ 0,1 ]
Entirety is seen, the formula of this method is:
S ( m , k , t ) = Σ i = 1 k [ Π j = 1 j ≠ m k i - j m - j s ( m , t ) ] , t ∈ [ 0,1 ] , m ≤ k (k is total hop count, and m is wherein m section), and Π j = 1 j ≠ m k i - j m - j = 1 , i = m 0 , i ≠ m .
Fig. 7 shows the bezier surface approximating method based on moral Castries algorithm difficult to understand that the embodiment of the present invention provides, and as shown in Figure 7, this bezier surface approximating method comprises the steps:
701, determine described in treat u, v direction of matching bezier surface, to quadrature to the Bezier on u direction, obtain the total length of described u direction Bezier;
702, the total length of described u direction Bezier is segmented, and obtain the coordinate of segmentation point;
703, according to u direction, segment coordinate a little, the total length of v direction Bezier is segmented;
704, according to many Beziers of u direction matching and the matching of v direction many Beziers, obtain the bezier surface after matching.
When fitting surface, utilize bus method, ensure that the curved surface generated is continuous by C1 while known data point.
Generally, the approximating method of Bezier curved surface utilizes the continuation spatially of Bezier curve.Any point on Bezier curved surface is: r ( u , v ) = Σ i = 0 n - 1 Σ j = 0 m - 1 P i , j B i , n ( u ) B j , m ( v ) , ( 0 ≤ u , v ≤ 1 ) , P i,jfeature grid summit is the space lattice of m × n point, B i,n(u), B j,mv () is Bernstein basis function, define Bezier curve respectively on u, v direction.
As m=n=4, can obtain a bicubic Bezier patch, matrix expression is: r (u, v)=[u 3u 2u 11] BPB t[v 3v 2v 11] t, (0≤u, v≤1)
Wherein: B = - 1 3 - 3 1 3 - 6 3 0 - 1 3 0 0 1 0 0 0 , Reference mark matrix P = P 0,0 P 0,1 P 0,2 P 0,3 P 1,0 P 1,1 P 1,2 P 1,3 P 2,0 P 2,1 P 2,2 P 2,3 P 3,0 P 3,1 P 3,2 P 3,3 , In these 16 reference mark, curved surface and P 0,0, P 0,3, P 3,0, P 3,3tangent, surrounding's 12 points of this dot matrix respectively define 4 Bezier curves, are the sideline of curved surface, four remaining some P 1,1, P 1,2, P 2,1, P 2,2the concavity and convexity of Control curve.
Therefore can obtain the parameter equation of three axis in space, and then the matching of Bezier curved surface can be carried out:
x ( u , v ) = u 3 u 2 u 1 1 BP x B T v 3 v 2 v 1 1 T y ( u , v ) = u 3 u 2 u 1 1 BP y B T v 3 v 2 v 1 1 T z ( u , v ) = u 3 u 2 u 1 1 BP z B T v 3 v 2 v 1 1 T , ( 0 ≤ u , v ≤ 1 )
When control dot matrix dimension is excessive, generally can splice bicubic Bezier patch, continuous in order to realize first order derivative, so require that curved surface overlaps at the reference mark of boundary, and coincide point and its reference mark, left and right conllinear.So just can solve the too much Fitting of data point.
But the present invention adopts the method for above-mentioned matched curve, the thinking by bus method " line moves into face " generates curved surface.If the offset dot matrix of known n × m: the method utilizing above-mentioned curve to generate is by the data point [p of the i-th row i, 1p i, 2p i,m] try to achieve 3m-2 corresponding reference mark p ‾ i , 1 p ‾ i , 2 . . . p ‾ i , 3 m - 2 , Can curve be tried to achieve by this 3m-2 reference mark:
S i ( l , k , u ) = Σ M = 1 k [ Π N = 1 N ≠ l k M - N l - N Σ M = 0 3 p ( M + 3 l - 3 ) B M , 3 ( u ) ] , u ∈ [ 0,1 ] , l ≤ k (wherein k is total hop count, and l is wherein l section).When i changes from 1 to n, n bar curve can be obtained successively.
For a certain u value, get n point [S by the column direction of offset dot matrix 1(l, k, u) S 2(l, k, u) ... S n(l, k, u)], in like manner can generate 3n-2 reference mark p ‾ i , 1 p ‾ i , 2 . . . p ‾ i , 3 n - 2 , Therefore corresponding curve can be generated:
S j ( l , k , v ) = Σ M = 1 k [ Π N = 1 N ≠ l k M - N l - N Σ M = 0 3 p ( M + 3 l - 3 ) B M , 3 ( v ) ] , v ∈ [ 0,1 ] , l ≤ k .
When u is from 0 to 1 change, owing to being get a little in a column direction, so can generate curved surface band, the interval of u is less, and curved surface band is more intensive.
As [S 1(l, k, u) S 2(l, k, u) ... S n(l, k, u)] in l when changing from 1 to k, then can obtain whole curved surface.As from the foregoing, curve S i(l, k, v) is the baseline of required curved surface, S j(l, k, v) is bus, and the C1 of the baseline of tensor product curved surface and bus ensure that the C1 of whole curved surface is continuous continuously.When the dimension of offset dot matrix increases, eliminate the process of surface joining, and the method can also be directed to actual demand, carry out gridding segmentation to curved surface, process is as follows: determine u, v direction, u direction upper curve is quadratured, calculates the total length L of curve, and remember l i(i=0,1,2 ... m-2) be the length of every section; Order for segmentation interval, N is for always to segment number; for the segmentation number of every section;
Parametric equation according to Bezier curve:
x ( t ) = ( 1 - t ) 3 P x 0 + 3 t ( 1 - t ) 2 P x 1 + 3 t 2 ( 1 - t ) P x 2 + t 3 P x 3 y ( t ) = ( 1 - t ) 3 P y 0 + 3 t ( 1 - t ) 2 P y 1 + 3 t 2 ( 1 - t ) P y 2 + t 3 P y 3 z ( t ) = ( 1 - t ) 3 P z 0 + 3 t ( 1 - t ) 2 P z 1 + 3 t 2 ( 1 - t ) P z 2 + t 3 P z 3 , t ∈ [ 0,1 ] And make
t = j n i , ( j = 0,1,2 . . . n i - 1 ) , Coordinate a little can be segmented;
After obtaining the coordinate of all segmentation points of u direction, v direction utilize the algorithm of matching Bezier curve can complete segmentation.
Adopt said method to simulate the high Bezier curved surface of profiling degree, and this curved surface can pass through all data points, ensure that the continuity of this curved surface, in surface fitting, reduces complexity, improve Fitting efficiency.
Fig. 8 shows a kind of Bezier matching system based on moral Castries algorithm difficult to understand that the embodiment of the present invention provides, as shown in Figure 8, this Bezier matching system comprises: reference mark acquisition module 81, control coefrficient determination module 82 and curve fitting module 83.
Reference mark acquisition module 81, for obtaining n data point of Bezier, by n data point of described Bezier, obtains 2 × (n-2) individual reference mark according to moral Castries algorithm difficult to understand;
For example, corresponding two reference mark of each known data point in the acquisition module of described reference mark, this data point does not comprise starting point and the terminal of described Bezier.
Control coefrficient determination module 82, for arranging control coefrficient on described reference mark, regulates described Bezier in the curvature at described data point place by changing described control coefrficient, and control coefrficient when determining that described curvature is target curvature;
In the present embodiment, the span of described control coefrficient is [0,2].Can be drawn by the experiment in said method, when C=0.7, be defined as control coefrficient during target curvature.
Curve fitting module 83, for according to the described control coefrficient after determining, obtains the Bezier after matching.
For example, above-mentioned curve fitting module 83 specifically for:
According to the described control coefrficient after determining, obtain the function expression of the described Bezier of m section;
According to the function expression of the described Bezier of described m section, utilize Langrange interpolation polynomial algorithm, obtain k section Bezier;
Wherein, k is total hop count of Bezier, and k=n-1, described m are the m section in k section Bezier, 1≤m≤n-1.
Fig. 9 shows the bezier surface matching system based on moral Castries algorithm difficult to understand that the embodiment of the present invention provides, and as shown in Figure 9, this bezier surface matching system comprises:
Curve determination module 91, for treating u, v direction of matching bezier surface described in determining, quadraturing to the Bezier on u direction, obtaining the total length of described u direction Bezier;
First Curve Subdivision module 92, for segmenting the total length of described u direction Bezier, and obtains the coordinate of segmentation point;
Second Curve Subdivision module 93, for segmenting coordinate a little according to u direction, segments the total length of v direction Bezier;
Surface fitting module 94, for according to many Beziers of u direction matching and the matching of v direction many Beziers, obtain the bezier surface after matching.
Carry out following experiment to the above-mentioned Bezier curved surface fitting method adopted described in the present embodiment and system below to verify:
The approximating method of the curve of the present invention that Figure 10 provides for the embodiment of the present invention and the correlation curve figure of sin function curve, as shown in Figure 10, this shows, adopts the curve fidelity of method matching of the present invention higher, and curve is continuously and through all data points.
The correlation curve figure of the approximating method of the curve of the present invention that Figure 11 provides for one embodiment of the invention and the sin function curve of special spacing, as shown in figure 11, this shows, adopt the curve fidelity of method matching of the present invention higher, curve continuously and through all data points, overlap with former sin function curve.
The graph of a relation of the data point number that Figure 12 A to 12B provides for one embodiment of the invention and error of fitting, as seen from the figure, along with the increase of data point number n, when n is from 1 to 2 change, error increases, and this is because data point is now on same straight line, not the feature of sin function; After n is greater than 3, error of fitting reduces fast, finally levels off to zero.
The graph of a relation of the data point number that Figure 13 A to 13C provides for another embodiment of the present invention and error of fitting, as shown in FIG. 13A, circle is got 10 points at equal intervals, obtain fitted figure, can find at starting point and destination county (the rightest place), have larger error, so reduce error by increasing data point, increasing offset counts to 30, can obtain shown in fitted figure 13B, can find there has been larger improvement than 13A in the error of starting point and destination county (the rightest place), two data points can also be increased at the data point place that error is large simultaneously, as shown in fig. 13 c, obtain the curve that error is less.
The following detailed description of the algorithm contrast obtaining Bezier reference mark, adopt the advantage of the inventive method:
The first is that simultaneous linear equations carries out solving reference mark:
Because any point on Bezier curve can be provided by formula: S ( t ) = Σ i = 0 n p i B i , n ( t ) , t ∈ [ 0,1 ] , Wherein:
p ifor reference mark.For known n data point A0, A1, A2 ... An-1,
A 0 = p 0 A 1 = p 0 c 1 0 t 0 ( 1 - t ) 1 + p 1 c 1 1 t 1 ( 1 - t ) 0 = p 0 ( 1 - t ) + p 1 t A 2 = p 0 c 2 0 t 0 ( 1 - t ) 2 + p 1 c 2 1 t 1 ( 1 - t ) 1 + p 2 c 2 2 t 2 ( 1 - t ) 0 = p 0 ( 1 - t ) 2 + p 1 c 2 1 t 1 ( 1 - t ) 1 + p 2 t 2 . . . A m = p 0 c m 0 ( 1 - t ) m + p 1 c m 1 t 1 ( 1 - t ) m - 1 + . . . + p m - 1 c m - 1 m - 1 t m - 1 . . . A n - 1 = p n - 1
Generally get with known data point A icorresponding.
This algorithm shortcomings: owing to adopting direct method to solve system of linear equations, calculated amount is O (n 3).Along with the quantity of data point increases, the exponent number of system of equations can increase, and can cause the sharp increase of calculated amount; The reference mark obtained by this algorithm is non-adjustable, may cause having jump phenomena in local, can not be spacing.
The second finds reference mark on angular bisector vertical line:
If A, B, C are known data point, so can the vertical line on the angular bisector crossing B point find B1, B2 as new reference mark at 2.As shown in figure 14, if adopt the method C point to move in BC direction, cutting of B point place vows that direction is fixed, and cannot change according to the actual requirements.
The third contrasts with conventional several interpolation algorithms, the data point selection rule about this valve: select starting point and terminal to be data point; The extreme point between starting point and terminal is selected to be data point; To above-mentioned data point matching, if effect is bad, choose corresponding extreme point again, until satisfy the demands for local.
Be directed to actual scanning object, wish to utilize minimum data point to carry out matching to target, therefore we are according to above-mentioned constituency rule, gather 5 point data of certain subject surface and carry out matching, contrast with other four kinds of interpolation methods, comparison diagram as follows as shown in figure 15 again.As seen from Figure 15, method of the present invention meets design requirement.
Be some application examples of surface fitting of the present invention below.
To be aircraft wing covering figure, Figure 16 B be Figure 16 A adopts the aircraft wing Skinning Surfaces figure after the inventive method matching, and as seen from the figure, adopt above-mentioned curved surface fitting method of the present invention, the surface chart profiling degree after matching is higher.
Figure 17 A be adopt the inventive method generate semicolumn curve surface of workpiece figure, Figure 17 B be adopt this method segmentation after surface chart, as seen from the figure, adopt method surface subdivision effect of the present invention more obvious.

Claims (10)

1., based on a Bezier approximating method for moral Castries algorithm difficult to understand, it is characterized in that, comprising:
Obtain n data point of Bezier, by n data point of described Bezier, obtain 2 × (n-2) individual reference mark according to moral Castries algorithm difficult to understand;
Described reference mark arranging control coefrficient, regulating described Bezier in the curvature at described data point place by changing described control coefrficient, and control coefrficient when determining that described curvature is target curvature;
According to the described control coefrficient after determining, obtain the Bezier after matching.
2. method according to claim 1, is characterized in that, n data point of described acquisition Bezier, by n data point of described Bezier, obtains 2 × (n-2) individual reference mark, comprising according to moral Castries algorithm difficult to understand:
Corresponding two reference mark of each known data point, this data point does not comprise starting point and the terminal of described Bezier.
3. method according to claim 1, is characterized in that, the span of described control coefrficient is [0,2].
4. method according to claim 1, is characterized in that, described according to the described control coefrficient after determining, obtains the Bezier after matching, comprising:
According to the described control coefrficient after determining, obtain the function expression of the described Bezier of m section;
According to the function expression of the described Bezier of described m section, utilize Langrange interpolation polynomial algorithm, obtain k section Bezier;
Wherein, k is total hop count of Bezier, and k=n-1, described m are the m section in k section Bezier, 1≤m≤n-1.
5. according to any one of Claims 1-4 based on the bezier surface approximating method of moral Castries algorithm difficult to understand, it is characterized in that, comprising:
Treat u, v direction of matching bezier surface described in determining, the Bezier on u direction is quadratured, obtain the total length of described u direction Bezier;
The total length of described u direction Bezier is segmented, and obtains the coordinate of segmentation point;
According to u direction, segment coordinate a little, the total length of v direction Bezier is segmented;
According to many Beziers of u direction matching and the matching of v direction many Beziers, obtain the bezier surface after matching.
6., based on a Bezier matching system for moral Castries algorithm difficult to understand, it is characterized in that, comprising:
Reference mark acquisition module, for obtaining n data point of Bezier, by n data point of described Bezier, obtains 2 × (n-2) individual reference mark according to moral Castries algorithm difficult to understand;
Control coefrficient determination module, for arranging control coefrficient on described reference mark, regulates described Bezier in the curvature at described data point place by changing described control coefrficient, and control coefrficient when determining that described curvature is target curvature;
Curve fitting module, for according to the described control coefrficient after determining, obtains the Bezier after matching.
7. system according to claim 6, is characterized in that, corresponding two reference mark of each known data point in the acquisition module of described reference mark, this data point does not comprise starting point and the terminal of described Bezier.
8. system according to claim 6, is characterized in that, the span of described control coefrficient is [0,2].
9. system according to claim 6, is characterized in that, described curve fitting module, for:
According to the described control coefrficient after determining, obtain the function expression of the described Bezier of m section;
According to the function expression of the described Bezier of described m section, utilize Langrange interpolation polynomial algorithm, obtain k section Bezier;
Wherein, k is total hop count of Bezier, and k=n-1, described m are the m section in k section Bezier, 1≤m≤n-1.
10. according to any one of claim 6 to 9 based on the bezier surface matching system of moral Castries algorithm difficult to understand, it is characterized in that, comprising:
Curve determination module, for treating u, v direction of matching bezier surface described in determining, quadraturing to the Bezier on u direction, obtaining the total length of described u direction Bezier;
First Curve Subdivision module, for segmenting the total length of described u direction Bezier, and obtains the coordinate of segmentation point;
Second Curve Subdivision module, for segmenting coordinate a little according to u direction, segments the total length of v direction Bezier;
Surface fitting module, for according to many Beziers of u direction matching and the matching of v direction many Beziers, obtain the bezier surface after matching.
CN201410469987.1A 2014-09-15 2014-09-15 Bezier curve surface fitting method and system based on de Casteljau algorithm Pending CN104268942A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410469987.1A CN104268942A (en) 2014-09-15 2014-09-15 Bezier curve surface fitting method and system based on de Casteljau algorithm

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410469987.1A CN104268942A (en) 2014-09-15 2014-09-15 Bezier curve surface fitting method and system based on de Casteljau algorithm

Publications (1)

Publication Number Publication Date
CN104268942A true CN104268942A (en) 2015-01-07

Family

ID=52160461

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410469987.1A Pending CN104268942A (en) 2014-09-15 2014-09-15 Bezier curve surface fitting method and system based on de Casteljau algorithm

Country Status (1)

Country Link
CN (1) CN104268942A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105354870A (en) * 2015-10-21 2016-02-24 新奥特(北京)视频技术有限公司 Restoration method and apparatus for drawn track
CN106683057A (en) * 2016-12-23 2017-05-17 中国计量大学 Method for automatically geometrically correcting multi-projection display walls with optional continuous screens with curved surfaces
CN110599568A (en) * 2019-09-12 2019-12-20 广州视源电子科技股份有限公司 Line generation method, device, equipment and storage medium
CN112150577A (en) * 2020-08-31 2020-12-29 北京师范大学 Continuation method of cubic B-spline
CN113283074A (en) * 2021-05-21 2021-08-20 华中科技大学 Method and system for activating potential flexibility of power system
CN116662731A (en) * 2023-08-01 2023-08-29 泉州昆泰芯微电子科技有限公司 Signal fitting method, magnetic encoder, optical encoder and control system

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105354870A (en) * 2015-10-21 2016-02-24 新奥特(北京)视频技术有限公司 Restoration method and apparatus for drawn track
CN106683057A (en) * 2016-12-23 2017-05-17 中国计量大学 Method for automatically geometrically correcting multi-projection display walls with optional continuous screens with curved surfaces
CN110599568A (en) * 2019-09-12 2019-12-20 广州视源电子科技股份有限公司 Line generation method, device, equipment and storage medium
CN110599568B (en) * 2019-09-12 2023-06-06 广州视源电子科技股份有限公司 Line generation method, device, equipment and storage medium
CN112150577A (en) * 2020-08-31 2020-12-29 北京师范大学 Continuation method of cubic B-spline
CN113283074A (en) * 2021-05-21 2021-08-20 华中科技大学 Method and system for activating potential flexibility of power system
CN113283074B (en) * 2021-05-21 2024-05-14 华中科技大学 Method and system for activating potential flexibility of power system
CN116662731A (en) * 2023-08-01 2023-08-29 泉州昆泰芯微电子科技有限公司 Signal fitting method, magnetic encoder, optical encoder and control system
CN116662731B (en) * 2023-08-01 2023-10-20 泉州昆泰芯微电子科技有限公司 Signal fitting method, magnetic encoder, optical encoder and control system

Similar Documents

Publication Publication Date Title
CN104268942A (en) Bezier curve surface fitting method and system based on de Casteljau algorithm
Kociecki et al. Shape optimization of free-form steel space-frame roof structures with complex geometries using evolutionary computing
Foley et al. Knot selection for parametric spline interpolation
CN104318621B (en) Ship hull surface reconstructing method based on non-uniform rational B-spline surface interpolation
US6911980B1 (en) Manipulation of curves and surfaces
CN105513110A (en) GPU-based method for drawing linetype map symbol with gradually-varied width
JP2006190049A (en) Method and device for drawing apex reduced pattern
CN105354881B (en) Distortion of the mesh optimized algorithm based on Category Attributes data
CN111310106B (en) Cutting contour fitting optimization method based on successive approximation of original contour
CN102981454A (en) Cutter track generating method based on potential energy field and energy functional optimization
CN103761708B (en) Image repair method based on outline
Sariöz An optimization approach for fairing of ship hull forms
CN106447671A (en) Automatic vector polygon segmentation method based on designated areas
CN113791617A (en) Global path planning method based on physical dimension of fire-fighting robot
CN104851133A (en) Image self-adaptive grid generation variational method
CN114545863A (en) Track smoothing method for numerical control machining based on B spline curve fitting
CN102385757B (en) Semantic restriction texture synthesis method based on geometric space
CN106296572A (en) A kind of face editor based on parts and beautification method
Hahmann Shape improvement of surfaces
CN116522660A (en) Numerical simulation method and system for explosion problem
CN104200423A (en) Multi-control-point based automatic adjusting method for upper and lower border line shapes of vector graphics
Šamec et al. An extended linear procedure for constrained form finding
US20160171760A1 (en) Electronic device and method for processing point cloud
CN102663184B (en) Rasterization method of algebraic B-spline curve based on regularization conditions
US7333109B2 (en) System, method and computer program product for modeling at least one section of a curve

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20150107