CN111444673B - Character bending deformation method, medium, equipment and device - Google Patents

Character bending deformation method, medium, equipment and device Download PDF

Info

Publication number
CN111444673B
CN111444673B CN202010156119.3A CN202010156119A CN111444673B CN 111444673 B CN111444673 B CN 111444673B CN 202010156119 A CN202010156119 A CN 202010156119A CN 111444673 B CN111444673 B CN 111444673B
Authority
CN
China
Prior art keywords
vertex
path control
control point
edge
bounding box
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.)
Active
Application number
CN202010156119.3A
Other languages
Chinese (zh)
Other versions
CN111444673A (en
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.)
Gaoding Xiamen Technology Co Ltd
Original Assignee
Gaoding Xiamen Technology 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 Gaoding Xiamen Technology Co Ltd filed Critical Gaoding Xiamen Technology Co Ltd
Priority to CN202010156119.3A priority Critical patent/CN111444673B/en
Publication of CN111444673A publication Critical patent/CN111444673A/en
Application granted granted Critical
Publication of CN111444673B publication Critical patent/CN111444673B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Controls And Circuits For Display Device (AREA)

Abstract

The invention discloses a character bending deformation method and a device, wherein the method comprises the following steps: acquiring path information of each character to be processed, calculating a bounding box according to path control points in the path information, and acquiring a centerline of the bounding box; setting a first vertex and a second vertex of the bounding box as fixed points; enabling the first rotating edge to rotate along the first vertex and the second rotating edge to rotate along the second vertex according to the rotating angle, and enabling each path control point to move along with the path control point; extending the rotated first rotating edge and the rotated second rotating edge to enable the first rotating edge and the second rotating edge to be intersected at a first intersection point, and obtaining the radius of an arc; calculating the distance of each moved path control point relative to the first intersection point according to the arc radius, and calculating the movement angle of each moved path control point relative to the center line of the bounding box according to the rotation angle; further calculating the position of each moved path control point to obtain a final deformed character; thereby greatly improving the controllability of the character bending deformation result.

Description

