CN113450429A - Track drawing method and device - Google Patents

Track drawing method and device Download PDF

Info

Publication number
CN113450429A
CN113450429A CN202110845253.9A CN202110845253A CN113450429A CN 113450429 A CN113450429 A CN 113450429A CN 202110845253 A CN202110845253 A CN 202110845253A CN 113450429 A CN113450429 A CN 113450429A
Authority
CN
China
Prior art keywords
track
trajectory
coordinate
coordinates
smoothness
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
CN202110845253.9A
Other languages
Chinese (zh)
Other versions
CN113450429B (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.)
Beijing Ape Power Future Technology Co Ltd
Original Assignee
Beijing Ape Power Future 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 Ape Power Future Technology Co Ltd filed Critical Beijing Ape Power Future Technology Co Ltd
Priority to CN202110845253.9A priority Critical patent/CN113450429B/en
Publication of CN113450429A publication Critical patent/CN113450429A/en
Application granted granted Critical
Publication of CN113450429B publication Critical patent/CN113450429B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The present specification provides a trajectory drawing method and apparatus, wherein the trajectory drawing method includes: acquiring a track drawing request; determining a track smoothing coefficient and a track attribute parameter according to the track drawing request; calculating a track element distance based on the track smoothness coefficient and the track attribute parameters; and determining drawing coordinates of the track elements according to the track element distance, and drawing the track elements according to the drawing coordinates of the track elements.

Description

