Method for rendering polygon with circular arc, controller, device and medium

By cutting the arc polygon into triangles and performing pixel addition and subtraction operations, the problems of line segment fitting error and low efficiency in the existing technology are solved, and efficient and accurate polygon rendering is achieved.

CN122244219BActive Publication Date: 2026-07-31SHENZHEN JIALICHUANG TECH DEV CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHENZHEN JIALICHUANG TECH DEV CO LTD
Filing Date
2026-05-20
Publication Date
2026-07-31

AI Technical Summary

Technical Problem

Existing technologies suffer from line segment fitting errors and low efficiency when rendering polygons with arcs, lacking efficient and accurate rendering methods.

Method used

By connecting the arcs of a polygon with circular arcs with line segments to form a cut circle, a polygon without arcs is obtained, which is then cut into multiple triangles. Pixel addition and subtraction operations are performed according to the direction of the cut circle and triangles, and finally the cut circle and triangles are rendered.

Benefits of technology

It improves rendering efficiency, avoids line segment fitting errors and jagged edges, and achieves accurate polygon rendering.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122244219B_ABST
    Figure CN122244219B_ABST
Patent Text Reader

Abstract

This application discloses a rendering method, controller, electronic device, and medium for polygons with arcs. The method includes: connecting the two endpoints of each arc of the polygon with arcs using line segments to form a secant circle corresponding to each arc, thus obtaining a polygon without arcs; cutting the polygon into multiple triangles, determining whether each triangle is clockwise or counterclockwise, and determining whether each secant circle is clockwise or counterclockwise; performing opposite pixel addition and subtraction operations on the clockwise triangles and secant circles and the counterclockwise triangles and secant circles; and rendering the non-zero pixels of each triangle and each secant circle after the pixel addition and subtraction operations, where non-zero pixels represent pixels that have not undergone the opposite pixel addition and subtraction operations simultaneously. This method can improve the rendering efficiency and rendering effect of polygons with arcs.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to, but is not limited to, the field of polygon processing technology, and in particular to a rendering method, controller, device, and medium for polygons with arcs. Background Technology

[0002] Currently, when rendering polygons, the common approach is to decompose the polygon into multiple triangles and then render each triangle individually. However, this method requires fitting the curved edges with multiple line segments when rendering polygons with curved edges, which may introduce line segment fitting errors. Furthermore, a small number of segments can lead to jagged edges, while a large number of segments results in low efficiency. Therefore, there is currently a lack of an efficient and accurate rendering method for polygons with curved edges. Summary of the Invention

[0003] This application provides a rendering method, controller, device, and medium for polygons with curved edges, which can accurately and efficiently render polygons with curved edges.

[0004] In a first aspect, embodiments of this application provide a rendering method for polygons with arcs, including: Connect the two endpoints of each arc of the polygon with arcs with line segments to form the circumscribed circle corresponding to each arc, and obtain a polygon that does not contain the arcs. The polygon is cut into multiple triangles, and each triangle is determined to be either clockwise or counterclockwise, and each cut circle is determined to be either clockwise or counterclockwise. Perform the opposite pixel addition and subtraction operations on the triangles and circles in the clockwise direction and the triangles and circles in the counterclockwise direction; After pixel addition and subtraction operations, non-zero pixels of each triangle and each encircling circle are rendered; the non-zero pixels represent pixels that have not undergone the opposite pixel addition and subtraction operations simultaneously.

[0005] In some embodiments, cutting the polygon into multiple triangles includes: Traverse all vertices of the polygon; Each time, one of the vertices is selected as the target vertex, and the two edges connected to the target vertex are connected by line segments to form a triangle. After the triangle is formed, the next vertex is selected as the target vertex, and this step is repeated until the polygon has been cut into multiple triangles. The two edges selected for constructing the triangle for each target vertex are different.

[0006] In some embodiments, determining whether each triangle is clockwise or counterclockwise includes: Obtain the coordinates of the three vertices of each triangle; The cross product of the coordinates of the three vertices of the triangle is calculated to obtain the result; When the calculation result is positive or negative, the triangle is determined to be either counterclockwise or clockwise.