Character bending deformation method, medium, equipment and device
Technical Field
The present invention relates to the field of word processing technologies, and in particular, to a word bending deformation method, a computer-readable storage medium, a computer device, and a word bending deformation apparatus.
Background
In the related art, in order to achieve a certain artistic effect, characters are usually required to be subjected to bending deformation in an application process, in the existing bending deformation method for the characters, the characters are usually firstly rasterized, then the generated image is subjected to bending deformation, when the characters are subjected to bending deformation, if the characters are firstly zoomed and then deformed, the efficiency is affected, and if the characters are firstly deformed and then zoomed, the edge effect of the characters is affected, so that the controllability of the character bending deformation result is poor.
Disclosure of Invention
The present invention is directed to solving, at least to some extent, one of the technical problems in the art described above. Therefore, an object of the present invention is to provide a text bending deformation method, which greatly improves the controllability of the text bending deformation result by directly performing bending deformation around the adjacent vertexes of the text bounding box.
A second object of the invention is to propose a computer-readable storage medium.
A third object of the invention is to propose a computer device.
The fourth purpose of the invention is to provide a character bending and deforming device.
In order to achieve the above object, a first aspect of the present invention provides a method for bending and deforming characters, comprising the steps of: acquiring path information of a character to be deformed, wherein the path information comprises path control points; calculating a bounding box of the character to be deformed according to all path control points of the character to be deformed, and acquiring a centerline of the bounding box according to the bounding box; setting a first vertex and a second vertex of the bounding box as fixed points, wherein the first vertex and the second vertex are adjacent vertices; acquiring a rotation angle, rotating the first rotation edge along a first vertex and rotating the second rotation edge along a second vertex according to the rotation angle so as to enable each path control point to move along with the path control point; extending the rotated first rotating edge and the rotated second rotating edge to enable the first rotating edge and the second rotating edge to be intersected at a first intersection point, and acquiring the radius of the circular arc according to the first intersection point; calculating the distance of each moved path control point relative to the first intersection point according to the arc radius, and calculating the movement angle of each moved path control point relative to the center line of the bounding box according to the rotation angle; and calculating the position of each corresponding moved path control point according to the distance and the movement angle, and acquiring the final deformed character according to the position of each moved path control point.
According to the character bending deformation method provided by the embodiment of the invention, firstly, path information of a character to be deformed is obtained, wherein the path information comprises path control points; then, calculating a bounding box of the character to be deformed according to all path control points of the character to be deformed, and acquiring a center line of the bounding box according to the bounding box; then setting a first vertex and a second vertex of the bounding box as fixed points, wherein the first vertex and the second vertex are adjacent vertices; secondly, acquiring a rotation angle, rotating the first rotation edge along the first vertex and rotating the second rotation edge along the second vertex according to the rotation angle so as to enable each path control point to move along with the path control point; then extending the rotated first rotating edge and the rotated second rotating edge to enable the first rotating edge and the second rotating edge to intersect at a first intersection point, and acquiring the radius of the arc according to the first intersection point; then, calculating the distance of each moved path control point relative to the first intersection point according to the arc radius, and calculating the movement angle of each moved path control point relative to the center line of the bounding box according to the rotation angle; finally, calculating the position of each corresponding moved path control point according to the distance and the movement angle, and acquiring a final deformed character according to the position of each moved path control point; therefore, the invention greatly improves the controllability of the character bending deformation result by directly winding the adjacent vertexes of the character bounding box to perform bending deformation.
In addition, the character bending deformation method provided by the above embodiment of the invention may also have the following additional technical features:
optionally, the bounding box includes a first vertex, a second vertex, a third vertex, and a fourth vertex, a first deformed edge is formed between the first vertex and the second vertex, a first rotated edge is formed between the first vertex and the fourth vertex, a second rotated edge is formed between the second vertex and the third vertex, and a second deformed edge is formed between the third vertex and the fourth vertex.
Optionally, the first rotating edge and the second rotating edge rotate in opposite directions.
Optionally, the first rotation edge rotates in a counterclockwise direction, and the second rotation edge rotates in a clockwise direction.
Optionally, the distance of each moved path control point from the first intersection point is calculated according to the following formula:
R=RAO-b
wherein R represents the distance of the moved path control point relative to the first intersection point, RAORepresenting the radius of the arc and b the distance perpendicular to the first deformed edge of the path control point that has not moved.
Optionally, the moving angle of each moved path control point relative to the bounding box centerline is calculated according to the following formula:
Figure BDA0002404100940000021
where α represents a movement angle of the moved path control point with respect to the bounding box center line, a represents a distance of the path control point that is not moved perpendicular to the bounding box center line, AD represents a distance of the first deformed edge, and θ represents a rotation angle.
Optionally, the position of each path control point after the movement is calculated according to the following formula:
Px=Ox+Rsinα
Py=Oy+Rcosα
wherein, PxCoordinate of abscissa, O, indicating moved path control pointxThe abscissa representing the first intersection point, PyOrdinate, O, representing the moved path control pointyThe ordinate of the vertical axis of the first intersection point is indicated.
In order to achieve the above object, a second embodiment of the present invention provides a computer-readable storage medium, on which a text-bending program is stored, which, when executed by a processor, implements the text-bending method as described above.
According to the computer-readable storage medium of the embodiment of the invention, the word bending deformation program is stored, so that the processor can realize the word bending deformation method when executing the word bending deformation program, and the controllability of the word bending deformation result is greatly improved.
In order to achieve the above object, a third embodiment of the present invention provides a computer device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the processor executes the computer program, the processor implements the character bending deformation method as described above.
According to the computer equipment of the embodiment of the invention, the computer program which can run on the processor is stored through the memory, so that the processor can realize the character bending deformation method when executing the computer program, and the controllability of the character bending deformation result is greatly improved.
In order to achieve the above object, a fourth aspect of the present invention provides a character bending deformation apparatus, including: the system comprises an acquisition module, a deformation module and a deformation module, wherein the acquisition module is used for acquiring path information of each character to be deformed, and the path information comprises path control points; the first calculation module is used for calculating the bounding box of the character to be deformed according to all the path control points of the character to be deformed and acquiring the center line of the bounding box according to the bounding box; the setting module is used for setting a first vertex and a second vertex of the bounding box as fixed points, wherein the first vertex and the second vertex are adjacent vertices; the deformation module is used for acquiring a rotation angle, rotating the first rotation edge along a first vertex and rotating the second rotation edge along a second vertex according to the rotation angle so as to enable each path control point to move along with the path control point; the processing module is used for prolonging the rotated first rotating edge and the rotated second rotating edge to enable the first rotating edge and the second rotating edge to intersect at a first intersection point, and acquiring the radius of the circular arc according to the first intersection point; the first calculation module is used for calculating the distance between each moved path control point and the first intersection point according to the arc radius and calculating the movement angle of each moved path control point relative to the center line of the bounding box according to the rotation angle; and the second calculation module is used for calculating the position of each corresponding moved path control point according to the distance and the movement angle, and acquiring the final deformed character according to the position of each moved path control point.
According to the character bending deformation device provided by the embodiment of the invention, the path information of each character to be deformed is acquired through the acquisition module, wherein the path information comprises path control points; then, calculating an bounding box of the character to be deformed according to all path control points of the character to be deformed by a first calculation module, and acquiring a center line of the bounding box according to the bounding box; setting a first vertex and a second vertex of the bounding box as fixed points through a setting module, wherein the first vertex and the second vertex are adjacent vertices; then, a rotation angle is obtained through a deformation module, the first rotation edge is rotated along a first vertex according to the rotation angle, and the second rotation edge is rotated along a second vertex so that each path control point moves along with the rotation angle; then, extending the rotated first rotating edge and the rotated second rotating edge through a processing module to enable the first rotating edge and the second rotating edge to intersect at a first intersection point, and acquiring the radius of the arc according to the first intersection point; then, the second calculation module calculates the distance between each moved path control point and the first intersection point according to the arc radius, and calculates the movement angle of each moved path control point relative to the center line of the bounding box according to the rotation angle; finally, the third calculation module calculates the position of each corresponding moved path control point according to the distance and the movement angle, and obtains the final deformed character according to the position of each moved path control point; therefore, the character bounding box is bent and deformed by directly winding the adjacent vertexes of the character bounding box, so that the controllability of the character bending and deforming result is greatly improved.
Drawings
FIG. 1 is a flow chart of a method for bending and deforming text according to an embodiment of the invention;
FIG. 2 is a diagram of path information, according to one embodiment of the present invention;
FIG. 3 is a schematic view of a text bending deformation process according to one embodiment of the invention;
FIG. 4 is a schematic diagram illustrating an effect of a character to be deformed according to an embodiment of the present invention;
FIG. 5 is a diagram illustrating an effect of a character to be deformed according to an embodiment of the present invention;
FIG. 6 is a diagram illustrating an effect of a modified text according to an embodiment of the present invention;
FIG. 7 is a diagram illustrating an effect of a modified text according to an embodiment of the present invention;
FIG. 8 is a diagram illustrating an effect of a modified text according to an embodiment of the present invention;
FIG. 9 is a diagram illustrating an effect of a modified text according to an embodiment of the present invention;
fig. 10 is a block diagram of a character bending deformation apparatus according to an embodiment of the present invention.
Detailed Description
Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the accompanying drawings are illustrative and intended to explain the present invention and should not be construed as limiting the present invention.
In order to better understand the above technical solutions, exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the invention are shown in the drawings, it should be understood that the invention can be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the invention to those skilled in the art.
In order to better understand the technical solution, the technical solution will be described in detail with reference to the drawings and the specific embodiments.
FIG. 1 is a flow chart of a method for bending and deforming text according to an embodiment of the invention; as shown in fig. 1, the method for bending and deforming characters according to the embodiment of the present invention includes the following steps:
step 101, obtaining path information of a character to be deformed, wherein the path information comprises path control points.
As one embodiment, the path information of the character to be deformed comprises a plurality of sections of closed paths, and each section of closed path is formed by connecting a plurality of sections of straight lines and/or quadratic Bezier curves end to end.
As a specific example, fig. 2 shows a Truetype font, which is composed of a straight line and a quadratic bezier curve, where the symbol "x" represents a start control point of the straight line or quadratic bezier curve, and the symbol "o" represents an intermediate control point of the quadratic bezier curve, which are path control points.
And 102, calculating the bounding box of the character to be deformed according to all the path control points of the character to be deformed, and acquiring the center line of the bounding box according to the bounding box.
That is, after all the path control points of the character to be deformed are obtained, the bounding box of the character to be deformed is calculated according to the path control points, wherein the bounding box comprises four vertex coordinates and four sides of the bounding box, and the center line of the bounding box can be obtained through the vertex coordinates of the bounding box.
It should be noted that the bounding box is an algorithm for solving the optimal bounding space of the discrete point set, and the calculation method of the bounding box has been described in detail in the prior art, which is not described herein again.
And 103, setting a first vertex and a second vertex of the bounding box as fixed points, wherein the first vertex and the second vertex are adjacent vertices.
It should be noted that the bounding box includes a first vertex, a second vertex, a third vertex, and a fourth vertex, a first deformed edge is formed between the first vertex and the second vertex, a first rotated edge is formed between the first vertex and the fourth vertex, a second rotated edge is formed between the second vertex and the third vertex, and a second deformed edge is formed between the third vertex and the fourth vertex.
That is, after the bounding box is calculated from all the path control points, two adjacent vertices of the bounding box are set as fixed points.
And 104, acquiring a rotation angle, rotating the first rotation edge along the first vertex and rotating the second rotation edge along the second vertex according to the rotation angle so as to enable each path control point to move along with the path control point.
It should be noted that, the user can input the rotation angle of the character to be deformed in a user-defined manner according to the required bending degree; that is, the angle of rotation is an adjustable amount input by the user.
That is, after the rotation angle is acquired, the first rotation edge is rotated along the first vertex and the second rotation edge is rotated along the second vertex according to the rotation angle, so that the first deformed edge and the second deformed edge are bent from a straight line to a curved line after the rotation is completed, and all the path control points in the bounding box follow the movement.
As an embodiment, the first rotating side and the second rotating side rotate in opposite directions.
As an example, the first rotation edge rotates in a counterclockwise direction and the second rotation edge rotates in a clockwise direction.
That is, the first rotating side rotates counterclockwise along the first vertex according to the rotation angle, and the second rotating side rotates counterclockwise along the second vertex according to the rotation angle.
And 105, extending the rotated first rotating edge and the rotated second rotating edge to enable the first rotating edge and the second rotating edge to intersect at a first intersection point, and acquiring the radius of the arc according to the first intersection point.
The arc radius is defined by taking the first intersection point as an origin and the first deformed edge as an arc.
And 106, calculating the distance of each moved path control point relative to the first intersection point according to the arc radius, and calculating the movement angle of each moved path control point relative to the center line of the bounding box according to the rotation angle.
As an embodiment, the distance of each of the moved path control points with respect to the first intersection point is calculated according to the following formula:
R=RAO-b
wherein R represents the distance of the moved path control point relative to the first intersection point, and RAORepresenting the radius of the arc and b the distance perpendicular to the first deformed edge of the path control point that has not moved.
The distance b of the unmoved path control point perpendicular to the first deformed edge is obtained according to the unmoved coordinates of the path control point, and the distance b is obtained according to the arc radius RAOAnd b, calculating the distance R of each moved path control point relative to the first intersection point.
As an embodiment, the moving angle of each of the moved path control points with respect to the bounding box center line is calculated according to the following formula:
Figure BDA0002404100940000061
where α represents a movement angle of the moved path control point with respect to the bounding box center line, a represents a distance of the path control point that is not moved perpendicular to the bounding box center line, AD represents a distance of the first deformed edge, and θ represents a rotation angle.
And 107, calculating the position of each corresponding moved path control point according to the distance and the movement angle, and acquiring the final deformed character according to the position of each moved path control point.
As an example, the position of each path control point after the movement is calculated according to the following formula:
Px=Ox+R sinα
Py=Oy+R cosα
wherein, PxCoordinate of horizontal axis, O, representing moved path control pointxThe abscissa representing the first intersection point, PyOrdinate coordinate, O, representing the moved path control pointyThe ordinate of the vertical axis of the first intersection point is indicated.
That is, the moved path control point coordinate is (P)x,Py) The first intersection has the coordinate of (O)x,Oy)。
In summary, according to the text bending deformation method of the embodiment of the present invention, path information of a text to be deformed is first obtained, where the path information includes path control points; then, calculating a bounding box of the character to be deformed according to all path control points of the character to be deformed, and acquiring a center line of the bounding box according to the bounding box; then setting a first vertex and a second vertex of the bounding box as fixed points, wherein the first vertex and the second vertex are adjacent vertices; secondly, acquiring a rotation angle, rotating the first rotation edge along the first vertex and rotating the second rotation edge along the second vertex according to the rotation angle so as to enable each path control point to move along with the path control point; then extending the rotated first rotating edge and the rotated second rotating edge to enable the first rotating edge and the second rotating edge to intersect at a first intersection point, and acquiring the radius of the arc according to the first intersection point; then, calculating the distance of each moved path control point relative to the first intersection point according to the arc radius, and calculating the movement angle of each moved path control point relative to the center line of the bounding box according to the rotation angle; finally, calculating the position of each corresponding moved path control point according to the distance and the movement angle, and acquiring a final deformed character according to the position of each moved path control point; therefore, the character bounding box is bent and deformed by directly winding the adjacent vertexes of the character bounding box, so that the controllability of the character bending and deforming result is greatly improved.
As a specific example, as shown in fig. 3, the bounding box of the character to be deformed is ABCD, a first vertex a and a second vertex B of the bounding box are set as fixed points, the first rotating side AB is rotated counterclockwise by θ degrees around the first vertex a to obtain a rotated first rotating side AB ', the second rotating side CD is rotated counterclockwise by θ degrees around the second vertex D to obtain a rotated second rotating side C' D, and the first rotating side AB 'and the second rotating side C' D are extended to intersect at a first intersection point O, so as to obtain a character deformed region surrounded by the first rotating side AB ', the second rotating side C' D, the arc AD, and the arc B 'C';
the coordinates (O) of the first intersection point O can be obtained through the coordinate calculation of the first vertex A, the second vertex D, the third vertex C and the fourth vertex Bx,Oy);
For the unmoved path control point X, the distance a between the center line mid of the bounding box and the distance b between the first deformed edge AD can be obtained by calculation, and the moving angle of each path control point after moving relative to the center line of the bounding box can be calculated according to the rotation angle θ:
Figure BDA0002404100940000071
and according to the radius of the circular arc RaOThe distance of each moved path control point relative to the first intersection point can be calculated as follows: r ═ RAO-b。
The coordinate (P) of the moved path control point X' can be calculated according to the distance R and the movement angle alphax,Py):Px=Ox+Rsinα;Py=Oy+Rcosα。
As a specific embodiment, fig. 4 is a schematic diagram of a single line of characters to be deformed, and after the single line of characters to be deformed in fig. 3 is processed by the above method, the effect diagram of the deformed characters shown in fig. 6 and 7 is obtained; fig. 5 is a schematic diagram of a plurality of lines of characters to be deformed, and after the plurality of lines of characters to be deformed in fig. 5 are processed by the above method, the effect diagram of the deformed characters shown in fig. 8 and 9 is obtained.
In addition, an embodiment of the present invention further provides a computer-readable storage medium, on which a text bending program is stored, which when executed by a processor implements the text bending method as described above.
According to the computer-readable storage medium of the embodiment of the invention, the word bending deformation program is stored, so that the processor can realize the word bending deformation method when executing the word bending deformation program, and the controllability of the word bending deformation result is greatly improved.
In addition, the embodiment of the present invention further provides a computer device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the processor executes the computer program, the method for bending and deforming characters as described above is implemented.
According to the computer equipment of the embodiment of the invention, the computer program which can run on the processor is stored through the memory, so that the processor can realize the character bending deformation method when executing the computer program, and the controllability of the character bending deformation result is greatly improved.
FIG. 10 is a block diagram of a text bending and deforming apparatus according to an embodiment of the present invention; as shown in fig. 10, the character bending deformation apparatus of the present embodiment includes: an acquisition module 201, a first calculation module 202, a setting module 203, a deformation module 204, a processing module 205, a second calculation module 206, and a third calculation module 207.
The obtaining module 201 obtains path information of each character to be deformed, where the path information includes path control points; the first calculation module calculates the bounding box of the character to be deformed according to all the path control points of the character to be deformed, and acquires the center line of the bounding box according to the bounding box; the setting module 203 sets a first vertex and a second vertex of the bounding box as fixed points, wherein the first vertex and the second vertex are adjacent vertices; the deformation module 204 obtains a rotation angle, and rotates the first rotation edge along the first vertex and the second rotation edge along the second vertex according to the rotation angle, so that each path control point moves along with the path control point; the processing module 205 extends the rotated first rotating edge and the rotated second rotating edge to intersect at a first intersection point, and obtains the radius of the arc according to the first intersection point; the second calculating module 206 calculates the distance between each moved path control point and the first intersection point according to the arc radius, and calculates the movement angle of each moved path control point relative to the centerline of the bounding box according to the rotation angle; the third calculating module 207 calculates the position of each corresponding moved path control point according to the distance and the movement angle, and obtains the final deformed character according to the position of each moved path control point.
Furthermore, the bounding box comprises a first vertex, a second vertex, a third vertex and a fourth vertex, a first deformed edge is formed between the first vertex and the second vertex, a first rotating edge is formed between the first vertex and the fourth vertex, a second rotating edge is formed between the second vertex and the third vertex, and a second deformed edge is formed between the third vertex and the fourth vertex.
Further, the first rotating edge and the second rotating edge rotate in opposite directions.
Further, the first rotation edge rotates in a counterclockwise direction, and the second rotation edge rotates in a clockwise direction.
Further, the second calculating module 206 is further configured to calculate a distance of each moved path control point relative to the first intersection point according to the following formula:
R=RAO-b
wherein R represents the distance of the moved path control point relative to the first intersection point, RAORepresenting the radius of the arc and b the distance perpendicular to the first deformed edge of the path control point that has not moved.
And calculating the moving angle of each moved path control point relative to the center line of the bounding box according to the following formula:
Figure BDA0002404100940000091
where α represents a movement angle of the moved path control point with respect to the bounding box center line, a represents a distance of the path control point that is not moved perpendicular to the bounding box center line, AD represents a distance of the first deformed edge, and θ represents a rotation angle.
Further, the third calculating module 207 is further configured to calculate the position of each moved path control point according to the following formula:
Px=Ox+R sinα
Py=Oy+R cosα
wherein, PxCoordinate of abscissa, O, indicating moved path control pointxThe abscissa representing the first intersection point, PyOrdinate coordinate, O, representing the moved path control pointyThe ordinate of the vertical axis of the first intersection point is indicated.
It should be noted that the foregoing explanation on the embodiment of the character bending deformation method is also applicable to the character bending deformation apparatus of the embodiment, and is not repeated herein.
In summary, according to the text bending deformation apparatus in the embodiment of the present invention, the obtaining module obtains the path information of each text to be deformed, where the path information includes path control points; then, calculating the bounding box of the character to be deformed according to all path control points of the character to be deformed by a first calculation module, and acquiring the center line of the bounding box according to the bounding box; setting a first vertex and a second vertex of the bounding box as fixed points through a setting module, wherein the first vertex and the second vertex are adjacent vertices; then, a rotation angle is obtained through a deformation module, the first rotation edge is rotated along a first vertex according to the rotation angle, and the second rotation edge is rotated along a second vertex so that each path control point moves along with the rotation angle; then, extending the rotated first rotating edge and the rotated second rotating edge through a processing module to enable the first rotating edge and the second rotating edge to intersect at a first intersection point, and acquiring the radius of the arc according to the first intersection point; then, the second calculation module calculates the distance between each moved path control point and the first intersection point according to the arc radius, and calculates the movement angle of each moved path control point relative to the center line of the bounding box according to the rotation angle; finally, the third calculation module calculates the position of each corresponding moved path control point according to the distance and the movement angle, and obtains the final deformed character according to the position of each moved path control point; therefore, the invention greatly improves the controllability of the character bending deformation result by directly winding the adjacent vertexes of the character bounding box to perform bending deformation.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It should be noted that in the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention can be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means can be embodied by one and the same item of hardware. The usage of the words first, second and third, etcetera do not indicate any ordering. These words may be interpreted as names.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.
In the description of the present invention, it is to be understood that the terms "first", "second" and the like are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implying any number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of the present invention, "a plurality" means two or more unless specifically defined otherwise.
In the present invention, unless otherwise explicitly stated or limited, the terms "mounted," "connected," "fixed," and the like are to be construed broadly, e.g., as being permanently connected, detachably connected, or integral; can be mechanically or electrically connected; either directly or indirectly through intervening media, either internally or in any other relationship. The specific meanings of the above terms in the present invention can be understood by those skilled in the art according to specific situations.
In the present invention, unless otherwise expressly stated or limited, the first feature "on" or "under" the second feature may be directly contacting the first and second features or indirectly contacting the first and second features through an intermediate. Also, a first feature "on," "over," and "above" a second feature may be directly or diagonally above the second feature, or may simply indicate that the first feature is at a higher level than the second feature. A first feature being "under," "below," and "beneath" a second feature may be directly under or obliquely under the first feature, or may simply mean that the first feature is at a lesser elevation than the second feature.
In the description of the specification, reference to the description of "one embodiment," "some embodiments," "an example," "a specific example," or "some examples" or the like means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above should not be understood to necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, various embodiments or examples and features of different embodiments or examples described in this specification can be combined and combined by one skilled in the art without contradiction.
Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention, and that variations, modifications, substitutions and alterations can be made to the above embodiments by those of ordinary skill in the art within the scope of the present invention.

