Touch device, handwriting display method of touch device and readable storage medium
By processing the intersection points and segments of the polygon in the processor of the touch device, the problem of handwriting display delay in the prior art is solved, and efficient handwriting calculation and display are realized.
Patent Information
- Application Number
- CN202311497958.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-10
- Publication Date
- 2025-05-13
AI Technical Summary
The prior art When processing handwritings containing multiple polygons, the calculation process takes a long time, resulting in delays in handwriting display.
By obtaining the edge segments of multiple polygons in the processor of the touch device, determining whether there are intersection points between the edge segments and the edge segments of the other polygons, and performing segmentation processing, thereby determining the result edges and connecting them, and finally obtaining the target handwriting.
Improves calculation efficiency and reduces the delay in handwriting display. Even if a handwriting contains a large number of polygons, it does not require every two polygons to be calculated once and calculated.
Smart Images

Figure CN119987640A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to touch technology, and more specifically, to a touch device, a handwriting display method of a touch device, and a readable storage medium. Background Art
[0002] With the rapid development of touch technology, more and more touch devices are used in daily life. When users draw lines on touch devices with their fingers or styluses, the rapid display of handwriting can greatly improve the user experience.
[0003] A handwriting is usually composed of multiple polygons. When determining the handwriting, the prior art usually performs a calculation for every two polygons, that is, first calculates the polygon formed by the first polygon and the second polygon, and then calculates the polygon formed by the formed polygon and the third polygon, and so on, until the last polygon is reached.
[0004] However, if a piece of handwriting contains a large number of polygons, the existing technology may easily cause the calculation process to take a long time and there will be a significant delay in the handwriting display. Summary of the invention
[0005] The embodiments of the present application provide a touch device, a handwriting display method of a touch device, and a readable storage medium, which can be used to solve the problem in the prior art that if a handwriting contains a large number of polygons, the prior art easily leads to a long calculation process and obvious delay in handwriting display.
[0006] In a first aspect, an embodiment of the present application provides a touch control device, the touch control device comprising:
[0007] A display screen, the display screen being configured to: display touch pen traces, the touch pen traces being composed of a plurality of polygons;
[0008] A processor connected to the display screen, the processor being configured to:
[0009] Obtain edge segments of the plurality of polygons;
[0010] For a side line segment of at least one polygon, determining whether the side line segment has an intersection with the side line segments of the remaining multiple polygons;
[0011] If there is an intersection point, at least two intersecting edge line segments are segmented to obtain multiple segmented edge line segments;
[0012] If there is no intersection, the edge segment is not segmented;
[0013] Determine a plurality of result edges from the plurality of segmented edge segments and the plurality of unsegmented edge segments;
[0014] Connecting the multiple result edges to obtain the target handwriting;
[0015] The display screen is further configured to display the target handwriting.
[0016] In the present application, the touch device includes a display screen and a processor. The processor determines whether there is an intersection between an edge segment and the edge segments of other multiple polygons. If there is an intersection, the at least two intersecting edge segments are segmented to obtain multiple segmented edge segments. If there is no intersection, no segmentation is performed. Multiple result edges are determined from the multiple segmented edge segments and the multiple unsegmented edge segments and connected to finally obtain the target handwriting. Even if a handwriting contains a large number of polygons N, it is not necessary to perform a calculation for every two polygons, which improves the calculation efficiency and reduces the handwriting display delay.
[0017] In some embodiments of the present application, when the processor is configured to obtain the edge segments of the plurality of polygons, it is specifically configured to:
[0018] For at least one polygon, scan two endpoints of a side segment of the polygon to obtain a first scanning event and a second scanning event, wherein the first scanning event and the second scanning event respectively include coordinate information of the endpoints;
[0019] According to the coordinate information of the first scanning event and the second scanning event of the edge segments of the multiple polygons, priority sorting is performed to obtain a plurality of sorted scanning events;
[0020] According to the edge segment identifiers corresponding to the sorted plurality of scanning events, the sorted edge segments of the plurality of polygons are obtained and stored in a preset edge sorting list.
[0021] In the present application, by obtaining the scanning events of each edge of each polygon and sorting them by priority according to the coordinate information of the scanning events, and then obtaining the edge segments of the sorted multiple polygons according to the edge segment identifiers corresponding to the sorted multiple scanning events, it is convenient to subsequently judge whether adjacent edge segments intersect based on the sorted edge segments, thereby improving calculation efficiency.
[0022] In some embodiments of the present application, the processor is configured to scan two endpoints of the edge segment of the polygon, and when obtaining the first scanning event and the second scanning event, is specifically configured as follows:
[0023] Acquire coordinate information of a first endpoint and a second endpoint of a side segment of the polygon, wherein the coordinate information includes first coordinate information and second coordinate information;
[0024] If the first coordinate information of the first endpoint is lower than the first coordinate information of the second endpoint, the scanning event corresponding to the first endpoint is the first scanning event, and the scanning event corresponding to the second endpoint is the second scanning event;
[0025] If the first coordinate information of the first endpoint is the same as the first coordinate information of the second endpoint, and the second coordinate information of the first endpoint is lower than the second coordinate information of the second endpoint, the scanning event corresponding to the first endpoint is the first scanning event, and the scanning event corresponding to the second endpoint is the second scanning event.
[0026] In the present application, the first scanning event and the second scanning event are determined according to the size relationship of the coordinate information of the first endpoint and the second endpoint of the acquired edge segment, thereby improving the accuracy of the obtained first scanning event and the second scanning event.
[0027] In some embodiments of the present application, the processor is configured to sort the priorities according to the coordinate information of the first scanning event and the second scanning event of the edge segments of the multiple polygons, and when the sorted multiple scanning events are obtained, the processor is specifically configured as follows:
[0028] For at least one scanning event, if there is no other scanning event with the same coordinate information as the scanning event, the coordinate information of the edge segments of the multiple polygons are sorted in ascending priority order according to the size relationship to obtain multiple sorted scanning events.
[0029] In the present application, if there is no scanning event with the same coordinate information as another scanning event, the coordinate information of the edge segments of the multiple polygons are sorted according to the size relationship, thereby improving the sorting efficiency and accuracy.
[0030] In some embodiments of the present application, the processor is configured to sort the priorities according to the coordinate information of the first scanning event and the second scanning event of the edge segments of the multiple polygons, and when the sorted multiple scanning events are obtained, the processor is specifically configured as follows:
[0031] For at least one scanning event, if there is another scanning event with the same coordinate information as the scanning event, the scanning event and the other scanning event are sorted according to the type of the scanning event and the preset type priority to obtain multiple sorted scanning events, wherein the types include a first scanning event type and a second scanning event type.
[0032] In the present application, if there is another scanning event with the same coordinate information as the scanning event, the scanning event is sorted according to the type and the preset type priority, thereby improving the sorting efficiency and accuracy.
[0033] In some embodiments of the present application, the processor is configured to sort the edge segments of the multiple polygons according to the coordinate information of the first scanning event and the second scanning event, and when obtaining the sorted edge segments of the multiple polygons, the processor is specifically configured as follows:
[0034] For at least one scanning event, if there is another scanning event with the same coordinate information as the scanning event, the scanning event and the other scanning event are sorted according to their hash values to obtain a plurality of sorted scanning events.
[0035] In the present application, if a scanning event exists with another scanning event having the same coordinate information, the scanning event and the other scanning event are sorted according to the size relationship of the hash values, thereby improving the sorting efficiency and accuracy.
[0036] In some embodiments of the present application, when the processor is configured to determine whether the edge segment has an intersection with the edge segments of the remaining multiple polygons, it is specifically configured as follows:
[0037] Sequentially obtain edge segments corresponding to the first scanning event type from the edge sorting list;
[0038] For at least one edge segment, based on a preset Bentley-Ottmann scan line algorithm, determine whether the edge segment has an intersection with edge segments of the remaining multiple polygons.
[0039] In the present application, the efficiency and speed of determining whether an edge segment has an intersection with the edge segments of other multiple polygons are improved through the preset Bentley-Ottmann scan line algorithm.
[0040] In some embodiments of the present application, when the processor is configured to determine a plurality of result edges from the plurality of segmented edge segments and the plurality of unsegmented edge segments, the processor is specifically configured to:
[0041] sequentially acquiring a target edge segment from the segmented plurality of edge segments and the unsegmented plurality of edge segments;
[0042] Counting according to the identification information of the target edge segment;
[0043] If the identification information of the target edge segment is preset identification information and the count reaches a preset value, the target edge segment is determined to be the result edge, and a plurality of result edges are obtained.
[0044] In the present application, if the identification information of the target edge segment is the preset identification information and the count reaches the preset value, the target edge segment is determined to be the result edge, and the result edges are connected in sequence to obtain the final processed polygon, which reduces the amount of calculation in the calculation process and saves time.
[0045] In a second aspect, the present application provides a handwriting display method for a touch device, the method comprising:
[0046] The display screen displays touch pen traces, wherein the touch pen traces are composed of a plurality of polygons;
[0047] The processor obtains edge segments of the plurality of polygons;
[0048] For a side line segment of at least one polygon, determining whether the side line segment has an intersection with the side line segments of the remaining multiple polygons;
[0049] If there is an intersection point, at least two intersecting edge line segments are segmented to obtain multiple segmented edge line segments;
[0050] Determine a plurality of result edges from the plurality of segmented edge segments and the plurality of unsegmented edge segments;
[0051] If there is no intersection, the edge segment is not segmented;
[0052] Connecting the multiple result edges to obtain the target handwriting;
[0053] The display screen displays the target handwriting.
[0054] In the present application, by determining whether there is an intersection between an edge segment and the edge segments of other multiple polygons, if there is an intersection, at least two intersecting edge segments are segmented to obtain multiple segmented edge segments; if there is no intersection, the edge segment is not segmented, and multiple result edges are determined from the multiple segmented edge segments and the multiple unsegmented edge segments and connected to finally obtain the target handwriting. Even if a handwriting contains a large number of polygons N, it is not necessary to perform a joint calculation for every two polygons, which improves the calculation efficiency and reduces the handwriting display delay.
[0055] In a third aspect, the present application provides a computer-readable storage medium having computer-executable instructions stored thereon. When the computer-executable instructions are executed by a processor, the handwriting display method of a touch device described in the second aspect is implemented.
[0056] In the present application, the present application provides storage conditions for executing the handwriting display method of the touch device by providing a computer-readable storage medium.
[0057] In a fourth aspect, the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the handwriting display method of a touch device described in the second aspect.
[0058] In the present application, a computer program product is provided to provide an operating program for executing the handwriting display method of a touch device. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] In order to more clearly illustrate the implementation methods in the embodiments of the present application or the related technologies, the following is a brief introduction to the drawings required for use in the embodiments or the related technology descriptions. Obviously, the drawings described below are some embodiments of the present application, and a person skilled in the art can also obtain other drawings based on these drawings.
[0060] Figure 1 A schematic diagram of the structure of a touch device provided in this application;
[0061] Figure 2 A schematic diagram of a touch handwriting display provided in an embodiment of the present application;
[0062] Figure 3 A schematic flow chart of a method for obtaining edge segments of multiple polygons provided in an embodiment of the present application;
[0063] Figure 4A A schematic diagram of a scanning event provided in an embodiment of the present application;
[0064] Figure 4B A schematic diagram of another scanning event provided in an embodiment of the present application;
[0065] Figure 5A A schematic diagram of a quadrilateral provided in an embodiment of the present application;
[0066] Figure 5B A schematic diagram of another quadrilateral provided in an embodiment of the present application;
[0067] Fig. 6A A schematic diagram of edge segment segmentation provided in an embodiment of the present application;
[0068] Figure 6B A schematic diagram of a result edge provided in an embodiment of the present application;
[0069] Figure 6C A schematic diagram of a target handwriting provided in an embodiment of the present application;
[0070] Figure 7 A schematic diagram of a flow chart of a handwriting display method of a touch device provided in an embodiment of the present application;
[0071] Figure 8 A handwriting display device for a touch device is provided in an embodiment of the present application. DETAILED DESCRIPTION
[0072] In order to make the purpose, implementation mode and advantages of the present application clearer, the exemplary implementation mode of the present application will be clearly and completely described below in conjunction with the drawings in the exemplary embodiments of the present application. Obviously, the described exemplary embodiments are only part of the embodiments of the present application, rather than all the embodiments.
[0073] It should be noted that the brief description of terms in this application is only for the convenience of understanding the embodiments described below, and is not intended to limit the embodiments of this application. Unless otherwise specified, these terms should be understood according to their common and usual meanings.
[0074] In addition, the terms "include" and "have" and any variations thereof are intended to cover but not exclude inclusion, for example, a product or device comprising a list of components is not necessarily limited to those components expressly listed but may include other components not expressly listed or inherent to such products or devices.
[0075] With the rapid development of touch technology, users have put forward higher requirements for touch devices, such as electronic whiteboards. When users draw lines with their fingers or stylus on touch devices to generate handwriting, the user's handwriting can be better met by quickly displaying the user's handwriting.
[0076] Usually, a handwriting is composed of multiple polygons. Assume that the handwriting is composed of 10 polygons, namely polygons A1, A2, A3, ..., A10. When determining handwriting, the prior art usually performs a calculation once for every two polygons, that is, A1 and A2 are calculated once to obtain polygon B1, and then B1 and A3 are calculated once to obtain polygon B2, and then B2 and A4 are calculated once to obtain polygon B3, until A10 is calculated, and finally a calculated polygon B10 is obtained.
[0077] Specific:
[0078] First calculation: B1=A1∪A2;
[0079] Second calculation: B2=B1∪A3;
[0080] The third calculation: B3 = B2 ∪ A4;
[0081] …
[0082] Ninth calculation: B10=B9∪A10.
[0083] In summary, assuming that a handwriting segment is composed of N polygons, then N-1 polygon union operations (combination operations) are required, and the speed of the two polygon union operations is positively correlated with the number of edges and intersections of the polygons. The time complexity is O((n+k)logn), and the time for the mth union operation (k can be ignored when k is much smaller than n) is Then the time required to perform the union operation on N polygons is Therefore, in the prior art, if a handwriting contains a large number of polygons N, when N reaches a certain value, it is easy to cause the calculation process to take a long time, and the calculation time of multiple polygons will not be able to meet the requirements of real-time handwriting writing or erasing, affecting the user experience.
[0084] Therefore, in view of the above technical problems in the prior art, the present application proposes a touch device, a handwriting display method of the touch device and a readable storage medium. The touch device includes a display screen and a processor connected to the display screen, the display screen is used to display touch handwriting, and the touch handwriting is composed of multiple polygons. The processor is used to obtain the edge segments of multiple polygons, and for the edge segment of at least one polygon, determine whether the edge segment has an intersection with the edge segments of the remaining multiple polygons. If there is an intersection, at least two intersecting edge segments are segmented to obtain multiple segmented edge segments. If there is no intersection, the edge segment does not need to be segmented, and multiple result edges are determined from the multiple segmented edge segments and the multiple edge segments that do not need to be segmented. The multiple result edges are connected to obtain the target handwriting, and the target handwriting is finally displayed on the display screen. The present application determines the result edges of multiple polygons and connects them to finally obtain the target handwriting. Even if the number of polygons N contained in a handwriting is large, it is not necessary to perform a calculation once for every two polygons, thereby improving the calculation efficiency and reducing the handwriting display delay.
[0085] In the application scenario of the present application, the touch device may be an electronic whiteboard or other all-in-one touch device, and the present application does not limit the type of the touch device. In addition, the present application does not limit the shape of each polygon.
[0086] The technical solution of the present application is described in detail below in conjunction with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.
[0087] Figure 1 A structural diagram of a touch device provided in this application, such as Figure 1 As shown, the touch control device includes a display screen 101 and a processor 102 .
[0088] The connection relationship is: the display screen 101 is connected to the processor 102 .
[0089] Its functions are:
[0090] The display screen 101 is configured to display touch pen traces. Figure 2 A schematic diagram of a touch handwriting display provided in an embodiment of the present application is shown in FIG. Figure 2 As shown, the touch pen trace is composed of multiple polygons.
[0091] It is understandable that the present application does not limit the number of constituent polygons, which can be determined based on actual conditions.
[0092] The processor 102 is configured to obtain edge segments of a plurality of polygons.
[0093] The processor 102 may also be a controller, a SOC main control chip, or an operating system, etc., and this application does not limit its type.
[0094] One possible implementation is:
[0095] Get the scanning events corresponding to the edge segments contained in each polygon, sort them by size according to the coordinate information of the obtained scanning events, obtain the sorted scanning event priority queue, and obtain the edge segments corresponding to the scanning events in sequence according to the order in the scanning event priority queue, and store them in the preset edge sorting list.
[0096] In this embodiment, the edge segment can be described by a scan event, that is, each edge of each polygon is converted into a scan event. A scan event is an endpoint information of an edge segment. Since an edge segment usually includes two endpoints, an edge segment includes two scan events, and the two scan events are paired events.
[0097] Each scanning event at least includes: the coordinate information of the endpoint, the identification information of the edge segment corresponding to the endpoint, and the identification information of the polygon to which the edge segment belongs. Therefore, according to the identification information of the scanning event obtained, such as polygon_id, the polygon to which the scanning event belongs can be determined.
[0098] The processor 102 is further configured to: determine, for a side segment of at least one polygon, whether the side segment has an intersection with the side segments of the remaining multiple polygons.
[0099] When an edge segment is obtained, it is determined whether the edge segment is inside other polygons. If it is inside other polygons, it means that the edge segment intersects with a certain edge segment of other polygons.
[0100] Specifically,
[0101] A preset Bentley-Ottmann scan line algorithm may be used to determine whether an edge segment has an intersection with edge segments of other multiple polygons.
[0102] The processor 102 is also configured to: if there is an intersection, segment at least two intersecting edge segments to obtain multiple segmented edge segments; if there is no intersection, there is no need to segment the edge segments, determine multiple result edges from the multiple segmented edge segments and the multiple unsegmented edge segments, connect the multiple result edges to obtain the target handwriting.
[0103] The specific process of determining multiple result edges from the multiple segmented edge segments and the multiple unsegmented edge segments will be described in detail in the following embodiments. Please refer to the following embodiments.
[0104] In the above embodiment of the present application, the touch device includes a display screen 101 and a processor 102 connected to the display screen 101. The display screen 101 is used to display touch handwriting, and the touch handwriting is composed of multiple polygons. The processor 102 is used to obtain the edge segments of multiple polygons, and for the edge segment of at least one polygon, determine whether the edge segment has an intersection with the edge segments of the remaining multiple polygons. If there is an intersection, the at least two intersecting edge segments are segmented to obtain multiple segmented edge segments. If there is no intersection, the edge segment is not segmented, and multiple result edges are determined from the multiple segmented edge segments and the multiple unsegmented edge segments. The multiple result edges are connected to obtain the target handwriting, and finally the display screen 101 displays the target handwriting. In this embodiment, even if the number of polygons N contained in a handwriting is large, it is not necessary to perform a calculation once for every two polygons, which improves the calculation efficiency and reduces the delay in handwriting display.
[0105] Furthermore, based on the above embodiment, the process of a processor obtaining edge segments of multiple polygons is described in detail through the following embodiment.
[0106] Figure 3 A schematic diagram of a flow chart of a method for obtaining edge segments of multiple polygons provided in an embodiment of the present application, such as Figure 3 As shown, the processor is configured to perform the following steps:
[0107] S301 . For at least one polygon, scan two endpoints of a side segment of the polygon to obtain a first scanning event and a second scanning event, wherein the first scanning event and the second scanning event respectively include coordinate information of the endpoints.
[0108] One possible implementation is:
[0109] The coordinate information of the first endpoint and the second endpoint of the edge segment of the polygon is obtained, where the coordinate information includes the first coordinate information and the second coordinate information.
[0110] If the first coordinate information of the first endpoint is lower than the first coordinate information of the second endpoint, the scanning event corresponding to the first endpoint is the first scanning event, and the scanning event corresponding to the second endpoint is the second scanning event.
[0111] If the first coordinate information of the first endpoint is the same as the first coordinate information of the second endpoint, and the second coordinate information of the first endpoint is lower than the second coordinate information of the second endpoint, the scanning event corresponding to the first endpoint is the first scanning event, and the scanning event corresponding to the second endpoint is the second scanning event.
[0112] For example,
[0113] Figure 4A A schematic diagram of a scanning event provided in an embodiment of the present application, such as Figure 4A As shown, for at least one edge in the polygon, scan the two endpoints of the edge, assuming that the coordinate information of endpoint a is (0,0) and the coordinate information of endpoint b is (1,0). If the first coordinate information 0 of endpoint a is lower than the first coordinate information 1 of endpoint b, then the scanning event corresponding to endpoint a is the first scanning event, and the scanning event corresponding to endpoint b is the second scanning event.
[0114] Figure 4B A schematic diagram of another scanning event provided in an embodiment of the present application is shown as follows: Figure 4B As shown, for at least one edge in the polygon, scan the two endpoints of the edge, assuming that the coordinate information of the c endpoint is (0,0) and the coordinate information of the d endpoint is (0,1). The first coordinate information 0 of the c endpoint is the same as the first coordinate information 0 of the d endpoint, and the second coordinate information 0 of the c endpoint is lower than the second coordinate information 1 of the d endpoint, then the scanning event corresponding to the c endpoint is the first scanning event, and the scanning event corresponding to the d endpoint is the second scanning event.
[0115] In this embodiment, the first scanning event may also be referred to as a left scanning event, and the second scanning event may also be referred to as a right scanning event, and this application does not limit their names.
[0116] S302 , sorting the first scanning events and the second scanning events of the edge segments of multiple polygons by priority to obtain multiple sorted scanning events, and storing them in a preset scanning event priority queue.
[0117] One possible implementation is:
[0118] For at least one scanning event, if there is no other scanning event with the same coordinate information as the scanning event, the coordinate information of the edge segments of multiple polygons are sorted in ascending priority order according to the size relationship to obtain multiple sorted scanning events.
[0119] For example,
[0120] Assume that the coordinate information of one of the scan events obtained is (2,3), and the coordinate information of the other scan event is (4,5). After traversal, no scan event with the same coordinate information (2,3) is found. Then, the scan event with coordinate information (2,3) has a higher priority than the scan event with coordinate information (4,5).
[0121] Another possible implementation is:
[0122] For at least one scanning event, if there is another scanning event with the same coordinate information as the scanning event, the scanning event and the other scanning event are sorted according to the type of the scanning event and the preset type priority to obtain multiple sorted scanning events, including a first scanning event type and a second scanning event type.
[0123] For example,
[0124] Figure 5A A schematic diagram of a quadrilateral provided in an embodiment of the present application, such as Figure 5A As shown, the coordinate information (2,1) is the first scanning event of the L1 side and the second scanning event of the L2 side. If the preset type priority size rule is that when there are scanning events with the same coordinate information, the second scanning event is placed before the first scanning event, therefore, the priority of the second scanning event of the L2 side with the coordinate information (2,1) is higher than the first scanning event of the L1 side.
[0125] Figure 5B A schematic diagram of another quadrilateral provided in an embodiment of the present application is shown in FIG. Figure 5B As shown, the coordinate information (0,0) is the first scanning event of the L1 edge and the first scanning event of the L2 edge. If the preset type priority size rule is that when there are scanning events with the same coordinate information, if the paired event of the B scanning event is above the edge of another scanning event A, the A scanning event is arranged before the B scanning event. Therefore, the paired event (0,1) of the first scanning event of the L2 edge is above the L1 edge, and therefore, the priority of the first scanning event of the L1 edge is higher than the first scanning event of the L2 edge.
[0126] Another possible implementation is:
[0127] If both of the above methods are not satisfied, the scanning event and the other scanning event are sorted according to their hash values to obtain a plurality of sorted scanning events.
[0128] S303 . Obtain the sorted edge segments of the plurality of polygons according to the edge segment identifiers corresponding to the sorted plurality of scanning events, and store them in a preset edge sorting list.
[0129] The scanning events are obtained from the scanning event priority queue in sequence. If the scanning event is the first scanning event, the edge segment to which it belongs can be determined according to the identification information of the first scanning event, and the edge segment is stored in the preset edge sorting list. If the scanning event obtained is the second scanning event, the paired event of the second scanning event, that is, the first scanning event, is taken out to reduce repeated calculations of each edge.
[0130] For each edge segment obtained, determine whether there is an intersection between the edge segment and the edge segments of the remaining multiple polygons. If there is an intersection, segment at least two intersecting edge segments to obtain multiple edge segments after segmentation. If there is no intersection, the edge segment is not segmented, and the edge segment that does not need to be segmented is the result edge, thereby obtaining multiple edge segments after segmentation and multiple edge segments that do not need to be segmented. Fig. 6A A schematic diagram of edge segment segmentation provided in an embodiment of the present application is shown in FIG. Fig. 6A As shown, when the M side of polygon A intersects with the N side of polygon B, the M side and the N side are split to obtain the M1 side, the M2 side, the N1 side and the N2 side.
[0131] In the above-mentioned embodiment of the present application, the processor obtains the first scanning event and the second scanning event by scanning the two endpoints of the edge segment of at least one polygon, the first scanning event and the second scanning event respectively including the coordinate information of the endpoints, and sorts the priority of the first scanning event and the second scanning event of the edge segments of multiple polygons according to the coordinate information, and obtains the sorted multiple scanning events, and then obtains the sorted edge segments of multiple polygons according to the edge segment identifiers corresponding to the sorted multiple scanning events, and stores them in a preset edge sorting list. The method of this embodiment facilitates the subsequent judgment of the result polygon by sorting the edge segments of multiple polygons, thereby improving the calculation efficiency.
[0132] As shown in step S303, when the present application obtains the first scanning event, each first scanning event will correspond to an in_out identifier. When obtaining the first scanning event, if in_out=Ture, it means that the edge corresponding to the scanning event is obtained according to a preset rule, for example, the scanning direction from the inside to the outside of the polygon. When an edge corresponding to a first scanning event is stored in a preset edge sorting list, if there is no nearest edge belonging to the same polygon below the edge, then in_out=Flase of the first scanning event.
[0133] Therefore, when obtaining the edge segment corresponding to the scanning event, the in_out value of each edge segment will be obtained at the same time. The target edge segment is obtained from the multiple edge segments segmented in the above embodiment and the multiple edge segments that do not need to be segmented in turn and counted. If in_out=Ture, count is reduced by 1, and if in_out=Flase, count is increased by 1. If the identification information of the target edge segment is the preset identification information and the count reaches the preset value, the target edge segment is determined to be a result edge, and multiple result edges are obtained, that is, if the target edge segment's in_out=Ture and count=1, or in_out=Flase and count=0, then the edge is a result edge, otherwise it is a non-result edge. Figure 6B A schematic diagram of a result edge provided in an embodiment of the present application, such as Figure 6B The result edges are shown as thick solid lines. After the result edges are obtained, they are connected to finally obtain the target handwriting, as shown in Figure 6C As shown, Figure 6C A schematic diagram of a target handwriting provided in an embodiment of the present application.
[0134] It will be appreciated that the above method can be used to process multiple polygons into a final polygon. Figures 6A-6C The number of polygons in the illustrated embodiment is for illustration only and does not limit the present application.
[0135] Figure 7 A schematic diagram of a flow chart of a handwriting display method of a touch device provided in an embodiment of the present application, such as Figure 7 As shown, the method comprises the following steps:
[0136] S701. The display screen displays touch pen traces, where the touch pen traces are composed of multiple polygons.
[0137] S702: The processor obtains edge segments of multiple polygons.
[0138] S703: The processor determines, for a side segment of at least one polygon, whether there is an intersection between the side segment and the side segments of the remaining multiple polygons.
[0139] S704: If there is an intersection, the processor segments at least two intersecting edge segments to obtain a plurality of segmented edge segments.
[0140] S705: If there is no intersection, the processor does not segment the edge segment. S706: The processor determines a plurality of result edges from the segmented plurality of edge segments and the unsegmented plurality of edge segments.
[0141] S707: The processor connects multiple result edges to obtain the target handwriting.
[0142] S708. The display screen displays the target handwriting.
[0143] In the above embodiments of the present application, the specific implementation steps and technical effects please refer to the above embodiments. To avoid redundancy, this embodiment will not be repeated.
[0144] Figure 8 A handwriting display device for a touch device provided in an embodiment of the present application includes: a display module 801 , an acquisition module 802 , a determination module 803 , and a processing module 804 .
[0145] The display module 801 is used to display touch pen traces, which are composed of multiple polygons.
[0146] The acquisition module 802 is used to acquire edge segments of multiple polygons.
[0147] The determination module 803 is used to determine, for a side segment of at least one polygon, whether there is an intersection between the side segment of at least one polygon and the side segments of the remaining multiple polygons.
[0148] The processing module 804 is used to segment at least two intersecting edge segments if there is an intersection point, to obtain a plurality of segmented edge segments.
[0149] The processing module 804 is further configured to not segment the edge segment if no intersection point exists.
[0150] The processing module 804 is further configured to determine a plurality of result edges from the plurality of segmented edge segments and the plurality of unsegmented edge segments.
[0151] The processing module 804 is further used to connect multiple result edges to obtain the target handwriting.
[0152] The display module 801 is also used to display the target handwriting on the display screen.
[0153] The handwriting display device for a touch device provided in the embodiment of the present application can execute the handwriting display method for a touch device in the above method embodiment, and its implementation principle and technical effect are similar and will not be repeated here.
[0154] It should be noted that the above Figure 8 The division of the modules shown is only a schematic diagram, and the present application does not limit the division of the modules and the naming of the modules.
[0155] The present application also provides a computer-readable storage medium, which may include: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, and other media that can store program codes. Specifically, the computer-readable storage medium stores computer execution instructions, and the program instructions are used in the handwriting display method of the touch device in the above-mentioned embodiment.
[0156] The present application also provides a computer program product, which includes a computer program stored in a readable storage medium. At least one control module of the display device can read the execution instruction from the readable storage medium, and at least one control module executes the execution instruction so that the display device implements the handwriting display method of the touch device provided by the above various embodiments.
[0157] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
[0158] For ease of explanation, the above description has been made in conjunction with specific embodiments. However, the above exemplary discussion is not intended to be exhaustive or limit the embodiments to the specific forms disclosed above. Based on the above teachings, various modifications and variations can be obtained. The selection and description of the above embodiments are intended to better explain the principles and practical applications, so that those skilled in the art can better use the embodiments and various different variations of the embodiments suitable for specific use considerations.
Claims
1. A touch device, characterized in that: The touch control device comprises: A display screen, the display screen being configured to: display touch pen traces, the touch pen traces being composed of a plurality of polygons; A processor connected to the display screen, the processor being configured to: Obtain edge segments of the plurality of polygons; For a side line segment of at least one polygon, determining whether the side line segment has an intersection with the side line segments of the remaining multiple polygons; If there is an intersection point, at least two intersecting edge line segments are segmented to obtain multiple segmented edge line segments; If there is no intersection, the edge segment is not segmented; Determine a plurality of result edges from the plurality of segmented edge segments and the plurality of unsegmented edge segments; Connecting the multiple result edges to obtain the target handwriting; The display screen is further configured to display the target handwriting.
2. The touch device according to claim 1, characterized in that: When the processor is configured to obtain the edge segments of the plurality of polygons, it is specifically configured to: For at least one polygon, scan two endpoints of a side segment of the polygon to obtain a first scanning event and a second scanning event, wherein the first scanning event and the second scanning event respectively include coordinate information of the endpoints; According to the coordinate information of the first scanning event and the second scanning event of the edge segments of the multiple polygons, priority sorting is performed to obtain a plurality of sorted scanning events; According to the edge segment identifiers corresponding to the sorted plurality of scanning events, the sorted edge segments of the plurality of polygons are obtained and stored in a preset edge sorting list.
3. The touch control device according to claim 2, characterized in that: The processor is configured to scan two endpoints of the edge segment of the polygon, and when obtaining the first scanning event and the second scanning event, is specifically configured as follows: Acquire coordinate information of a first endpoint and a second endpoint of a side segment of the polygon, wherein the coordinate information includes first coordinate information and second coordinate information; If the first coordinate information of the first endpoint is lower than the first coordinate information of the second endpoint, the scanning event corresponding to the first endpoint is the first scanning event, and the scanning event corresponding to the second endpoint is the second scanning event; If the first coordinate information of the first endpoint is the same as the first coordinate information of the second endpoint, and the second coordinate information of the first endpoint is lower than the second coordinate information of the second endpoint, the scanning event corresponding to the first endpoint is the first scanning event, and the scanning event corresponding to the second endpoint is the second scanning event.
4. The touch control device according to claim 3, characterized in that: The processor is configured to sort the first scanning event and the second scanning event of the edge segments of the multiple polygons according to the priority order, and when obtaining the sorted multiple scanning events, the processor is specifically configured as follows: For at least one scanning event, if there is no other scanning event with the same coordinate information as the scanning event, the coordinate information of the edge segments of the multiple polygons are sorted in ascending priority order according to the size relationship to obtain multiple sorted scanning events.
5. The touch control device according to claim 3, characterized in that: The processor is configured to sort the first scanning event and the second scanning event of the edge segments of the multiple polygons according to the priority order, and when obtaining the sorted multiple scanning events, the processor is specifically configured as follows: For at least one scanning event, if there is another scanning event with the same coordinate information as the scanning event, the scanning event and the other scanning event are sorted according to the type of the scanning event and the preset type priority to obtain multiple sorted scanning events, wherein the types include a first scanning event type and a second scanning event type.
6. The touch control device according to claim 3, characterized in that: The processor is configured to sort the edge segments of the multiple polygons by priority according to the coordinate information of the first scanning event and the second scanning event, and when obtaining the sorted edge segments of the multiple polygons, the processor is specifically configured as follows: For at least one scanning event, if there is another scanning event with the same coordinate information as the scanning event, the scanning event and the other scanning event are sorted according to their hash values to obtain a plurality of sorted scanning events.
7. The touch control device according to any one of claims 2 to 6, characterized in that: When the processor is configured to determine whether the edge segment has an intersection with the edge segments of the remaining multiple polygons, it is specifically configured as follows: Sequentially obtain edge segments corresponding to the first scanning event type from the edge sorting list; For at least one edge segment, based on a preset Bentley-Ottmann scan line algorithm, determine whether the edge segment has an intersection with edge segments of the remaining multiple polygons.
8. The touch control device according to claim 7, characterized in that: When the processor is configured to determine a plurality of result edges from the plurality of segmented edge segments and the plurality of unsegmented edge segments, the processor is specifically configured to: sequentially acquiring a target edge segment from the segmented plurality of edge segments and the unsegmented plurality of edge segments; Counting according to the identification information of the target edge segment; If the identification information of the target edge segment is preset identification information and the count reaches a preset value, the target edge segment is determined to be the result edge, and a plurality of result edges are obtained.
9. A handwriting display method for a touch device, characterized in that: The method comprises: The display screen displays touch pen traces, wherein the touch pen traces are composed of a plurality of polygons; The processor obtains edge segments of the plurality of polygons; For a side line segment of at least one polygon, determining whether the side line segment has an intersection with the side line segments of the remaining multiple polygons; If there is an intersection point, at least two intersecting edge line segments are segmented to obtain multiple segmented edge line segments; If there is no intersection, the edge segment is not segmented; Determine a plurality of result edges from the plurality of segmented edge segments and the plurality of unsegmented edge segments; Connecting the multiple result edges to obtain the target handwriting; The display screen displays the target handwriting.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, the method of claim 9 is implemented.