[0007] In some embodiments, performing pixel addition and subtraction operations on the clockwise triangles and the secant circles opposite to those on the counterclockwise triangles and the secant circles includes: Increment each pixel of the triangle and the circumscribed circle in the clockwise direction by 1, and decrement each pixel of the triangle and the circumscribed circle in the counterclockwise direction by 1; or, Increment each pixel of the triangle and the circumference in the counterclockwise direction by 1, and decrement each pixel of the triangle and the circumference in the clockwise direction by 1.

[0008] In some embodiments, rendering the non-zero pixels of each triangle and each encircling circle after pixel addition and subtraction operations includes: When a pixel is incremented by 1, the first count result of the pixel is set to 1. When a pixel is decremented by 1, the second count result of the pixel is set to -1. The initial values ​​of the first count result and the second count result of each pixel are 0. Summing the first and second counts for each pixel yields all non-zero pixels whose summation is not equal to 0. Render the non-zero pixels of each triangle and each circumference.

[0009] In some embodiments, rendering the non-zero pixels of each triangle and each encircling circle after pixel addition and subtraction operations includes: For each of the secant circles, construct the optimal triangle containing the secant circle; After pixel addition and subtraction operations, the rendering engine renders the non-zero pixels of each triangle and the non-zero pixels inside the inscribed circle.

[0010] In some embodiments, constructing an optimal triangle containing each of the secant circles includes: The straight line portion of the circle is taken as the base of the optimal triangle and extended to both sides; Draw a side tangent to the inscribed circle at each end of the base edge to form a triangle; The optimal triangle is obtained when the area of ​​the triangle reaches its minimum value.

[0011] Secondly, embodiments of this application also provide a controller, including: at least one processor and a memory for communicatively connecting to the at least one processor; the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the rendering method for the arc-shaped polygon described in the first aspect embodiment.

[0012] Thirdly, embodiments of this application also provide an electronic device, including the controller described in the third aspect embodiment.

[0013] Fourthly, embodiments of this application also provide a computer-readable storage medium storing computer-executable instructions for performing the rendering method for a polygon with arcs as described in the first aspect.

[0014] The rendering method, controller, electronic device, and medium for polygons with arcs according to embodiments of this application have at least the following beneficial effects: by connecting the arcs of the polygon with arcs with line segments to form a cut circle, and then obtaining a polygon without arcs, it is convenient to cut the polygon into multiple triangles. Subsequently, pixel addition and subtraction operations are performed according to the direction of the cut circle and the triangles, which can avoid errors when rendering concave polygons. Finally, rendering the cut circle and the triangles at the same time can improve rendering efficiency and avoid the problem of line segment fitting error or jagged edges when fitting the arc edge with multiple line segments. It can also accurately render concave polygons.

[0015] Additional aspects and advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Attached Figure Description

[0016] Figure 1 This is a flowchart of the steps of a rendering method for a polygon with an arc provided in one embodiment of this application; Figure 2 This is a schematic diagram of a polygon with an arc provided in one embodiment of this application; Figure 3 It is Figure 2 A schematic diagram showing the circle formed by the arc of a polygon with a circular arc. Figure 4 It is Figure 3 A schematic diagram showing the polygon ABCDE after being cut into multiple triangles; Figure 5 It is Figure 3 Another schematic diagram showing the polygon ABCDE after being cut into multiple triangles; Figure 6 It is Figure 3Another schematic diagram showing the polygon ABCDE after being cut into multiple triangles; Figure 7 This application provides a schematic diagram of cutting a concave polygon into multiple triangles according to one embodiment; Figure 8 This application provides a schematic diagram of an embodiment for constructing the optimal triangle for cutting a circle; Figure 9 This is a schematic diagram of the controller provided in one embodiment of this application. Detailed Implementation