Claims (10)

1. A character bending deformation method is characterized by comprising the following steps:
acquiring path information of a character to be deformed, wherein the path information comprises path control points;
calculating an bounding box of the characters to be deformed according to all path control points of the characters to be deformed, and acquiring a center line of the bounding box according to the bounding box;
setting a first vertex and a second vertex of the bounding box as fixed points, wherein the first vertex and the second vertex are adjacent vertices;
acquiring a rotation angle, rotating the first rotation edge along a first vertex and rotating the second rotation edge along a second vertex according to the rotation angle so as to enable each path control point to move along with the path control point;
extending the rotated first rotating edge and the rotated second rotating edge to enable the first rotating edge and the second rotating edge to intersect at a first intersection point, and acquiring the radius of the arc according to the first intersection point;
calculating the distance of each moved path control point relative to the first intersection point according to the arc radius, and calculating the movement angle of each moved path control point relative to the center line of the bounding box according to the rotation angle;
and calculating the position of each corresponding moved path control point according to the distance and the movement angle, and acquiring the final deformed character according to the position of each moved path control point.
2. The method of text warping according to claim 1, wherein the bounding box includes a first vertex, a second vertex, a third vertex, and a fourth vertex, wherein a first warped edge is formed between the first vertex and the second vertex, a first rotated edge is formed between the first vertex and the fourth vertex, a second rotated edge is formed between the second vertex and the third vertex, and a second warped edge is formed between the third vertex and the fourth vertex.
3. The method of bending and deforming letters according to claim 2, wherein the first rotating side and the second rotating side rotate in opposite directions.
4. The method of claim 3, wherein the first rotation edge rotates in a counterclockwise direction and the second rotation edge rotates in a clockwise direction.
5. The bending deformation method for letters according to claim 4, wherein the distance of each path control point after moving with respect to the first intersection point is calculated according to the following formula:
R=RAO-b
wherein R represents the distance of the moved path control point relative to the first intersection point, RAORepresenting the radius of the circular arc and b the distance perpendicular to the first deformed edge of the path control point that is not moved.
6. The character bending deformation method of claim 5 wherein the angle of movement of each of the moved path control points relative to the centerline of the bounding box is calculated according to the following formula:
Figure FDA0002404100930000011
where α represents a movement angle of the moved path control point with respect to the bounding box center line, a represents a distance of the path control point that is not moved perpendicular to the bounding box center line, AD represents a distance of the first deformed edge, and θ represents a rotation angle.
7. The bending deformation method of letters according to claim 6, wherein the position of each path control point after the movement is calculated according to the following formula:
Px=Ox+Rsinα
Py=Oy+Rcosα
wherein, PxCoordinate of horizontal axis, O, representing moved path control pointxCoordinate of abscissa, P, representing first intersectionyOrdinate coordinate, O, representing the moved path control pointyThe ordinate of the vertical axis of the first intersection point is indicated.
8. A computer-readable storage medium, on which a text-bending program is stored, which when executed by a processor implements a text-bending method according to any one of claims 1 to 7.
9. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor, when executing the computer program, implements the method of text warping as claimed in any one of claims 1-7.
10. A character bending and deforming apparatus, comprising:
the system comprises an acquisition module, a deformation module and a deformation module, wherein the acquisition module is used for acquiring path information of each character to be deformed, and the path information comprises path control points;
the first calculation module is used for calculating the bounding box of the character to be deformed according to all the path control points of the character to be deformed and acquiring the center line of the bounding box according to the bounding box;
the setting module is used for setting a first vertex and a second vertex of the bounding box as fixed points, wherein the first vertex and the second vertex are adjacent vertices;
the deformation module is used for acquiring a rotation angle, rotating the first rotation edge along the first vertex and rotating the second rotation edge along the second vertex according to the rotation angle so as to enable each path control point to move along with the rotation;
the processing module is used for prolonging the rotated first rotating edge and the rotated second rotating edge to enable the first rotating edge and the second rotating edge to intersect at a first intersection point, and acquiring the radius of the circular arc according to the first intersection point;
the second calculation module is used for calculating the distance between each moved path control point and the first intersection point according to the arc radius and calculating the movement angle of each moved path control point relative to the center line of the bounding box according to the rotation angle;
and the third calculation module is used for calculating the position of each corresponding moved path control point according to the distance and the movement angle and acquiring the final deformed character according to the position of each moved path control point.
CN202010156119.3A 2020-03-09 2020-03-09 Character bending deformation method, medium, equipment and device Active CN111444673B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010156119.3A CN111444673B (en) 2020-03-09 2020-03-09 Character bending deformation method, medium, equipment and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010156119.3A CN111444673B (en) 2020-03-09 2020-03-09 Character bending deformation method, medium, equipment and device

