Image rendering based on boolean operations of simplified contour polygons

By splitting the edges of a simplified polygon and using intersection points and edge annotations, the target edges are directly filtered for Boolean operations, which solves the problems of low efficiency and poor accuracy in the operation of polygons with arcs, and achieves efficient and accurate image drawing.

WO2026012392A1PCT designated stage Publication Date: 2026-01-15ANT WEALTH (SHANGHAI) FINANCIAL INFORMATION SERVICES CO LTD

Patent Information

Application Number
PCT/CN2025/107710
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-07-10
Filing Date
2025-07-09
Publication Date
2026-01-15

AI Technical Summary

Technical Problem

Existing technologies suffer from low efficiency and poor accuracy in handling polygons with arcs, and there is a risk of misconfiguration when distinguishing between inside and outside during coloring.

Method used

By splitting the edges of the simplified polygon and using the intersection points and the internal and external attribute annotations of the edges, the target edges can be directly selected for Boolean operations, avoiding the approximation of curved edges and improving computational efficiency and accuracy.

Benefits of technology

It achieves efficient and accurate polygon Boolean operations, eliminates the risk of errors in distinguishing between inside and outside, and improves the efficiency and accuracy of image rendering.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025107710_15012026_PF_FP_ABST
    Figure CN2025107710_15012026_PF_FP_ABST
Patent Text Reader

Abstract

One or more embodiments of the present disclosure relate to graphics rendering, and in particular to an image rendering method and system based on Boolean operations of simplified contour polygons. The method comprises the steps of: placing two simplified contour polygons to be processed by Boolean operations in an xoy rectangular coordinate system; searching for and splitting edges of the simplified contour polygon on the basis of inflection points, searching for intersection points between the edges of the two simplified contour polygons, and splitting the edges of the simplified contour polygons again on the basis of the intersection points; traversing the edges of the two simplified contour polygons, and labeling both sides of each edge with annotations representing internal and external attributes of the two simplified contour polygons; screening for target edges and target sides on the basis of the Boolean operations; and connecting all the target edges, obtaining a result region on the basis of the target sides, and filling the result region with a pre-configured color.
Need to check novelty before this filing date? Find Prior Art

Description

Image drawing based on Boolean operations of simplified polygons Technical Field

[0001] One or more embodiments of this disclosure relate to graphics rendering, and more specifically to image rendering based on Boolean operations of simplified polygons. Background Technology

[0002] Scalable Vector Graphics (SVG) is based on the XML markup language and is used to describe two-dimensional vector graphics. As a text-based open web standard, SVG can elegantly and concisely render graphics of different sizes. The SVG format provides vector graphics that can be infinitely enlarged without loss of quality or distortion, and its content can be easily modified without a graphics editor. The SVG rendering process involves Boolean operations on polygons. These Boolean operations include intersection, union, difference, and XOR. Summary of the Invention

[0003] This disclosure describes one or more embodiments of an image drawing method and system based on Boolean operations of simplified polygons, providing a new polygon Boolean operation scheme with higher computational efficiency.

[0004] In a first aspect, embodiments of this disclosure provide an image drawing method based on Boolean operations of simplified polygons. The two simplified polygons to be subjected to the Boolean operation satisfy the following condition: when placed in an xoy rectangular coordinate system, excluding the vertical edges, the number of intersection points between the simplified polygons and any perpendicular line does not exceed two. The image drawing method includes the following steps: placing the two simplified polygons to be subjected to the Boolean operation in an xoy rectangular coordinate system; finding and splitting the edges of the simplified polygons based on inflection points; finding the intersection points of the edges of the two simplified polygons; splitting the edges of the simplified polygons again based on the intersection points; traversing the edges of the two simplified polygons and annotating both sides of the edges with annotations representing the internal and external attributes of the two simplified polygons; filtering out target edges and target sides based on the Boolean operation; connecting all the target edges; obtaining a result area based on the target sides; and filling the result area with a pre-configured color.

[0005] Secondly, this disclosure provides an image drawing system based on Boolean operations of simplified polygons. The two simplified polygons to be subjected to the Boolean operation satisfy the following condition: when placed in an xoy rectangular coordinate system, excluding the vertical edges, the number of intersection points between the simplified polygons and any perpendicular line does not exceed two. The image drawing system includes: a placement module for placing the two simplified polygons to be subjected to the Boolean operation in an xoy rectangular coordinate system; a side-splitting module for finding and splitting the edges of the simplified polygons based on inflection points, finding the intersection points of the edges of the two simplified polygons, and splitting the edges of the simplified polygons again based on the intersection points; an annotation module for traversing the edges of the two simplified polygons and annotating both sides of the edges with annotations representing the internal and external attributes of the two simplified polygons; a filtering module for filtering out target edges and target sides based on the Boolean operation; and a region module for connecting all the target edges, obtaining a result region based on the target side, and filling the result region with a pre-configured color.

[0006] Thirdly, embodiments of this disclosure provide an image drawing method based on Boolean operations of curved polygons, comprising the steps of: splitting the curved polygon into one or more simplified polygons; rewriting the Boolean operation based on the splitting of the curved polygon to obtain a Boolean operation sequence; performing the image drawing method based on Boolean operations of simplified polygons as described in the first aspect on the initial Boolean operation of the Boolean operation sequence to obtain the result of the image drawing; when the result of the Boolean operation is not a simplified polygon, splitting the result of the Boolean operation into multiple simplified polygons and rewriting the Boolean operation sequence; repeating the previous step until the Boolean operation sequence is reduced to only a union operation; and performing the union operation to obtain the result of the image drawing.

[0007] Fourthly, embodiments of this disclosure provide an image rendering system based on Boolean operations with curved polygons, comprising: a splitting module for splitting a curved polygon into one or more simplified polygons; a rewriting module for rewriting the Boolean operations based on the splitting of the curved polygons to obtain a Boolean operation sequence; a simplified operation module for executing the image rendering method based on Boolean operations with simplified polygons as described in the first aspect for the initial Boolean operation of the Boolean operation sequence to obtain the result of the image rendering, wherein when the result of the Boolean operation is not a simplified polygon, the result of the Boolean operation is split into multiple simplified polygons and the Boolean operation sequence is rewritten; a looping module for repeating the previous step until the Boolean operation sequence is reduced to a union operation; and a merging module for performing the union operation to obtain the result of the image rendering.

[0008] Fifthly, embodiments of this disclosure provide an electronic device, including a processor and a memory; the processor is connected to the memory; the memory is used to store executable program code; the processor reads the executable program code stored in the memory to run a program corresponding to the executable program code, so as to perform the method described in any of the above aspects.

[0009] In a sixth aspect, embodiments of this disclosure provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the methods described in any of the preceding aspects.

[0010] In a seventh aspect, embodiments of this disclosure provide a computer program product, including a computer program that, when executed by a processor, implements the methods described in any of the above aspects.

[0011] The beneficial effects of the technical solutions provided by some embodiments of this disclosure include at least the following: In one or more embodiments of this disclosure, an image drawing method based on Boolean operations of simplified polygons is provided. This method discloses a polygon Boolean operation scheme based on a given simplified polygon. By splitting the edges and using edge annotations, target edges matching the Boolean operation results are directly selected. Connecting these target edges yields the Boolean operation result, enabling rapid image drawing with high Boolean operation efficiency. The image drawing method based on Boolean operations of polygons with curved edges provided by one or more embodiments of this disclosure supports highly efficient and accurate Boolean operations on polygons with curved edges, expanding the application scope of Boolean operations for image drawing. By rewriting the Boolean operations and establishing and adjusting the Boolean operation sequence, the efficiency of Boolean operations and image drawing of polygons with curved edges is improved.

[0012] Other features and advantages of one or more embodiments of this disclosure will be further revealed in the following detailed description and accompanying drawings. Attached Figure Description

[0013] To more clearly illustrate the technical solutions in the embodiments of this disclosure, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this disclosure. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0014] Figure 1 is a schematic diagram of Boolean operations on an arc-shaped polygon provided in an embodiment of this disclosure.

[0015] Figure 2 is a schematic diagram of the application scenario of the Boolean operation method for curved polygons provided in the embodiments of this disclosure.

[0016] Figure 3 is a schematic diagram of the surround mode provided in the embodiment of this disclosure.

[0017] Figure 4 is a comparative schematic diagram of the surround mode provided in the embodiments of this disclosure.

[0018] Figure 5 is a schematic flowchart of the Boolean operation method for a simplified polygon provided in an embodiment of this disclosure.

[0019] Figure 6 is a schematic diagram of Boolean operations on a simplified polygon provided in an embodiment of this disclosure.

[0020] Figure 7 is a schematic diagram of edge splitting provided in an embodiment of this disclosure.

[0021] Figure 8 is a schematic diagram with annotations provided for embodiments of this disclosure.

[0022] Figure 9 is a schematic flowchart of the method for finding intersection points provided in an embodiment of this disclosure.

[0023] Figure 10 is a schematic diagram of finding intersection points provided in an embodiment of this disclosure.

[0024] Figure 11 is a schematic diagram of the annotation method provided in the embodiments of this disclosure.

[0025] Figure 12 is a schematic diagram of annotations provided in the embodiments of this disclosure.

[0026] Figure 13 is a schematic diagram of a simplified polygon Boolean operation system provided in an embodiment of this disclosure.

[0027] Figure 14 is a schematic flowchart of the method for splitting arc-shaped polygons provided in the embodiments of this disclosure.

[0028] Figure 15 is a schematic diagram of a Boolean operation system with an arc polygon provided in an embodiment of this disclosure.

[0029] Figure 16 is a schematic diagram of an image rendering system provided in an embodiment of this disclosure.

[0030] Figure 17 is a schematic diagram of an electronic device provided in an embodiment of this disclosure. Detailed Implementation

[0031] The technical solutions of the embodiments of this disclosure will be explained and described below with reference to the accompanying drawings. However, the following embodiments are only preferred embodiments of this disclosure and not all of them. Other embodiments obtained by those skilled in the art based on the embodiments in the implementation methods without creative effort are all within the protection scope of this disclosure.

[0032] The terms "first," "second," "third," etc., in the specification, claims, and accompanying drawings of this disclosure 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 such processes, methods, products, or apparatus.

[0033] In the following description, terms such as “inner,” “outer,” “upper,” “lower,” “left,” and “right” are used only to facilitate the description of the embodiments and to simplify the description, and are not intended to indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of this disclosure.

[0034] All data involved in this application are information and data authorized by the user or fully authorized by all parties, and the collection of relevant data complies with the relevant laws, regulations and standards of the relevant countries and regions.

[0035] Before introducing the technical solutions of the embodiments of this disclosure, the application scenarios of one or more embodiments of this disclosure will be described. (Glossary of terms: polygonal Boolean operations)

[0036] The polygon Boolean operations referred to in this disclosure involve a series of logical operations performed on polygons (or polygon meshes) in computer graphics and geometric modeling. Examples include union, intersection, complement, and difference. These operations are commonly used to process and manipulate the shape, position, and attributes of polygons to perform operations such as merging, cutting, and trimming. Specifically, union combines all parts of two polygons to form a new polygon whose boundaries are the union of the original polygon boundaries. Intersection finds the overlapping portions between two polygons to form a new polygon whose boundaries are the intersection of the original polygon boundaries. Complement finds the portion of one polygon that is not in the other, forming a new polygon. Difference finds the portion of one polygon that is removed from another, forming a new polygon. For example, a∪b represents the union of a and b, a∩b represents the intersection of a and b, ((a∩┐b)∪(b∩┐a)) represents the complement of a and b, and (a∩┐b) represents the difference between a and b, i.e., removing the part of a that overlaps with b. Here, ┐ represents the NOT operation. (Polygons with arcs)

[0037] The arc-shaped polygons referred to in this disclosure are polygons in which zero or more edges are replaced by arcs. An arc-shaped polygon has multiple vertices, where two vertices are connected by an arc (i.e., the edge between the two vertices is replaced by an arc). Since a straight line can also be considered a curve, polygons also fall under the category of arc-shaped polygons as defined in this disclosure. One or more Boolean operation methods for arc-shaped polygons disclosed in this disclosure are also applicable to Boolean operations on polygons. Inflection point

[0038] The inflection point referred to in this disclosure refers to a point on a curve where the sign of the derivative of the curve changes in its neighborhood. At an inflection point, the tangent line to the curve may be absent or horizontal. (Horizontal inflection point)

[0039] The term "horizontal inflection point" in this disclosure refers to the inflection point on the curve after it has been symmetrically flipped along the line y = x. At the horizontal inflection point, the tangent line to the curve may be absent or perpendicular. Application Scenarios Introduction

