CN101527032A - Mutual distortion method among planar arbitrary polygons - Google Patents

Mutual distortion method among planar arbitrary polygons Download PDF

Info

Publication number
CN101527032A
CN101527032A CN200910029210A CN200910029210A CN101527032A CN 101527032 A CN101527032 A CN 101527032A CN 200910029210 A CN200910029210 A CN 200910029210A CN 200910029210 A CN200910029210 A CN 200910029210A CN 101527032 A CN101527032 A CN 101527032A
Authority
CN
China
Prior art keywords
polygon
point
termination
broken line
initial
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
CN200910029210A
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.)
Kunshan Industrial Technology Research Institute Co Ltd
Original Assignee
Kunshan Industrial Technology Research Institute Co Ltd
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 Kunshan Industrial Technology Research Institute Co Ltd filed Critical Kunshan Industrial Technology Research Institute Co Ltd
Priority to CN200910029210A priority Critical patent/CN101527032A/en
Publication of CN101527032A publication Critical patent/CN101527032A/en
Pending legal-status Critical Current

Links

Images

Abstract

The invention discloses a mutual distortion method among planar arbitrary polygons, which is characterized in that a polygon is divided into a plurality of sections of polylines; the corresponding relationship of an initial polygon and a terminate polygon is set up according to the proportion of high points of the polygon on the polylines; the corresponding relationship comprises the segmentation of the polygon, the distortion among the polylines, and the distortion between single points and the polylines; and finally, the terminate polygon is interpolated. The invention can automatically segment the polygon, set up the corresponding relationship between sections and also automatically interpolate a middle result according to the total frame number and the corresponding situation of the polygon in each region, thereby the invention avoids artificial subjectivity and has the characteristics of high precision and high efficiency.

Description