Publications (2)

Publication Number Publication Date
CN111444673A CN111444673A (en) 2020-07-24
CN111444673B true CN111444673B (en) 2022-07-19

Family

ID=71653196

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010156119.3A Active CN111444673B (en) 2020-03-09 2020-03-09 Character bending deformation method, medium, equipment and device

Country Status (1)

Country Link
CN (1) CN111444673B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113256758B (en) * 2021-05-20 2023-08-18 稿定(厦门)科技有限公司 Graphic smoothing method

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104851118A (en) * 2015-05-25 2015-08-19 滁州学院 Method for sharing CorelDraw point symbol in ArcGIS
CN106126085A (en) * 2016-06-13 2016-11-16 华南理工大学 A kind of multi-point touch gesture interaction three-dimensional modeling method of facing mobile apparatus
CN109308734A (en) * 2017-07-27 2019-02-05 腾讯科技(深圳)有限公司 The generation method and its device of 3D text, equipment, storage medium
CN110111425A (en) * 2019-05-07 2019-08-09 厦门欢乐逛科技股份有限公司 Oblique angle generation method, medium, equipment and the device of 3D font

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10331840B2 (en) * 2016-01-15 2019-06-25 International Business Machines Corporation Resource aware method for optimizing wires for slew, slack, or noise

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104851118A (en) * 2015-05-25 2015-08-19 滁州学院 Method for sharing CorelDraw point symbol in ArcGIS
CN106126085A (en) * 2016-06-13 2016-11-16 华南理工大学 A kind of multi-point touch gesture interaction three-dimensional modeling method of facing mobile apparatus
CN109308734A (en) * 2017-07-27 2019-02-05 腾讯科技(深圳)有限公司 The generation method and its device of 3D text, equipment, storage medium
CN110111425A (en) * 2019-05-07 2019-08-09 厦门欢乐逛科技股份有限公司 Oblique angle generation method, medium, equipment and the device of 3D font

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
文本图像的几何畸变校正技术研究;张淑兵;《中国优秀硕士学位论文全文数据库》;20070615;全文 *