[0040] Polygonal Boolean operations refer to a series of logical operations performed on polygons (or polygon meshes) in computer graphics and geometric modeling, such as union, intersection, complement, and difference. These operations are commonly used to process and manipulate the shape, position, and attributes of polygons to achieve operations such as merging, cutting, and trimming graphics. Boolean operations are crucial in fields such as computer-aided design (CAD), computer graphics, and 3D modeling, helping designers and engineers to precisely manipulate and process complex geometric shapes. For example, in SVG rendering, SVG code can describe an image, significantly reducing the number of bytes required to store and transmit the image. SVG (Scalable Vector Graphics) is an XML markup language for describing two-dimensional vector graphics. It is an open standard vector graphics format widely used in web development, graphic design, and mobile applications. SVG images can be losslessly scaled up and down without distortion or blurring because they are based on mathematical descriptions rather than pixels. This makes SVG images ideal for scenarios requiring responsive design and cross-device display. Furthermore, SVG images can contain elements such as shapes, paths, text, and filter effects, making them highly flexible and powerful. In web development, SVG images are commonly used to render icons, charts, maps, animations, and more. Compared to traditional raster images (such as JPEG and PNG), SVG images can achieve the same visual effect with a smaller file size, and are also easier to implement with dynamic interactions and animations.

[0041] In this art, arcs are typically represented using Bézier curves, a common curve representation method in computer graphics and computer-aided design (CAD). Bézier curves are defined by a series of control points and knots. Due to their favorable mathematical properties and smoothness, Bézier curves are widely used in curve drawing, shape modeling, and animation design. The arcs involved in the arced polygons disclosed in this disclosure are exemplary representations using Bézier curves. All embodiments of this disclosure can be implemented using other curve representation methods.

[0042] Current polygon Boolean operations, when dealing with polygons with arcs, require converting the arcs into many smaller line segments before performing the polygon Boolean operations. This not only reduces the efficiency of polygon Boolean operations but also leads to a decrease in accuracy.

[0043] Please refer to Figure 1, which shows an exemplary graphic described using SVG. The final image can be represented as a = a1∪a2∪a3∪a4, where a1 = c1∩c2, a2 ​​= s1∩┐c3, a3 = s2∩┐c4, a4 ​​= s3∩┐c5, and the expressions for a1 to a5 constitute a Boolean operation. The coordinate expressions and relative positions of c1, c2, c3, c4, c5, s1, s2, and s3 all need to be recorded. Combined with the Boolean operation, the graphic can be rendered. Please refer to Figure 2, which is a panoramic schematic diagram of the application of the Boolean operation method for curved polygons described in one or more embodiments of this disclosure. After performing Boolean operations and the involved curved polygons, and then filling in the colors, the graphic can be completed.

[0044] A fundamental concept in vector graphics rendering is defining whether a closed region is inside or outside, so that only the inside is filled during rendering. This is determined by the winding number, also known as the wrapping rule or fill rule.

[0045] The order of the edges of a closed region can be either clockwise or counterclockwise. As shown in Figure 3, the triangle is filled with red, and the three edges can be drawn either clockwise or counterclockwise.

[0046] Draw a ray from any direction in the region and determine the intersection of the ray and the edge (tangency is not considered). If a counterclockwise edge is encountered, add 1 and a clockwise edge is deducted 1. The final sum of all the times, i.e. the number of encirclements, can be one of three: positive, zero, or negative.

[0047] Filling rules can be established by defining different cases, the most common being non-zero wrapping and odd / even wrapping. The former means that non-zero wrapping numbers are inside and all others are outside, while the latter means that odd numbers are inside and even numbers are outside. The wrapping numbers of the two triangles above are -1 and +1, and the effect is the same regardless of which rule is used.

[0048] Please refer to Figure 4. Draw a star shape following the direction of the black arrow. The fill effect under the two rules of non-zero wrapping and parity wrapping is shown in Figure 4. The wrapping number of the center area of ​​the star is -2. Non-zero wrapping is considered as the inside, and parity wrapping is considered as the outside. When you need to treat the center area as the outside, you need to set it to parity wrapping. Conversely, when you need to treat the center area as the inside, you need to set it to non-zero wrapping. There is a possibility of configuration errors. For example, in canvas and SVG, the library code defaults to non-zero wrapping, which needs to be changed to parity wrapping by passing a value. In canvas, ctx.fill('nonzero'); / / default non-zero wrapping, can be omitted ctx.fill('evenodd'); / / parity wrapping In SVG,<path fill-rule="nonzero" / > / / Non-zero surround by default, optional configuration<path fill-rule="evenodd" / > / / Odd and even surround.

[0049] It is evident that the relevant technologies not only suffer from low efficiency and poor accuracy in handling arcs, but also have the potential for misconfiguration in distinguishing between inside and outside when filling in colors, which technical personnel need to be aware of.

[0050] This disclosure provides one or more embodiments of a Boolean operation method for curved polygons. By splitting the edges using intersection points and then annotating the inside and outside attributes of the edges, the distinction between inside and outside is achieved. The inside and outside can be determined directly from the Boolean operation expression, eliminating the risk of errors in distinguishing between inside and outside. The disclosed Boolean operation method for curved polygons uses inflection points to split the curved edges, enabling direct Boolean operations based on the curved edges without needing to approximate the curved edges with short line segments, thus improving the efficiency and accuracy of Boolean operations.

[0051] This disclosure first provides an image drawing method based on Boolean operations of simplified polygons. The two simplified polygons to be Boolean operated on satisfy the condition that when placed in the xoy rectangular coordinate system, the number of intersection points between the simplified polygons and any perpendicular line does not exceed 2 when the vertical side is removed. Please refer to Figure 5. The image drawing method includes the following steps.

[0052] Step 102) Place the two simplified polygons to be operated on in the xoy rectangular coordinate system; Step 104) Find and split the edges of the simplified polygons based on the inflection points, find the intersection points of the edges of the two simplified polygons, and split the edges of the simplified polygons again based on the intersection points; Step 106) Traverse the edges of the two simplified polygons and annotate the sides of the edges with annotations representing the internal and external attributes of the two simplified polygons; Step 108) Filter out the target edges and target sides based on the Boolean operation; Step 110) Connect all the target edges, obtain the result area based on the target sides, and fill the result area with a pre-configured color.

[0053] Please refer to Figure 6. Considering only the double-flame portion in the image, it is obtained by performing a complement operation on two overlapping spindle shapes. The two spindle shapes are numbered p1 and p2, respectively. The Boolean operation can be represented as: a = ((p1∩┐p2)∪(p2∩┐p1)). Both spindle shapes are simple polygons. Following step 104), the edges of the two simple polygons are split, resulting in 12 edges, as shown in Figure 7. Following step 106), each edge is annotated, as shown in Figure 8. Solid squares represent the interior of p1, hollow squares represent the exterior of p1, solid circles represent the interior of p2, and hollow circles represent the exterior of p2. After annotation, the target edges selected according to step 108 include edges ① to ②. Taking the left side as the bottom side and the right side as the top side, the target sides are: edge ① top side, edge ② top side, edge ③ bottom side, edge ④ bottom side, edge ⑤ bottom side, edge ⑥ bottom side, edge ⑦ top side, edge ⑧ top side, edge ⑨ top side, edge ⑩ top side, edge bottom, side Bottom side. Extend edge ① to edge After connection, two regions are obtained based on the target side, and the union of these two regions is the result region. By filling the result region with color, the dual-flame partial image shown in Figure 6 can be obtained.