Mutual distortion method among planar arbitrary polygons
Technical field
The present invention relates to the deformation technology of planar graph, relate in particular to a kind of mutual distortion method among planar arbitrary polygons.
Background technology
At present, the method for phase enantiotropy is a lot of between planar arbitrary polygons, but all needs to look for the corresponding relation on initial polygon and the polygonal summit of termination, after having set up the summit corresponding relation, again the summit motion path is made interpolation.This process of corresponding point of looking for itself just has artificial subjectivity, especially under initial and two inconsistent situations of polygon vertex number of termination, because need artificial insertion summit, so its subjectivity is more obvious.
Summary of the invention
In order to overcome the deficiency that prior art exists, the object of the present invention is to provide a kind of mutual distortion method among planar arbitrary polygons that reduces artificial subjectivity.
The present invention is achieved by the following technical solutions:
A kind of mutual distortion method among planar arbitrary polygons is characterized in that comprising following step:
1. import initial polygon and the polygonal summit of termination, and to the polygon processing that unitizes of input;
2. find out each unique point in initial polygon and the termination polygon, with different polygons according to upper left, in last, upper right, lower-left, in down, in the bottom right, a left side, be divided into 8 sections in the right side, and set up initial polygon and the corresponding relation of termination polygon in each zone;
3. judge respectively that initial polygon and termination polygon are broken line or point in same section, be out of shape accordingly, calculate and write down each and put the move distance of each frame in initial polygon and termination polygon, these points are joined in the termination polygon array, forward next section to;
4. judge successively whether the every frame move distance of each section point of interface is identical, if identical then delete wherein any point;
5. connect polygonal each point of termination successively, draw the termination polygon.
Aforesaid mutual distortion method among planar arbitrary polygons, it is characterized in that described step 3. in, if judge that initial polygon and termination polygon all are broken line in same section, then carry out the distortion between broken line and the broken line: calculate termination polygon each the distance and the ratio of the length overall of whole section broken line on the broken line in the section separately in initial polygon and the corresponding region along broken line to this regional starting point, ratio is sorted from small to large, find the position of point on the termination polygon that has these ratios on the initial polygon broken line with the ratio after the ordering then, and the position of point on initial polygon that has these ratios on the termination polygon broken line, calculate and write down the move distance that each puts each frame, these points are joined in the termination polygon array, forward next section to.
Aforesaid mutual distortion method among planar arbitrary polygons, it is characterized in that described step 3. in, the polygon that terminates is one section broken line if judgement initial polygon in same section only has a point, then carry out the distortion between single-point and the broken line: in initial polygon, insert " broken line number of vertex-1 in this section of termination polygon " individual initial vertax, these points are a plurality of coincide points, make initial polygon this section have with termination polygon this section broken line on identical the counting of number of vertex, interpolation goes out the centre position of each point on coincide point and the broken line, calculate and write down the move distance that each puts each frame, these points are joined in the termination polygon array, forward next section to.
Aforesaid mutual distortion method among planar arbitrary polygons, it is characterized in that described step 3. in, if judging initial polygon is broken line, and the termination polygon in the corresponding region is a single-point, then make the single-point on the corresponding broken line of all corresponding termination polygon of each point on the initial polygon broken line, calculate and write down the move distance that each puts each frame, these points are joined in the termination polygon array, forward next section to.
Aforesaid mutual distortion method among planar arbitrary polygons, it is characterized in that described step 3. in, if judge that the termination polygon in initial polygon and the corresponding region all is a single-point, then carry out the distortion between single-point and the single-point, intermediate point between 2 of the interpolation, calculate and write down the move distance that each puts each frame, these points are joined in the termination polygon array, forward next section to.
Aforesaid mutual distortion method among planar arbitrary polygons is characterized in that described unitized processing, at first finds in initial polygon and the termination polygon point of Y coordinate maximum in the X coordinate maximum point, and then along clockwise direction, the sequence number of point increases successively; Calculate this point and more preceding vector value, some vector values of this point and back at last, these two vector values of multiplication cross are if the result is less than 0, sequence number is sketched the contours of according to clockwise direction, need not change order, if the result is not less than 0, then to change the order of the point in the termination polygon array.
Aforesaid mutual distortion method among planar arbitrary polygons, it is characterized in that described step 2. in, when initial polygon is carried out segmentation with the termination polygon, whole polygon is counted as and is embedded in the rectangle, and all extreme points all are positioned on this rectangle on the polygon, these extreme points are respectively: Y coordinate smallest point in the X coordinate smallest point, Y coordinate maximum point in the X coordinate smallest point, X coordinate smallest point in the Y coordinate maximum point, X coordinate maximum point in the Y coordinate maximum point, Y coordinate maximum point in the X coordinate maximum point, Y coordinate smallest point in the X coordinate maximum point, X coordinate maximum point in the Y coordinate smallest point, X coordinate smallest point in the Y coordinate smallest point, zone between the adjacent extreme point forms one section broken line, and polygon is by according to upper left, in on, upper right, the lower-left, in down, the bottom right, in the left side, 8 sections broken lines that are divided in the right side combine.
The invention has the beneficial effects as follows: the present invention can carry out segmentation to polygon automatically, and the corresponding relation between foundation section and the section, and can be according to total frame number, the corresponding situation automatic interpolation of each regional internal polygon intermediate result, therefore avoided artificial subjectivity, has the precision height, the characteristic that efficient is high.
Description of drawings
Fig. 1 is initial polygon of the present invention and the polygonal segmentation synoptic diagram of termination;
Fig. 2 is that the ratio value of each point of the present invention calculates synoptic diagram;
Fig. 3 is the initial polygon synoptic diagram that a single point is only arranged in some section of the present invention.
Embodiment
The invention will be further described below in conjunction with accompanying drawing:
Fig. 1 is for being initial polygon of the present invention and the polygonal segmentation synoptic diagram of termination; Fig. 2 is to be the ratio value calculating synoptic diagram of each point of the present invention; Fig. 3 is to be the initial polygon synoptic diagram that a single point is only arranged in some section of the present invention.
Mutual distortion method among planar arbitrary polygons of the present invention may further comprise the steps:
(1) input initial polygon and the termination polygonal summit Pi (i=0,1 ... n), Qj (j=0,1 ... m), to the polygon processing that unitizes of input, as shown in Figure 1, establishing the B point is No. 1 point, and sequence number along clockwise direction increases successively.Specifically be to find in initial and the termination polygon point of Y value maximum in the X coordinate smallest point earlier, calculate this point and more preceding vector value again
Figure A20091002921000061
This point and the vector value that descends a bit
Figure A20091002921000062
These two vector values of multiplication cross If the result is less than 0, explanation is sketched the contours of clockwise, need not change order, only making the B point is No. 1 point.Otherwise, also to change the order of polygon array mid point simultaneously.
(2) find out initial polygon and termination polygon each unique point A, B, C, D, E, F, G, H, with initial polygon and the segmentation of termination polygon.And note sequence number in the polygon of these unique points after unitized, and set up the corresponding relation of the initial polygon broken line in each zone and termination polygon broken line.
Promptly as shown in Figure 1: whole initial polygon and termination polygon are counted as in the rectangle separately that is embedded in as shown in Figure 1, and the character that described rectangle has is: extreme points all on the polygon all are positioned on this rectangle.These extreme points are respectively: Y coordinate smallest point in the X coordinate smallest point------------------X coordinate maximum point in F point, the Y coordinate smallest point---X coordinate smallest point in G point, the Y coordinate smallest point---the H point of Y coordinate smallest point in E point, the X coordinate maximum point of Y coordinate maximum point in D point, the X coordinate maximum point of X coordinate maximum point in C point, the Y coordinate maximum point of X coordinate smallest point in B point, the Y coordinate maximum point of Y coordinate maximum point in A point, the X coordinate smallest point.Unitize by initial, termination polygon to input, make the A point be the 0th point of call number, then the call number of any one point can be decided on the polygon.
Initial and termination polygon can be regarded the combination of the multistage broken line that is split to form by all extreme points again as, and all broken lines all are arranged in 0 to No. 7 section (lower left corner is the 0th section, and segment number is along with clockwise direction increases progressively) as shown in Figure 1.So polygonal distortion is the process that eight sections initial polygon broken lines are deformed into eight sections termination polygon broken lines in the respective regions.
(3) deformation process comprises the distortion between single-point or broken line and single-point or the broken line.Be specially:
1. the deformation process between broken line and the broken line
It can be considered as the deformation process of one section elastic threads for the deformation process of the broken line in any zone.This rope has such characteristics: 1, original length is infinitely small; 2, can be drawn into random length.With Fig. 2 is example.Make this broken line become A ' G ' from AG, can find B, C, D, E, the length of these original point of F earlier along broken line to first point, use the total length of these length then divided by broken line, obtain a ratio r, this ratio has just been determined the position of this point at the whole piece broken line, the distance that B, C, D, E, F point orders along broken line to A is divided by the total length of initial broken line, and H point arrives A ' distance divided by the total length of the polygon broken line that terminates along broken line.This ratio has been arranged, and we just can set up B, C, D, E, F point in the position on the termination broken line and the H point position on initial polygon broken line.
First and last point A, G are moved at A ', G ' can think that such process: O moves to X, Y scaling X that O ' motion process is superimposed with rectangle Scale, Y Scale, wherein:
X Scale=L’/L Y Scale=W’/W
As follows with matrix representation:
( X ′ , Y ′ ) = [ ( X , Y ) + ( - X 0 , - Y 0 ) ] X Scale Y Scale + [ X 0 ′ , Y 0 ′ ] - - - ( 1 )
The motion of other points also will be superimposed with Δ X, Δ Y, and existing is example with the B point, wherein:
ΔX=X B′-X B″?ΔY=Y B′-Y B″
X wherein B ", Y B "X, Y coordinate substitution formula (1) that B is ordered are tried to achieve.Obviously B ' coordinate is (X B "+ Δ X, Y B "+ Δ Y).Above deformation process is distortion to be made as a frame is only arranged.If this process is divided into the n frame, so A, G o'clock at the i frame (position of 1≤i≤n) can become formula (2) by formula (1), promptly
( X i , Y i ) = [ ( X , Y ) + ( - X 0 , - Y 0 ) ] i × X Scale / n i × Y Scale / n + [ X 0 ′ , Y 0 ′ ] - - - ( 2 )
On the broken line other o'clock can be expressed as at i coordinate constantly: X i+ i * Δ X/n, Y i+ i * Δ Y/n.When i=n, just realized above whole deformation process.
It is a bit linear at the position and the frame number of any frame arbitrarily on the broken line to make discovery from observation, and it is as follows to derive: to the first and last point, i frame X, Y coordinate are:
X i=(X-X 0)×X Scale×i/n、Y i=(Y-Y 0)×Y Scale×i/n
To other points, i frame X, Y coordinate are:
X i=((X-X 0)×X Scale+ΔX)×i/n、Y i=((Y-Y 0)×Y Scale+ΔY)×i/n
Because (X-X 0) * X Scale/ n, Δ X, (Y-Y 0) * Y Scale/ n, Δ Y are constant, so a bit linear at the coordinate and the frame number of i frame arbitrarily on the broken line, then a bit we can obtain by the first and last position of this point of interpolation in the position of i frame arbitrarily, can be reduced to:
(1-i/n)×X+i/n×X′、(1-i/n)×Y+i/n×Y′ (3)
All points (A, B, C, D, E, F, G, H) on so whole this section broken line any one the process that changes to the termination shape from original shape position constantly can be decided, and can decide as long as connect these shapes of putting this broken line successively.
2. the distortion between initial polygonal single-point and the polygonal broken line of termination
In some cases, in initial polygonal some section, may not have complete broken line, and a point is only arranged, as shown in Figure 3, △ ABC only has a point in 1,3,5,6,7 section, if this polygon will be deformed into termination polygon shown in Figure 1, the point of △ ABC in these sections will become broken line so.The simplest method is the point that increases in this section, inserts " broken line number of vertex-1 in this section of termination polygon " individual initial vertax in initial polygon, makes the quantity of the point in this zone suitable with termination polygon quantity, and obviously the position of all these points is all identical.Interpolation goes out the centre position of each point on coincide point and the broken line then, finds out these points and the polygonal corresponding relation of termination, and then every bit also can be showed by formula (3) at X, the Y coordinate of i frame.This has just realized the distortion between point and the broken line.
3. the distortion between initial polygonal broken line and the polygonal single-point of termination
If initial polygon is a broken line in certain section, and in this section of termination polygon correspondence, only be a point, can make all points on the initial polygonal broken line set up corresponding relation so, use formula (3) to determine X, the Y coordinate of these o'clocks again at the i frame with polygonal this point of termination.
4. the distortion between single-point and the single-point
If initial polygon and termination polygon all are single-point in the section of correspondence, then the intermediate point between 2 of the simple interpolations gets final product.
Then to being out of shape successively in each corresponding region.
(4) judge successively whether the every frame move distance of each section point of interface is identical, if identical deletion any point wherein.
(5) connect polygonal each point of termination successively, draw the termination polygon.
Below disclose the present invention with preferred embodiment, so it is not in order to restriction the present invention, and all employings are equal to replaces or technical scheme that the equivalent transformation mode is obtained, all drops within protection scope of the present invention.