[0017] The embodiments of the present invention are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain this application, and should not be construed as limiting this application. The step numbers in the following embodiments are set only for ease of explanation, and there is no limitation on the order between the steps. The execution order of each step in the embodiments can be adaptively adjusted according to the understanding of those skilled in the art.

[0018] In the description of this invention, it should be understood that the orientation descriptions, such as up, down, front, back, left, right, etc., are based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limiting this invention.

[0019] The terms "first," "second," "third," and "fourth," etc., used in the specification, claims, and accompanying drawings of this invention are used to distinguish different objects, not to describe a specific order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or apparatuses.

[0020] In this invention, the reference to "embodiment" means that a specific feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of the invention. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a mutually exclusive, independent, or alternative embodiment. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0021] Currently, when rendering polygons, the common approach is to decompose the polygon into multiple triangles and then render each triangle individually. However, this method requires fitting the curved edges with multiple line segments when rendering polygons with curved edges, which may introduce line segment fitting errors. Furthermore, a small number of segments can lead to jagged edges, while a large number of segments results in low efficiency. Therefore, there is currently a lack of an efficient and accurate rendering method for polygons with curved edges.

[0022] This application proposes a rendering method, controller, electronic device, and medium for polygons with arcs. By connecting the arcs of the polygon with arcs using line segments to form a cut circle, a polygon without arcs is obtained. This facilitates the cutting of the polygon into multiple triangles. Subsequently, pixel addition and subtraction operations are performed based on the directions of the cut circle and triangles, which can avoid errors when rendering concave polygons. Finally, rendering the cut circle and triangles simultaneously can improve rendering efficiency and avoid line segment fitting errors or jagged edges caused when fitting multiple line segments to the arc edges. It can also accurately render concave polygons.

[0023] The embodiments of this application will be further described below with reference to the accompanying drawings.

[0024] Firstly, embodiments of this application propose a rendering method for polygons with arcs, such as... Figure 1 As shown, the method includes the following steps: Step S100: Connect the two endpoints of each arc of the polygon with arcs with line segments to form the cut circle corresponding to each arc, and obtain a polygon that does not contain arcs; By connecting the two endpoints of the arc with line segments to form a cut circle, subsequent rendering can be performed directly on the cut circle without fitting the arc with multiple line segments. This avoids line segment fitting errors and problems such as jagged edges due to too few fitted line segments or low efficiency due to too many fitted line segments. After separating the arc from the polygon containing the arc using the cut circle, the remaining part can form a polygon without the arc, which is convenient for subsequent cutting of the polygon into triangles. For example, refer to... Figure 2 Assuming the original polygon with an arc has an arc AB, connecting points AB with line segments forms a shape like... Figure 3 The circle S shown can be divided into a polygon ABCDE without arcs by connecting the arcs AB with line segments.

[0025] Step S200: Cut the polygon into multiple triangles, determine whether each triangle is clockwise or counterclockwise, and determine whether each cut circle is clockwise or counterclockwise. Cutting a polygon into multiple triangles facilitates subsequent polygon rendering and avoids rendering errors caused by concave polygons. After cutting the triangles, it's necessary to distinguish whether each triangle is clockwise or counterclockwise, and also whether each cut circle is clockwise or counterclockwise, to facilitate subsequent pixel addition and subtraction operations. Figure 4 As shown, polygon ABCDE can be divided into three triangles: triangle BCD, triangle ABD, and triangle ADE. Alternatively, it can be divided according to... Figure 5 It can be cut in the following ways: into triangles ABC, ACD, and ADE. It can also be cut according to... Figure 6 The triangles can be cut in various ways, resulting in triangles ABE, BCD, and BDE. There are multiple, not just one, ways to cut the triangles.

[0026] Step S300: Perform the opposite pixel addition and subtraction operations on the clockwise triangles and circles and the counterclockwise triangles and circles; After completing the triangle and circle cutting, determine whether each triangle and circle is clockwise or counterclockwise. Perform opposite pixel increment / decrement operations on clockwise and counterclockwise triangles and circles. For example, if a pixel increment operation is performed on clockwise triangles and circles, a pixel subtraction operation is performed on counterclockwise triangles and circles, with the same increment / decrement value. Conversely, pixel subtraction can be performed on clockwise triangles and circles, and pixel increment on counterclockwise triangles and circles.