[0054] Referring to Figure 9, the method for finding the intersection of two simplified polygon edges includes the following steps: Step 202) Incorporating the edges of the two simplified polygons into a search set; Step 204) Generating an envelope box for each edge in the search set; Step 206) Generating a scanning vertical line, starting from the leftmost envelope box, scanning to the right using the scanning vertical line until reaching the right boundary of the rightmost envelope box; Step 208) Generating an active list, incorporating the edge into the active list when the envelope box begins to contact the scanning vertical line, and removing the edge from the active list when the envelope box disengages from the scanning vertical line; Step 210) Incorporating two edges that are simultaneously in the active list and whose envelope boxes overlap into a search intersection list; Step 212) Obtaining the intersection of the two simplified polygon edges based on the search intersection list, wherein for overlapping edges, only the endpoints are considered as intersection points.

[0055] Please refer to Figure 10. The envelope boxes of edges a, b, c, and d are shown by the shaded areas in the figure, and edge c is an arc-shaped edge. The generated scanning vertical line starts from the left. When it touches the envelope box of edge a, edge a is added to the active list, and then the scanning vertical line continues to move to the right. When the scanning vertical line touches the envelope box of edge b, edge b is added to the active list. At this time, edges a and b exist in the active list simultaneously, and their envelope boxes overlap, so edges a and b are added to the intersection list. As the scanning vertical line continues to move to the right, it will lose contact with the envelope box of edge b, at which point edge b is removed from the active list. Then the scanning vertical line will touch the envelope box of edge c, and edge c is added to the active list. At this time, edges a and c exist in the active list simultaneously, and their envelope boxes overlap, so edges a and c are added to the intersection list. As the scanning vertical line continues to move to the right, the envelope box of edge a will lose contact with the scanning vertical line, and edge a is removed from the active list. The scanning vertical line will then touch the envelope of edge d, adding edge d to the active list. At this point, although edges c and d exist in the active list simultaneously, their envelopes do not overlap; therefore, edges c and d do not need to be added to the intersection list. The final intersection list contains edges a and b, and edges a and c. It is calculated that edges a and b have no intersection, while edges a and c have an intersection. Based on the intersection, edge a is split into a1 and a2, and edge c is split into c1 and c2, as shown in Figure 10.

[0056] On the other hand, in another embodiment, the method of traversing the edges of the two simplified polygons and annotating both sides of the edges with annotations indicating the inside and outside attributes of the two simplified polygons includes the steps of: adding the edges of the two simplified polygons to edge sets respectively, the two edge sets being paired sets, and the two simplified polygons being paired outlines; traversing the two edge sets respectively and annotating both sides of each edge in the edge set with annotations indicating the inside and outside attributes of the simplified polygon in which it is located; traversing the edges in the two edge sets that do not overlap with the edges in the paired sets respectively and annotating both sides of the edges with annotations indicating the inside and outside attributes of the paired outlines.

[0057] Referring to Figure 11, the method for traversing the edge set and annotating both sides of each edge in the edge set to indicate whether it is inside or outside the simplified polygon includes: Step 302) Determining the start point, end point, upper side, and lower side of the edge based on pre-configured start and end point rules; Step 304) Generating a scanning vertical line, starting from the leftmost edge of the start point, and scanning to the right using the scanning vertical line; Step 306) Generating an annotation list, triggering edge inclusion and edge removal events based on pre-configured event rules; Step 308) Sort the edge inclusion and edge removal events according to pre-configured sorting rules and then include them in the annotation list; Step 310) When there are two edges in the annotation list, determining the vertical position relationship between the two edges, and annotating both sides of the edge based on the vertical position relationship between the two edges and the pre-configured annotation rules.

[0058] The pre-configured event rules include: when the starting point intersects the scanning perpendicular line, an edge inclusion event is triggered to include the edge in the label list; when the ending point intersects the scanning perpendicular line, an edge removal event is triggered to remove the edge from the label list.

[0059] Methods for determining the vertical relationship between two sides include: determining the vertical position of the two sides according to the average y-value of the sides.

[0060] The pre-configured annotation rules include: labeling the bottom side of the lower edge as an external annotation and the top side as an internal annotation, and labeling the bottom side of the upper edge as an internal annotation and the top side as an external annotation. The internal annotation indicates the interior of the simplified polygon, and the external annotation indicates the exterior of the simplified polygon.

[0061] The pre-configured start and end point rules include: taking the left endpoint of a non-perpendicular edge as the start point and the right endpoint as the end point; taking the top endpoint of a vertical edge as the start point and the bottom endpoint as the end point; and considering the left side of a vertical edge as the top side and the right side as the bottom side.

[0062] Please refer to Figure 12. The generated scanning vertical line scans from left to right. Vertex A and vertex C will simultaneously come into contact with the scanning vertical line. The triggering order is as follows: Vertex A is the starting point of edge ① and also the starting point of edge ②, so the edge inclusion event of edge ① and edge ② will be triggered.

[0063] Vertex C is the endpoint of edge ② and the starting point of edge ③, thus triggering the edge removal event of edge ② and the edge inclusion event of edge ③.

[0064] Since the average y-value of edge ① is greater than that of edge ②, edge ① is above edge ②. Based on positional relationships, events triggered by the upper start and end points take precedence over those triggered by the lower start and end points; the inclusion event of edge ① is superior to the inclusion event of edge ②. Since the average y-value of edge ② is greater than that of edge ③, edge ② is above edge ③. The removal event of edge ② is superior to the inclusion event of edge ③.

[0065] Correspondingly, when the scanning perpendicular line contacts vertices B and D, vertex B is the endpoint of edge ① and the starting point of edge ④, thus triggering the edge removal event for edge ① and the edge inclusion event for edge ④. Vertex D is the endpoint of edge ③ and the endpoint of edge ④, thus triggering the edge removal event for edge ③ and the edge removal event for edge ④.

[0066] Since the average y-value of edge ① is greater than that of edge ④, edge ① is above edge ④. The event of edge ① being removed is more desirable than the event of edge ④ being added. Since the average y-value of edge ④ is greater than that of edge ③, edge ④ is above edge ③. The event of edge ④ being removed is more desirable than the event of edge ③ being removed.