Also Published As

Publication number Publication date
CN111444673A (en) 2020-07-24

Similar Documents

Publication Publication Date Title
US8624893B2 (en) System and method for generating 2D texture coordinates for 3D meshed surfaces
CN110489778B (en) Graph segmentation method and laser etching control system for laser etching processing
JPS6367220B2 (en)
US9922623B2 (en) Emboldening of outline fonts
CN106530379B (en) Method and apparatus for performing path delineation
CN111444673B (en) Character bending deformation method, medium, equipment and device
US9202148B2 (en) Image processing apparatus and method for generating stencil data of a stroke based on shape information, connection-point information, and end-point information
US9792729B2 (en) System and method for context preserving maps of tubular structures
CN109481045B (en) Movement control method and device for orthodontic tooth model
JP2001138700A5 (en) Sheet with three-dimensional pattern and its manufacturing method
CN114429535A (en) Smooth cutting method and device for triangular mesh curved surface
WO2014016894A1 (en) Shape data generation method and device
CN113256758B (en) Graphic smoothing method
JP4967989B2 (en) Design support apparatus, design support method, and design support program
JP2011039828A (en) System and method for processing image
JP2009122998A (en) Method for extracting outline from solid/surface model, and computer software program
JP2007156604A (en) Curved surface creation method, curved surface creation program and three-dimensional shape processor
CN109191365B (en) Three-dimensional space handwritten character dimension reduction method based on directed cuboid
CN111144064B (en) Character deformation method, medium, equipment and device
JP2010044440A (en) Three-dimensional shape processing apparatus and processing method
KR101654865B1 (en) Apparatus, method and computer program for rendering image based on stroke
JP6026949B2 (en) Curved surface drawing apparatus and curved surface drawing program
CN110335353B (en) Method, device, equipment and storage medium for automatically subdividing blocks
CN113033085B (en) Particle swarm optimization and Bezier curve-based particle shape simulation method and system
JP6592308B2 (en) Curved surface drawing apparatus and curved surface drawing program

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant