[go: up one dir, main page]

CN115880394A - Handwriting drawing method and device, computer equipment and storage medium - Google Patents

Handwriting drawing method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN115880394A
CN115880394A CN202111162677.1A CN202111162677A CN115880394A CN 115880394 A CN115880394 A CN 115880394A CN 202111162677 A CN202111162677 A CN 202111162677A CN 115880394 A CN115880394 A CN 115880394A
Authority
CN
China
Prior art keywords
line element
position point
point
information
determining
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111162677.1A
Other languages
Chinese (zh)
Inventor
周星宇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing ByteDance Network Technology Co Ltd
Original Assignee
Beijing ByteDance Network 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 Beijing ByteDance Network Technology Co Ltd filed Critical Beijing ByteDance Network Technology Co Ltd
Priority to CN202111162677.1A priority Critical patent/CN115880394A/en
Publication of CN115880394A publication Critical patent/CN115880394A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • User Interface Of Digital Computer (AREA)

Abstract

The disclosure provides a handwriting drawing method, a handwriting drawing device, a computer device and a storage medium, wherein the method comprises the following steps: receiving position point information sent by a first user end; determining line element information corresponding to each position point based on the position point information, wherein the line element information is used for representing boundary information of line elements between the position point and two adjacent position points; the boundary information of the line element between any position point and two adjacent position points is the same; and determining the line element between every two adjacent position points based on the line element information, and drawing handwriting based on the determined line element.

Description

Handwriting drawing method and device, computer equipment and storage medium
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a handwriting drawing method and apparatus, a computer device, and a storage medium.
Background
In an online classroom, a whiteboard brush tool is a common teaching tool. The teacher end uses the mouse to control the white board painting brush tool to move so as to form handwriting with variable thickness, and the student end restores the handwriting of the teacher end by receiving position point information of the handwriting.
In the related art, a corresponding trapezoidal line element is placed between every two position points, and handwriting of a teacher end is restored by superposing the trapezoidal line elements. However, the line elements drawn by the method have cracks, the crack phenomenon can cause gaps in the middle of handwriting, and if the distance between the line elements is reduced in order to prevent the cracks, and more line elements are filled, the calculation amount is greatly increased, so that the load of a CPU is increased.
Disclosure of Invention
The embodiment of the disclosure at least provides a handwriting drawing method, a handwriting drawing device, computer equipment and a storage medium.
In a first aspect, an embodiment of the present disclosure provides a handwriting drawing method, including:
receiving position point information sent by a first user end;
determining line element information corresponding to each position point based on the position point information, wherein the line element information is used for representing boundary information of a line element between the position point and two adjacent position points; the boundary information of the line element between any position point and two adjacent position points is the same;
and determining the line element between every two adjacent position points based on the line element information, and drawing handwriting based on the determined line element.
In one possible implementation, the line element information includes position information of line element end points, and the line element end points include line element upper end points and line element lower end points; the position point information comprises width information of a line element where the position point is located;
the determining of the line element information corresponding to each location point based on the location point information includes:
for any position point, determining a direction vector corresponding to the position point based on the position point information of the position point, wherein the direction vector is used for representing the drawing direction of a line element where the position point is located;
and determining the position information of the line element upper end point and the line element lower end point corresponding to the position point based on the direction vector and the width information included in the position point information of the position point.
In a possible embodiment, the determining, based on the line element information, a line element between each two adjacent position points includes:
and aiming at any two adjacent position points, connecting the upper end points of the line elements corresponding to the any two position points respectively, connecting the lower end points of the line elements corresponding to the any two position points respectively, and connecting the upper end points of the line elements and the lower end points of the line elements corresponding to the same position point to form the line elements between the any two adjacent position points.
In a possible implementation manner, the location point information further includes a timestamp when the first user terminal draws the location point, and location information corresponding to the location point;
the determining, for any one position point, a direction vector corresponding to the position point based on the position point information of the position point includes:
determining a next position point corresponding to the position point based on the timestamp included in the position point information;
and determining a first vector between the position point and the next position point by taking the position point as a starting point and the next position point as an end point, and taking the first vector as a direction vector corresponding to the position point.
In a possible embodiment, for any location point, determining, based on location point information of the location point, a direction vector corresponding to the location point includes:
determining a next position point and an upper position point corresponding to the position point based on the time stamp included in the position point information;
determining a second vector between the previous position point and the next position point by taking the previous position point as a starting point and the next position point as an end point;
determining a direction vector corresponding to the position point based on the second vector, wherein the direction vector is the same as the direction of the second vector; the direction vector corresponding to the first position point is a vector formed by taking the first position point as a starting point and taking the second position point as an end point, and the direction vector of the last position point is the same as the direction vector of the last position point.
In a possible embodiment, after determining the line element between each two adjacent position points based on the line element information, the method further includes:
detecting whether the currently determined line element is overlapped with the previously determined line element;
if the target line element end points are overlapped, determining target position points respectively corresponding to the target line element end points corresponding to the overlapped area;
and for any two target position points adjacent to the time stamps, taking a target line element endpoint of a first target position point with an earlier time stamp in the any two target position points as a target line element endpoint of a second target position point with a later time stamp, and re-determining a line element between the first target position point and the second target position point based on the re-determined line element endpoint.
In a possible implementation, the detecting whether the currently determined line element overlaps with the previously determined line element includes:
determining first end points of other line elements of which the distances from the current line element meet preset conditions;
and determining whether the current line element and the other line elements are overlapped or not based on the position information of the first end point and the direction vector of the position point corresponding to the current line element.
In a possible implementation manner, the receiving location point information sent by the first user equipment includes:
receiving a data set sent by a first user end, wherein the data set comprises a plurality of position point information corresponding to the same stroke and reference time information corresponding to the data set, and the reference time information is used for sequentially marking the plurality of data sets sent by the first user end;
the handwriting drawing based on the determined line element comprises the following steps:
determining line element information corresponding to a position point with the latest timestamp in the drawn current stroke;
under the condition that the current stroke is detected not to be drawn completely, determining whether to be connected with the drawn current stroke;
if yes, drawing on the basis of drawing of the current stroke based on the cached line element information and the line element corresponding to the currently received data set;
if not, drawing is directly carried out on the basis of the line element corresponding to the currently received data set.
In one possible embodiment, the determining whether to connect with the drawn current stroke includes:
and determining whether to connect with the drawn current stroke or not according to the reference time information corresponding to the currently received data set, the timestamp corresponding to the position point of the currently received data set and the timestamp corresponding to the position point of the drawn previous data set.
In a second aspect, an embodiment of the present disclosure further provides an apparatus for drawing handwriting, including:
the receiving module is used for receiving the position point information sent by the first user terminal;
the determining module is used for determining line element information corresponding to each position point based on the position point information, wherein the line element information is used for representing boundary information of line elements between the position point and two adjacent position points; the boundary information of the line element between any position point and two adjacent position points is the same;
and the drawing module is used for determining the line element between every two adjacent position points based on the line element information and drawing handwriting based on the determined line element.
In one possible implementation, the line element information includes position information of line element end points, and the line element end points include line element upper end points and line element lower end points; the position point information comprises width information of a line element where the position point is located;
the determining module, when determining the line element information corresponding to each location point based on the location point information, is configured to:
for any position point, determining a direction vector corresponding to the position point based on the position point information of the position point, wherein the direction vector is used for representing the drawing direction of a line element where the position point is located;
and determining the position information of the upper end point of the line element and the lower end point of the line element corresponding to the position point based on the width information included in the direction vector and the position point information of the position point.
In a possible implementation manner, the determining module, when determining the line element between each two adjacent position points based on the line element information, is configured to:
and aiming at any two adjacent position points, connecting the upper end points of the line elements corresponding to the any two position points respectively, connecting the lower end points of the line elements corresponding to the any two position points respectively, and connecting the upper end points of the line elements and the lower end points of the line elements corresponding to the same position point to form the line elements between the any two adjacent position points.
In a possible implementation manner, the location point information further includes a timestamp when the first user terminal draws the location point, and location information corresponding to the location point;
the determining module, when determining the direction vector corresponding to the location point based on the location point information of the location point for any location point, is configured to:
determining a next position point corresponding to the position point based on the timestamp included in the position point information;
and determining a first vector between the position point and the next position point by taking the position point as a starting point and the next position point as an end point, and taking the first vector as a direction vector corresponding to the position point.
In a possible embodiment, the determining module, when determining, for any location point, a direction vector corresponding to the location point based on location point information of the location point, is configured to:
determining a next position point and an upper position point corresponding to the position point based on the time stamp included in the position point information;
determining a second vector between the previous position point and the next position point by taking the previous position point as a starting point and the next position point as an end point;
determining a direction vector corresponding to the position point based on the second vector, wherein the direction vector is the same as the direction of the second vector; the corresponding direction vector of the first position point is a vector formed by taking the first position point as a starting point and taking the second position point as an end point, and the direction vector of the last position point is the same as the direction vector of the last position point.
In one possible embodiment, the drawing module, after determining the line element between each two adjacent position points based on the line element information, is further configured to:
detecting whether the currently determined line element is overlapped with the previously determined line element;
if the target line element end points are overlapped, determining target position points respectively corresponding to the target line element end points corresponding to the overlapped area;
and for any two target position points adjacent to the time stamps, taking a target line element endpoint of a first target position point with an earlier time stamp in the any two target position points as a target line element endpoint of a second target position point with a later time stamp, and re-determining a line element between the first target position point and the second target position point based on the re-determined line element endpoint.
In a possible implementation, the drawing module, when detecting whether a currently determined line element overlaps a previously determined line element, is configured to:
determining first end points of other line elements of which the distances from the current line element meet preset conditions;
and determining whether the current line element and the other line elements are overlapped or not based on the position information of the first end point and the direction vector of the position point corresponding to the current line element.
In a possible implementation manner, the receiving module, when receiving the location point information sent by the first user end, is configured to:
receiving a data set sent by a first user end, wherein the data set comprises a plurality of position point information corresponding to the same stroke and reference time information corresponding to the data set, and the reference time information is used for sequentially marking the plurality of data sets sent by the first user end;
the drawing module is used for, when handwriting drawing is performed based on the determined line element:
determining line element information corresponding to a position point with the latest timestamp in the drawn current stroke;
under the condition that the current stroke is detected not to be drawn completely, determining whether to be connected with the drawn current stroke;
if yes, drawing on the basis of the drawing of the current stroke based on the cached line element information and the line element corresponding to the currently received data set;
if not, drawing is directly carried out on the basis of the line element corresponding to the currently received data set.
In one possible embodiment, the receiving module, when determining whether to connect with the drawn current stroke, is configured to:
and determining whether to connect with the drawn current stroke or not according to the reference time information corresponding to the currently received data set, the timestamp corresponding to the position point of the currently received data set and the timestamp corresponding to the position point of the drawn previous data set.
In a third aspect, an embodiment of the present disclosure further provides a computer device, including: a processor, a memory and a bus, the memory storing machine-readable instructions executable by the processor, the processor and the memory communicating via the bus when the computer device is running, the machine-readable instructions when executed by the processor performing the steps of the first aspect described above, or any possible implementation of the first aspect.
In a fourth aspect, this disclosed embodiment also provides a computer-readable storage medium, on which a computer program is stored, where the computer program is executed by a processor to perform the steps in the first aspect or any one of the possible implementation manners of the first aspect.
According to the handwriting drawing method, the handwriting drawing device, the computer equipment and the storage medium, firstly position point information sent by a first user terminal is received, then line element information corresponding to each position point is determined based on the position point information, finally line elements between every two adjacent position points are determined based on the line element information, and handwriting drawing is carried out based on the determined line elements. Therefore, as the same boundary is shared between two adjacent line elements, and only one line element is arranged between every two position points of the line elements drawn by the method, the phenomenon of cracking between the line elements can be avoided on the basis of not increasing the number of the line elements, and the smoothness of the drawn handwriting is ensured.
In order to make the aforementioned objects, features and advantages of the present disclosure more comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings required in the embodiments will be briefly described below, and the drawings herein incorporated in and forming a part of the specification illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the technical solutions of the present disclosure. It is to be understood that the following drawings depict only certain embodiments of the disclosure and are therefore not to be considered limiting of its scope, for those skilled in the art to which the disclosure pertains without the benefit of the inventive faculty, and that additional related drawings may be derived therefrom.
FIG. 1 is a flow chart illustrating a method for drawing handwriting according to an embodiment of the present disclosure;
FIG. 2 is a schematic diagram illustrating line element endpoints, width information, and line elements provided by an embodiment of the present disclosure;
FIG. 3 is a flow chart illustrating a method for determining line element information according to an embodiment of the present disclosure;
FIG. 4 is a schematic diagram illustrating a method for determining a direction vector provided by an embodiment of the present disclosure;
FIG. 5 is a schematic diagram illustrating another method for determining a direction vector provided by an embodiment of the present disclosure;
FIG. 6 is a schematic diagram illustrating a calculation of a direction vector provided by an embodiment of the present disclosure;
FIG. 7 is a schematic diagram illustrating a line element provided by an embodiment of the present disclosure;
FIG. 8 is a diagram illustrating a method for determining whether line elements overlap according to an embodiment of the disclosure;
fig. 9 is a schematic diagram illustrating a method for drawing a trilateral line element according to an embodiment of the present disclosure;
FIG. 10 illustrates a flow chart of a handwriting rendering provided by an embodiment of the present disclosure;
FIG. 11 is a schematic diagram illustrating a connection with a current drawn stroke provided by an embodiment of the present disclosure;
FIG. 12 is a schematic diagram showing an architecture of a handwriting drawing device provided by an embodiment of the present disclosure;
fig. 13 shows a schematic structural diagram of a computer device provided by an embodiment of the present disclosure.
Detailed Description
To make the objects, technical solutions and advantages of the embodiments of the present disclosure more apparent, the technical solutions in the embodiments of the present disclosure will be described clearly and completely with reference to the drawings in the embodiments of the present disclosure, and it is obvious that the described embodiments are only a part of the embodiments of the present disclosure, not all of the embodiments. The components of the embodiments of the present disclosure, generally described and illustrated in the figures herein, can be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the disclosure, provided in the accompanying drawings, is not intended to limit the scope of the disclosure, as claimed, but is merely representative of selected embodiments of the disclosure. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the disclosure without making creative efforts, shall fall within the protection scope of the disclosure.
In an online classroom, a whiteboard brush tool is a common teaching tool. The teacher end uses a mouse to control the white board painting brush tool to move so as to form handwriting with variable thickness, and the student end restores the handwriting of the teacher end by receiving position point information of the handwriting.
In the related art, a corresponding trapezoidal line element is placed between every two position points, and handwriting of a teacher end is restored by superposing the trapezoidal line elements. However, the line elements drawn by the method have cracks, the crack phenomenon can cause gaps in the middle of handwriting, and if the distance between the line elements is reduced in order to prevent the cracks, and more line elements are filled, the calculation amount is greatly increased, so that the load of a CPU is increased.
Based on the research, the disclosure provides a handwriting drawing method, a handwriting drawing device, a computer device and a storage medium, and the method comprises the steps of firstly receiving position point information sent by a first user terminal, then determining line element information corresponding to each position point based on the position point information, finally determining line elements between every two adjacent position points based on the line element information, and drawing handwriting based on the determined line elements. Therefore, as the same boundary is shared between two adjacent line elements, and only one line element is arranged between every two position points of the line elements drawn by the method, the phenomenon of cracking between the line elements can be avoided on the basis of not increasing the number of the line elements, and the smoothness of the drawn handwriting is ensured.
The above-mentioned drawbacks are the results of the inventor after practical and careful study, and therefore, the discovery process of the above-mentioned problems and the solutions proposed by the present disclosure to the above-mentioned problems should be the contribution of the inventor in the process of the present disclosure.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures.
In order to facilitate understanding of the embodiment, first, a method for drawing handwriting disclosed in the embodiment of the present disclosure is described in detail, where an execution subject of the method for drawing handwriting provided in the embodiment of the present disclosure is a second user side, and the second user side may be a smart phone, a tablet computer, a personal computer, or the like.
Referring to fig. 1, a flowchart of a handwriting drawing method provided by the embodiment of the present disclosure is shown, where the method includes steps 101 to 103, where:
step 101, receiving location point information sent by a first user terminal;
step 102, determining line element information corresponding to each position point based on the position point information, wherein the line element information is used for representing boundary information of a line element between the position point and two adjacent position points; the boundary information of the line element between any position point and two adjacent position points is the same;
and 103, determining a line element between every two adjacent position points based on the line element information, and drawing handwriting based on the determined line elements.
The following is a detailed description of the above steps.
For step 101,
The first user terminal may be a teacher terminal, and the processes from step 101 to step 103 may be performed by a second user terminal, which may be a student terminal. Illustratively, the teacher end can realize the movement of the painting brush tool by controlling the mouse, and display corresponding handwriting at the teacher end, and the teacher can draw the handwriting in the target area by controlling the mouse to realize auxiliary teaching. The student end can restore the handwriting drawn by the teacher end by receiving the position point information sent by the teacher end.
It should be noted here that the position point information includes absolute coordinates of each position point, and after receiving the position point information, the display position of each position point in the display area may be determined based on the absolute coordinates.
In a possible implementation manner, the location point information may be sent and cached in a form of a data set, and a second user side may receive the data set sent by the first user side, where the data set includes multiple location point information corresponding to a same stroke and reference time information corresponding to the data set, where the same stroke refers to a stroke drawn in a process from a pen-down start to a pen-up start, and the reference time information is used for sequentially marking multiple data sets sent by the first user side.
The reference time information may be a time stamp of a last location point of a data set before the current data set, for example, a time stamp of a last location point of a last data set of the current data set, or a time stamp of a last location point of a last data set of the current data set.
Or the reference time information may also be an identifier of the data set, where the identifier of the data set is used to indicate an order of the data set, and may be generated at the second user end according to an order in which the data set is generated, for example, the identifier of the data set may be "1, 2, 3, 4".
Illustratively, a second user end receives a first data set and a second data set corresponding to the handwriting of a Chinese character 'one', the first received data set comprises three position point information, absolute coordinates of the three position point information are respectively a position point A coordinate (15, 20), a position point B coordinate (17, 19) and a position point C coordinate (18, 20) according to the sequence of corresponding timestamps from morning to evening, the reference time information is 1, the second received data set comprises two position point information, the absolute coordinates are respectively a position point D coordinate (19, 21) and a position point E coordinate (21, 21) according to the sequence of corresponding timestamps from morning to evening, and the reference time information is 2.
With respect to step 102,
After the second user end receives the position point information, the second user end needs to determine line element information corresponding to each position point according to the position point information, and then performs handwriting reduction according to the line element information.
In a possible implementation, the line element information includes position information of line element end points, and the line element end points include a line element upper end point and a line element lower end point; the position point information comprises width information of the line element where the position point is located.
If the upper end points of the line elements corresponding to the adjacent position points are on any side of the connecting line between the adjacent position points, the lower end points of the line elements corresponding to the adjacent position points are on the other side of the connecting line between the adjacent position points; the line element is an irregular triangle or quadrangle formed by connecting straight line segments and used for representing the shape of handwriting between every two position points, and the line element end point is the end point of the line element boundary. The width information represents the distance between any position point and the line element end point corresponding to the position point, and is preset by the first user terminal.
For example, as shown in fig. 2, if there are four position points a, B, C, and D, the position points E and G are line element end points corresponding to the B point, the position points F and H are line element end points corresponding to the C point, the quadrangle EFHG is the line element, and the lengths of the line segments EB, BG, FC, and CH are lengths corresponding to the width information.
In order to ensure that no gap is generated between the line elements, the boundary information of the line elements between any position point and two adjacent position points is the same in the disclosure. Specifically, a connecting line between the upper end point of the line element and the lower end point of the line element is used as a boundary of the line element between any position point and two adjacent position points, and the position information of the upper end point of the line element and the lower end point of the line element corresponding to the boundary is the corresponding boundary information, that is, two line elements between any position point and two adjacent position points thereof share the boundary.
In determining the line element information corresponding to each location point based on the location point information, for example, referring to the method shown in fig. 3, the method includes the following steps:
s301, for any position point, determining a direction vector corresponding to the position point based on the position point information of the position point, wherein the direction vector is used for representing the drawing direction of a line element where the position point is located;
s302, based on the direction vector and the width information included in the position point information of the position point, determining the position information of the upper end point and the lower end point of the line element corresponding to the position point.
In a possible implementation manner, the location point information further includes a timestamp when the first user terminal draws the location point, and location information corresponding to the location point.
The location information may be coordinates of a location point, the timestamp may refer to a time when the first user end draws the location point, the time may refer to an absolute time, or may refer to a relative time, and the relative time may exemplarily refer to a time when a relative content is displayed, for example, a kth second of the content display.
In a possible implementation manner, when determining, for any one location point, a direction vector corresponding to the location point based on location point information of the location point, a next location point corresponding to the location point may be determined based on a timestamp included in the location point information; and determining a first vector between the position point and the next position point by taking the position point as a starting point and the next position point as an end point, and taking the first vector as a direction vector corresponding to the position point.
For example, a timestamp corresponding to a current location point may be determined, and then the next location point adjacent to the timestamp corresponding to the current location point is determined based on an order of the timestamps from morning to evening, and a first vector between the location point and the next location point, that is, a direction vector corresponding to the current location point, is determined by using the location point as a starting point and the next location point as an ending point.
Exemplarily, referring to fig. 4, the current position point is M, the next position point is N, the position point M is used as a starting point, the position point N is used as an end point, the position point M and the position point N are connected, and the first vector is obtained
Figure BDA0003290358520000131
In another possible embodiment, the direction vector may be determined jointly by a line connecting the previous position point and the next position point adjacent to the current position point.
For example, when determining, for any location point, a direction vector corresponding to the location point based on location point information of the location point, a next location point and a previous location point corresponding to the location point may also be determined based on a timestamp included in the location point information; determining a second vector between the previous position point and the next position point by taking the previous position point as a starting point and the next position point as an end point; and determining a direction vector corresponding to the position point based on the second vector, wherein the direction vector is the same as the direction of the second vector.
Specifically, confirm the corresponding timestamp in current position point, based on the order of timestamp from morning to evening, confirm with the corresponding timestamp in current position point is adjacent next position point with last position point, with last position point is the starting point, next position point connects for the terminal point, confirms the corresponding second vector in current position point, crosses current position point department, does the parallel line of second vector, confirms the direction vector.
Here, the current position point may be used as a starting point, a preset length is intercepted from the direction vector, and any point on the direction vector is determined, so as to facilitate subsequent calculation.
For example, referring to fig. 5, the current position point is B, the previous position point is a, the next position point is C, and a straight line passing through a and C is obtained to obtain the second vector
Figure BDA0003290358520000141
Over said current position point B as>
Figure BDA0003290358520000142
Get the direction vector of point B as->
Figure BDA0003290358520000143
In this case, the corresponding direction vector of the first position point is a vector formed by taking the first position point as a starting point and taking the second position point as an end point; the direction vector of the last position point is the same as the direction vector of the last position point; alternatively, the direction vector of the last position point is a vector direction starting from the penultimate position point and ending at the last position point.
Taking FIG. 5 as an example, if point A isThe first position point, then the direction vector of the point A is
Figure BDA0003290358520000144
C is the last position point, the direction vector of the point C can be the same as that of the point B or be greater than or equal to the vector->
Figure BDA0003290358520000145
In the same direction.
In a possible implementation manner, when determining the position information of the upper end point of the line element and the lower end point of the line element corresponding to the position point based on the width information included in the direction vector and the position point information of the position point, specifically, for any position point, a perpendicular line of the direction vector may be made through the position point, the position point is taken as a starting point, the preset length in the width information is respectively cut along two directions of the perpendicular line, and the position information of the upper end point of the line element and the lower end point of the line element corresponding to the position point is determined.
Here, when determining the position information of the line element upper end point and the line element lower end point, a coordinate system may be established with the position point as an origin of coordinates, and the relative position coordinates of the line element upper end point and the line element lower end point with respect to the position point may be determined based on the preset length and the direction vector.
Illustratively, as shown in FIG. 6, the direction vectors
Figure BDA0003290358520000146
When calculating the coordinates of the end point G on the line element corresponding to the current position point C (relative coordinates to C in this case) and the coordinates of the end point H under the line element corresponding to the current position point C (relative coordinates to C in this case), a plane rectangular coordinate system may be established with the current position point C as the origin of coordinates (0, 0), the horizontal right direction as the positive direction of the X axis, and the vertical upward direction as the positive direction of the Y axis, and then the relative coordinates (X) of the end point G on the line element may be calculated 1 ,y 1 ) And the relative coordinates (x) of the end point H under said line element 2 ,y 2 )。
Illustratively, the relative coordinates (x) of the end point G on the line element 1 ,y 1 ) And the relative coordinates (x) of the end point H under said line element 2 ,y 2 ) The calculation can be made by the following formula:
Figure BDA0003290358520000151
Figure BDA0003290358520000152
Figure BDA0003290358520000153
Figure BDA0003290358520000154
wherein, | CG | represents the distance between the current position point C and the end point G on the line element, i.e. the width information corresponding to the position point C, y f The ordinate of the end point F of the direction vector is represented, | CF | represents the distance between the current position point C and the end point F of the direction vector, x f And | CH | represents the distance between the current position point C and the line element lower end point H, i.e., the width information corresponding to the position point C.
It is to be noted here that the coordinate (x) of the end point F f ,y f ) For the relative coordinate, as described in the method for determining the direction vector, when determining the relative coordinate of the end point F, the absolute coordinates of the next position point D, or the previous position point B and the next position point D may be first converted into the relative coordinate, and then the relative coordinate of the end point F is calculated; or after the absolute coordinate of the end point F is calculated, the absolute coordinate of the end point F is converted into a relative coordinate.
Here, after the relative coordinates of the respective line element end points are determined, the relative coordinates of the line element end points may be converted into absolute coordinates based on the absolute coordinates of the position points, and then line element rendering may be performed based on the absolute coordinates of the line element end points.
For step 103,
In a possible implementation manner, when determining a line element between every two adjacent position points based on the line element information, for any two adjacent position points, the upper end points of the line element corresponding to the any two position points are connected, the lower end points of the line element corresponding to the any two position points are connected, and the upper end point of the line element and the lower end point of the line element corresponding to the same position point are connected, so as to form the line element between the any two adjacent position points.
Here, because there are only two line element end points corresponding to the same position point, the line element between the position point and the previous position point and the line element between the position point and the next position point have the same boundary, that is, the two line elements share the boundary, and the boundary is the connecting line between the line element upper end point and the line element lower end point corresponding to the position point, so that no crack occurs between adjacent line elements in the handwriting drawn based on the method provided by the present disclosure.
For example, as shown in fig. 7, IF there are three adjacent position points a, D, and G in sequence, the upper end point of the line element corresponding to the position point a is B, the lower end point of the line element is C, the upper end point of the line element corresponding to the position point D is E, the lower end point of the line element is F, the upper end point of the line element corresponding to the position point G is H, the lower end point of the line element is I, CF, FE, EB, BC, EH, HI, and IF are connected respectively, the formed quadrilateral BEFC is a line element between the position points a and D, the formed quadrilateral EHIF is a line element between the position points D and G, and the quadrilateral BEFC and the EHIF share a boundary FE.
In practical application, after the line elements are connected based on the above method, if the curvature of the handwriting is too large, the adjacent line elements are likely to overlap, and if the overlapped line elements are not processed, the overlapped color of the restored handwriting is deepened, thereby affecting the display effect.
In a possible implementation manner, when detecting whether the currently determined line element overlaps with the previously determined line element, a first end point of another line element whose distance from the current line element satisfies a preset condition may be determined, and then, based on the position information of the first end point and a direction vector of a position point corresponding to the current line element, whether the current line element overlaps with the other line element may be determined. The preset condition may be that the preset condition is closest to the current line element or is located inside the current line element.
Specifically, a comparison vector is determined, which uses the position point as a starting point and uses the upper end point or the lower end point of the line element corresponding to the upper position point as an end point, and if an included angle between the comparison vector and the direction vector is smaller than 90 degrees, that is, the product of the comparison vector and the direction vector is larger than 0, the line elements are overlapped.
For example, referring to fig. 8, when determining whether line elements determined based on the position point B and the position point C overlap, the product of the comparison vector and the direction vector may be calculated by the following formula:
Figure BDA0003290358520000171
wherein,
Figure BDA0003290358520000172
represents said direction vector +>
Figure BDA0003290358520000173
Representing the comparison vector, x f Abscissa, x, representing position point F g Abscissa, y, representing position point G f Indicating the ordinate, y, of the location point F g The ordinate of the position point G is shown.
Here, the coordinates of the point G and the point F may be relative coordinates to the point C, or may be absolute coordinates, as long as they are coordinates in the same coordinate system.
In one possible implementation, after it is detected that a currently determined line element overlaps a previously determined line element, target position points corresponding to target line element end points corresponding to an overlapping region are determined, and for any two target position points adjacent to a timestamp, a target line element end point of a first target position point with an earlier timestamp in the two target position points is taken as a target line element end point of a second target position point with a later timestamp, and a line element between the first target position point and the second target position point is re-determined based on the re-determined line element end point.
In one possible implementation, when a line element between the first target position point and the second target position point is redetermined based on the redetermined line element end point, for any two adjacent position points, the upper end point or the lower end point of the line element corresponding to the any two position points are connected, and the upper end point and the lower end point of the line element corresponding to the same position point are connected to form a trilateral line element between the any two adjacent position points.
For example, referring to fig. 9, IF there are two adjacent position points B and C, the upper end point of the line element corresponding to the position point B is H, the lower end point of the line element is F, the upper end point of the line element corresponding to the position point C is I, the lower end point of the line element is J, and the line elements defined by the lower end point of the line element between the position point a and the position point D overlap, the lower end point of the line element corresponding to the position point C is F, and HF, HI, and IF are connected, respectively, and the formed trilateral HIF is the line element between the position points B and C.
In one possible embodiment, after determining the line elements, handwriting drawing is performed based on the determined line elements, as shown in fig. 10, including the following steps:
s1001, determining line element information corresponding to a latest position point of a timestamp in a drawn current stroke;
s1002, under the condition that the current stroke is detected not to be drawn completely, determining whether to be connected with the drawn current stroke;
if so, S1003 is sequentially executed, and if not, S1004 is executed.
S1003, drawing is carried out on the basis of drawing of the current stroke based on the cached line element information and the line element corresponding to the currently received data set;
and S1004, drawing is directly carried out on the basis of the line element corresponding to the currently received data set.
Specifically, when the second user side caches the data set, an incremental drawing mode is usually adopted, that is, when the current data set is cached, a previous data set is covered, so if the previous data set and the current data set belong to the same stroke, a line element between a last position point in the previous data set and a first position point in the current data set is not drawn, and a middle break of the stroke may be caused.
Therefore, when performing line element connection, it should be determined whether connection between the current data set and the previous data set is needed, and line element drawing is performed between the data sets that need to be connected.
In one possible implementation, it may be determined whether the current undrawn stroke and the drawn stroke belong to the same stroke based on the consistency indicator. Wherein the consecutive mark is generated by the first user end and stored in the data set for indicating whether the data set and the next data set belong to the same stroke.
Illustratively, the flag displays 1 if the current data set data and the data set belong to the same stroke, and 0 if the current data set data and the data set do not belong to the same stroke.
In addition, in a poor network condition, the data sets received by the second user end may be out of order, so that the last data set received is not adjacent to the current data set, or is not received in a chronological order from morning to evening, and therefore, it should be determined whether any of the received data sets arrives sequentially.
In a possible implementation manner, whether to connect with the drawn current stroke may be further determined based on the reference time information corresponding to the currently received data set, the timestamp corresponding to the position point of the currently received data set, and the timestamp corresponding to the position point of the drawn previous data set.
For example, taking the reference time information as the time stamp of the last position point of the last data set of the current data set as an example, whether to connect with the drawn current stroke may be determined by the following two conditions.
The condition 1 is that a timestamp in the earliest position point information in the last data set is greater than reference time information;
and 2, the timestamp in the latest position point information in the last data set is smaller than the timestamp in the earliest position point information in the current data set.
If the condition 1 is met, the last data set is shown to be behind the last data set, if the condition 2 is met, the last data set is shown to be ahead of the current data set, and if both conditions are met, the three data sets are received according to the time sequence, and then connection is carried out.
For example, as shown in fig. 11, the second user receives a first data set, a second data set, and a third data set in sequence, where a latest position point of a corresponding timestamp in the first data set is a, an earliest position point of a corresponding timestamp in the second data set is B, a latest position point of a corresponding timestamp is C, and a earliest position point of a corresponding timestamp in the third data set is D, the timestamp corresponding to the position point a and the timestamp corresponding to the position point B are compared according to the condition 1, the timestamp corresponding to the position point C and the timestamp corresponding to the position point D are compared according to the condition 2, and if both conditions are met, connection is performed between the position point a and the position point B, and the position point B and the position point C, and if any one condition is not met, connection is not performed.
In a possible embodiment, since the data sets are cached in an overlay manner, when any data set is received, the latest line element information of the corresponding timestamp in the previous data set is retained, so as to facilitate subsequent connection with the drawing handwriting of the current data set after the data set is received.
The handwriting drawing method provided by the embodiment of the disclosure includes the steps of firstly receiving position point information sent by a first user terminal, then determining line element information corresponding to each position point based on the position point information, finally determining line elements between every two adjacent position points based on the line element information, and drawing handwriting based on the determined line elements. Therefore, as the two adjacent line elements share the same boundary, and only one line element is arranged between every two position points of the line elements drawn by the method, the phenomenon of cracking between the line elements can be avoided on the basis of not increasing the number of the line elements, and the smoothness of the drawn handwriting is ensured.
It will be understood by those skilled in the art that in the method of the present invention, the order of writing the steps does not imply a strict order of execution and any limitations on the implementation, and the specific order of execution of the steps should be determined by their function and possible inherent logic.
Based on the same inventive concept, the embodiment of the present disclosure further provides a handwriting drawing device corresponding to the handwriting drawing method, and as the principle of solving the problem of the device in the embodiment of the present disclosure is similar to the handwriting drawing method in the embodiment of the present disclosure, the implementation of the device may refer to the implementation of the method, and the repeated parts are not described again.
Referring to fig. 12, there is shown an architecture diagram of a handwriting drawing apparatus according to an embodiment of the present disclosure, the apparatus includes: a receiving module 1201, a determining module 1202, and a drawing module 1203; wherein,
a receiving module 1201, configured to receive location point information sent by a first user equipment;
a determining module 1202, configured to determine, based on the location point information, line element information corresponding to each location point, where the line element information is used to represent boundary information of a line element between the location point and two adjacent location points; the boundary information of the line element between any position point and two adjacent position points is the same;
and a drawing module 1203, configured to determine, based on the line element information, a line element between every two adjacent position points, and perform handwriting drawing based on the determined line element.
In one possible implementation, the line element information includes position information of line element end points, and the line element end points include line element upper end points and line element lower end points; the position point information comprises width information of a line element where the position point is located;
the determining module 1202, when determining the line element information corresponding to each location point based on the location point information, is configured to:
for any position point, determining a direction vector corresponding to the position point based on the position point information of the position point, wherein the direction vector is used for representing the drawing direction of a line element where the position point is located;
and determining the position information of the upper end point of the line element and the lower end point of the line element corresponding to the position point based on the width information included in the direction vector and the position point information of the position point.
In a possible implementation, the determining module 1202, when determining the line element between each two adjacent position points based on the line element information, is configured to:
and aiming at any two adjacent position points, connecting the upper end points of the line element corresponding to the any two position points respectively, connecting the lower end points of the line element corresponding to the any two position points respectively, and connecting the upper end point of the line element and the lower end point of the line element corresponding to the same position point to form the line element between the any two adjacent position points.
In a possible implementation manner, the location point information further includes a timestamp when the first user terminal draws the location point, and location information corresponding to the location point;
the determining module 1202, when determining, for any location point, a direction vector corresponding to the location point based on the location point information of the location point, is configured to:
determining a next position point corresponding to the position point based on the timestamp included in the position point information;
and determining a first vector between the position point and the next position point by taking the position point as a starting point and the next position point as an end point, and taking the first vector as a direction vector corresponding to the position point.
In a possible implementation manner, the determining module 1202, when determining, for any location point, a direction vector corresponding to the location point based on the location point information of the location point, is configured to:
determining a next position point and an upper position point corresponding to the position point based on the time stamp included in the position point information;
determining a second vector between the previous position point and the next position point by taking the previous position point as a starting point and the next position point as an end point;
determining a direction vector corresponding to the position point based on the second vector, wherein the direction vector is the same as the direction of the second vector; the direction vector corresponding to the first position point is a vector formed by taking the first position point as a starting point and taking the second position point as an end point, and the direction vector of the last position point is the same as the direction vector of the last position point.
In a possible implementation, the drawing module 1203, after determining the line element between each two adjacent position points based on the line element information, is further configured to:
detecting whether the currently determined line element is overlapped with the previously determined line element;
if the target line element end points are overlapped, determining target position points respectively corresponding to the target line element end points corresponding to the overlapped area;
and for any two target position points adjacent to the time stamps, taking a target line element endpoint of a first target position point with an earlier time stamp in the any two target position points as a target line element endpoint of a second target position point with a later time stamp, and re-determining a line element between the first target position point and the second target position point based on the re-determined line element endpoint.
In a possible implementation, the drawing module 1203, when detecting whether the currently determined line element overlaps with the previously determined line element, is configured to:
determining first end points of other line elements, the distance between which and the current line element meets a preset condition;
and determining whether the current line element and the other line elements are overlapped or not based on the position information of the first end point and the direction vector of the position point corresponding to the current line element.
In a possible implementation manner, the receiving module 1201, when receiving the location point information sent by the first user end, is configured to:
receiving a data set sent by a first user end, wherein the data set comprises a plurality of position point information corresponding to the same stroke and reference time information corresponding to the data set, and the reference time information is used for sequentially marking the plurality of data sets sent by the first user end;
the drawing module 1203, when performing handwriting drawing based on the determined line element, is configured to:
determining line element information corresponding to a position point with the latest timestamp in the drawn current stroke;
under the condition that the current stroke is detected not to be drawn completely, determining whether to be connected with the drawn current stroke;
if yes, drawing on the basis of the drawing of the current stroke based on the cached line element information and the line element corresponding to the currently received data set;
if not, drawing is directly carried out on the basis of the line element corresponding to the currently received data set.
In a possible implementation, the receiving module 1201, when determining whether to connect with the drawn current stroke, is configured to:
and determining whether to connect with the drawn current stroke or not according to the reference time information corresponding to the currently received data set, the timestamp corresponding to the position point of the currently received data set and the timestamp corresponding to the position point of the drawn previous data set.
The description of the processing flow of each module in the device and the interaction flow between the modules may refer to the related description in the above method embodiments, and will not be described in detail here.
Based on the same technical concept, the embodiment of the disclosure also provides computer equipment. Referring to fig. 13, a schematic structural diagram of a computer device 1300 provided in the embodiment of the present disclosure includes a processor 1301, a memory 1302, and a bus 1303. The storage 1302 is used for storing execution instructions and includes a memory 13021 and an external storage 13022; the memory 13021 is also referred to as an internal memory, and is used for temporarily storing operation data in the processor 1301 and data exchanged with an external storage 13022 such as a hard disk, the processor 1301 exchanges data with the external storage 13022 through the memory 13021, and when the computer device 1300 runs, the processor 1301 and the storage 1302 communicate through the bus 1303, so that the processor 1301 executes the following instructions:
receiving position point information sent by a first user end;
determining line element information corresponding to each position point based on the position point information, wherein the line element information is used for representing boundary information of a line element between the position point and two adjacent position points; the boundary information of the line element between any position point and two adjacent position points is the same;
and determining the line element between every two adjacent position points based on the line element information, and performing handwriting drawing based on the determined line elements.
In one possible implementation, the line element information includes position information of line element end points, and the line element end points include line element upper end points and line element lower end points; the position point information comprises width information of a line element where the position point is located;
in a possible implementation manner, the processor 1301, in executing the instructions, determining the line element information corresponding to each location point based on the location point information includes:
for any position point, determining a direction vector corresponding to the position point based on the position point information of the position point, wherein the direction vector is used for representing the drawing direction of a line element where the position point is located;
and determining the position information of the upper end point of the line element and the lower end point of the line element corresponding to the position point based on the width information included in the direction vector and the position point information of the position point.
In a possible implementation manner, in the instructions executed by the processor 1301, the determining a line element between each two adjacent position points based on the line element information includes:
and aiming at any two adjacent position points, connecting the upper end points of the line element corresponding to the any two position points respectively, connecting the lower end points of the line element corresponding to the any two position points respectively, and connecting the upper end point of the line element and the lower end point of the line element corresponding to the same position point to form the line element between the any two adjacent position points.
In a possible implementation manner, the location point information further includes a timestamp when the first user terminal draws the location point, and location information corresponding to the location point;
in a possible implementation manner, the processor 1301 executes instructions, wherein the determining, for any position point, a direction vector corresponding to the position point based on the position point information of the position point includes:
determining a next position point corresponding to the position point based on the timestamp included in the position point information;
and determining a first vector between the position point and the next position point by taking the position point as a starting point and the next position point as an end point, and taking the first vector as a direction vector corresponding to the position point.
In a possible implementation manner, the processor 1301 executes instructions, wherein the determining, for any position point, a direction vector corresponding to the position point based on the position point information of the position point includes:
determining a next position point and an upper position point corresponding to the position point based on the time stamp included in the position point information;
determining a second vector between the previous position point and the next position point by taking the previous position point as a starting point and the next position point as an end point;
determining a direction vector corresponding to the position point based on the second vector, wherein the direction vector is the same as the direction of the second vector; the direction vector corresponding to the first position point is a vector formed by taking the first position point as a starting point and taking the second position point as an end point, and the direction vector of the last position point is the same as the direction vector of the last position point.
In a possible implementation manner, the processor 1301 executes instructions, and after determining a line element between each two adjacent position points based on the line element information, the method further includes:
detecting whether the currently determined line element is overlapped with the previously determined line element;
if the target line element end points are overlapped, determining target position points respectively corresponding to the target line element end points corresponding to the overlapped area;
and for any two target position points adjacent to the time stamps, taking a target line element endpoint of a first target position point with an earlier time stamp in the any two target position points as a target line element endpoint of a second target position point with a later time stamp, and re-determining a line element between the first target position point and the second target position point based on the re-determined line element endpoint.
In a possible implementation, the detecting whether the currently determined line element overlaps with the previously determined line element in the instructions executed by the processor 1301 includes:
determining first end points of other line elements of which the distances from the current line element meet preset conditions;
and determining whether the current line element and the other line elements are overlapped or not based on the position information of the first end point and the direction vector of the position point corresponding to the current line element.
In a possible implementation manner, the instructions executed by the processor 1301, the receiving the location point information sent by the first ue includes:
receiving a data set sent by a first user end, wherein the data set comprises a plurality of position point information corresponding to the same stroke and reference time information corresponding to the data set, and the reference time information is used for sequentially marking the plurality of data sets sent by the first user end;
the handwriting drawing based on the determined line element comprises the following steps:
determining line element information corresponding to a position point with the latest timestamp in the drawn current stroke;
under the condition that the current stroke is detected not to be drawn completely, determining whether to be connected with the drawn current stroke;
if yes, drawing on the basis of the drawing of the current stroke based on the cached line element information and the line element corresponding to the currently received data set;
if not, drawing is directly carried out on the basis of the line element corresponding to the currently received data set.
In one possible embodiment, the instructions executed by the processor 1301 for determining whether to connect with the drawn current stroke include:
and determining whether to connect with the drawn current stroke or not according to the reference time information corresponding to the currently received data set, the timestamp corresponding to the position point of the currently received data set and the timestamp corresponding to the position point of the drawn previous data set.
The embodiment of the present disclosure further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program performs the steps of the handwriting drawing method described in the above method embodiment. The storage medium may be a volatile or non-volatile computer-readable storage medium.
The embodiments of the present disclosure also provide a computer program product, where the computer program product bears program codes, and instructions included in the program codes may be used to execute steps of the handwriting drawing method described in the foregoing method embodiments, which may be specifically referred to in the foregoing method embodiments and are not described herein again.
The computer program product may be implemented by hardware, software or a combination thereof. In an alternative embodiment, the computer program product is embodied in a computer storage medium, and in another alternative embodiment, the computer program product is embodied in a Software product, such as a Software Development Kit (SDK), or the like.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the system and the apparatus described above may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again. In the several embodiments provided in the present disclosure, it should be understood that the disclosed system, apparatus, and method may be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one logical division, and there may be other divisions when actually implemented, and for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of devices or units through some communication interfaces, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one position, or may be distributed on multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present disclosure may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a non-volatile computer-readable storage medium executable by a processor. Based on such understanding, the technical solution of the present disclosure may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present disclosure. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
Finally, it should be noted that: the above-mentioned embodiments are merely specific embodiments of the present disclosure, which are used to illustrate the technical solutions of the present disclosure, but not to limit the technical solutions, and the scope of the present disclosure is not limited thereto, and although the present disclosure is described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: any person skilled in the art can modify or easily conceive of the technical solutions described in the foregoing embodiments or equivalent technical features thereof within the technical scope of the present disclosure; such modifications, changes or substitutions do not depart from the spirit and scope of the embodiments of the present disclosure, and should be construed as being included therein. Therefore, the protection scope of the present disclosure shall be subject to the protection scope of the claims.