Claims (7)

1, a kind of mutual distortion method among planar arbitrary polygons is characterized in that comprising following step:
1. import initial polygon and the polygonal summit of termination, and to the polygon processing that unitizes of input;
2. find out each unique point in initial polygon and the termination polygon, with different polygons according to upper left, in last, upper right, lower-left, in down, in the bottom right, a left side, be divided into 8 sections in the right side, and set up initial polygon and the corresponding relation of termination polygon in each zone;
3. judge respectively that initial polygon and termination polygon are broken line or point in same section, be out of shape accordingly, calculate and write down each and put the move distance of each frame in initial polygon and termination polygon, these points are joined in the termination polygon array, forward next section to;
4. judge successively whether the every frame move distance of each section point of interface is identical, if identical then delete wherein any point;
5. connect polygonal each point of termination successively, draw the termination polygon.
2, mutual distortion method among planar arbitrary polygons according to claim 1, it is characterized in that described step 3. in, if judge that initial polygon and termination polygon all are broken line in same section, then carry out the distortion between broken line and the broken line: calculate termination polygon each the distance and the ratio of the length overall of whole section broken line on the broken line in the section separately in initial polygon and the corresponding region along broken line to this regional starting point, ratio is sorted from small to large, find the position of point on the termination polygon that has these ratios on the initial polygon broken line with the ratio after the ordering then, and the position of point on initial polygon that has these ratios on the termination polygon broken line, calculate and write down the move distance that each puts each frame, these points are joined in the termination polygon array, forward next section to.
3, mutual distortion method among planar arbitrary polygons according to claim 1, it is characterized in that described step 3. in, the polygon that terminates is one section broken line if judgement initial polygon in same section only has a point, then carry out the distortion between single-point and the broken line: in initial polygon, insert " broken line number of vertex-1 in this section of termination polygon " individual initial vertax, these points are a plurality of coincide points, make initial polygon this section have with termination polygon this section broken line on identical the counting of number of vertex, interpolation goes out the centre position of each point on coincide point and the broken line, calculate and write down the move distance that each puts each frame, these points are joined in the termination polygon array, forward next section to.
4, mutual distortion method among planar arbitrary polygons according to claim 1, it is characterized in that described step 3. in, if judging initial polygon is broken line, and the termination polygon in the corresponding region is a single-point, then make the single-point on the corresponding broken line of all corresponding termination polygon of each point on the initial polygon broken line, calculate and write down the move distance that each puts each frame, these points are joined in the termination polygon array, forward next section to.
5, mutual distortion method among planar arbitrary polygons according to claim 1, it is characterized in that described step 3. in, if judge that the termination polygon in initial polygon and the corresponding region all is a single-point, then carry out the distortion between single-point and the single-point, intermediate point between 2 of the interpolation, calculate and write down the move distance that each puts each frame, these points are joined in the termination polygon array, forward next section to.
6, mutual distortion method among planar arbitrary polygons according to claim 1, it is characterized in that described unitized processing, at first find in initial polygon and the termination polygon point of Y coordinate maximum in the X coordinate smallest point, then along clockwise direction, the sequence number of point increases successively; Calculate this point and more preceding vector value, some vector values of this point and back at last, these two vector values of multiplication cross are if the result is less than 0, sequence number is sketched the contours of according to clockwise direction, need not change order, if the result is not less than 0, then to change the order of the point in the termination polygon array.
7, mutual distortion method among planar arbitrary polygons according to claim 1, it is characterized in that described step 2. in, when initial polygon is carried out segmentation with the termination polygon, whole polygon is counted as and is embedded in the rectangle, and all extreme points all are positioned on this rectangle on the polygon, these extreme points are respectively: Y coordinate smallest point in the X coordinate smallest point, Y coordinate maximum point in the X coordinate smallest point, X coordinate smallest point in the Y coordinate maximum point, X coordinate maximum point in the Y coordinate maximum point, Y coordinate maximum point in the X coordinate maximum point, Y coordinate smallest point in the X coordinate maximum point, X coordinate maximum point in the Y coordinate smallest point, X coordinate smallest point in the Y coordinate smallest point, zone between the adjacent extreme point forms one section broken line, and polygon is by according to upper left, in on, upper right, the lower-left, in down, the bottom right, in the left side, 8 sections broken lines that are divided in the right side combine.
CN200910029210A 2009-04-03 2009-04-03 Mutual distortion method among planar arbitrary polygons Pending CN101527032A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN200910029210A CN101527032A (en) 2009-04-03 2009-04-03 Mutual distortion method among planar arbitrary polygons

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN200910029210A CN101527032A (en) 2009-04-03 2009-04-03 Mutual distortion method among planar arbitrary polygons