[0027] Step S400: After pixel addition and subtraction operations, render the non-zero pixels of each triangle and each encircling circle; non-zero pixels represent pixels that have not undergone the opposite pixel addition and subtraction operations at the same time.

[0028] For some concave polygons, when cut into multiple triangles, one triangle may be located inside another triangle, and the two triangles may be oriented in opposite directions (one clockwise, the other counterclockwise). When performing pixel addition and subtraction operations on these two triangles, the inner triangle will undergo both operations simultaneously, canceling each other out. These pixels will not be rendered subsequently. However, pixels located inside an outer triangle but outside an inner triangle do not undergo both operations and are considered non-zero pixels, requiring subsequent rendering. For example, as... Figure 7As shown, when a concave polygon FGHI is cut into triangles, it can be cut into triangles FGH and FHI. Triangle FGH is located inside triangle FHI, and the two are oriented in opposite directions. Assuming that when a pixel addition operation is performed on the pixels inside triangle FGH, a pixel addition operation is also performed on the pixels inside triangle FHI. Then, a pixel subtraction operation is performed on the pixels inside triangle FHI. The results of the two operations cancel each other out. Therefore, during subsequent rendering, there is no need to render the pixels inside triangle FHI. This method can avoid errors when rendering concave polygons.

[0029] According to the rendering method of the polygon with arcs in this application, the arcs of the polygon with arcs are connected by line segments to form a cut circle, and then a polygon without arcs is obtained. This makes it easier to cut the polygon into multiple triangles. Subsequently, pixel addition and subtraction operations are performed according to the direction of the cut circle and the triangles, which can avoid errors when rendering concave polygons. Finally, the cut circle and triangles are rendered at the same time, which can improve rendering efficiency and avoid the problem of line segment fitting error or jagged edges when the arc edge is fitted with multiple line segments. It can also accurately render concave polygons.

[0030] Furthermore, in some embodiments of this application, the process of cutting a polygon into multiple triangles includes the following two steps: Traverse all vertices of the polygon; Each time, select one vertex as the target vertex and connect the two edges connected to the target vertex with line segments to construct a triangle. After construction, select the next vertex as the target vertex and repeat this step until the polygon has been cut into multiple triangles. The two edges selected for constructing the triangle for each target vertex are different.

[0031] by Figure 3 Taking the polygon ABCDE as an example, when cutting the triangle, assuming vertex B is first chosen as the target vertex, the two sides AB and BC connected to vertex B can be connected by line segments to form triangle ABC. Then, arbitrarily choosing one vertex from A, C, D, and E, for example, vertex C as the target vertex, we can construct triangle ACD. The remaining three vertices form triangle AED, and the result is as follows. Figure 5 As shown. If vertex C is chosen as the first target vertex, triangle BCD can be obtained. Then, if B is chosen as the target vertex, triangle ABD can be obtained. Finally, triangle ADE remains, as shown. Figure 4 As shown. It should be noted that the order in which the vertices are selected can be adjusted according to the actual situation and is not subject to specific restrictions, as long as the polygon can be cut into multiple triangles.

[0032] Furthermore, in some embodiments of this application, in order to determine whether each triangle is clockwise or counterclockwise, the following four steps are included: Get the coordinates of the three vertices of each triangle; Calculate the cross product of the coordinates of the three vertices of the triangle to obtain the result; When the calculation result is positive or negative, determine whether the triangle is in a counterclockwise or clockwise direction.