[0067] The annotation list changes during the process as follows: → Edge ① inclusion event; → Edge ② inclusion event; → Trigger step 310), according to the annotation rules, an empty rectangle is marked below edge ②, and a solid rectangle is marked above edge ②. Correspondingly, a solid rectangle is marked below edge ①, and an empty rectangle is marked above edge ①; → Edge ② removal event; → Edge ③ inclusion event; → Trigger step 310), according to the annotation rules, an empty rectangle is marked below edge ③, and a solid rectangle is marked above edge ③; → Edge ① removal event; → Edge ④ inclusion event; → Trigger step 310), according to the annotation rules, edge ③ is below and edge ④ is above. Edge ③ has already been annotated, so an annotation opposite to that of edge ③ is added to edge ④. A solid rectangle is marked below edge ④, and an empty rectangle is marked above edge ④; → Edge ④ removal event; → Edge ③ removal event.

[0068] Complete the annotation of edges ① to ④.

[0069] On the other hand, in another implementation, the pre-configured sorting rules include: events triggered by the upper start and end points have priority over those triggered by the lower start and end points.

[0070] On the other hand, in another implementation, the pre-configured start and end point rules include: taking the left endpoint of a non-perpendicular edge as the start point and the right endpoint as the end point, taking the lower endpoint of a vertical edge as the start point and the upper endpoint as the end point, and considering the left side of a vertical edge as the upper side of the edge and the right side as the lower side of the edge.

[0071] The pre-configured sorting rules include: events triggered at the lower start and end points have priority over those triggered at the upper start and end points.

[0072] On the other hand, in another implementation, the method of filtering out target edges based on the annotation category and the Boolean operation includes: generating annotation codes representing annotations according to a pre-configured encoding order, with edges having the same annotation code as a category; generating the required annotation code range based on the Boolean operation, finding a category that matches the annotation code range, and taking all edges in the category as target edges.

[0073] On the other hand, in another embodiment, the method of connecting all the target edges to obtain the result region includes: randomly selecting a target edge, establishing a new chain, incorporating the target edge into the new chain, and repeatedly performing the following steps until all target edges are incorporated into the chain; randomly selecting a target edge from the target edges that have not been incorporated into the chain, and checking whether the target edge can be connected to an existing chain; when the target edge can be connected to an existing chain, incorporating the target edge into the corresponding chain; when the target edge cannot be connected to an existing chain, establishing a new chain, and incorporating the target edge into the new chain; when a chain incorporates a new target edge, checking whether the chain can be connected to other chains; if two chains can be connected, merging the two chains.

[0074] On the other hand, this disclosure provides an image rendering system based on Boolean operations on simplified polygons. The two simplified polygons to be subjected to the Boolean operation satisfy the following condition: when placed in the xoy rectangular coordinate system, excluding the vertical edges, the number of intersection points between the simplified polygons and any perpendicular line does not exceed two. Referring to Figure 13, the image rendering system includes: a placement module for placing the two simplified polygons to be subjected to the Boolean operation in the xoy rectangular coordinate system; a side-splitting module for finding and splitting the edges of the simplified polygons based on inflection points, finding the intersection points of the edges of the two simplified polygons, and splitting the edges of the simplified polygons again based on the intersection points; an annotation module for traversing the edges of the two simplified polygons and annotating both sides of the edges with annotations representing the internal and external attributes of the two simplified polygons; a filtering module for filtering out target edges and target sides based on the Boolean operation; and a region module for connecting all the target edges, obtaining a result region based on the target side, and filling the result with a pre-configured color.

[0075] The edge segmentation module includes: an inflection point edge segmentation submodule, used to find and segment the edges of the simplified polygon based on inflection points; and an intersection point edge segmentation submodule, used to find the intersection points of the edges of two simplified polygons and segment the edges of the simplified polygons again based on the intersection points. The intersection point edge segmentation submodule includes: an envelope unit, used to include the edges of the two simplified polygons into a search set and generate an envelope box for each edge in the search set; and a scanning unit, used to generate a scanning vertical line, starting from the leftmost envelope box and using the scanning vertical line to... The right scan continues until the right boundary of the rightmost envelope box is reached; an activity unit is used to generate an activity list, which includes the edge when the envelope box begins to contact the scanning vertical line, and removes the edge from the activity list when the envelope box loses contact with the scanning vertical line; an intersection unit is used to include two edges that are simultaneously in the activity list and whose envelope boxes overlap into a list to be intersected, and obtain the intersection point of the two simple polygon edges based on the list to be intersected, wherein only the endpoints of the overlapping edges are considered as intersection points.

[0076] On the other hand, in another embodiment, the annotation module includes: an edge set submodule, used to add the edges of the two simplified polygons to the edge sets respectively, the two edge sets being paired sets, and the two simplified polygons being paired outlines; a primary annotation submodule, used to traverse the two edge sets respectively, and annotate both sides of each edge in the edge set with annotations indicating whether it is inside or outside the simplified polygon; and a secondary annotation submodule, used to traverse the edges in the two edge sets that do not overlap with the edges in the paired sets respectively, and annotate both sides of the edges with annotations indicating whether it is inside or outside the outline.

[0077] On the other hand, in another implementation, the single-stage annotation submodule includes: a side-splitting unit, used to determine the start point, end point, and upper and lower sides of an edge based on pre-configured start-end side-splitting rules; a scanning unit, used to generate a scanning vertical line, starting from the leftmost edge of the start point and scanning to the right using the scanning vertical line; an event unit, used to generate an annotation list, and trigger edge inclusion and edge removal events based on pre-configured event rules; a sorting unit, used to sort the edge inclusion and edge removal events based on pre-configured sorting rules and then include them in the annotation list; and an annotation unit, used to determine the vertical position relationship between the two edges when there are two edges in the annotation list, and to annotate the annotations on both sides of the edge based on the vertical position relationship between the two edges and pre-configured annotation rules.

[0078] On the other hand, in another embodiment, the filtering module includes: an encoding submodule, used to generate annotation codes representing annotations according to a pre-configured encoding order, with edges having the same annotation code as a category; and a selection submodule, used to generate the required annotation code range based on the Boolean operation, find the category that matches the annotation code range, and use all edges in the category as target edges.

[0079] On the other hand, this disclosure provides an image drawing method based on Boolean operations of curved polygons, as shown in Figure 14, including the following steps: splitting the curved polygon into one or more simplified polygons; rewriting the Boolean operation based on the splitting of the curved polygon to obtain a Boolean operation sequence; performing the image drawing method based on Boolean operations of simplified polygons as described above on the initial Boolean operation of the Boolean operation sequence to obtain the result of the image drawing; when the result of the Boolean operation is not a simplified polygon, splitting the result of the Boolean operation into multiple simplified polygons and rewriting the Boolean operation sequence; repeating the previous step until the Boolean operation sequence only has a union operation remaining; performing the union operation to obtain the result of the image drawing.