Claims (12)

1. A handwriting drawing method is characterized by comprising the following steps:
receiving position point information sent by a first user end;
determining line element information corresponding to each position point based on the position point information, wherein the line element information is used for representing boundary information of a line element between the position point and two adjacent position points; the boundary information of the line element between any position point and two adjacent position points is the same;
and determining the line element between every two adjacent position points based on the line element information, and drawing handwriting based on the determined line element.
2. The method of claim 1, wherein the line element information includes position information of line element end points, the line element end points including a line element upper end point and a line element lower end point; the position point information comprises width information of a line element where the position point is located;
the determining of the line element information corresponding to each location point based on the location point information includes:
for any position point, determining a direction vector corresponding to the position point based on the position point information of the position point, wherein the direction vector is used for representing the drawing direction of a line element where the position point is located;
and determining the position information of the line element upper end point and the line element lower end point corresponding to the position point based on the direction vector and the width information included in the position point information of the position point.
3. The method of claim 2, wherein the determining the line element between each two adjacent position points based on the line element information comprises:
and aiming at any two adjacent position points, connecting the line element upper end points corresponding to the any two adjacent position points respectively, connecting the line element lower end points corresponding to the any two position points respectively, and connecting the line element upper end point and the line element lower end point corresponding to the same position point to form a line element between the any two adjacent position points.
4. The method according to claim 2, wherein the location point information further includes a timestamp when the first user terminal plots the location point, and location information corresponding to the location point;
the determining, for any one position point, a direction vector corresponding to the position point based on the position point information of the position point includes:
determining a next position point corresponding to the position point based on the timestamp included in the position point information;
and determining a first vector between the position point and the next position point by taking the position point as a starting point and the next position point as an end point, and taking the first vector as a direction vector corresponding to the position point.
5. The method according to claim 2, wherein for any position point, determining a direction vector corresponding to the position point based on the position point information of the position point comprises:
determining a next position point and an upper position point corresponding to the position point based on the time stamp included in the position point information;
determining a second vector between the previous position point and the next position point by taking the previous position point as a starting point and the next position point as an end point;
determining a direction vector corresponding to the position point based on the second vector, wherein the direction vector is the same as the direction of the second vector; the direction vector corresponding to the first position point is a vector formed by taking the first position point as a starting point and taking the second position point as an end point, and the direction vector of the last position point is the same as the direction vector of the last position point.
6. The method of claim 1, wherein after determining the line element between each two adjacent position points based on the line element information, the method further comprises:
detecting whether the currently determined line element is overlapped with the previously determined line element;
if the target line element end points are overlapped, determining target position points respectively corresponding to the target line element end points corresponding to the overlapped area;
and for any two target position points adjacent to the time stamps, taking a target line element endpoint of a first target position point with an earlier time stamp in the any two target position points as a target line element endpoint of a second target position point with a later time stamp, and re-determining a line element between the first target position point and the second target position point based on the re-determined line element endpoint.
7. The method of claim 6, wherein detecting whether a currently determined line element overlaps a previously determined line element comprises:
determining first end points of other line elements, the distance between which and the current line element meets a preset condition;
and determining whether the current line element and the other line elements are overlapped or not based on the position information of the first end point and the direction vector of the position point corresponding to the current line element.
8. The method according to claim 1, wherein the receiving the location point information sent by the first ue comprises:
receiving a data set sent by a first user end, wherein the data set comprises a plurality of position point information corresponding to the same stroke and reference time information corresponding to the data set, and the reference time information is used for sequentially marking the plurality of data sets sent by the first user end;
the handwriting drawing based on the determined line element comprises the following steps:
determining line element information corresponding to a position point with the latest timestamp in the drawn current stroke;
under the condition that the current stroke is detected not to be drawn completely, determining whether to be connected with the drawn current stroke;
if yes, drawing on the basis of drawing of the current stroke based on the cached line element information and the line element corresponding to the currently received data set;
if not, drawing is directly carried out on the basis of the line element corresponding to the currently received data set.
9. The method of claim 8, wherein said determining whether to connect with a current stroke that has been drawn comprises:
and determining whether to connect with the drawn current stroke or not according to the reference time information corresponding to the currently received data set, the timestamp corresponding to the position point of the currently received data set and the timestamp corresponding to the position point of the drawn previous data set.
10. An apparatus for drawing handwriting, comprising:
the receiving module is used for receiving the position point information sent by the first user terminal;
a determining module, configured to determine, based on the location point information, line element information corresponding to each location point, where the line element information is used to represent boundary information of a line element between the location point and two adjacent location points; the boundary information of the line element between any position point and two adjacent position points is the same;
and the drawing module is used for determining the line element between every two adjacent position points based on the line element information and drawing handwriting based on the determined line element.
11. A computer device, comprising: a processor, a memory and a bus, the memory storing machine-readable instructions executable by the processor, the processor and the memory communicating via the bus when a computer device is running, the machine-readable instructions when executed by the processor performing the steps of the method for drawing handwriting as claimed in any one of claims 1 to 9.
12. A computer-readable storage medium, characterized in that a computer program is stored thereon which, when being executed by a processor, carries out the steps of a method for drawing handwriting according to any one of claims 1 to 9.
CN202111162677.1A 2021-09-30 2021-09-30 Handwriting drawing method and device, computer equipment and storage medium Pending CN115880394A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111162677.1A CN115880394A (en) 2021-09-30 2021-09-30 Handwriting drawing method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111162677.1A CN115880394A (en) 2021-09-30 2021-09-30 Handwriting drawing method and device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115880394A true CN115880394A (en) 2023-03-31

