CN110111425A - Oblique angle generation method, medium, equipment and the device of 3D font - Google Patents

Oblique angle generation method, medium, equipment and the device of 3D font Download PDF

Info

Publication number
CN110111425A
CN110111425A CN201910376972.3A CN201910376972A CN110111425A CN 110111425 A CN110111425 A CN 110111425A CN 201910376972 A CN201910376972 A CN 201910376972A CN 110111425 A CN110111425 A CN 110111425A
Authority
CN
China
Prior art keywords
font
vertex
oblique angle
original contour
straight line
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.)
Granted
Application number
CN201910376972.3A
Other languages
Chinese (zh)
Other versions
CN110111425B (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.)
Xiamen Happy Shopping Technology Co Ltd
Original Assignee
Xiamen Happy Shopping 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 Xiamen Happy Shopping Technology Co Ltd filed Critical Xiamen Happy Shopping Technology Co Ltd
Priority to CN201910376972.3A priority Critical patent/CN110111425B/en
Publication of CN110111425A publication Critical patent/CN110111425A/en
Application granted granted Critical
Publication of CN110111425B publication Critical patent/CN110111425B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/20Finite element generation, e.g. wire-frame surface description, tesselation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T19/00Manipulating 3D models or images for computer graphics
    • G06T19/20Editing of 3D images, e.g. changing shapes or colours, aligning objects or positioning parts
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/60Analysis of geometric attributes
    • G06T7/66Analysis of geometric attributes of image moments or centre of gravity
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2200/00Indexing scheme for image data processing or generation, in general
    • G06T2200/08Indexing scheme for image data processing or generation, in general involving all processing steps from image acquisition to 3D model generation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2219/00Indexing scheme for manipulating 3D models or images for computer graphics
    • G06T2219/20Indexing scheme for editing of 3D models
    • G06T2219/2021Shape modification

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Geometry (AREA)
  • Computer Graphics (AREA)
  • Software Systems (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Architecture (AREA)
  • Computer Hardware Design (AREA)
  • General Engineering & Computer Science (AREA)
  • Image Generation (AREA)

Abstract

The invention discloses oblique angle generation method, medium, equipment and the devices of a kind of 3D font, comprising: obtains every original contour of Truetype font;Three control points of the endpoint of every section of straight line in every original contour and every secondary Bezier are sequentially connected with to generate controlling polygon;The normal of every straightway is calculated, and calculates the normal on each vertex of controlling polygon;It is inside contracted along normal direction control original contour;During controlling polygon is inside contracted, whether detection controlling polygon collides, and controls the vertex to collide and the straightway to collide stopping movement;Straight line and secondary Bezier in original contour and the straight line and secondary Bezier that inside contract in rear profile are sampled respectively to generate triangle meshes, and generate oblique angle according to triangle meshes;To realize that the triangle gridding for avoiding two-dimentional font from carrying out oblique angle in three-dimensional conversion process crosses one another, the sensorial effects of the 3D font ultimately generated are improved.

Description

Oblique angle generation method, medium, equipment and the device of 3D font
Technical field
The present invention relates to Font processing technical field, in particular to a kind of oblique angle generation method, medium, the equipment of 3D font And device.
Background technique
During carrying out three-dimensional conversion to two-dimentional font, it often may require that and inside contract oblique angle in character contour generation to increase Add the expressive force of font.
However, during the existing three-dimensional conversion to the progress of two-dimentional font, when font to be processed is that profile is more multiple When miscellaneous font (for example, Chinese font), it is easy to appear the case where triangle gridding at oblique angle crosses one another, and then is influenced final The rendering effect of the three-dimensional font of generation.
Summary of the invention
The present invention is directed to solve one of the technical problem in above-mentioned technology at least to a certain extent.For this purpose, of the invention One purpose is to propose a kind of oblique angle generation method of 3D font, can be avoided two-dimentional font and carry out in three-dimensional conversion process tiltedly The triangle gridding at angle crosses one another, and improves the sensorial effects of the 3D font ultimately generated.
Second object of the present invention is to propose a kind of computer readable storage medium.
Third object of the present invention is to propose a kind of computer equipment.
Fourth object of the present invention is to propose a kind of oblique angle generating means of 3D font.
In order to achieve the above objectives, first aspect present invention embodiment proposes a kind of oblique angle generation method of 3D font, packet It includes following steps: obtaining every original contour of Truetype font, wherein every original contour includes the straight line of end to end convergence With secondary Bezier;By three controls of the endpoint and every secondary Bezier of every section of straight line in every original contour Point is sequentially connected with to generate controlling polygon;The normal of every straightway of controlling polygon is calculated, and according to controlling polygon Every straightway normal calculate controlling polygon each vertex normal;Normal along each vertex of controlling polygon Direction controls each vertex to gradually moving so that controlling polygon is inside contracted inside original contour;Controlling polygon into During row inside contracts, detects between the vertex of controlling polygon and vertex and whether touched between straightway and straightway It hits, and controls the vertex to collide and the straightway to collide stopping movement;To in original contour every section of straight line and Every secondary Bezier and the every section of straight line and every secondary Bezier inside contracted in rear profile are sampled respectively To generate triangle meshes, and oblique angle is generated according to triangle meshes.
The oblique angle generation method of 3D font according to an embodiment of the present invention, firstly, obtaining every original of Truetype font Beginning profile, wherein every original contour includes the straight line and secondary Bezier of end to end convergence;It will be every in every original contour The endpoint of section straight line and three control points of every secondary Bezier are sequentially connected with to generate controlling polygon;Calculate control The normal of every straightway of polygon, and the every of controlling polygon is calculated according to the normal of every straightway of controlling polygon The normal on a vertex;Normal direction along each vertex of controlling polygon, control each vertex to inside original contour gradually Movement is so that controlling polygon is inside contracted;During controlling polygon is inside contracted, the vertex of controlling polygon is detected Whether collide between vertex and between straightway and straightway, and controls the vertex to collide and collide Straightway stop movement;To the every section of straight line and every secondary Bezier in original contour and inside contract in rear profile Every section of straight line and every secondary Bezier are sampled respectively to generate triangle meshes, and are generated according to triangle meshes It is improved most lifelong to realize that the triangle gridding for avoiding two-dimentional font from carrying out oblique angle in three-dimensional conversion process crosses one another at oblique angle At 3D font sensorial effects.
In addition, the oblique angle generation method of the 3D font proposed according to that above embodiment of the present invention can also have following add Technical characteristic:
Optionally, during the controlling polygon is inside contracted, the original contour, which follows, to be inside contracted.
Optionally, in the original contour every section of straight line and the mode that is sampled of every secondary Bezier with The mode sampled to the every section of straight line inside contracted in rear profile and every secondary Bezier is identical, so that the original Sampled point on beginning profile is identical as the sampled point inside contracted in rear profile and corresponds.
Optionally, the two neighboring sampled point on the original contour is inside contracted corresponding adjacent two in rear profile with described A sampled point constitutes two triangles, to generate the triangle meshes.
In order to achieve the above objectives, second aspect of the present invention embodiment proposes a kind of computer readable storage medium, thereon The oblique angle for being stored with 3D font generates program, and the oblique angle of the 3D font generates when program is executed by processor and realizes such as above-mentioned 3D The oblique angle generation method of font.
Computer readable storage medium according to an embodiment of the present invention, the oblique angle by storing 3D font generate program, this The oblique angle of sample 3D font generates the oblique angle generation method that program realizes such as above-mentioned 3D font when being executed by processor, and realization is kept away The triangle gridding for exempting from oblique angle in the two-dimentional three-dimensional conversion process of font progress crosses one another, and improves the sense organ of the 3D font ultimately generated Effect.
In order to achieve the above objectives, third aspect present invention embodiment proposes a kind of computer equipment, including memory, processing Device and storage on a memory and the computer program that can run on a processor, when processor executes computer program, realization Such as the oblique angle generation method of above-mentioned 3D font.
Computer equipment according to an embodiment of the present invention executes the oblique angle generation method of above-mentioned 3D font by processor, It realizes that the triangle gridding for avoiding two-dimentional font from carrying out oblique angle in three-dimensional conversion process crosses one another, improves the 3D font ultimately generated Sensorial effects.
In order to achieve the above objectives, fourth aspect present invention embodiment proposes a kind of oblique angle generating means of 3D font, packet It includes: module is obtained, for obtaining every original contour of Truetype font, wherein every original contour includes end to end convergence Straight line and secondary Bezier;First generation module, for by the endpoint of every section of straight line in every original contour and every Three control points of secondary Bezier are sequentially connected with to generate controlling polygon;Computing module, it is polygon for calculating control The normal of every straightway of shape, and according to each top of the normal of every straightway of controlling polygon calculating controlling polygon The normal of point;Control module controls each vertex to original contour for the normal direction along each vertex of controlling polygon Inside is gradually moved so that controlling polygon is inside contracted, and during controlling polygon is inside contracted, detection control is more Whether collide between the vertex and vertex of side shape and between straightway and straightway, and the vertex that control collides And the straightway to collide stops movement;Second generation module, for in original contour every section of straight line and every two Secondary Bezier and the every section of straight line and every secondary Bezier inside contracted in rear profile are sampled respectively to generate Triangle meshes, and oblique angle is generated according to triangle meshes.
The oblique angle generating means of 3D font according to an embodiment of the present invention obtain Truetype font by obtaining module Every original contour, wherein every original contour includes the straight line and secondary Bezier of end to end convergence;It is getting After every original contour of Truetype font, by the first generation module by the endpoint of every section of straight line in every original contour It is sequentially connected with three control points of every secondary Bezier to generate controlling polygon;So that computing module control is polygon The normal of every straightway of shape is calculated, and calculates controlling polygon according to the normal of every straightway of controlling polygon Each vertex normal;After the completion of calculating, by control module along the normal direction on each vertex of controlling polygon, control Each vertex is inside contracted in controlling polygon to gradually moving inside original contour so that controlling polygon is inside contracted In the process, it detects between the vertex of controlling polygon and vertex and whether collides between straightway and straightway, and It controls the vertex to collide and the straightway to collide stops movement;After the completion of inside contracting, pass through the second generation module pair Every section of straight line and every secondary Bezier in original contour and inside contract every section of straight line in rear profile and every secondary Bezier is sampled respectively to generate triangle meshes, and generates oblique angle according to triangle meshes;It is avoided to realize The triangle gridding that two-dimentional font carries out oblique angle in three-dimensional conversion process crosses one another, and improves the sense organ effect of the 3D font ultimately generated Fruit.
In addition, the oblique angle generating means of the 3D font proposed according to that above embodiment of the present invention can also have following add Technical characteristic:
Optionally, during the controlling polygon is inside contracted, the original contour, which follows, to be inside contracted.
Optionally, in the original contour every section of straight line and the mode that is sampled of every secondary Bezier with The mode sampled to the every section of straight line inside contracted in rear profile and every secondary Bezier is identical, so that the original Sampled point on beginning profile is identical as the sampled point inside contracted in rear profile and corresponds.
Optionally, second generation module is also used to, by the original contour two neighboring sampled point with it is described It inside contracts corresponding two neighboring sampled point in rear profile and constitutes two triangles, to generate the triangle meshes.
Detailed description of the invention
Fig. 1 is the flow diagram according to the oblique angle generation method of the 3D font of the embodiment of the present invention;
Fig. 2 is the original contour and controlling polygon schematic diagram according to the embodiment of the present invention;
Fig. 3 is to inside contract effect diagram according to the controlling polygon of the embodiment of the present invention;
Fig. 4 is according to compression process collision detection flow diagram in the controlling polygon of the embodiment of the present invention;
Fig. 5 is the triangle meshes product process schematic diagram according to the embodiment of the present invention;
Fig. 6 is to generate effect diagram according to the three-dimensional font of the embodiment of the present invention;
Fig. 7 is the block diagram according to the oblique angle generating means of the 3D font of the embodiment of the present invention.
Specific embodiment
The embodiment of the present invention is described below in detail, examples of the embodiments are shown in the accompanying drawings, wherein from beginning to end Same or similar label indicates same or similar element or element with the same or similar functions.Below with reference to attached The embodiment of figure description is exemplary, it is intended to is used to explain the present invention, and is not considered as limiting the invention.
During existing two dimension font carries out three-dimensional conversion, the triangle gridding for being easy to appear oblique angle crosses one another, into And influence the rendering effect of the three-dimensional font ultimately generated;The oblique angle generation method of 3D font according to an embodiment of the present invention, it is first First, obtain Truetype font every original contour, wherein every original contour include end to end convergence straight line and secondary shellfish Sai Er curve;Three control points of the endpoint of every section of straight line in every original contour and every secondary Bezier are sequentially connected It connects to generate controlling polygon;The normal of every straightway of controlling polygon is calculated, and every according to controlling polygon is straight The normal of line segment calculates the normal on each vertex of controlling polygon;Normal direction along each vertex of controlling polygon, control Each vertex is made to gradually moving so that controlling polygon is inside contracted inside original contour;It is inside contracted in controlling polygon In the process, it detects between the vertex of controlling polygon and vertex and whether collides between straightway and straightway, and control It makes the vertex to collide and the straightway to collide stops movement;To in original contour every section of straight line and every it is secondary Bezier and the every section of straight line and every secondary Bezier inside contracted in rear profile are sampled respectively to generate three Angling grid, and oblique angle is generated according to triangle meshes, avoid two-dimentional font from carrying out oblique angle in three-dimensional conversion process to realize Triangle gridding cross one another, improve the sensorial effects of the 3D font ultimately generated.
In order to better understand the above technical scheme, the exemplary reality that the present invention will be described in more detail below with reference to accompanying drawings Apply example.Although showing exemplary embodiment of the present invention in attached drawing, it being understood, however, that may be realized in various forms this hair It is bright and should not be limited by the embodiments set forth herein.It is to be able to thoroughly understand this on the contrary, providing these embodiments Invention, and the scope of the present invention can be fully disclosed to those skilled in the art.
In order to better understand the above technical scheme, in conjunction with appended figures and specific embodiments to upper Technical solution is stated to be described in detail.
Fig. 1 is according to the flow diagram of the oblique angle generation method of the 3D font of the embodiment of the present invention, as shown in Figure 1, should The oblique angle generation method of 3D font the following steps are included:
S101 obtains every original contour of Truetype font.
S102, three control points of the endpoint of every section of straight line in every original contour and every secondary Bezier are suitable Secondary connection is to generate controlling polygon.
That is, each original contour to Truetype font obtains, wherein every original contour includes The straight line of end to end convergence and secondary Bezier will be every after getting each original contour of Truetype font The endpoint of every section of straight line and three control points of every secondary Bezier are sequentially connected with to generate in original contour The controlling polygon of corresponding original contour.
As an example, Truetype font can be defined by one or more closed oriented profile, wherein Every profile itself will not intersect, and will not be intersected with other contour lines;Also, by every section of straight line in every original contour Endpoint and every secondary Bezier three control points be sequentially connected with the controlling polygon of generation can be by original wheel In exterior feature is enclosed in, also, the shape of the controlling polygon is close with the shape of profile;Specifically, as shown in Fig. 2, original contour Abde is the original contour being made of two straightways and two secondary Beziers, wherein point a and point b, point d and point e minutes Not Wei in original contour two straightways two endpoints, point b, point c and point d are that the secondary Bezier in top is corresponding Three control points;Point e, point f and point a are corresponding three control points of the secondary Bezier that is below, straight by every section Two endpoints of line and three control points of every secondary Bezier are sequentially connected with;In other words, by the endpoint of straight line and The control point of secondary Bezier is sequentially connected with, to generate controlling polygon abcdef.
S103 calculates the normal of every straightway of controlling polygon, and according to every straightway of controlling polygon Normal calculates the normal on each vertex of controlling polygon.
As an example, in calculating controlling polygon during the normal of straight line section, firstly, obtaining the straight line The midpoint of section is then the normal of the straightway by the midpoint and with the perpendicular straight line of the straightway;Further, two it is straight Line segment forms vertex after connecting, and the normal of two intersecting straight lines sections is formed by between intersection point and vertex corresponding to line Straight line is the normal on the vertex.
S104, the normal direction along each vertex of controlling polygon, control each vertex to inside original contour gradually Movement is so that controlling polygon is inside contracted.
That is, controlling each vertex along the normal direction on each vertex and gradually being carried out to the inside of original contour It is mobile, thus, during vertex is mobile, controlling polygon is whole to contract.
In some embodiments, during controlling polygon is inside contracted, the shifting of original contour model- following control polygon It is dynamic to be inside contracted.
As an example, as shown in figure 3, Fig. 3 is the vertex of mobile controlling polygon so that controlling polygon and original The flow diagram that profile is inside contracted, in figure, two solid lines are respectively used to indicate that controlling polygon and original contour, arrow are used In the normal for indicating each vertex, it is more that two dotted lines are respectively used to the control after indicating to be inside contracted along each vertex normal direction Side shape and model- following control polygon inside contracted after profile.
S105, during controlling polygon is inside contracted, detect between the vertex of controlling polygon and vertex and Whether collide between straightway and straightway, and controls the vertex to collide and the straightway to collide stopping shifting It is dynamic.
That is, during controlling polygon is inside contracted, between the vertex and vertex of controlling polygon, it is straight Whether collide and detected between line segment and straightway, if sent out between vertex and vertex or between straightway and straightway Raw collision, then terminate the vertex to collide or the straightway to collide inside contracts movement.
As an example, firstly, being preset to collision distance threshold, in the process that controlling polygon is inside contracted In, the distance between the distance between the vertex of controlling polygon and vertex, non-conterminous straightway and straightway are carried out in real time Monitoring, and judge the distance between the distance between vertex and vertex, non-conterminous straightway and straightway whether less than preset Collision distance threshold value, if it is judged that being yes, then it is assumed that between current vertex and vertex or non-conterminous straightway and straightway Between collide, and terminate the vertex to collide or the straightway to collide inside contracts movement.
As another example, as shown in figure 4, Fig. 4 is to carry out collision detection during controlling polygon is inside contracted Flow diagram, if in Fig. 4 scheme (A) shown in, point 1,2,3,4,5 expression controlling polygons each vertex, point 1`, 2`, 3`, 4`, 5` indicate each vertex of the controlling polygon after inside contracting;As schemed to be inside contracted shown in (B) in controlling polygon in Fig. 4 In the process, the distance between vertex and vertex in controlling polygon are monitored, at this point, between vertex 4` and vertex 5` away from From preset collision distance threshold value is less than, then judge to collide between vertex 4` and vertex 5`, and stop vertex 4` and vertex 5 `'s inside contracts movement;As in Fig. 4 scheme (C) shown in, stopping vertex 4` and vertex 5` inside contract movement after, controlling polygon Other vertex continue to inside contract, at this point, the distance between non-adjacent straightway 1`-2` and straightway 3`-4` is less than preset collision Distance threshold, in other words, this two straightways will intersect, then judge that straightway 1`-2` and straightway 3`-4` collide, and Stop corresponding vertex 1`, vertex 2` and vertex 3` inside contracts movement, finally, after all vertex stop inside contracting movement, It then obtains as schemed to inside contract profile shown in (D) in Fig. 4.
S106 to the every section of straight line and every secondary Bezier in original contour and inside contracts every section in rear profile Straight line and every secondary Bezier are sampled respectively to generate triangle meshes, and are generated tiltedly according to triangle meshes Angle.
That is, in original contour every section of straight line and every secondary Bezier sample, and to inside contracting Every section of straight line and every secondary Bezier in rear profile are sampled, and generate triangle according to the sampled result of the two Change grid, then, generates oblique angle according to the triangle meshes of generation.
As an example, it every section of straight line in original contour and every secondary Bezier and inside contracts in rear profile Every section of straight line and every secondary Bezier are one-to-one relationship, also, during sampling to the two, are taken Identical sample mode, thus, so that the sampled point on original contour is identical as the sampled point inside contracted in rear profile and one is a pair of It answers;Then, it is assumed that plane where original contour is X-Y, will inside contract profile and translates toward Z axis positive direction, after translation is completed, inside contracts Profile every a pair of of sampling section corresponding with original contour has corresponding two groups of sampled points to (i.e. four sampled points), from And according to this four sampled points, can connect and generate two triangles, successively according to sampled point carry out triangle generation it Afterwards, that is, the generation of triangle meshes is completed, and then the generation at oblique angle can be carried out according to triangle meshes.
As another example, as shown in figure 5, figure (E) is that untreated control is polygon as shown in the figure (E) in Fig. 5 The schematic diagram of shape and original contour, as shown in the figure (F) in Fig. 5, figure (F) is the sampled result after sampling to original contour Schematic diagram;As shown in the figure (G) in Fig. 5, figure (G) is to inside contracting the sampled result schematic diagram after profile samples;In Fig. 5 Figure (H) shown in, figure (H) be according to original contour and inside contract profile sampled result carry out triangle gridding after effect show It is intended to;As shown in the figure (I) in Fig. 5, figure (I) is that font e generates the effect diagram behind oblique angle according to triangle meshes.
In addition, oblique in order to more intuitively embody the three-dimensional font of the oblique angle generation method of the 3D font of embodiment of the present invention generation Angle will generate the effect diagram at three-dimensional font oblique angle for the raising degree of final three-dimensional font visual effect in the prior art The effect diagram at the generation three-dimensional font oblique angle that the oblique angle generation method of the 3D font proposed with the embodiment of the present invention is carried out It is compared;As shown in fig. 6, figure (J) is the effect in the prior art for generating three-dimensional font oblique angle as shown in figure (J) in Fig. 6 Fruit schematic diagram is such as schemed shown in (J), and the prior art is after carrying out oblique angle generation for " original text " word, the final three-dimensional word of generation In body, many places oblique angle, which produces, to cross one another, and greatly affected the visual effect of final three-dimensional font, as schemed (K) institute in Fig. 6 Show, schemes effect diagram of the oblique angle generation method for generation three-dimensional font oblique angle of the 3D font of (K) embodiment of the present invention, such as Scheme shown in (K), after the oblique angle generation method of the 3D font of the embodiment of the present invention carries out oblique angle generation for " original text " word, oblique angle it Between will not generate and cross one another, compared with prior art, visual effect is greatly improved.
In conclusion the oblique angle generation method of 3D font according to an embodiment of the present invention, firstly, obtaining Truetype font Every original contour, wherein every original contour includes the straight line and secondary Bezier of end to end convergence;It is original by every The endpoint of every section of straight line and three control points of every secondary Bezier are sequentially connected with to generate controlling polygon in profile; The normal of every straightway of controlling polygon is calculated, and more according to the calculating control of the normal of every straightway of controlling polygon The normal on each vertex of side shape;Normal direction along each vertex of controlling polygon controls each vertex to original contour It gradually moves so that controlling polygon is inside contracted inside;During controlling polygon is inside contracted, detection control is polygon Whether collide between the vertex and vertex of shape and between straightway and straightway, and control the vertex that collides and The straightway to collide stops movement;To the every section of straight line and every secondary Bezier in original contour and after inside contracting Every section of straight line and every secondary Bezier in profile are sampled respectively to generate triangle meshes, and according to trigonometric ratio Grid generates oblique angle, to realize that the triangle gridding for avoiding two-dimentional font from carrying out oblique angle in three-dimensional conversion process crosses one another, mentions The sensorial effects for the 3D font that height ultimately generates.
In order to realize above-described embodiment, the embodiment of the present invention also proposed a kind of computer readable storage medium, deposit thereon The oblique angle for containing 3D font generates program, and the oblique angle of the 3D font generates when program is executed by processor and realizes such as above-mentioned 3D word The oblique angle generation method of body.
Computer readable storage medium according to an embodiment of the present invention, the oblique angle by storing 3D font generate program, this The oblique angle of sample 3D font generates the oblique angle generation method that program realizes such as above-mentioned 3D font when being executed by processor, and realization is kept away The triangle gridding for exempting from oblique angle in the two-dimentional three-dimensional conversion process of font progress crosses one another, and improves the sense organ of the 3D font ultimately generated Effect.
In order to realize above-described embodiment, the embodiment of the present invention proposes a kind of computer equipment, including memory, processor and The computer program that can be run on a memory and on a processor is stored, when processor executes computer program, is realized as above The oblique angle generation method for the 3D font stated.
Computer equipment according to an embodiment of the present invention executes the oblique angle generation method of above-mentioned 3D font by processor, It realizes that the triangle gridding for avoiding two-dimentional font from carrying out oblique angle in three-dimensional conversion process crosses one another, improves the 3D font ultimately generated Sensorial effects.
In order to realize above-described embodiment, as shown in fig. 7, the oblique angle that the embodiment of the present invention also proposed a kind of 3D font generates Device, comprising: obtain module 10, the first generation module 20, computing module 30, control module 40 and the second generation module 50.
Wherein, every original contour that module 10 is used to obtain Truetype font is obtained, wherein every original contour packet Include the straight line and secondary Bezier of end to end convergence;
First generation module 20 is used for three by the endpoint of every section of straight line in every original contour and every secondary Bezier A control point is sequentially connected with to generate controlling polygon;
Computing module 30 is used to calculate the normal of every straightway of controlling polygon, and according to every straight line of controlling polygon The normal of section calculates the normal on each vertex of controlling polygon;
Control module 40 is used for the normal direction along each vertex of controlling polygon, controls each vertex to inside original contour It gradually moves so that controlling polygon is inside contracted, and during controlling polygon is inside contracted, detects controlling polygon Vertex and vertex between and straightway and straightway between whether collide, and the vertex that collides of control and The straightway to collide stops movement;
Second generation module 50 is used for the every section of straight line and every secondary Bezier in original contour and inside contracts rear-wheel Every section of straight line and every secondary Bezier in exterior feature are sampled respectively to generate triangle meshes, and according to trigonometric ratio net Lattice generate oblique angle.
In some embodiments, during controlling polygon is inside contracted, original contour, which follows, to be inside contracted.
In some embodiments, in original contour every section of straight line and the side that is sampled of every secondary Bezier Formula is identical as the mode sampled to the every section of straight line inside contracted in rear profile and every secondary Bezier, so that original wheel Sampled point on exterior feature is identical as the sampled point inside contracted in rear profile and corresponds.
In some embodiments, the second generation module 50 is also used to, by original contour two neighboring sampled point with it is interior Corresponding two neighboring sampled point constitutes two triangles in contracting rear profile, to generate triangle meshes.
It should be noted that the above-mentioned description about the oblique angle generation method of 3D font in Fig. 1 is equally applicable to the 3D word The oblique angle generating means of body, herein without repeating.
In conclusion the oblique angle generating means of 3D font according to an embodiment of the present invention, are obtained by obtaining module Every original contour of Truetype font, wherein every original contour includes the straight line and secondary Bezier song of end to end convergence Line;It, will be every in every original contour by the first generation module after getting every original contour of Truetype font The endpoint of section straight line and three control points of every secondary Bezier are sequentially connected with to generate controlling polygon;To calculate The normal of every straightway of module controlling polygon is calculated, and the normal meter of every straightway according to controlling polygon Calculate the normal on each vertex of controlling polygon;After the completion of calculating, by control module along each vertex of controlling polygon Normal direction controls each vertex to gradually moving inside original contour so that controlling polygon is inside contracted, and more controlling During side shape is inside contracted, detect between the vertex of controlling polygon and vertex and between straightway and straightway whether It collides, and the control vertex to collide and the straightway to collide stop movement;After the completion of inside contracting, pass through Two generation modules to the every section of straight line and every secondary Bezier in original contour and inside contract every section in rear profile it is straight Line and every secondary Bezier are sampled respectively to generate triangle meshes, and generate oblique angle according to triangle meshes; To realize that the triangle gridding for avoiding two-dimentional font from carrying out oblique angle in three-dimensional conversion process crosses one another, the 3D ultimately generated is improved The sensorial effects of font.
It should be understood by those skilled in the art that, the embodiment of the present invention can provide as method, system or computer program Product.Therefore, complete hardware embodiment, complete software embodiment or reality combining software and hardware aspects can be used in the present invention Apply the form of example.Moreover, it wherein includes the computer of computer usable program code that the present invention, which can be used in one or more, The computer program implemented in usable storage medium (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.) produces The form of product.
The present invention be referring to according to the method for the embodiment of the present invention, the process of equipment (system) and computer program product Figure and/or block diagram describe.It should be understood that every one stream in flowchart and/or the block diagram can be realized by computer program instructions The combination of process and/or box in journey and/or box and flowchart and/or the block diagram.It can provide these computer programs Instruct the processor of general purpose computer, special purpose computer, Embedded Processor or other programmable data processing devices to produce A raw machine, so that being generated by the instruction that computer or the processor of other programmable data processing devices execute for real The device for the function of being specified in present one or more flows of the flowchart and/or one or more blocks of the block diagram.
These computer program instructions, which may also be stored in, is able to guide computer or other programmable data processing devices with spy Determine in the computer-readable memory that mode works, so that it includes referring to that instruction stored in the computer readable memory, which generates, Enable the manufacture of device, the command device realize in one box of one or more flows of the flowchart and/or block diagram or The function of being specified in multiple boxes.
These computer program instructions also can be loaded onto a computer or other programmable data processing device, so that counting Series of operation steps are executed on calculation machine or other programmable devices to generate computer implemented processing, thus in computer or The instruction executed on other programmable devices is provided for realizing in one or more flows of the flowchart and/or block diagram one The step of function of being specified in a box or multiple boxes.
It should be noted that in the claims, any reference symbol between parentheses should not be configured to power The limitation that benefit requires.Word "comprising" does not exclude the presence of component or step not listed in the claims.Before component Word "a" or "an" does not exclude the presence of multiple such components.The present invention can be by means of including several different components It hardware and is realized by means of properly programmed computer.In the unit claims listing several devices, these are filled Several in setting, which can be, to be embodied by the same item of hardware.The use of word first, second, and third is not Indicate any sequence.These words can be construed to title.
Although preferred embodiments of the present invention have been described, it is created once a person skilled in the art knows basic Property concept, then additional changes and modifications may be made to these embodiments.So it includes excellent that the following claims are intended to be interpreted as It selects embodiment and falls into all change and modification of the scope of the invention.
Obviously, various changes and modifications can be made to the invention without departing from essence of the invention by those skilled in the art Mind and range.In this way, if these modifications and changes of the present invention belongs to the range of the claims in the present invention and its equivalent technologies Within, then the present invention is also intended to include these modifications and variations.
In the description of the present invention, it is to be understood that, term " first ", " second " are used for description purposes only, and cannot It is interpreted as indication or suggestion relative importance or implicitly indicates the quantity of indicated technical characteristic.Define as a result, " the One ", the feature of " second " can explicitly or implicitly include one or more of the features.In the description of the present invention, The meaning of " plurality " is two or more, unless otherwise specifically defined.
In the present invention unless specifically defined or limited otherwise, term " installation ", " connected ", " connection ", " fixation " etc. Term shall be understood in a broad sense, for example, it may be being fixedly connected, may be a detachable connection, or integral;It can be mechanical connect It connects, is also possible to be electrically connected;It can be directly connected, can also can be in two elements indirectly connected through an intermediary The interaction relationship of the connection in portion or two elements.It for the ordinary skill in the art, can be according to specific feelings Condition understands the concrete meaning of above-mentioned term in the present invention.
In the present invention unless specifically defined or limited otherwise, fisrt feature in the second feature " on " or " down " can be with It is that the first and second features directly contact or the first and second features pass through intermediary mediate contact.Moreover, fisrt feature exists Second feature " on ", " top " and " above " but fisrt feature be directly above or diagonally above the second feature, or be merely representative of First feature horizontal height is higher than second feature.Fisrt feature can be under the second feature " below ", " below " and " below " One feature is directly under or diagonally below the second feature, or is merely representative of first feature horizontal height less than second feature.
In the description of this specification, reference term " one embodiment ", " some embodiments ", " example ", " specifically show The description of example " or " some examples " etc. means specific features, structure, material or spy described in conjunction with this embodiment or example Point is included at least one embodiment or example of the invention.In the present specification, schematic expression of the above terms are not It is interpreted as that identical embodiment or example must be directed to.Moreover, particular features, structures, materials, or characteristics described It may be combined in any suitable manner in any one or more of the embodiments or examples.In addition, without conflicting with each other, this The technical staff in field can be by the spy of different embodiments or examples described in this specification and different embodiments or examples Sign is combined.
Although the embodiments of the present invention has been shown and described above, it is to be understood that above-described embodiment is example Property, it is not considered as limiting the invention, those skilled in the art within the scope of the invention can be to above-mentioned Embodiment is changed, modifies, replacement and variant.

Claims (10)

1. a kind of oblique angle generation method of 3D font, which comprises the following steps:
Obtain Truetype font every original contour, wherein every original contour include end to end convergence straight line and Secondary Bezier;
Three control points of the endpoint of every section of straight line in every original contour and every secondary Bezier are sequentially connected It connects to generate controlling polygon;
Calculate the normal of every straightway of the controlling polygon, and the method for every straightway according to the controlling polygon The normal on each vertex of controlling polygon described in line computation;
Normal direction along each vertex of the controlling polygon, control each vertex to gradually move inside original contour with Inside contract the controlling polygon;
During the controlling polygon is inside contracted, detect between the vertex and vertex of the controlling polygon and straight Whether collide between line segment and straightway, and controls the vertex to collide and the straightway to collide stopping shifting It is dynamic;
To the every section of straight line and every secondary Bezier in original contour and inside contract every section of straight line in rear profile and every The secondary Bezier of item is sampled respectively to generate triangle meshes, and generates oblique angle according to the triangle meshes.
2. the oblique angle generation method of 3D font as described in claim 1, which is characterized in that in controlling polygon progress During contracting, the original contour, which follows, to be inside contracted.
3. the oblique angle generation method of 3D font as claimed in claim 1 or 2, which is characterized in that in the original contour Mode that every section of straight line and every secondary Bezier are sampled with to the every section of straight line inside contracted in rear profile and every The mode that the secondary Bezier of item is sampled is identical, so that the sampled point on the original contour inside contracts rear profile with described On sampled point it is identical and correspond.
4. the oblique angle generation method of 3D font as claimed in claim 3, which is characterized in that will be adjacent on the original contour Two sampled points inside contract two triangles of corresponding two neighboring sampled point composition in rear profile with described, to generate the triangle Change grid.
5. a kind of computer readable storage medium, which is characterized in that the oblique angle for being stored thereon with 3D font generates program, the 3D word The oblique angle of body, which generates, realizes that the oblique angle such as 3D font of any of claims 1-4 generates when program is executed by processor Method.
6. a kind of computer equipment including memory, processor and stores the meter that can be run on a memory and on a processor Calculation machine program, which is characterized in that when the processor executes the computer program, realize such as any one of claim 1-4 The oblique angle generation method of the 3D font.
7. a kind of oblique angle generating means of 3D font characterized by comprising
Module is obtained, for obtaining every original contour of Truetype font, wherein every original contour includes end to end The straight line of linking and secondary Bezier;
First generation module, for by the endpoint of every section of straight line in every original contour and every secondary Bezier Three control points are sequentially connected with to generate controlling polygon;
Computing module, the normal of every straightway for calculating the controlling polygon, and according to the controlling polygon The normal on each vertex of controlling polygon described in the method line computation of every straightway;
Control module controls each vertex to original contour for the normal direction along each vertex of the controlling polygon Inside is gradually moved so that the controlling polygon is inside contracted, and during the controlling polygon is inside contracted, is examined It surveys between the vertex and vertex of the controlling polygon and whether collides between straightway and straightway, and control hair The vertex of raw collision and the straightway to collide stop movement;
Second generation module, for the every section of straight line and every secondary Bezier in original contour and inside contracting rear profile In every section of straight line and every secondary Bezier sampled respectively to generate triangle meshes, and according to the trigonometric ratio Grid generates oblique angle.
8. the oblique angle generating means of 3D font as claimed in claim 7, which is characterized in that in controlling polygon progress During contracting, the original contour, which follows, to be inside contracted.
9. the oblique angle generating means of 3D font as claimed in claim 7 or 8, which is characterized in that in the original contour Mode that every section of straight line and every secondary Bezier are sampled with to the every section of straight line inside contracted in rear profile and every The mode that the secondary Bezier of item is sampled is identical, so that the sampled point on the original contour inside contracts rear profile with described On sampled point it is identical and correspond.
10. the oblique angle generating means of 3D font as claimed in claim 9, which is characterized in that second generation module is also used In inside contracting corresponding two neighboring sampled point in rear profile and constitute the two neighboring sampled point on the original contour with described Two triangles, to generate the triangle meshes.
CN201910376972.3A 2019-05-07 2019-05-07 3D font oblique angle generation method, medium, device and apparatus Active CN110111425B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910376972.3A CN110111425B (en) 2019-05-07 2019-05-07 3D font oblique angle generation method, medium, device and apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910376972.3A CN110111425B (en) 2019-05-07 2019-05-07 3D font oblique angle generation method, medium, device and apparatus

Publications (2)

Publication Number Publication Date
CN110111425A true CN110111425A (en) 2019-08-09
CN110111425B CN110111425B (en) 2023-02-24

Family

ID=67488671

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910376972.3A Active CN110111425B (en) 2019-05-07 2019-05-07 3D font oblique angle generation method, medium, device and apparatus

Country Status (1)

Country Link
CN (1) CN110111425B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111444673A (en) * 2020-03-09 2020-07-24 稿定(厦门)科技有限公司 Character bending deformation method, medium, equipment and device
CN111444675A (en) * 2020-03-12 2020-07-24 稿定(厦门)科技有限公司 Character round angle processing method, medium, equipment and device
CN111651959A (en) * 2020-04-17 2020-09-11 福建天泉教育科技有限公司 3D font realization method and terminal

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040090437A1 (en) * 2002-11-12 2004-05-13 Akira Uesaki Curved surface image processing apparatus and curved surface image processing method
CN101764943A (en) * 2008-11-04 2010-06-30 新奥特(北京)视频技术有限公司 Method for dividing quadratic Bezier curve in subtitle object vector outline by intersection points
CN107767439A (en) * 2017-08-24 2018-03-06 宁波大学 The generation method of three-dimensional metal advertisement word model

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040090437A1 (en) * 2002-11-12 2004-05-13 Akira Uesaki Curved surface image processing apparatus and curved surface image processing method
CN101764943A (en) * 2008-11-04 2010-06-30 新奥特(北京)视频技术有限公司 Method for dividing quadratic Bezier curve in subtitle object vector outline by intersection points
CN107767439A (en) * 2017-08-24 2018-03-06 宁波大学 The generation method of three-dimensional metal advertisement word model

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
软件世界: "让你的字更COOL", 《软件世界》 *
邹北骥等: "局部包络片控制误差简化三角网格模型", 《电子学报》 *

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111444673A (en) * 2020-03-09 2020-07-24 稿定(厦门)科技有限公司 Character bending deformation method, medium, equipment and device
CN111444673B (en) * 2020-03-09 2022-07-19 稿定(厦门)科技有限公司 Character bending deformation method, medium, equipment and device
CN111444675A (en) * 2020-03-12 2020-07-24 稿定(厦门)科技有限公司 Character round angle processing method, medium, equipment and device
CN111444675B (en) * 2020-03-12 2022-08-16 稿定(厦门)科技有限公司 Character round angle processing method, medium, equipment and device
CN111651959A (en) * 2020-04-17 2020-09-11 福建天泉教育科技有限公司 3D font realization method and terminal
CN111651959B (en) * 2020-04-17 2023-02-28 福建天泉教育科技有限公司 Method and terminal for realizing 3D font

Also Published As

Publication number Publication date
CN110111425B (en) 2023-02-24

Similar Documents

Publication Publication Date Title
JP5361793B2 (en) A method for reconstructing the swept volume distance field at the sample point.
CN101890523B (en) A method for simulating numerically controlled milling using adaptively sampled distance fields
CN110111425A (en) Oblique angle generation method, medium, equipment and the device of 3D font
KR100707841B1 (en) Nurbs surface deformation apparatus and the method using 3d target curve
JP5805322B2 (en) Computer program product and method for generating and simulating an object model
Plante et al. A layered wisp model for simulating interactions inside long hair
JP2015504190A (en) Method and system for simulating machining of a workpiece with a tool
CN103135446B (en) Motion trail authentication device of multiaxis numerical control machine tool
CN104933216A (en) Simulation method of ball B-spline-based weft knitted fabric model
US20200210543A1 (en) Simulation Of Robotic Painting For Electrostatic Wraparound Applications
CN110415352A (en) Three-dimensional closed curved surface structure algorithm based on closed contour
Ruspini et al. Haptic display for human interaction with virtual dynamic environments
Ize et al. Grid creation strategies for efficient ray tracing
CN106503171A (en) A kind of processing method and processing device of vector data
CN116992796A (en) Self-adaptive low-dissipation SPH-HLLC Riemann solver coupling algorithm
Nuić et al. Algorithms for procedural generation and display of trees
Yuan et al. The simulation of cable harness based on mass-spring model
Modi et al. Multi-Agent Path Planning with Asymmetric Interactions In Tight Spaces
CN110717965B (en) Real-time path generation method based on dimension reduction in three-dimensional space
Jin et al. Blob‐based liquid morphing
KR100404905B1 (en) Caculation method for variable radius offset curves and a recording medium providing program therein
Zeng et al. Three-dimensional deformation in curl vector field
CN118194663A (en) Knitted fabric simulation method based on position dynamics
Guo et al. A New Collision Detection Algorithm for Vascular Interventional Surgery Simulation Training System
Ali et al. Comparison of Ghost Cell and one-sided Interpolation method for moving bodies in Immersed Boundary Method

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
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 361000 G02, 3rd floor, No.10, Punan 1st Road, Dongpu Road, Siming District, Xiamen City, Fujian Province

Applicant after: Xiamen draft Co.,Ltd.

Address before: 361000 G02, 3rd floor, No.10, Punan 1st Road, Dongpu Road, Siming District, Xiamen City, Fujian Province

Applicant before: XIAMEN HUANLEGUANG TECHNOLOGY Co.,Ltd.

GR01 Patent grant
GR01 Patent grant