Publications (1)

Publication Number Publication Date
CN101527032A true CN101527032A (en) 2009-09-09

Family

ID=41094890

Family Applications (1)

Application Number Title Priority Date Filing Date
CN200910029210A Pending CN101527032A (en) 2009-04-03 2009-04-03 Mutual distortion method among planar arbitrary polygons

Country Status (1)

Country Link
CN (1) CN101527032A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102752520A (en) * 2011-05-17 2012-10-24 新奥特(北京)视频技术有限公司 Deformation method and system in polygon mode for two-dimensional subtitle
CN103065319A (en) * 2012-12-31 2013-04-24 上海同岩土木工程科技有限公司 Closed surface automatic search method of space multiply connected domain
CN104238921A (en) * 2013-06-21 2014-12-24 苏州精易会信息技术有限公司 Custom polygon drawing method and device

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102752520A (en) * 2011-05-17 2012-10-24 新奥特(北京)视频技术有限公司 Deformation method and system in polygon mode for two-dimensional subtitle
CN103065319A (en) * 2012-12-31 2013-04-24 上海同岩土木工程科技有限公司 Closed surface automatic search method of space multiply connected domain
CN103065319B (en) * 2012-12-31 2015-03-04 上海同岩土木工程科技有限公司 Closed surface automatic search method of space multiply connected domain
CN104238921A (en) * 2013-06-21 2014-12-24 苏州精易会信息技术有限公司 Custom polygon drawing method and device