[0080] On the other hand, in another embodiment, the method of splitting the arc-shaped polygon into one or more simplified polygons, as shown in Figure 14, includes the following steps: Step 402) Calculate all the horizontal turning points of the arc-shaped polygon; Step 404) Draw horizontal rays from each horizontal turning point into the interior of the arc-shaped polygon; Step 406) The intersection of the rays with the arc-shaped polygon and the line connecting the turning points constitutes a dividing line segment; Step 408) Divide the arc-shaped polygon based on all the dividing line segments.

[0081] On the other hand, in another implementation, the method of rewriting the Boolean operation based on the splitting of the arc-shaped polygon to obtain the Boolean operation sequence includes: rewriting the arc-shaped polygons included in the Boolean operation as the union operation of its simplified outline polygon, and establishing a blank Boolean operation sequence; expanding the rewritten Boolean operation, selecting the non-union Boolean operations in sequence, adding them to the Boolean operation sequence, and finally adding the remaining union Boolean operations to the Boolean operation sequence.

[0082] On the other hand, this disclosure provides an image drawing system based on Boolean operations of curved polygons, as shown in Figure 15, comprising: a splitting module for splitting curved polygons into one or more simplified polygons; a rewriting module for rewriting the Boolean operations based on the splitting of the curved polygons to obtain a Boolean operation sequence; a simplified operation module for performing the image drawing method based on simplified polygon Boolean operations as described above on the initial Boolean operation of the Boolean operation sequence to obtain the result of the image drawing; when the result of the Boolean operation is not a simplified polygon, splitting the result of the Boolean operation into multiple simplified polygons and rewriting the Boolean operation sequence; a looping module for repeating the previous step until the Boolean operation sequence is reduced to only a union operation; and a merging module for performing the union operation to obtain the result of the image drawing.

[0083] On the other hand, in another embodiment, the splitting module includes: an inflection point calculation submodule, used to calculate all the inflection points of the arc-shaped polygon; a ray submodule, used to draw horizontal rays from each inflection point into the interior of the arc-shaped polygon; an intersection point submodule, used to form dividing line segments by connecting the intersection points of the rays with the arc-shaped polygon and the inflection points; and a segmentation submodule, used to segment the arc-shaped polygon based on all the dividing line segments.

[0084] On the other hand, this disclosure provides an image drawing method based on polygon Boolean operations, including the steps of: using the aforementioned polygon Boolean operation method with arcs to obtain the result of the polygon Boolean operation, and filling the result with a pre-configured color.

[0085] On the other hand, this disclosure provides an image drawing system based on polygon Boolean operations, as shown in Figure 16, including: a Boolean operation module for obtaining the result of polygon Boolean operations using the aforementioned curved polygon Boolean operation method; and a color filling module for filling a pre-configured color based on the result.

[0086] Please refer to Figure 17, which shows a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure.

[0087] As shown in Figure 17, the electronic device 1100 may include: at least one processor 1101, at least one network interface 1104, a user interface 1103, a memory 1105, and at least one communication bus 1102. The communication bus 1102 can be used to connect and communicate with the aforementioned components. The user interface 1103 may include buttons, and optionally may include standard wired or wireless interfaces. The network interface 1104 may include, but is not limited to, a Bluetooth module, an NFC module, or a Wi-Fi module. The processor 1101 may include one or more processing cores. The processor 1101 connects to various parts within the electronic device 1100 using various interfaces and lines, and executes various functions of the routing device 1100 and processes data by running or executing instructions, programs, code sets, or instruction sets stored in the memory 1105, and by calling data stored in the memory 1105. Optionally, the processor 1101 may be implemented using at least one hardware form of DSP, FPGA, or PLA. The processor 1101 may integrate one or more combinations of CPU, GPU, and modem. The CPU primarily handles the operating system, user interface, and applications; the GPU is responsible for rendering and drawing the content that the display screen needs to show; and the modem is used for wireless communication.

[0088] It is understandable that the aforementioned modem may not be integrated into the processor 1101, but may be implemented using a separate chip.

[0089] The memory 1105 may include RAM or ROM. Optionally, the memory 1105 may include a non-transitory computer-readable medium. The memory 1105 may be used to store instructions, programs, code, code sets, or instruction sets. The memory 1105 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as touch function, sound playback function, image playback function, etc.), instructions for implementing the above-described method embodiments, etc.; the data storage area may store data involved in the above-described method embodiments, etc. Optionally, the memory 1105 may also be at least one storage device located remotely from the aforementioned processor 1101. As a computer storage medium, the memory 1105 may include an operating system, a network communication module, a user interface module, and application programs. The processor 1101 may be used to call the application programs stored in the memory 1105 and execute the methods in one or more of the above embodiments.

[0090] This disclosure also provides a computer-readable storage medium storing instructions that, when executed on a computer or processor, cause the computer or processor to perform one or more steps in the above embodiments. If the constituent modules of the above-described electronic device are implemented as software functional units and sold or used as independent products, they can be stored in the computer-readable storage medium.

[0091] This disclosure also provides a computer program product, including a computer program that, when executed by a processor, implements one or more steps in the above embodiments.

[0092] Where there is no conflict, the technical features in this embodiment and implementation scheme can be combined arbitrarily.

[0093] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this disclosure are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in or transmitted through a computer-readable storage medium. The computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium accessible to a computer or a data storage device such as a server or data center that integrates one or more available media. The available media may be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., digital versatile discs (DVDs)), or semiconductor media (e.g., solid-state drives (SSDs)).

[0094] When implemented through hardware or firmware, the aforementioned method flow is programmed into the hardware circuit to obtain the corresponding hardware circuit structure and achieve the corresponding function. For example, a Programmable Logic Device (PLD) (such as a Field Programmable Gate Array (FPGA)) is such an integrated circuit, whose logic function is determined by the user programming the device. Designers can program a digital system onto a PLD themselves, eliminating the need for chip manufacturers to design and fabricate dedicated integrated circuit chips. Furthermore, nowadays, instead of manually fabricating integrated circuit chips, this programming is mostly implemented using "logic compiler" software, similar to the software compiler used in program development. The original code before compilation must also be written in a specific programming language, called a Hardware Description Language (HDL). There is not just one HDL, but many. Those skilled in the art should understand that by simply performing some logic programming on the method flow using one of the aforementioned hardware description languages ​​and programming it into an integrated circuit, the hardware circuit implementing the logic method flow can be easily obtained.

[0095] The embodiments described above are merely preferred embodiments of this disclosure and are not intended to limit the scope of this disclosure. Any modifications and improvements made by those skilled in the art to the technical solutions of this disclosure without departing from the spirit of this disclosure shall fall within the protection scope defined by the claims of this disclosure.

Claims

1. An image drawing method based on Boolean operations on simplified polygons, wherein the two simplified polygons to be subjected to Boolean operations satisfy the following condition: when placed in an xoy rectangular coordinate system, excluding the perpendicular sides, the number of intersection points between the simplified polygons and any perpendicular line does not exceed two. The image drawing method includes the following steps: Place the two simplified polygons to be subjected to Boolean operations in the xoy rectangular coordinate system; Find and split the edges of the simplified polygon based on the inflection point, find the intersection point of the edges of two simplified polygons, and split the edges of the simplified polygon again based on the intersection point; Traverse the edges of the two simplified polygons and annotate both sides of the edges with comments representing the interior and exterior attributes of the two simplified polygons; The target edge and target side are filtered out based on the Boolean operation; Connect all the target edges, obtain the result region based on the target edges, and fill the result region with a pre-configured color.

2. The image drawing method based on Boolean operations of simplified polygons according to claim 1, The method for finding the intersection point of the sides of two simple polygons includes the following steps: Include the edges of the two simplified polygons in the search set; Generate an envelope box for each edge in the search set; Generate a scanning vertical line, starting from the leftmost envelope box, and scan to the right using the scanning vertical line until the right boundary of the rightmost envelope box is reached; An activity list is generated. When the envelope box begins to contact the scanning vertical line, the edge is added to the activity list. When the envelope box loses contact with the scanning vertical line, the edge is removed from the activity list. Two sides that are both in the activity list and whose envelope boxes overlap are included in the list of intersections to be found. Based on the list of intersections to be determined, the intersection points of the edges of two simple polygons are obtained, wherein the endpoints of the overlapping edges are considered as intersection points only.

3. The image drawing method based on Boolean operations of simplified polygons according to claim 1, The method for traversing the edges of two simplified polygons and annotating both sides of the edges with annotations representing the interior and exterior attributes of the two simplified polygons includes the following steps: The edges of the two simplified polygons are added to the edge set respectively, the two edge sets are paired sets, and the two simplified polygons are paired outlines; Traverse both edge sets separately and annotate both sides of each edge in the edge set with annotations indicating whether it is inside or outside the simplified polygon in which it is located; Traverse each of the two edge sets that do not overlap with the edges of the opposite set, and label both sides of the edge to indicate whether it is inside or outside the outline.

4. The image drawing method based on Boolean operations of simplified polygons according to claim 3, The method for traversing the edge set and annotating both sides of each edge in the edge set with annotations indicating whether it is inside or outside the polygonal outline is as follows: Based on pre-configured start and end point rules, determine the start point, end point, upper side, and lower side of the edge; Generate a scanning vertical line, starting from the leftmost edge of the starting point, and scan to the right using the scanning vertical line; Generate a list of annotations and trigger edge inclusion and edge removal events based on pre-configured event rules; Based on pre-configured sorting rules, the edge inclusion events and edge removal events are sorted and then included in the annotation list; When the annotation list has two sides, determine the vertical position relationship between the two sides, and annotate the annotations on both sides of the side based on the vertical position relationship between the two sides and the pre-configured annotation rules. in, Pre-configured event rules include: When the starting point intersects the scanning perpendicular line, an edge inclusion event is triggered to include the edge in the label list; when the ending point intersects the scanning perpendicular line, an edge removal event is triggered to remove the edge from the label list. Methods for determining the vertical relationship between two sides include: Determine the vertical position of the two sides based on the average y-value of the sides; Pre-configured annotation rules include: The bottom side of the lower edge is labeled as an external annotation and the top side as an internal annotation, and the bottom side of the upper edge is labeled as an internal annotation and the top side as an external annotation. The internal annotation indicates the interior of the simplified polygon, and the external annotation indicates the exterior of the simplified polygon.

5. The image drawing method based on Boolean operations of simplified polygons according to claim 4, Pre-configured start and end point rules include: For non-perpendicular edges, the left endpoint is taken as the starting point and the right endpoint as the ending point. For perpendicular edges, the top endpoint is taken as the starting point and the bottom endpoint as the ending point. The left side of a perpendicular edge is considered the top side of the edge, and the right side is considered the bottom side of the edge. The pre-configured sorting rules include: Events triggered by the upper starting and ending points have priority over those triggered by the lower starting and ending points. or, Pre-configured start and end point rules include: Take the left endpoint of the non-perpendicular edge as the start point and the right endpoint as the end point. Take the bottom endpoint of the perpendicular edge as the start point and the top endpoint as the end point. The left side of the perpendicular edge is considered the top side of the edge, and the right side is considered the bottom side of the edge. The pre-configured sorting rules include: Events triggered at the lower starting and ending points take precedence over those triggered at the upper starting and ending points.

6. The image drawing method based on Boolean operations of simplified polygons according to any one of claims 1 to 5, The method for filtering target edges based on the annotation classification of all edges and the Boolean operation includes: Annotation codes representing annotations are generated according to a pre-configured encoding order, and edges with the same annotation codes are classified as a single category. Based on the Boolean operation, the required annotation encoding range is generated, and a category that matches the annotation encoding range is found. All edges in the category are used as target edges.

7. The image drawing method based on Boolean operations of simplified polygons according to any one of claims 1 to 5, The method for connecting all the target edges to obtain the result region includes: Choose any target edge, create a new chain, and incorporate the target edge into the new chain. Repeat the following steps until all target edges are incorporated into the chain. Select any target edge from those that have never been included in the chain and check whether the target edge can be connected to an existing chain. When the target edge can be connected to an existing chain, the target edge is included in the corresponding chain; when the target edge cannot be connected to an existing chain, a new chain is established and the target edge is included in the new chain. When a chain is added to a new target edge, check if the chain can be connected to other chains. If the two chains can be connected, merge the two chains.

8. An image rendering system based on Boolean operations on simplified polygons, wherein the two simplified polygons to be subjected to Boolean operations satisfy the following condition: when placed in an xoy rectangular coordinate system, excluding the perpendicular sides, the number of intersection points between the simplified polygons and any perpendicular line does not exceed two; the image rendering system comprises: A placement module is used to place the two simplified polygons to be subjected to Boolean operations in the xoy rectangular coordinate system; The edge splitting module is used to find and split the edges of the simplified polygon based on the inflection point, find the intersection point of the edges of two simplified polygons, and split the edges of the simplified polygon again based on the intersection point. The annotation module is used to traverse the edges of the two simplified polygons and annotate both sides of the edges with annotations representing the internal and external attributes of the two simplified polygons. The filtering module is used to filter out the target edge and target side based on the Boolean operation; A region module is used to connect all the target edges, obtain a result region based on the target edges, and fill the result region with a pre-configured color.