[0033] Specifically, assuming the coordinates of the three vertices of the triangle are A(X1, Y1, Z1), B(X2, Y2, Z2), and C(X3, Y3, Z3), starting from vertex A, calculate vectors AB and AC respectively: AB = (X2 - X1, Y2 - Y1); AC = (X3-X1, Y3-Y1). After performing the cross product, the result is: W=(X2-X1)*(Y3-Y1)-(Y2-Y1)*(X3-X1); If W > 0, the vertices of the triangle are arranged in a counter-clockwise direction according to the order of A, B, C. If W < 0, the vertices of the triangle are arranged in a clockwise direction according to the order of A, B, C. If W = 0, the three points are collinear and cannot form a triangle.

[0034] When determining the clockwise and counterclockwise direction of a circle, the circle is defined by its center, radius, starting angle, and swept angle. A positive swept angle indicates a counterclockwise direction, while a negative angle indicates a clockwise direction. When generating triangles, the order of the triangle vertices is adjusted according to the clockwise or counterclockwise direction.

[0035] Furthermore, in some embodiments of this application, step S300 above, which involves performing the opposite pixel addition and subtraction operations on the clockwise triangles and secant circles to those in the counterclockwise direction, includes the following two steps: Step S310: Increment each pixel of the triangles and circles in the clockwise direction by 1, and decrement each pixel of the triangles and circles in the counterclockwise direction by 1; or, Step S320: Increment each pixel of the triangle and the circle in the counterclockwise direction by 1, and decrement each pixel of the triangle and the circle in the clockwise direction by 1.

[0036] By performing opposite pixel addition and subtraction operations on the clockwise and counterclockwise triangles and their secants, errors can be avoided when rendering concave polygons. For some concave polygons, when cut into multiple triangles, one triangle may be inside another, and the two triangles may be oriented in opposite directions (one clockwise, the other counterclockwise). When performing pixel addition and subtraction operations on these two triangles, the inner triangle will undergo both operations simultaneously, canceling each other out, and these pixels will not be rendered. However, pixels located inside an outer triangle but outside an inner triangle do not undergo both operations and are considered non-zero pixels, requiring subsequent rendering. For example, as... Figure 7 As shown, when a concave polygon FGHI is cut into triangles, it can be cut into triangle FGH and triangle FHI. Triangle FGH is located inside triangle FHI, and the two are oriented in opposite directions. Suppose that each pixel inside triangle FGH is incremented by 1, each pixel inside triangle FHI is also incremented by 1. Then, each pixel inside triangle FGH is decremented by 1. The results of the two operations cancel each other out. Therefore, during subsequent rendering, there is no need to render the pixels inside triangle FHI. This method can avoid errors when rendering concave polygons.

[0037] Furthermore, in some embodiments of this application, step S400 above—rendering the non-zero pixels of each triangle and each encircling circle after pixel addition and subtraction operations—includes the following three steps: Step S410: When a pixel is incremented by 1, set the first count result of the pixel to 1; when a pixel is decremented by 1, set the second count result of the pixel to -1. The initial values ​​of the first and second count results of each pixel are 0. Step S420: Summate the first and second count results for each pixel to obtain all non-zero pixels whose summation result is not equal to 0; Step S430: Render the non-zero pixels of each triangle and each cut circle.

[0038] When performing pixel increment / decrement operations on each pixel, a counter can be set. When a pixel is incremented by 1, the count result is +1; when a pixel is decremented by 1, the count result is -1. After completing pixel increment / decrement operations on all pixels, the count result of each pixel's counter is counted. If the count result is +1 or -1, it means that the pixel is a non-zero pixel. If the count result is 0, the pixel is not a non-zero pixel and does not need to be rendered further.

[0039] Furthermore, in some embodiments of this application, step S400 above—rendering the non-zero pixels of each triangle and each encircling circle after pixel addition and subtraction operations—includes the following two steps: For each of the secant circles, construct the optimal triangle containing the secant circle; After pixel addition and subtraction operations, the rendering engine renders the non-zero pixels of each triangle and the non-zero pixels inside the inscribed circle.

[0040] It's important to note that rendering triangles is a built-in mechanism of the rendering engine, which can automatically render the non-zero pixels of a triangle. However, for a circumscribed circle, it's necessary to first generate a triangle containing the circumscribed circle, then determine which pixels within this triangle belong to the circumscribed circle, and finally render the non-zero pixels inside the circumscribed circle using the triangle rendering mechanism. To improve rendering efficiency, it's necessary to construct an optimal triangle that contains the circumscribed circle.

[0041] Furthermore, in some embodiments of this application, in order to construct an optimal triangle containing a circumscribed circle, the following three steps are included: The straight line portion that cuts the circle is taken as the base of the optimal triangle and extended to both sides; Draw a side tangent to the inscribed circle at each end of the base to form a triangle; The optimal triangle is obtained when the area of ​​the triangle is minimized.

[0042] In this application, constructing the optimal triangle essentially means finding the triangle with the smallest area that can enclose the enclosed circle. For example, such as... Figure 8 As shown, let x = M + m, then we have M = xm. Also, based on the angle θ, we can obtain M / L = n / r. This leads to L = M * r / n = (x - m) * r / sqrt(x^2 - r^2). According to the triangle area formula S' = M * L, the triangle area function is f(x) = ((xm)^2 * r) / sqrt(x^2 - r^2). Taking the derivative of this function and setting it to 0 gives the extreme point. Substituting this extreme point into the function yields the triangle with the smallest area, i.e., the optimal triangle. After obtaining the optimal triangle, it's determined which elements within the optimal triangle belong to the pixels inside the inscribed circle. Then, through the triangle rendering mechanism, the non-zero pixels inside the inscribed circle are rendered.

[0043] According to the rendering method for polygons with arcs in this application, by connecting the arcs of the polygon with arcs using line segments to form a mitered circle, a polygon without arcs is obtained. This facilitates the cutting of the polygon into multiple triangles. Subsequent pixel addition and subtraction operations are performed based on the directions of the mitered circle and the triangles, which can avoid errors when rendering concave polygons. Finally, rendering the mitered circle and the triangles simultaneously can improve rendering efficiency and avoid line segment fitting errors or jagged edges caused when fitting multiple line segments to the arc edges. It can also accurately render concave polygons. When rendering the mitered circle, an optimal triangle is constructed based on the mitered circle, and then it is determined which pixels inside the optimal triangle belong to the pixels inside the mitered circle. The mitered circle is then rendered through the triangle rendering mechanism, improving the rendering efficiency and effect of polygons with arcs.

[0044] Secondly, such as Figure 9 As shown, the present invention also provides a controller, comprising: The processor 101 can be implemented using a general-purpose central processing unit (CPU), microprocessor, application specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this application. The memory 102 can be implemented as a read-only memory (ROM), static storage device, dynamic storage device, or random access memory (RAM). The memory 102 can store the operating system and other applications. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 102 and is called and executed by the processor 101 to execute the rendering method for the curved polygon of this application embodiment. Input / output interface 103 is used to implement information input and output; The communication interface 104 is used to enable communication and interaction between this device and other devices. Communication can be achieved through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.). Bus 105 transmits information between various components of the device (e.g., processor 101, memory 102, input / output interface 103, and communication interface 104); The processor 101, memory 102, input / output interface 103 and communication interface 104 are connected to each other within the device via bus 105.

[0045] Thirdly, embodiments of this application also provide an electronic device, including the controller described in the second aspect embodiment.

[0046] Fourthly, embodiments of this application also provide a storage medium, which is a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described rendering method for polygons with arcs.

[0047] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof. The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separate, and may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0048] It will be understood by those skilled in the art that all or some of the steps and systems in the methods disclosed above can be implemented as software, firmware, hardware, and suitable combinations thereof. Some or all of the physical components can be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit. Such software can be distributed on a computer-readable medium, which can include computer storage media (or non-transitory media) and communication media (or transient media). As is known to those skilled in the art, the term computer storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disc (DVD) or other optical disc storage, magnetic cartridges, magnetic tape, disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and is accessible to a computer. Furthermore, as is known to those skilled in the art, communication media typically include computer-readable instructions, data structures, program modules, or other data in modulated data signals such as carrier waves or other transmission mechanisms, and may include any information delivery medium.