Track drawing method and device
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a method and an apparatus for trajectory mapping.
Background
With the development of computer technology, drawing graphics through terminal equipment becomes a more widely applied mode. In the prior art, most of handwriting drawn by a user is rendered by adopting a point rendering mode, which mainly uses a series of closely arranged points to render the handwriting, and the smoothness of the handwriting is fed back by controlling the density of the points. However, because the drawing requirements under different scenes are different in standard, for example, the smoothness requirement of handwriting may be higher when drawing a logo, and the smoothness requirement of handwriting is lower when inputting characters by handwriting, the control of the smoothness of the drawn handwriting for different scenes becomes a problem which needs to be solved urgently.
Disclosure of Invention
In view of this, the embodiments of the present specification provide a trajectory drawing method. The present specification also relates to a trajectory drawing device, a computing device, and a computer-readable storage medium, which are used to solve the technical drawbacks of the prior art.
According to a first aspect of embodiments of the present specification, there is provided a trajectory drawing method including:
acquiring a track drawing request;
determining a track smoothing coefficient and a track attribute parameter according to the track drawing request;
calculating a track element distance based on the track smoothness coefficient and the track attribute parameters;
and determining drawing coordinates of the track elements according to the track element distance, and drawing the track elements according to the drawing coordinates of the track elements.
Optionally, the determining a trajectory smoothing coefficient according to the trajectory drawing request includes:
analyzing the track drawing request to obtain a drawing pressure parameter, and determining a track smoothness grade corresponding to the drawing pressure parameter;
and determining the track smoothness coefficient corresponding to the track smoothness grade according to the corresponding relation between the reference track smoothness grade and the reference track smoothness coefficient.
Optionally, the reference trajectory smoothing coefficient is determined by:
acquiring a coordinate distance matched with the smooth grade of the reference track;
calculating an initial track smoothing coefficient according to the attribute information of the track elements and the coordinate distance;
and taking the initial track smoothing coefficient as the reference track smoothing coefficient corresponding to the reference track smoothing grade.
Optionally, the determining the track attribute parameter according to the track drawing request includes:
and determining a track width parameter according to the track drawing request, and taking the track width parameter as the track attribute parameter.
Optionally, the calculating a track element distance based on the track smoothing coefficient and the track attribute parameter includes:
reading a preset distance formula in response to the track drawing request;
inputting the track smoothing coefficient and the track width parameter into the distance formula for calculation to obtain the track element distance;
wherein the distance is calculated as
Figure BDA0003180293470000021
spacing represents the track element distance, s represents the track smoothing coefficient, and w represents the track width parameter.
Optionally, the determining the trace element drawing coordinates according to the trace element distance includes:
analyzing the track drawing request to obtain track coordinates;
and adjusting the track coordinates according to the track element distance, and obtaining the track element drawing coordinates according to the adjustment result.
Optionally, the drawing the trajectory element according to the trajectory element drawing coordinates includes:
acquiring preset track element information;
and drawing the track elements at the track element drawing coordinates according to the track element information.
Optionally, the obtaining a trajectory drawing request includes:
acquiring the track drawing request according to a preset time period;
correspondingly, after the step of drawing the trace element according to the trace element drawing coordinates is executed, the method further includes:
and rendering and displaying the target track formed by the track elements.
Optionally, the adjusting the trajectory coordinate according to the trajectory element distance and obtaining the trajectory element drawing coordinate according to an adjustment result includes:
determining a previous track coordinate and a next track coordinate adjacent to the track coordinate;
determining a first midpoint coordinate based on the track coordinate and the previous track coordinate, and determining a second midpoint coordinate based on the track coordinate and the next track coordinate;
and adjusting the first midpoint coordinate and the second midpoint coordinate according to the track element distance, and obtaining the track element drawing coordinate according to an adjustment result.
According to a second aspect of embodiments herein, there is provided a trajectory drawing device including:
an acquisition module configured to acquire a trajectory drawing request;
a determination module configured to determine a trajectory smoothing coefficient and a trajectory attribute parameter according to the trajectory drawing request;
a calculation module configured to calculate a trajectory element distance based on the trajectory smoothing coefficient and the trajectory attribute parameter;
and the drawing module is configured to determine drawing coordinates of the track elements according to the track element distance and draw the track elements according to the drawing coordinates of the track elements.
Optionally, the determining module is further configured to:
analyzing the track drawing request to obtain a drawing pressure parameter, and determining a track smoothness grade corresponding to the drawing pressure parameter; and determining the track smoothness coefficient corresponding to the track smoothness grade according to the corresponding relation between the reference track smoothness grade and the reference track smoothness coefficient.
Optionally, the determining module is further configured to:
acquiring a coordinate distance matched with the smooth grade of the reference track; calculating an initial track smoothing coefficient according to the attribute information of the track elements and the coordinate distance; and taking the initial track smoothing coefficient as the reference track smoothing coefficient corresponding to the reference track smoothing grade.
Optionally, the determining module is further configured to:
and determining a track width parameter according to the track drawing request, and taking the track width parameter as the track attribute parameter.
Optionally, the computing module is further configured to:
reading a preset distance formula in response to the track drawing request; the track smoothing coefficients are summedInputting the track width parameter into the distance formula for calculation to obtain the track element distance; wherein the distance is calculated as
Figure BDA0003180293470000031
spacing represents the track element distance, s represents the track smoothing coefficient, and w represents the track width parameter.
Optionally, the rendering module is further configured to:
analyzing the track drawing request to obtain track coordinates; and adjusting the track coordinates according to the track element distance, and obtaining the track element drawing coordinates according to the adjustment result.
Optionally, the rendering module is further configured to:
acquiring preset track element information; and drawing the track elements at the track element drawing coordinates according to the track element information.
Optionally, the obtaining module is further configured to:
acquiring the track drawing request according to a preset time period;
correspondingly, the trajectory drawing device further comprises:
and the rendering module is configured to render and display the target track formed by the track elements.
Optionally, the rendering module is further configured to:
determining a previous track coordinate and a next track coordinate adjacent to the track coordinate; determining a first midpoint coordinate based on the track coordinate and the previous track coordinate, and determining a second midpoint coordinate based on the track coordinate and the next track coordinate; and adjusting the first midpoint coordinate and the second midpoint coordinate according to the track element distance, and obtaining the track element drawing coordinate according to an adjustment result.
According to a third aspect of embodiments herein, there is provided a computing device comprising:
a memory and a processor;
the memory is configured to store computer-executable instructions, and the processor is configured to implement the steps of the trajectory mapping method when executing the computer-executable instructions.
According to a fourth aspect of embodiments herein, there is provided a computer-readable storage medium storing computer-executable instructions that, when executed by a processor, implement the steps of the trajectory rendering method.
After the track drawing method provided by the specification is obtained, the track smoothing coefficient and the track attribute parameter related to the track to be drawn can be determined according to the track drawing request, so that when the track is drawn subsequently, track smoothing coefficients and track attribute parameters may be referenced, at which time track element distances are calculated in combination with the track smoothing coefficients and the track attribute parameters, and determining the drawing coordinates of the track elements according to the track element distance, so that the basic elements forming the track can be drawn according to the track drawing coordinates, namely the track elements, realizes that the drawing of the track elements can be reasonably controlled through the track smoothness coefficient and the track attribute parameters, therefore, the track formed based on the track elements can be more reasonable, the problem that the track elements are distributed too densely or too sparsely is avoided, and the smoothness of the drawn track is more consistent with the current drawn scene.
Drawings
Fig. 1 is a flowchart of a trajectory mapping method provided in an embodiment of the present specification;
FIG. 2 is a diagram illustrating a trajectory mapping method according to an embodiment of the present disclosure;
FIG. 3 is a diagram illustrating another trajectory mapping method provided in an embodiment of the present disclosure;
FIG. 4 is a flowchart illustrating a trajectory drawing method applied to a text writing scene according to an embodiment of the present disclosure;
fig. 5 is a schematic structural diagram of a trajectory mapping device according to an embodiment of the present disclosure;
fig. 6 is a block diagram of a computing device according to an embodiment of the present disclosure.
Detailed Description
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present description. This description may be embodied in many different forms and should not be construed as limited to the embodiments set forth herein, as those skilled in the art will be able to make and use the present disclosure without departing from the spirit and scope of the present disclosure.
The terminology used in the description of the one or more embodiments is for the purpose of describing the particular embodiments only and is not intended to be limiting of the description of the one or more embodiments. As used in one or more embodiments of the present specification and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used in one or more embodiments of the present specification refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It will be understood that, although the terms first, second, etc. may be used herein in one or more embodiments to describe various information, these information should not be limited by these terms. These terms are only used to distinguish one type of information from another. For example, a first can also be referred to as a second and, similarly, a second can also be referred to as a first without departing from the scope of one or more embodiments of the present description. The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination", depending on the context.
In the present specification, a trajectory drawing method is provided, and the present specification relates to a trajectory drawing device, a computing apparatus, and a computer-readable storage medium, which are described in detail one by one in the following embodiments.
In practical application, when a user draws a graph on input equipment, the graph is generated based on the handwriting of the user, in the process, the input equipment sends coordinates and other data of a current pen point (the position touched by the user on the input equipment) on a screen to an operating system at short time intervals (such as a few milliseconds or a dozen milliseconds) for generating the handwriting, and the operating system draws basic elements forming the handwriting according to the data, namely draws points with set sizes on the screen, but the points are sparse, and the problem that the handwriting is not consistent when being directly drawn is solved, so that new points need to be supplemented in the process, and the handwriting is fuller. The interpolation is to calculate new data in the range by an algorithm according to the existing data, the point density of the interpolation is the distance between the centers of circles of adjacent points, and finally, the points after the interpolation are rendered, so that the handwriting is formed.
In the prior art, the number of interpolation points required is directly counted by controlling collected adjacent points, and most of the number comes from experience, so that different relevant parameters need to be set in different scenes, the applicability is low, and the requirements for handwriting width are different in different scenes, so that the problems of over-dense point density or over-sparse point density occur, and therefore an effective scheme is urgently needed to solve the problems.
After the track drawing method provided by the specification is obtained, the track smoothing coefficient and the track attribute parameter related to the track to be drawn can be determined according to the track drawing request, so that when the track is drawn subsequently, track smoothing coefficients and track attribute parameters may be referenced, at which time track element distances are calculated in combination with the track smoothing coefficients and the track attribute parameters, and determining the drawing coordinates of the track elements according to the track element distance, so that the basic elements forming the track can be drawn according to the track drawing coordinates, namely the track elements, realizes that the drawing of the track elements can be reasonably controlled through the track smoothness coefficient and the track attribute parameters, therefore, the track formed based on the track elements can be more reasonable, the problem that the track elements are distributed too densely or too sparsely is avoided, and the smoothness of the drawn track is more consistent with the current drawn scene.
Fig. 1 shows a flowchart of a trajectory mapping method provided in an embodiment of the present specification, which specifically includes the following steps:
step S102, a track drawing request is obtained.
In practical applications, when drawing figures or writing characters through an input device, the drawing of figures or characters is usually performed according to handwriting of a user on the input device so as to present the same figures or characters as the handwriting of the user. That is, the trace is drawn according to the handwriting moved by the user through the input device, that is, the same figure or character as the handwriting can be generated through the drawn trace. The track generation is composed of a plurality of track elements, and the track elements are spliced to form the track so as to draw the graph and the character which are the same as the handwriting of the user.
Based on this, most of the track elements are presented in the form of points, and the tracks can be generated by splicing the points. Referring to the schematic diagram shown in fig. 2, when a user draws a straight line on the input device, a plurality of trace elements (i.e., points) are drawn according to the handwriting of the user, such as the points 1 to 5 in fig. 2 (a), and the five points are spliced to form a straight line and displayed to the user through the input device. The density of the points controls the smoothness of the drawn straight line, and when the points are dense, the drawn straight line is smoother, and as shown in the schematic diagram (b) in fig. 2, the smoothness of the points is higher as the fit degree is closer. When the points are sparse, the drawn straight line is rougher, and as shown in the schematic diagram (c) in fig. 2, the degree of smoothness is lower as the points are more distant from each other.
And the smoothness requirements for the drawn tracks under different scenes are different, if the distances between points are controlled by the same distance, different handwriting widths cannot be adapted, and the smoothness of the drawn tracks cannot be reasonably adjusted, so that the drawn figures or characters cannot meet the drawing requirements. According to the track drawing method provided by the embodiment, in order to enable the drawn track to meet the drawing requirement of drawing a scene, the drawing processing of each track element is controlled jointly by combining track attribute information and track smoothness coefficients, so that the adjacent track elements are adjusted at reasonable intervals, the drawn track is more reasonable, the current scene requirement is met, and the use experience of a user is improved.
Based on the above, the trace drawing request is specifically a drawing request collected based on the handwriting moved by the user through the input device, and it can be determined through the trace drawing request which trace elements (i.e. points to be drawn) that the handwriting moved by the user currently needs to be drawn, so as to facilitate the subsequent drawing of the trace elements, thereby forming a trace meeting the drawing requirements of the user.
In practical applications, the input device may be a smart phone, an electronic drawing board, a notebook computer, a tablet computer, or the like, and accordingly, when the user draws graphics or characters on the input device, the user may use a touch screen or an external device, such as an external stylus or a mouse, which is not limited herein.
And step S104, determining a track smoothing coefficient and track attribute parameters according to the track drawing request.
Specifically, on the basis of acquiring the track drawing request, further, in order to draw track elements meeting the current drawn scene in the follow-up process, the track meeting the requirement is formed, at the moment, the track smoothness coefficient can be determined by combining the current drawn scene, and track attribute parameters corresponding to the track to be drawn are determined, so that the smoothness degree of the track drawn can be controlled through the track smoothness coefficient in the follow-up process conveniently, and meanwhile, a reasonable track can be presented on the basis of ensuring the smoothness degree by combining the track attribute parameters.
The track attribute parameters specifically refer to parameters related to attributes corresponding to the track to be drawn, and the track attribute parameters can control the content of the drawn track, such as width, color and the like; correspondingly, the track smoothness coefficient specifically refers to a coefficient for controlling the smoothness of the track to be drawn, and the track to be drawn can be made smoother or rougher by adjusting the track smoothness coefficient, that is, the track smoothness coefficient can control the distance between each track element to reflect the smoothness of the track.
Referring to the schematic diagram shown in fig. 2 (a), taking point 2 and point 3 as examples to illustrate the track smoothness coefficient, AB being the diameter of point 2, that is, the widest place of the handwriting, and the distance CD between the adjacent point 3 and the focus of point 2 being the narrowest place of the handwriting, the difference between AB and CD can be calculated to represent the smoothness of the handwriting, that is, the smoothness of the drawn track, if the difference between AB and CD is 0, it means that the currently drawn track is sufficiently smooth, otherwise, if the difference between AB and CD is larger, it means that the currently drawn track is less smooth, and the difference is the track smoothness coefficient (smooth).
Further, when determining a track smoothness coefficient according to a track drawing request, since the coefficient is a basis for controlling the track smoothness, and requirements for the track smoothness are different in different scenes, in order to select a suitable track smoothness coefficient to control the track smoothness in the current scene, the track smoothness coefficient may be completed by combining related parameters in the track drawing request, in this embodiment, the specific implementation manner is as follows:
analyzing the track drawing request to obtain a drawing pressure parameter, and determining a track smoothness grade corresponding to the drawing pressure parameter;
and determining a track smoothness coefficient corresponding to the track smoothness grade according to the corresponding relation between the reference track smoothness grade and the reference track smoothness coefficient.
Specifically, the drawing pressure parameter refers to a pressure parameter acquired by a pressure sensor of the input device when the user draws content through the input device; the higher the pressure is, the higher the smoothness of the currently drawn track is, and conversely, the lower the pressure is, the lower the smoothness of the currently drawn track is; correspondingly, the track smoothness grade specifically refers to a grade corresponding to the track smoothness determined based on the pressure parameter, wherein a higher grade indicates a higher pressure and thus a higher smoothness, and a lower grade indicates a lower pressure and thus a lower smoothness.
Based on the above, after the trace drawing request is collected, because the trace drawing request contains all parameters corresponding to the handwriting moved by the current user, the trace drawing request can be analyzed to obtain drawing pressure parameters corresponding to the handwriting moved by the user in the current drawing scene, the trace smoothness grade required by the current drawing trace can be determined through the drawing pressure parameters, and then the trace smoothness coefficient corresponding to the trace smoothness grade in the current drawing scene can be determined by reading the corresponding relation between the reference trace smoothness grade and the reference trace smoothness coefficient, so that the smoothness degree of the trace can be conveniently controlled subsequently, and the trace meeting the user requirement is rendered.
In addition, because the trace is drawn in real time, considering the efficiency of generating the trace, when a trace drawing request is obtained, the request may already include a request for drawing a plurality of trace elements, and each trace element needs to be generated by a user by moving the trace, at this time, a plurality of drawing pressure parameters may be obtained, and a trace smoothing coefficient corresponding to each trace element to be drawn may be respectively determined, so as to determine a trace smoothing coefficient corresponding to each trace element, so as to facilitate the subsequent completion of the drawing of each trace element on the basis of the above, thereby forming a trace meeting the requirement, it should be noted that the drawing processes of each trace element are similar, in this embodiment, the process of drawing one trace element is described, and the drawing processes of other trace elements forming the trace may refer to the same or similar description content in this embodiment, and are not limited in any way herein.
In conclusion, the track smooth coefficient corresponding to the track element to be drawn is determined by adopting the drawing pressure parameter, so that the drawn track element can meet the requirement of drawing a scene more, and the drawn track is more reasonable.
Furthermore, considering that the track smooth coefficient meeting the drawing requirements for the accurate determination of different drawing pressure parameters can be preset, the reference track smooth coefficient can be set in advance, so that when the device is used, the track smooth coefficient meeting the requirements can be conveniently drawn by other attributes of the subsequent combination track through the quick determination track smooth coefficient reading mode, and in the embodiment, the reference track smooth coefficient is determined by the following mode:
acquiring a coordinate distance matched with the smooth grade of the reference track;
calculating an initial track smoothing coefficient according to the attribute information and the coordinate distance of the track elements;
and taking the initial track smoothing coefficient as a reference track smoothing coefficient corresponding to the reference track smoothing grade.
Specifically, the coordinate distance specifically refers to a distance between track elements matched with the current reference track smoothness level, and if the track elements are circular points, the coordinate distance specifically refers to a circle center distance between the two circular points, and the distance between the track elements can be controlled by adjusting the distance, and then the track smoothness coefficient can be controlled on the basis of the distance, so that the corresponding relation between the reference track smoothness level and the reference track smoothness coefficient is pre-configured, and the coordinate distance is convenient to use when the track is drawn; correspondingly, the attribute information of the trace element specifically refers to information related to an attribute corresponding to the trace element to be drawn, such as size information, shape information, and the like of the trace element.
Based on this, in order to complete the subsequent drawing processing by adopting a reasonable track smoothness coefficient for different drawing pressure parameters, before that, the corresponding relation between the track smoothness grade and the track smoothness coefficient can be configured in advance, and in the process, the track smoothness coefficient is considered as the key for determining the track smoothness degree, and the smoothness degree is determined based on the distance between track elements, so that the coordinate distance matched with the reference track smoothness grade can be obtained, then the initial track smoothness coefficient matched with the reference track smoothness grade is calculated by combining the attribute information of the track elements and the coordinate record and is taken as the reference track smoothness coefficient corresponding to the reference track smoothness grade, the corresponding relation between each reference track smoothness coefficient and the reference track smoothness grade is determined by adopting the method, namely, the relation between a large number of grades and coefficients can be configured in advance, is convenient to use when drawing.
In summary, by adopting a mode of pre-configuring the corresponding relation between the reference track smoothness level and the reference track smoothness coefficient, the track smoothness required by the current drawn scene can be quickly determined in the drawing process, so that the track elements meeting the scene requirements can be conveniently drawn subsequently to form tracks with reasonable smoothness.
Furthermore, in order to enable the subsequently generated trace elements to satisfy the current drawing request, the subsequent drawing processing is also completed in combination with the handwriting width selected by the user, in this embodiment, the specific implementation manner is as follows:
and determining a track width parameter according to the track drawing request, and taking the track width parameter as a track attribute parameter.
Specifically, the track width parameter specifically means the width that the content that the user need draw corresponds when drawing through input device, and the track element that can guarantee to draw through combining the track width parameter is more reasonable, and the smoothness degree is also more reasonable when drawing the orbit promptly to conveniently constitute the orbit that satisfies the demand.
In practical application, in order to improve the drawing efficiency, the track width parameter may be used as the diameter of the track element, so that after the position of the track element is determined subsequently, the track element is drawn by using the track width parameter as a radius, and the drawing efficiency can be improved. In addition, if the track width parameter exceeds a certain threshold value, if the track width parameter is directly used as the diameter to draw track elements, the possible smoothness degree can be influenced, the diameters of a plurality of track elements can be cut out based on the track width parameter, and the track can be drawn by selecting a mode of splicing the track elements up and down, so that the track of the smoothness degree which meets the requirements can be drawn.
For example, referring to the schematic diagram shown in fig. 3, in order to support the user to draw a reasonable graph through the input device, the AC (distance between centers of circle 1 and circle 2) distance corresponding to the track smoothness level 1 may be set to m1The track smoothness level 2 corresponds to an AC distance of m2… … smooth grade n of track corresponds to AC distance mn(wherein 0 < mn<…<m2<m1And n is a positive integer, the higher the smoothness level, the closer the AC distance, the smoother the drawn trajectory),the circle 1 and the circle 2 are adjacent track elements, A and C are the centers of the two circles respectively, a common tangent of the two circles can be drawn at the moment, so that the common tangent is intersected at two points B and D of the two circles, E is an intersection point of one side of the common tangent of the two circles, a perpendicular line passing through the point E is made into an AC, the common tangent is respectively intersected at the point G, the point BD is connected at the point H, the point AE is an EH with the radius of the circle r and the track smooth coefficient of 2 times, the AGE forms a right triangle, and the EG is set as x.
In order to select a reasonable trajectory smoothing coefficient for trajectory drawing in different drawing scenes, this embodiment provides a method for determining a trajectory smoothing coefficient corresponding to different drawing requirements, and specifically implements the method
Figure BDA0003180293470000101
Respectively determine the distance m at AC2To mnIn the case of (2), the track smoothing coefficients are respectively corresponding to (2) to (n), and then the track smoothing coefficient 1 corresponding to the track smoothing level 1 is determined on the basis of the track smoothing coefficients, and the track smoothing coefficient n corresponding to the track smoothing level 2 … … is determined on the basis of the track smoothing level 2.
That is to say, in order to satisfy different scenes of drawing, can set up the smooth coefficient of orbit that different orbit smoothness degrees correspond according to actual demand, through the distance of adjustment AC apart from control orbit element, control orbit element's distance, and this distance influences the smooth degree of orbit indirectly again, consequently can control different orbit smoothness degrees and correspond different smooth coefficient of orbit through setting up different AC distances. The larger the track smoothness degree is, the smaller the track smoothness coefficient is, and the smoother the drawn track is; the smaller the track smoothness degree is, the larger the track smoothness coefficient is, and the drawn track is not smooth. When the method is used, the track smoothness coefficient corresponding to the proper track smoothness grade can be selected according to different track widths, and the positions of track elements needing to be drawn in a drawing scene can be obtained by combining the track widths, so that the reasonability of the drawn track is improved.
Further, under the condition that a drawing request submitted by a user through an input device is collected, it is determined that the collected request contains a coordinate, a track element needs to be drawn, at the moment, a drawing pressure parameter is obtained by analyzing the drawing request, the track smoothness grade corresponding to the drawing pressure parameter is determined to be 5, at the moment, the track smoothness grade 5 corresponding to the track smoothness grade 5 is determined by reading the corresponding relation between the track smoothness grade and the track smoothness coefficient, and meanwhile, the width of the handwriting selected by the user during drawing is determined to be width, so that the follow-up drawing of the track element based on the track smoothness grade 5 and the width of the handwriting is facilitated, and the handwriting meeting the drawing requirement is formed.
In addition, in order to be suitable for different track drawing scenes, different track smoothness coefficients can be set for different drawing scenes in a testing mode, namely, the track smoothness coefficients corresponding to different track smoothness degrees are tested through experiments to achieve the presetting of the track smoothness coefficients, and during use, the corresponding track smoothness coefficients can be directly selected for use according to the requirements of the current scene on the track smoothness degrees. In practical applications, the setting of the track smoothing coefficient may be selected according to practical application scenarios, and the embodiment is not limited herein.
And step S106, calculating the track element distance based on the track smoothing coefficient and the track attribute parameters.
Specifically, on the basis of determining the track smoothing coefficient and the track attribute parameters, further, in order to draw the track elements meeting the requirement of the smoothing degree at a reasonable position, the track element distance may be calculated by combining the track smoothing coefficient and the track attribute parameters, and then the drawing coordinates are adjusted on the basis to complete the drawing processing of the track elements. The track element distance is specifically a distance for adjusting the drawing position of the track element and is controlled by a track smoothness coefficient and a track attribute parameter, so that the track element can be drawn at a reasonable position, and the smoothness degree can meet the current drawing requirement.
Further, in the process of calculating the distance of the trace element, since the distance is a basic element for determining the drawing position of the trace element, the calculation may be completed by combining a preset distance formula, and in this embodiment, the specific implementation manner is as follows:
reading a preset distance formula in response to a track drawing request;
inputting the track smoothness coefficient and the track width parameter into a distance formula for calculation to obtain track element distance; wherein the distance is calculated as
Figure BDA0003180293470000111
spacing represents the track element distance, s represents the track smoothing coefficient, and w represents the track width parameter.
Specifically, in order to draw the track element at a reasonable position, the track element distance can be calculated by combining a preset distance formula, that is, the track smoothness coefficient and the track width parameter are substituted into the distance formula, so that the track element distance can be obtained.
Following the above example, in the case where the track smoothing coefficient is determined to be 5 and the handwriting width is determined to be width, the value of the track smoothing coefficient 5 is determined to be s5If the value of the handwriting width is w, s is5And w is substituted into the distance calculation formula to be calculated, and the distance between the position of the to-be-drawn track element and the position of the last drawn track element is determined to be Sp according to the calculation result, so that the position can be determined and the track elements can be drawn on the basis of the position.
In conclusion, the track element distance is calculated by combining the track smoothness coefficient and the track width parameter, and the requirements of the handwriting width and the smoothness degree can be fully combined, so that the drawn track is more reasonable, and the problem that track elements in the track are distributed too densely or sparsely is avoided.
And S108, determining a drawing coordinate of the track element according to the track element distance, and drawing the track element according to the drawing coordinate of the track element.
Specifically, on the basis of the obtained trajectory element distance through the above calculation, further, the trajectory element drawing coordinates of the trajectory element to be drawn may be determined based on the trajectory element distance, and then the trajectory element may be drawn according to the seat. The track element drawing coordinates are coordinates where the track element is drawn, the coordinates are determined based on track element distances, and the track element is a basic element forming a track matched with the handwriting of the user, and may be a circle, a rectangle, or a regular polygon.
During specific implementation, when the track elements are drawn at the track element drawing coordinates, the drawn track elements are considered to be basic elements for determining the track, so that the track can be drawn by taking the track width parameter as the diameter of the track elements, and the track can be drawn by taking the track width parameter as the diameter sum of a plurality of track elements, so that the smoothness degree of the drawn track is more reasonable, and the drawing requirement is met.
Further, when determining a trace element drawing coordinate based on the trace element distance, since the trace element drawing coordinate is a position where a current trace element is drawn, and the distance between trace elements is a basis for determining the smoothness of a trace, the coordinate is determined based on the coordinate of a last trace element that has been drawn, in this embodiment, the specific implementation manner is as follows:
analyzing the track drawing request to obtain track coordinates;
and adjusting the track coordinates according to the track element distance, and obtaining the track element drawing coordinates according to the adjustment result.
Specifically, the track coordinates refer to coordinates collected when a user moves handwriting on the input device, and track elements are not drawn at the coordinates; in order to draw the track meeting the requirements of the smooth program, the track coordinates can be adjusted according to the track element distance, namely the track coordinates are adjusted to the position far away from or close to the last drawn track element according to the track element distance, so that the track element drawing coordinates are obtained according to the adjustment result, the track elements meeting the requirements can be conveniently drawn at the position subsequently, and the track with reasonable smoothness degree can be generated.
Further, in order to draw the trace elements meeting the requirements and form a trace matched with the handwriting of the user, the trace elements can be drawn according to the preset trace element information, and in this embodiment, the specific implementation manner is as follows:
acquiring preset track element information;
and drawing the track elements at the track element drawing coordinates according to the track element information.
Specifically, the trace element information specifically refers to relevant information corresponding to the trace element to be drawn, such as the size, the shape, and the like of the trace element; based on the above, after the drawing coordinates of the track elements are determined, the track elements can be drawn at the drawing coordinates of the track elements according to the track element information.
Following the above example, after determining the trace element distance as Sp, the trace coordinates are determined as (x2, y2) by parsing the user's draw request, and the coordinates of the last drawn trace element are (x1, y1), in order to enable the drawn trace to meet the smoothness requirement, the trace coordinates (x2, y2) may be adjusted based on the trace element distance Sp, determining that the drawing coordinates of the trace element at a distance Sp from the coordinates (x1, y1) of the trace element already drawn are (x1+ Sp, y1+ Sp) according to the adjustment result, and the trace element to be drawn is a circle, with a diameter of the trajectory width parameter w, a circle with a diameter w may then be drawn at the trajectory element drawing coordinates x1+ Sp, y1+ Sp), and the trace elements are used as trace elements for responding to the drawing request of the user and used for splicing the trace of which the current time node is matched with the handwriting of the user.
To sum up, through combining the track element distance to carry out the definite of track element drawing coordinate, can guarantee that the position that needs draw the track element is more reasonable for the smoothness degree of the track of drawing is better, satisfies user's drawing demand, carries out the drawing of track element according to preset track element information simultaneously, can make the track element of concatenation all unified, the effectual drawing effect that has improved.
In addition, in order to improve the efficiency of drawing the trace elements, when a trace drawing request is collected, the trace drawing request may be collected according to a preset time period, so that a plurality of trace elements may be drawn simultaneously when the request is obtained each time, in this embodiment, a specific implementation manner is as follows:
acquiring a track drawing request according to a preset time period;
correspondingly, after the step of drawing the trace element according to the trace element drawing coordinates is executed, the method further comprises the following steps: and rendering and displaying the target track formed by the track elements.
Specifically, the preset time period specifically refers to a time for acquiring the track drawing request, such as 5ms, 8ms, or 10ms, in practical application, the setting of the time period may be set according to a practical application scenario, and the embodiment is not limited herein.
Based on this, after the trace elements are drawn, in order to draw the target trace meeting the drawing requirements of the user, the target trace composed of the trace elements is rendered and displayed to the user when the trace drawing request cannot be acquired, so that the target trace matched with the handwriting of the user is generated.
In practical application, each track element can be directly rendered and displayed after being rendered, and then, through continuous rendering of each track element, the rendering content can be generated when handwriting of a user moves, so that the drawn target track can be displayed to the user in time, and the participation experience of the user is improved.
Furthermore, in order to reduce consumption of computing resources for drawing the trace element and improve the drawing effect, the drawing coordinates of the trace element may be determined according to a manner of selecting a midpoint of the trace coordinate, in this embodiment, a specific implementation manner is as follows:
determining a previous track coordinate and a next track coordinate adjacent to the track coordinate; determining a first midpoint coordinate based on the track coordinate and the previous track coordinate, and determining a second midpoint coordinate based on the track coordinate and the next track coordinate; and adjusting the first midpoint coordinate and the second midpoint coordinate according to the track element distance, and obtaining a track element drawing coordinate according to an adjustment result.
In practical applications, since the trace drawing request collected in each time period may contain more trace coordinates, then, at this time, each track coordinate needs to be adjusted to draw the track elements at the reasonable positions, in this process, in order to improve the drawing efficiency and the drawing accuracy, after the trajectory coordinates are determined, simultaneously determining the previous track coordinate adjacent to the track coordinate and the next track coordinate adjacent to the track coordinate, then selecting the middle point of the track coordinate and the previous track coordinate as a first middle point coordinate, selecting the middle point of the track coordinate and the next track coordinate as a second middle point coordinate, and finally respectively adjusting the first middle point coordinate and the second middle point coordinate according to the track element distance, and obtaining drawing coordinates of the two track elements, and then respectively drawing the track elements.
For example, in the case where the track coordinates are determined to be (x5, y5), the previous track coordinates (x4, y4) adjacent to the track coordinates are simultaneously determined, the next track coordinates (x6, y6) adjacent to the track coordinates are determined, then the midpoint of the track coordinates (x5, y5) and the previous track coordinates (x4, y4) is selected as the first midpoint coordinates (xa, ya), the midpoint of the track coordinates (x5, y5) and the next track coordinates (x6, y4) is selected as the second midpoint coordinates (xb, yb), then the first midpoint coordinates (xa, ya) are adjusted by the track element distance Sp so that the first midpoint coordinates are located at a distance Sp from the center coordinates of the already drawn track elements, the adjusted first midpoint coordinates are obtained, and at the same time the second midpoint coordinates (xb, yb) are adjusted by the track element distance Sp so that the second midpoint coordinates are located at a distance Sp from the center coordinates of the already drawn track elements, and obtaining the adjusted second midpoint coordinate, and finally drawing the track elements on the adjusted first midpoint coordinate and the adjusted second midpoint coordinate respectively.
In summary, by determining the drawing coordinates of the track elements by adjusting the coordinates of the midpoint, the consumption of computing resources can be reduced, and the smoothness of the drawn track can be improved.
After the track drawing method provided by the specification is obtained, the track smoothing coefficient and the track attribute parameter related to the track to be drawn can be determined according to the track drawing request, so that when the track is drawn subsequently, track smoothing coefficients and track attribute parameters may be referenced, at which time track element distances are calculated in combination with the track smoothing coefficients and the track attribute parameters, and determining the drawing coordinates of the track elements according to the track element distance, so that the basic elements forming the track can be drawn according to the track drawing coordinates, namely the track elements, realizes that the drawing of the track elements can be reasonably controlled through the track smoothness coefficient and the track attribute parameters, therefore, the track formed based on the track elements can be more reasonable, the problem that the track elements are distributed too densely or too sparsely is avoided, and the smoothness of the drawn track is more consistent with the current drawn scene.
The following describes the trajectory drawing method further by taking the application of the trajectory drawing method provided in this specification in writing as an example with reference to fig. 4. Fig. 4 shows a processing flow chart of a trajectory drawing method applied to a text writing scene according to an embodiment of the present specification, and specifically includes the following steps:
step S402, collecting the track drawing request submitted by the user according to a preset time period.
In this embodiment, the trajectory drawing method is described by taking an example of a teacher explaining writing of Chinese characters in an online classroom. Based on the method, in order to explain the Chinese character writing format to students in a classroom, a teacher writes a certain Chinese character on a lecture screen by hand, and in the process, in order to draw the content meeting the current scene requirement, the trace drawing is completed by combining the handwriting width and the trace smoothness coefficient selected by the teacher, so that the Chinese character content matched with the handwriting of the teacher is generated and displayed.
And S404, analyzing the track drawing request to obtain a pressure parameter, and determining a track smoothness grade corresponding to the pressure parameter.
And step S406, determining a track smoothness coefficient corresponding to the track smoothness grade according to the corresponding relation between the reference track smoothness grade and the reference track smoothness coefficient.
Step S408, determining a track width parameter according to the track drawing request.
In step S410, a preset distance formula is read in response to the track drawing request.
Step S412, inputting the track width parameter and the track smoothness coefficient into the distance formula to obtain the track element distance.
And step S414, adjusting the track coordinates in the track drawing request according to the track element distance, and obtaining the track element drawing coordinates according to the adjustment result.
And step S416, drawing the track elements at the track element drawing coordinates according to preset track element information.
And step S418, generating and displaying a target track according to the track elements.
The track drawing method provided by the specification can reasonably control the drawing of track elements through the track smoothness coefficient and the track attribute parameters, so that the track formed based on the track elements can be more reasonable, the problem that the track elements are distributed too densely or too sparsely is avoided, and the smoothness degree of the drawn track is more consistent with the current drawing scene.
Corresponding to the above method embodiment, the present specification further provides an embodiment of a trajectory drawing device, and fig. 5 shows a schematic structural diagram of the trajectory drawing device provided in an embodiment of the present specification. As shown in fig. 5, the apparatus includes:
an obtaining module 502 configured to obtain a trajectory drawing request;
a determining module 504 configured to determine a trajectory smoothing coefficient and a trajectory attribute parameter according to the trajectory drawing request;
a calculation module 506 configured to calculate a trajectory element distance based on the trajectory smoothing coefficient and the trajectory attribute parameter;
a drawing module 508 configured to determine trajectory element drawing coordinates from the trajectory element distance, and draw the trajectory element according to the trajectory element drawing coordinates.
In an optional embodiment, the determining module 504 is further configured to:
analyzing the track drawing request to obtain a drawing pressure parameter, and determining a track smoothness grade corresponding to the drawing pressure parameter; and determining the track smoothness coefficient corresponding to the track smoothness grade according to the corresponding relation between the reference track smoothness grade and the reference track smoothness coefficient.
In an optional embodiment, the determining module 504 is further configured to:
acquiring a coordinate distance matched with the smooth grade of the reference track; calculating an initial track smoothing coefficient according to the attribute information of the track elements and the coordinate distance; and taking the initial track smoothing coefficient as the reference track smoothing coefficient corresponding to the reference track smoothing grade.
In an optional embodiment, the determining module 504 is further configured to:
and determining a track width parameter according to the track drawing request, and taking the track width parameter as the track attribute parameter.
In an optional embodiment, the calculation module 506 is further configured to:
reading a preset distance formula in response to the track drawing request; inputting the track smoothing coefficient and the track width parameter into the distance formula for calculation to obtain the track element distance; wherein the distance is calculated as
Figure BDA0003180293470000171
spacing represents the track element distance, s represents the track smoothing coefficient, and w represents the track width parameter.
In an optional embodiment, the rendering module 508 is further configured to:
analyzing the track drawing request to obtain track coordinates; and adjusting the track coordinates according to the track element distance, and obtaining the track element drawing coordinates according to the adjustment result.
In an optional embodiment, the rendering module 508 is further configured to:
acquiring preset track element information; and drawing the track elements at the track element drawing coordinates according to the track element information.
In an optional embodiment, the obtaining module 502 is further configured to:
acquiring the track drawing request according to a preset time period;
correspondingly, the trajectory drawing device further comprises:
and the rendering module is configured to render and display the target track formed by the track elements.
In an optional embodiment, the rendering module 508 is further configured to:
determining a previous track coordinate and a next track coordinate adjacent to the track coordinate; determining a first midpoint coordinate based on the track coordinate and the previous track coordinate, and determining a second midpoint coordinate based on the track coordinate and the next track coordinate; and adjusting the first midpoint coordinate and the second midpoint coordinate according to the track element distance, and obtaining the track element drawing coordinate according to an adjustment result.
After the track drawing device provided by the present specification obtains the track drawing request, the track smoothing coefficient and the track attribute parameter related to the track to be drawn can be determined according to the track drawing request, so that when the track is drawn subsequently, track smoothing coefficients and track attribute parameters may be referenced, at which time track element distances are calculated in combination with the track smoothing coefficients and the track attribute parameters, and determining the drawing coordinates of the track elements according to the track element distance, so that the basic elements forming the track can be drawn according to the track drawing coordinates, namely the track elements, realizes that the drawing of the track elements can be reasonably controlled through the track smoothness coefficient and the track attribute parameters, therefore, the track formed based on the track elements can be more reasonable, the problem that the track elements are distributed too densely or too sparsely is avoided, and the smoothness of the drawn track is more consistent with the current drawn scene.
The above is a schematic scheme of a trajectory drawing device of the present embodiment. It should be noted that the technical solution of the trajectory drawing device and the technical solution of the trajectory drawing method belong to the same concept, and details that are not described in detail in the technical solution of the trajectory drawing device can be referred to the description of the technical solution of the trajectory drawing method.
Fig. 6 illustrates a block diagram of a computing device 600 provided according to an embodiment of the present description. The components of the computing device 600 include, but are not limited to, a memory 610 and a processor 620. The processor 620 is coupled to the memory 610 via a bus 630 and a database 650 is used to store data.
Computing device 600 also includes access device 640, access device 640 enabling computing device 600 to communicate via one or more networks 660. Examples of such networks include the Public Switched Telephone Network (PSTN), a Local Area Network (LAN), a Wide Area Network (WAN), a Personal Area Network (PAN), or a combination of communication networks such as the internet. Access device 640 may include one or more of any type of network interface (e.g., a Network Interface Card (NIC)) whether wired or wireless, such as an IEEE802.11 Wireless Local Area Network (WLAN) wireless interface, a worldwide interoperability for microwave access (Wi-MAX) interface, an ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a bluetooth interface, a Near Field Communication (NFC) interface, and so forth.
In one embodiment of the present description, the above-described components of computing device 600, as well as other components not shown in FIG. 6, may also be connected to each other, such as by a bus. It should be understood that the block diagram of the computing device architecture shown in FIG. 6 is for purposes of example only and is not limiting as to the scope of the present description. Those skilled in the art may add or replace other components as desired.
Computing device 600 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., tablet, personal digital assistant, laptop, notebook, netbook, etc.), mobile phone (e.g., smartphone), wearable computing device (e.g., smartwatch, smartglasses, etc.), or other type of mobile device, or a stationary computing device such as a desktop computer or PC. Computing device 600 may also be a mobile or stationary server.
Wherein processor 620 is configured to execute the following computer-executable instructions:
acquiring a track drawing request;
determining a track smoothing coefficient and a track attribute parameter according to the track drawing request;
calculating a track element distance based on the track smoothness coefficient and the track attribute parameters;
and determining drawing coordinates of the track elements according to the track element distance, and drawing the track elements according to the drawing coordinates of the track elements.
The above is an illustrative scheme of a computing device of the present embodiment. It should be noted that the technical solution of the computing device and the technical solution of the trajectory drawing method described above belong to the same concept, and details that are not described in detail in the technical solution of the computing device can be referred to the description of the technical solution of the trajectory drawing method described above.
An embodiment of the present specification also provides a computer readable storage medium storing computer instructions that, when executed by a processor, are operable to:
acquiring a track drawing request;
determining a track smoothing coefficient and a track attribute parameter according to the track drawing request;
calculating a track element distance based on the track smoothness coefficient and the track attribute parameters;
and determining drawing coordinates of the track elements according to the track element distance, and drawing the track elements according to the drawing coordinates of the track elements.
The above is an illustrative scheme of a computer-readable storage medium of the present embodiment. It should be noted that the technical solution of the storage medium belongs to the same concept as the technical solution of the above-mentioned track drawing method, and details that are not described in detail in the technical solution of the storage medium can be referred to the description of the technical solution of the above-mentioned track drawing method.
The foregoing description has been directed to specific embodiments of this disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
The computer instructions comprise computer program code which may be in the form of source code, object code, an executable file or some intermediate form, or the like. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, and the like. It should be noted that the computer readable medium may contain content that is subject to appropriate increase or decrease as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer readable media does not include electrical carrier signals and telecommunications signals as is required by legislation and patent practice.
It should be noted that, for the sake of simplicity, the foregoing method embodiments are described as a series of acts or combinations, but those skilled in the art should understand that the present disclosure is not limited by the described order of acts, as some steps may be performed in other orders or simultaneously according to the present disclosure. Further, those skilled in the art should also appreciate that the embodiments described in this specification are preferred embodiments and that acts and modules referred to are not necessarily required for this description.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
The preferred embodiments of the present specification disclosed above are intended only to aid in the description of the specification. Alternative embodiments are not exhaustive and do not limit the invention to the precise embodiments described. Obviously, many modifications and variations are possible in light of the above teaching. The embodiments were chosen and described in order to best explain the principles of the specification and its practical application, to thereby enable others skilled in the art to best understand the specification and its practical application. The specification is limited only by the claims and their full scope and equivalents.