Similar Documents

Publication Publication Date Title
CN102903134B (en) Fast Drawing is the method for curve repeatedly
CN101527032A (en) Mutual distortion method among planar arbitrary polygons
CN111611664B (en) Power transmission line path selection method and system
CN103092933A (en) Delaunay triangulation network parallel net-constructing method based on rectangular piecing towards magnanimity point cloud data
CN102193786A (en) Device and method for constructing self-adaptive graphic user interface (GUI)
CN104268237B (en) The batch parallel generation system and its generation method of electronic cartography
CN106023310A (en) Garment three-dimensional digital model customization platform system
CN108803498A (en) Numerical control device
CN110414708A (en) A kind of tide lane prioritization scheme selection method, device and storage medium
CN103077228A (en) Set characteristic vector-based quick clustering method and device
CN106406813B (en) A kind of general-purpose servo control arithmetic logic unit
CN102999931A (en) Method and device for drawing electronic handwriting
CN103310446B (en) A kind of solid matching method that instructs filtering based on iteration
CN104933675B (en) A kind of controllable complicated mosaic generation method of periodicity
CN108229075B (en) Auxiliary design method of folding paper box
CN110188290B (en) Distributed unmanned warehouse location recommendation intelligent algorithm based on star topology structure
CN109102311A (en) A kind of advertisement area partitioning method and device, equipment
CN102693525A (en) Method for solving problem of pixel multiple accesses to stack in seed filling algorithm
Rau et al. Industrialization and world inequality: The transformation of the division of labor in 59 nations, 1960-1981
CN101850564B (en) Numerical control surging and punching control method
Iranmanesh et al. Computation of the first edge-Wiener index of TUC4C8 (S) nanotube
Shi et al. Vehicle routing problem of an innovative B2C and O2O joint distribution service
Li Arrangement of machines under spatial constraint by using a novel algorithm
CN107346237A (en) A kind of more palace trrellis diagram piece processing method and processing devices based on iOS system
Bailey Efficient implementation of greyscale morphological filters

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C02 Deemed withdrawal of patent application after publication (patent law 2001)
WD01 Invention patent application deemed withdrawn after publication

Open date: 20090909