9. The image rendering system based on Boolean operations of simplified polygons according to claim 8, The side-splitting module includes: The inflection point edge segmentation submodule is used to find and segment the edges of the simplified polygon based on inflection points; The intersection point edge splitting submodule is used to find the intersection point of the edges of two simplified polygons, and then split the edges of the simplified polygons again based on the intersection point; The intersection point edge-splitting submodule includes: An envelope unit is used to include the edges of the two simplified polygons into a search set, and to generate an envelope box for each edge in the search set. The scanning unit is used to generate a scanning vertical line, starting from the leftmost envelope box and scanning to the right using the scanning vertical line until the right boundary of the rightmost envelope box is reached. An activity unit is used to generate an activity list. When the envelope box begins to contact the scanning vertical line, the edge is added to the activity list, and when the envelope box loses contact with the scanning vertical line, the edge is removed from the activity list. The intersection unit is used to include two sides that are simultaneously in the activity list and whose envelope boxes overlap into the intersection list. Based on the intersection list, the intersection point of the two simple polygonal sides is obtained, wherein the endpoints of the overlapping sides are only considered as intersection points.

10. The image rendering system based on Boolean operations of simplified polygons according to claim 8 or 9, The annotation module includes: The edge set submodule is used to add the edges of the two simplified polygons to the edge set respectively, the two edge sets are paired sets, and the two simplified polygons are paired outlines; The first annotation submodule is used to traverse the two edge sets respectively and annotate both sides of each edge in the edge set to indicate the inside and outside of the simplified polygon in which it is located; The secondary annotation submodule is used to traverse the edges in the two edge sets that do not overlap with the edges in the opposite set, and to annotate both sides of the edges to indicate whether they are inside or outside the outline.

11. The image rendering system based on Boolean operations of simplified polygons according to claim 10, The primary annotation submodule includes: The side division unit is used to determine the start point, end point, upper side, and lower side of an edge based on pre-configured start and end side division rules. A scanning unit is used to generate a scanning vertical line, starting from the leftmost edge of the starting point and scanning to the right using the scanning vertical line; Event units are used to generate a list of annotations and trigger edge inclusion and edge removal events based on pre-configured event rules. The sorting unit is used to sort the edge inclusion events and edge removal events according to the pre-configured sorting rules and then include them in the label list; The annotation unit is used to determine the vertical position relationship between the two sides when the annotation list has two sides, and to annotate the annotations on both sides of the side based on the vertical position relationship between the two sides and the pre-configured annotation rules.

12. The image rendering system based on Boolean operations of simplified polygons according to claim 8 or 9, The filtering module includes: The encoding submodule is used to generate annotation codes representing annotations according to a pre-configured encoding order, with edges having the same annotation code belonging to a category; A submodule is selected to generate the required annotation encoding range based on the Boolean operation, find the category that matches the annotation encoding range, and use all edges in the category as target edges.

13. An image drawing method based on Boolean operations on polygons with arcs, including the following steps: Split the curved polygon into one or more simplified polygons; Based on the splitting of the arc-shaped polygon, the Boolean operation is rewritten to obtain a Boolean operation sequence; The image drawing method based on simplified polygon Boolean operation as described in any one of claims 1 to 5 is executed for the initial Boolean operation of the Boolean operation sequence to obtain the result of the image drawing. When the result of the Boolean operation is not a simplified polygon, the result of the Boolean operation is split into multiple simplified polygons and the Boolean operation sequence is rewritten. Repeat the previous step until only the union operation remains in the Boolean operation sequence; Perform the union operation to obtain the result of the image rendering.

14. The image drawing method based on Boolean operations of an arc-shaped polygon according to claim 13, The method for splitting an arc-shaped polygon into one or more simplified polygons includes the following steps: Calculate all the transverse inflection points of the arc-shaped polygon; Starting from each horizontal turning point, draw horizontal rays into the interior of the arc-shaped polygon; The line connecting the intersection of the ray with the arc-shaped polygon and the inflection point forms a dividing line segment; The arc-shaped polygon is segmented based on all segmentation line segments.

15. The image drawing method based on Boolean operations of an arc-shaped polygon according to claim 13, The method for rewriting the Boolean operations based on the segmentation of the arc-shaped polygon to obtain the Boolean operation sequence includes: Rewrite the curved polygons included in the Boolean operation as union operations of their simplified polygons, and establish a blank Boolean operation sequence; Expand the rewritten Boolean operations, select non-union Boolean operations in sequence, add them to the Boolean operation sequence, and finally add the remaining union Boolean operations to the Boolean operation sequence.

16. An image rendering system based on Boolean operations with arc polygons, including: The split module is used to split an arc-shaped polygon into one or more simplified polygons; A rewrite module is used to rewrite the Boolean operation based on the splitting of the arc-shaped polygon to obtain a Boolean operation sequence; The simplified polygon operation module is used to execute the image drawing method based on simplified polygon Boolean operation as described in any one of claims 1 to 5 for the initial Boolean operation of the Boolean operation sequence, to obtain the result of the image drawing, and when the result of the Boolean operation is not a simplified polygon, to split the result of the Boolean operation into multiple simplified polygons and to rewrite the Boolean operation sequence; The loop module is used to repeat the previous step until only the union operation remains in the Boolean operation sequence; The merging module is used to perform the union operation to obtain the result of the image rendering.

17. The image rendering system based on Boolean operations with arc polygons according to claim 16, The splitting module includes: The inflection point calculation submodule is used to calculate and obtain all the inflection points of the arc-shaped polygon; The ray submodule is used to sequentially draw horizontal rays from each inflection point into the interior of the arc-shaped polygon; The intersection submodule is used to form dividing line segments by connecting the intersection points of the ray and the arc-shaped polygon and the inflection points. The segmentation submodule is used to segment the arc-shaped polygon based on all segmentation line segments.

18. Electronic devices, including processors and memory; The processor is connected to the memory; The memory is used to store executable program code; The processor runs a program corresponding to the executable program code stored in the memory to perform the method as described in any one of claims 1-7 and 13-15.

19. A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method as claimed in any one of claims 1-7, 13-15.

20. A computer program product comprising a computer program that, when executed by a processor, implements the method as claimed in any one of claims 1-7, 13-15.

Citation Information

Patent Citations

  • Vector graph filling method

    CN112200886A

  • Large-scale graph simplification method for polygon with arcs

    CN118133759A

  • Image drawing method and system based on profile polygon Boolean operation

    CN118781224A

Cited By

  • Unidirectional scanning method and device, storage medium and simulation method

    CN121615594A