Claims (12)

1. A trajectory drawing method, comprising:
acquiring a track drawing request;
determining a track smoothing coefficient and a track attribute parameter according to the track drawing request;
calculating a track element distance based on the track smoothness coefficient and the track attribute parameters;
and determining drawing coordinates of the track elements according to the track element distance, and drawing the track elements according to the drawing coordinates of the track elements.
2. The trajectory rendering method of claim 1, wherein determining a trajectory smoothing coefficient based on the trajectory rendering request comprises:
analyzing the track drawing request to obtain a drawing pressure parameter, and determining a track smoothness grade corresponding to the drawing pressure parameter;
and determining the track smoothness coefficient corresponding to the track smoothness grade according to the corresponding relation between the reference track smoothness grade and the reference track smoothness coefficient.
3. The trajectory drawing method according to claim 2, wherein the reference trajectory smoothing coefficient is determined by:
acquiring a coordinate distance matched with the smooth grade of the reference track;
calculating an initial track smoothing coefficient according to the attribute information of the track elements and the coordinate distance;
and taking the initial track smoothing coefficient as the reference track smoothing coefficient corresponding to the reference track smoothing grade.
4. The trajectory rendering method of claim 1, wherein determining trajectory attribute parameters according to the trajectory rendering request comprises:
and determining a track width parameter according to the track drawing request, and taking the track width parameter as the track attribute parameter.
5. The trajectory rendering method of claim 4, wherein the calculating a trajectory element distance based on the trajectory smoothing coefficient and the trajectory attribute parameter comprises:
reading a preset distance formula in response to the track drawing request;
inputting the track smoothing coefficient and the track width parameter into the distance formula for calculation to obtain the track element distance;
wherein the distance is calculated as
Figure FDA0003180293460000011
spacing represents the track element distance, s represents the track smoothing coefficient, and w represents the track width parameter.
6. The trajectory rendering method of claim 1, wherein determining trajectory element rendering coordinates from the trajectory element distances comprises:
analyzing the track drawing request to obtain track coordinates;
and adjusting the track coordinates according to the track element distance, and obtaining the track element drawing coordinates according to the adjustment result.
7. The trajectory drawing method according to any one of claims 1 to 6, wherein the drawing the trajectory element in accordance with the trajectory element drawing coordinates includes:
acquiring preset track element information;
and drawing the track elements at the track element drawing coordinates according to the track element information.
8. The trajectory drawing method according to any one of claims 1 to 6, wherein the obtaining of the trajectory drawing request includes:
acquiring the track drawing request according to a preset time period;
correspondingly, after the step of drawing the trace element according to the trace element drawing coordinates is executed, the method further includes:
and rendering and displaying the target track formed by the track elements.
9. The trajectory drawing method according to claim 6, wherein the adjusting the trajectory coordinates according to the trajectory element distance and obtaining the trajectory element drawing coordinates according to the adjustment result includes:
determining a previous track coordinate and a next track coordinate adjacent to the track coordinate;
determining a first midpoint coordinate based on the track coordinate and the previous track coordinate, and determining a second midpoint coordinate based on the track coordinate and the next track coordinate;
and adjusting the first midpoint coordinate and the second midpoint coordinate according to the track element distance, and obtaining the track element drawing coordinate according to an adjustment result.
10. A trajectory drawing device, comprising:
an acquisition module configured to acquire a trajectory drawing request;
a determination module configured to determine a trajectory smoothing coefficient and a trajectory attribute parameter according to the trajectory drawing request;
a calculation module configured to calculate a trajectory element distance based on the trajectory smoothing coefficient and the trajectory attribute parameter;
and the drawing module is configured to determine drawing coordinates of the track elements according to the track element distance and draw the track elements according to the drawing coordinates of the track elements.
11. A computing device comprising a memory and a processor; the memory is for storing computer-executable instructions, and the processor is for executing the computer-executable instructions to implement the steps of the method of any one of claims 1 to 9.
12. A computer-readable storage medium storing computer instructions, which when executed by a processor, perform the steps of the method of any one of claims 1 to 9.
CN202110845253.9A 2021-07-26 2021-07-26 Track drawing method and device Active CN113450429B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110845253.9A CN113450429B (en) 2021-07-26 2021-07-26 Track drawing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110845253.9A CN113450429B (en) 2021-07-26 2021-07-26 Track drawing method and device