Family

ID=85756720

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111162677.1A Pending CN115880394A (en) 2021-09-30 2021-09-30 Handwriting drawing method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115880394A (en)

Similar Documents

Publication Publication Date Title
EP3769509B1 (en) Multi-endpoint mixed-reality meetings
WO2022001256A1 (en) Image annotation method and device, electronic apparatus, and storage medium
US20160092728A1 (en) Electronic device and method for processing handwritten documents
US20210374902A1 (en) Method and Apparatus for Generating Sample Image and Electronic Device
US11574414B2 (en) Edge-based three-dimensional tracking and registration method and apparatus for augmented reality, and storage medium
CN103679792B (en) The rendering intent and system of a kind of threedimensional model
US20170169002A1 (en) Electronic apparatus and display control method
CN106600664B (en) drawing method and device of symmetric graph
CN108197596A (en) A kind of gesture identification method and device
WO2018018941A1 (en) Method and system for zooming image by using cooperation between opengl and opencl
CN102566812B (en) Method and device for implementation of handwriting notepad
US9927971B2 (en) Electronic apparatus, method and storage medium for generating chart object
CN115880394A (en) Handwriting drawing method and device, computer equipment and storage medium
US10679049B2 (en) Identifying hand drawn tables
CN116912439A (en) Method and system for accurately marking multiple information on three-dimensional topographic map
CN107679219B (en) Matching method and device, interactive intelligent panel and storage medium
CN104145303A (en) Drawing device and drawing program
CN116310040A (en) Drawing processing method and device of three-dimensional model, electronic equipment and storage medium
CN104238921A (en) Custom polygon drawing method and device
CN113487704A (en) Method and device for drawing dovetail arrow head, storage medium and terminal equipment
CN113963361A (en) A kind of handwriting display method and related device
US20170060407A1 (en) Electronic apparatus and method
CN114168060A (en) Electronic whiteboard rendering method, device, device and storage medium
CN113066153A (en) Method, device and equipment for generating pipeline flow chart and storage medium
US12223603B2 (en) Method of learning a target object using a virtual viewpoint camera and a method of augmenting a virtual model on a real object implementing the target object using the same

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

Address after: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Applicant after: Douyin Vision Co.,Ltd.

Address before: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Applicant before: Tiktok vision (Beijing) Co.,Ltd.

Address after: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Applicant after: Tiktok vision (Beijing) Co.,Ltd.

Address before: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Applicant before: BEIJING BYTEDANCE NETWORK TECHNOLOGY Co.,Ltd.

CB02 Change of applicant information