[0049] The above provides a detailed description of the preferred embodiments of the present invention. However, the present invention is not limited to the above embodiments. Those skilled in the art can make various equivalent modifications or substitutions without departing from the spirit of the present invention. All such equivalent modifications or substitutions are included within the scope defined by the claims of the present invention.

Claims

1. A rendering method of a polygon with a circular arc, characterized by, include: Connect the two endpoints of each arc of the polygon with arcs with line segments to form the circumscribed circle corresponding to each arc, and obtain a polygon that does not contain the arcs. The polygon is cut into multiple triangles, and each triangle is determined to be either clockwise or counterclockwise, and each cut circle is determined to be either clockwise or counterclockwise. Perform the opposite pixel addition and subtraction operations on the triangles and circles in the clockwise direction and the triangles and circles in the counterclockwise direction; After pixel addition and subtraction operations, the non-zero pixels of each triangle and each encircling circle are rendered; The non-zero pixels refer to pixels that have not undergone opposite pixel addition or subtraction operations simultaneously; The step of cutting the polygon into multiple triangles includes: Traverse all vertices of the polygon; Each time, one of the vertices is selected as the target vertex, and the two edges connected to the target vertex are connected by line segments to form a triangle. After the triangle is formed, the next vertex is selected as the target vertex, and this step is repeated until the polygon has been cut into multiple triangles. The two edges selected for forming the triangle by each target vertex are different. The step of performing the opposite pixel addition and subtraction operations on the clockwise triangles and the secant circles to those counterclockwise includes: Increment each pixel of the triangle and the circumscribed circle in the clockwise direction by 1, and decrement each pixel of the triangle and the circumscribed circle in the counterclockwise direction by 1; or, Increment each pixel of the triangle and the circumference in the counterclockwise direction by 1, and decrement each pixel of the triangle and the circumference in the clockwise direction by 1; After pixel addition and subtraction operations, rendering is performed on the non-zero pixels of each triangle and each encircling circle, including: When a pixel is incremented by 1, the first count result of the pixel is set to 1. When a pixel is decremented by 1, the second count result of the pixel is set to -1. The initial values ​​of the first count result and the second count result of each pixel are 0. Summing the first and second counts for each pixel yields all non-zero pixels whose summation is not equal to 0. Render the non-zero pixels of each triangle and each circumference.

2. The rendering method of a polygon with circular arcs according to claim 1, wherein, Determining whether each triangle is clockwise or counterclockwise includes: Obtain the coordinates of the three vertices of each triangle; The cross product of the coordinates of the three vertices of the triangle is calculated to obtain the result; When the calculation result is positive or negative, the triangle is determined to be either counterclockwise or clockwise.

3. The rendering method for polygons with circular arcs according to claim 1, characterized in that, After pixel addition and subtraction operations, rendering is performed on the non-zero pixels of each triangle and each encircling circle, including: For each of the secant circles, construct the optimal triangle containing the secant circle; After pixel addition and subtraction operations, the rendering engine renders the non-zero pixels of each triangle and each circumference after pixel addition and subtraction.

4. The rendering method for polygons with circular arcs according to claim 3, characterized in that, For each of the secant circles, constructing an optimal triangle containing the secant circle includes: The straight line portion of the circle is taken as the base of the optimal triangle and extended to both sides; Draw a side tangent to the inscribed circle at each end of the base edge to form a triangle; The optimal triangle is obtained when the area of ​​the triangle reaches its minimum value.

5. A controller, characterized in that, include: It includes at least one processor and a memory for communicatively connecting with said at least one processor; The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the rendering method for a polygon with an arc as described in any one of claims 1 to 4.

6. An electronic device, characterized in that, Includes the controller as described in claim 5.

7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions for causing a computer to perform the rendering method for a polygon with an arc as described in any one of claims 1-4.