Publications (2)

Publication Number Publication Date
CN113450429A true CN113450429A (en) 2021-09-28
CN113450429B CN113450429B (en) 2024-06-04

Family

ID=77817246

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110845253.9A Active CN113450429B (en) 2021-07-26 2021-07-26 Track drawing method and device

Country Status (1)

Country Link
CN (1) CN113450429B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110298807A1 (en) * 2010-06-07 2011-12-08 Samsung Electronics Co., Ltd. Touch screen and display method
CN103310474A (en) * 2013-06-08 2013-09-18 深圳市经纬科技有限公司 Method and system for implementing original handwriting
CN109410737A (en) * 2018-10-31 2019-03-01 成都四方伟业软件股份有限公司 Dynamic trajectory method for drafting and system are put on a kind of map based on Local hydrodynamic unit
CN111273807A (en) * 2020-01-07 2020-06-12 通彩视听科技(上海)有限公司 Handwriting implementation and optimization method and device and computer equipment
CN111383296A (en) * 2018-12-28 2020-07-07 北京小米移动软件有限公司 Display method and device for drawing track and storage medium
CN112614510A (en) * 2020-12-23 2021-04-06 北京猿力未来科技有限公司 Audio quality evaluation method and device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110298807A1 (en) * 2010-06-07 2011-12-08 Samsung Electronics Co., Ltd. Touch screen and display method
CN103310474A (en) * 2013-06-08 2013-09-18 深圳市经纬科技有限公司 Method and system for implementing original handwriting
CN109410737A (en) * 2018-10-31 2019-03-01 成都四方伟业软件股份有限公司 Dynamic trajectory method for drafting and system are put on a kind of map based on Local hydrodynamic unit
CN111383296A (en) * 2018-12-28 2020-07-07 北京小米移动软件有限公司 Display method and device for drawing track and storage medium
CN111273807A (en) * 2020-01-07 2020-06-12 通彩视听科技(上海)有限公司 Handwriting implementation and optimization method and device and computer equipment
CN112614510A (en) * 2020-12-23 2021-04-06 北京猿力未来科技有限公司 Audio quality evaluation method and device

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
ZHOUCHEN LIN .ETAL: "Style-preserving English handwriting synthesis", PATTERN RECOGNITION, vol. 40, no. 07, 31 July 2007 (2007-07-31) *
陆向艳 等: "基于Unity的N阶贝塞尔曲线绘制三维物体运动轨迹", 软件, no. 09, 30 September 2020 (2020-09-30) *

Also Published As

Publication number Publication date
CN113450429B (en) 2024-06-04

Similar Documents

Publication Publication Date Title
CN112507806B (en) Intelligent classroom information interaction method and device and electronic equipment
CN106997613B (en) 3D model generation from 2D images
US11475617B2 (en) Path-constrained drawing with visual properties based on drawing tool
CN114648615B (en) Method, device and equipment for controlling interactive reproduction of target object and storage medium
US10846889B2 (en) Color handle generation for digital image color gradients using machine learning
US11455752B2 (en) Graphical element color diffusion techniques
KR20210126697A (en) Method and device for driving animated image based on artificial intelligence
CN111782131A (en) Pen point implementation method, device, equipment and readable storage medium
JP7390445B2 (en) Training method for character positioning model and character positioning method
JP2019028094A (en) Character generation device, program and character output device
WO2023019995A1 (en) Training method and apparatus, translation presentation method and apparatus, and electronic device and storage medium
CN113688273B (en) Graphic question answering and judging method and device
CN113516697A (en) Image registration method and device, electronic equipment and computer-readable storage medium
CN111583264B (en) Training method for image segmentation network, image segmentation method, and storage medium
CN113450429B (en) Track drawing method and device
CN114797109A (en) Object editing method and device, electronic equipment and storage medium
KR20120076490A (en) Based on template user authoring system and service method therefor
CN109493401B (en) PowerPoint generation method, device and electronic equipment
CN112308745A (en) Method and apparatus for generating information
CN116071755B (en) Text positioning method, device and equipment in electronic seal and storage medium
CN113469878B (en) Text erasing method and training method and device of model thereof, and storage medium
KR102343848B1 (en) Method and operating device for searching conversion strategy using user status vector
CN114585992B (en) Writing track processing method, touch control equipment, writing system and storage medium
CN111063036B (en) Three-dimensional character arrangement method, medium, equipment and system based on path planning
CN115392413A (en) Method and device for determining code spreading object code

Legal Events

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