Automatic hole digging and filling method and device for drawing and storage medium
By automatically identifying the minimum bounding box and center point of geometric elements, generating and filling the cut-out area, the problem of low efficiency and poor accuracy in BIM model drawing output is solved, and efficient and accurate automatic drawing filling is achieved.
Patent Information
- Application Number
- CN202610327905.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-03-18
- Publication Date
- 2026-04-17
AI Technical Summary
In existing technologies, the filling process for BIM model drawing production relies on traditional manual operations, resulting in low efficiency and poor accuracy, making it difficult to meet the timeliness requirements and professional requirements of large-scale engineering projects.
By automatically identifying the minimum bounding box and geometric center point of geometric elements, determining the element relationships, generating and filling the punched area, and combining tree control and mapping hash table to achieve automated filling.
It significantly improves the efficiency and accuracy of drawing complex structures, ensuring the professionalism and readability of the drawings.
Smart Images

Figure CN121883652A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of drawing technology, specifically to an automatic hole-filling method, device, and storage medium for drawings. Background Technology
[0002] With the continuous expansion of airport construction and the deep integration and application of BIM technology, "one-click drawing generation" based on BIM models has become a core component of digital and intelligent design for airport projects. It enables integrated linkage between design data and drawing results, significantly improving design efficiency and the standardization of deliverables. In the drawing generation process for airport pavements, aprons, and other structures, closed areas of different structural layers and functional zones need to be filled with patterns or colors to clearly distinguish component attributes, thicknesses, and functional uses. This is a crucial aspect of drawing representation.
[0003] However, in existing technologies, the filling process for BIM model output still relies on traditional manual operation: designers need to manually identify the boundaries of each closed area, perform hole-cutting processing (i.e., remove the blank parts corresponding to the hole components in the area), and then select the filling pattern, set the filling parameters, and complete the filling block by block. This method has significant drawbacks: First, it is inefficient. Airport engineering drawings contain a large number of complex and dense closed areas and hole structures. Manually processing each area requires a lot of time and is difficult to adapt to the timeliness requirements of large-scale engineering output. Second, it is inaccurate. Manual operation is prone to omissions in filling, incomplete hole processing, or deviations in the filling range due to visual fatigue and misjudgment, affecting the professionalism and readability of the drawings.
[0004] Existing automatic fill tools are mostly limited to basic single-area filling, making it difficult to solve the problems of filling efficiency and accuracy in complex engineering scenarios. Summary of the Invention
[0005] In view of this, the purpose of the present invention is to provide an automatic hole-filling method and device for drawings, so as to solve the problems of low efficiency and insufficient accuracy in the prior art for filling drawings.
[0006] According to a first aspect of the present invention, an automatic hole-filling method for drawings is provided, comprising:
[0007] Automatically read all visible geometric elements from the drawing to be filled, obtain the ItemType instance data corresponding to each geometric element, and calculate the minimum bounding box of each geometric element; Group geometric elements with the same ItemType instance data into one category, and set the color and fill style for each category of geometric elements; Based on the minimum bounding box and geometric center point of the geometric element, determine in turn whether the geometric element is an internal element of another geometric element; If so, then based on the outer edges of these two geometric elements, generate the cutout area for the outer geometric element; The inner edge of the closed line of the geometric element that does not have a hole area is used as the filling area, and the hole area of the geometric element that has a hole area is used as the filling area. Based on the color and fill style corresponding to each geometric element, the fill area is filled to generate a completed drawing.
[0008] Preferably, geometric elements with the same ItemType instance data are grouped into one category, and the color and fill style corresponding to each category of geometric elements are set, including: The ItemType instance data of the geometric element includes the library name, type name, attribute name, and attribute value; Based on the ItemType instance data of all geometric elements, construct a tree control that lists the elements hierarchically, with the first-level node being the library name, the second-level node being the type name, and the third-level node being the attribute name. Obtain the user's check mark command on the tree control, combine the attribute values of the node selected by the check mark command, and treat each combination as a set of elements; Set the color and fill style for each type of element collection; Place the geometric elements that meet the conditions into the corresponding element set.
[0009] Preferably, based on the minimum bounding box and geometric center point of the geometric element, it is sequentially determined whether a geometric element is an interior element of another geometric element, including: Read the unique element ID of each geometry element; The element ID, attribute value, minimum bounding box, and geometric center point of each geometric element are combined into a quadruple; Choose any two geometric elements as a quadruple and designate them as the first and second geometric elements respectively. If there exists a minimum bounding box of the first geometric element that is inside the minimum bounding box of the second geometric element, and the geometric center of the first geometric element is inside the outer edge of the second geometric element, then the first geometric element is an internal element of the second geometric element.
[0010] Preferably, before filling the fill area of each geometric element, the method further includes: Obtain the user's preview checkbox instruction on the tree control, and determine the geometric element to be previewed based on the preview checkbox instruction; Create a memory-level temporary model, the lifecycle of which is bound to the preview window; Generate geometric elements to be previewed in the memory-level temporary model; Based on the color and fill style corresponding to the geometric element, a fill preview image of the geometric element is generated in the memory-level temporary model; A preview window for the memory-level temporary model is generated.
[0011] Preferably, when filling the filling area of each geometric element, the method further includes: Establish a hash table mapping the attribute values of each type of geometric element to its color and fill style; The filling area of each geometric element is filled according to the mapping hash table.
[0012] Preferably, after generating the filled-in drawing, the following steps are also included: Generate a fill legend for each type of geometric element. The fill legend includes the color and fill style displayed as a pattern, as well as the ItemType instance data of the geometric element corresponding to the pattern.
[0013] Preferably, the method further includes: Read the populate resource file based on the populate resource path entered by the user; List all fill styles based on the read fill resource file; Based on the target fill style and color selected by the user, a rectangle is generated in the memory-level temporary model, and the selected target fill style and color are filled in the rectangle. A preview window for the memory-level temporary model is generated.
[0014] Preferably, setting the color and fill style corresponding to each type of geometric element also includes: Based on the user's settings, set the color and fill style for the selected geometric elements; For unselected geometric elements, randomly set different colors and fill styles than those of the selected geometric elements.
[0015] According to a second aspect of the present invention, an automatic hole-filling device for drawings is provided, comprising: The main controller, and the memory connected to the main controller; The memory stores program instructions; The main controller is used to execute program instructions stored in the memory and perform any of the methods described above.
[0016] According to a third aspect of the present invention, a computer-readable storage medium is provided, which stores a computer program that, when executed by a processor, implements the method described in any of the preceding claims.
[0017] The technical solution provided by this invention may include the following beneficial effects: It is understood that the technical solution presented in this invention can automatically read each visible geometric element from the drawing to be filled, obtain the corresponding ItemType instance data, and calculate the minimum bounding box; classify the geometric elements according to the instance data, and set the color and fill style for each category; determine whether a geometric element is an internal element of another geometric element based on the minimum bounding box and the geometric center point; if so, generate a cutout area for the external geometric element; and fill the fill area or cutout area of the geometric element according to the color and fill style to generate a filled drawing. It is understood that this technical solution, by jointly identifying the cutout area using the minimum bounding box and the geometric center point, achieves high recognition accuracy; during filling, it can quickly fill according to the color and fill style corresponding to the geometric element, significantly improving the drawing efficiency of complex structures.
[0018] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit the invention. Attached Figure Description
[0019] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0020] Figure 1 This is a schematic diagram illustrating the steps of an automatic hole-filling method for drawings according to an exemplary embodiment; Figure 2 This is a schematic diagram of an automatic classification process according to an exemplary embodiment; Figure 3 This is a schematic diagram of a hole filling process according to an exemplary embodiment; Figure 4 This is a schematic diagram of a filled illustration according to an exemplary embodiment; Figure 5 This is a preview diagram of a fill style according to an exemplary embodiment; Figure 6 This is a schematic diagram of a closed edge line according to an exemplary embodiment; Figure 7 This is an example of an information summary representation. Figure 8 This is a schematic diagram illustrating the filling effect according to an exemplary embodiment. Detailed Implementation
[0021] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Rather, they are merely examples of apparatuses and methods consistent with some aspects of the invention as detailed in the appended claims.
[0022] In one embodiment, Figure 1 This is a schematic diagram illustrating the steps of an automatic hole-filling method for drawings according to an exemplary embodiment. See also... Figure 1 A method for automatically filling holes in drawings is provided, including: Step S11: Automatically read all visible geometric elements from the drawing to be filled, obtain the ItemType instance data corresponding to each geometric element, and calculate the minimum bounding box of each geometric element.
[0023] The drawing to be filled can be a DGN / DWG drawing. In practice, taking an airport passage as an example, the drawing to be filled can be a BIM output model of the airport passage, which contains a complete geometric representation, ItemType instance data of each geometric element, and a layer mapping table.
[0024] Additionally, if the drawing to be filled does not contain ItemType instance data, the ItemType instance data corresponding to each element can be extracted from the external database or the MS_ItemType library.
[0025] The ItemType instance data of the geometric element includes the library name LibName, the type name TypeName, the property name PropertyName, and the property value PropertyValue.
[0026] It also calculates the minimum bounding box (or 3D convex hull) for each geometric element, providing basic geometric and attribute data support for subsequent attribute-based filling and identification of inner and outer edges (holes).
[0027] Preferably, since the data formats of ItemType instance data stored from different external databases or the MS_ItemType library may be different, ItemType instance data of all data formats can be read and converted into a standard format recognized by the algorithm through CustomItemHost (a tool in Bentley ORD software specifically used to parse and read ItemType data formats), so as to avoid omissions or misreadings due to format confusion during subsequent classification.
[0028] Step S12: Group geometric elements with the same ItemType instance data into one category, and set the color and fill style for each category of geometric elements.
[0029] This step iterates through all visible geometric elements read from the DGN / DWG drawing, groups elements containing the same ItemType instance data into the same category, and then sets exclusive colors, fill patterns, proportions, angles, and other fill styles for each category of elements according to the drawing template and the predefined ItemType correspondence rules in the fill style library. This provides a clear and standardized foundation for subsequent automated hole filling or solid filling.
[0030] Step S13: Based on the minimum bounding box and geometric center point of the geometric element, determine in turn whether the geometric element is an internal element of another geometric element.
[0031] This step determines whether a nesting relationship exists between two geometric elements. If so, the outer geometric element needs to be processed to create a hole. The determination is based on the minimum bounding box and the geometric center point of the geometric elements. First, by using the minimum bounding box of the geometric elements, it can be determined whether the minimum bounding box of the inner element is completely inside the minimum bounding box of the outer geometric element. If so, the geometric center point of the inner element is obtained, and it is verified whether the geometric center point is located within the actual geometry of the outer geometric element. Only when both conditions are met can the element be determined to be an inner element of the outer edge element (i.e., the hole boundary), providing accurate boundary identification for subsequent hole filling.
[0032] Step S14: If yes, then generate the cutout area of the outer geometric element based on the outer edges of the two geometric elements.
[0033] Assuming the internal geometric element is a window and the external geometric element is a wall, the outer edge of the wall is taken as the outer edge of the cut-out area, and the outer edge of the window is taken as the inner edge of the cut-out area. This gives us the annular cut-out area of the external geometric element, providing a precise boundary range for subsequent pattern filling and elimination of internal hole areas.
[0034] Step S15: Use the inner edge of the closed line of the geometric element that does not have a hole area as the filling area, and use the hole area of the geometric element that has a hole area as the filling area.
[0035] If a geometric element has a corresponding cutout area, that cutout area is used as the fill area for the subsequent pattern. For example, if a rectangular geometric element is a wall and has no other geometric elements inside, indicating that there are no windows or similar elements on the wall, then when filling this geometric element later, all of its internal areas need to be filled. Therefore, the area inside its outer edge closed line is used as the fill area. If a rectangular geometric element is a wall and has another rectangular geometric element inside that is a window, the annular cutout area of the wall is obtained through step S14. This annular cutout area excludes the window area. Therefore, when filling this geometric element later, its annular cutout area needs to be filled with the color and fill style corresponding to the wall, while the window area needs to be filled with the color and fill style corresponding to the window.
[0036] Step S16: Fill the area of each geometric element according to its corresponding color and fill style to generate a filled drawing.
[0037] It is understood that the technical solution shown in this embodiment can automatically read each visible geometric element from the drawing to be filled, obtain the corresponding ItemType instance data, and calculate the minimum bounding box; classify the geometric elements according to the instance data, and set the color and fill style for each category; determine whether a geometric element is an internal element of another geometric element based on the minimum bounding box and the geometric center point; if so, generate a cutout area for the external geometric element; and fill the fill area or cutout area of the geometric element according to the color and fill style to generate a filled drawing. It is understood that this technical solution, by jointly identifying the cutout area using the minimum bounding box and the geometric center point, achieves high recognition accuracy; during filling, it can quickly fill according to the color and fill style corresponding to the geometric element, significantly improving the drawing efficiency of complex structures.
[0038] In a preferred embodiment, see Figure 2 This groups geometric elements with the same ItemType instance data into one category and sets the color and fill style for each category, including: Based on the ItemType instance data of all geometric elements, construct a tree control that lists elements hierarchically, with the first-level node being the library name, the second-level node being the type name, and the third-level node being the attribute name; obtain the user's check mark command on the tree control, combine the attribute values under the node selected by the check mark command, and each combination is taken as a type of element set; set the color and fill style for each type of element set; and place the geometric elements that meet the conditions into the corresponding element set.
[0039] This embodiment uses the ItemType instance data of all read geometric elements to construct a three-level tree control in the software interface (first level is LibName, second level is TypeName, and third level is PropertyName). After the user selects a target node, the system extracts the PropertyValue attribute values under the selected node and combines them. Each combination corresponds to a set of elements. Then, according to the predefined rules of the drawing template and fill style library, a unique color, fill pattern, scale, angle and other styles are set for each set. Finally, the geometric elements with the corresponding attribute value combination are accurately classified into their respective sets, laying the classification foundation for subsequent automated filling.
[0040] For example, the user selects the attribute names "Door" and "Size"; the attribute values under "Door" are "Iron Door" and "Wooden Door". The attribute values under "Size" are "50cm" and "80cm". After combining the above two attribute names, four types of geometric elements with attribute values will appear: 50cm Iron Door, 80cm Iron Door, 50cm Wooden Door, and 80cm Wooden Door. Different colors and fill patterns are set for the geometric elements of each type of attribute value.
[0041] In a preferred embodiment, see Figure 3 Based on the minimum bounding box and geometric center point of each geometric element, determine in turn whether each geometric element is an interior element of another geometric element, including: Read the unique element ID of each geometric element; combine the element ID, attribute value, minimum bounding box, and geometric center point of each geometric element into a quadruple; arbitrarily select two quadruples of geometric elements and set them as the first geometric element and the second geometric element, respectively; if the minimum bounding box of the first geometric element is inside the minimum bounding box of the second geometric element, and the geometric center point of the first geometric element is inside the outer edge of the second geometric element, then the first geometric element is an internal element of the second geometric element.
[0042] In practice, this step reads the unique ElementID of each geometric element, and then integrates this ID with the element's ItemType attribute value (ItemTypeValue), minimum bounding box (Range), and geometric center point (Centroid) into a quadruple. Subsequently, two quadruples are arbitrarily selected as the first and second geometric elements, respectively. The ContainsXY function is used to determine whether the minimum bounding box of the first geometric element is inside the minimum bounding box of the second geometric element. At the same time, the PointInOnOutXY function is used to verify whether the geometric center point of the first geometric element is actually inside the outer edge of the second geometric element. Only when both conditions are met can it be determined that the first geometric element is an internal element of the second geometric element, providing an accurate basis for the subsequent generation of the cut-out area.
[0043] Next, record the IDs of all pairs of geometric elements that satisfy the above conditions, and calculate the annular cutout region. For geometric elements on the outside, use the resulting annular cutout region as the fill region. After traversing all geometric elements, the remaining geometric elements that do not form a ring indicate that the entire area within their edges needs to be filled, so the area inside their outer edge closure line is used as the fill region.
[0044] In a preferred embodiment, before filling the fill area of each geometric element, the method further includes: Obtain the user's preview checkbox instruction on the tree control, and determine the geometric element to be previewed based on the preview checkbox instruction; create a memory-level temporary model, the lifecycle of which is bound to the preview window; generate the geometric element to be previewed in the memory-level temporary model; generate a fill preview image of the geometric element in the memory-level temporary model based on the color and fill style corresponding to the geometric element; and generate a preview window for the memory-level temporary model.
[0045] In practical application, the technical solution of this embodiment first obtains the preview command selected by the user on the three-level tree control to determine the geometric elements to be previewed. Then, CreateDgnModel() is called to create a memory-level temporary model (named according to the TempFill_Preview {GUID} rule, with its lifecycle bound to the preview window, and automatically recycled upon exit). The geometric elements to be previewed are generated in this temporary model. Then, based on the preset fill styles such as color, fill pattern, proportion, and angle of the element's category, the AsAreaFillPropertiesEdit function is used to complete the fill processing and generate a preview image. Finally, a preview window is generated and the temporary model is mounted in it to achieve real-time visualization of the fill effect.
[0046] Preferably, after previewing, if the user approves the fill effect, they can send a confirmation command. After receiving the confirmation command, the system will then perform the subsequent fill operation.
[0047] In a preferred embodiment, when filling the filling area of each geometric element, the method further includes: establishing a mapping hash table of attribute values, colors, and filling styles for each type of geometric element; and filling the filling area of each geometric element according to the mapping hash table.
[0048] In practice, this embodiment reads the predefined drawing template, fill style library, and configuration table ItemTypeFillMap.xml, extracts the ItemType instance data of various geometric elements (including LibName, TypeName, PropertyName, and PropertyValue combinations), and associates them with the corresponding fill parameters (including color, fill pattern name, scale, angle, line spacing, etc.) to construct a mapping hash table H_pattern of "attribute value → fill configuration". This hash table can provide a fast index for subsequent filling, avoid repeated matching, and improve filling efficiency.
[0049] The filling execution phase relies entirely on this mapping hash table: for each geometric element that has been categorized, the system extracts its ItemType attribute value, quickly indexes the corresponding color and fill style configuration through the hash table, and then accurately fills the element's filling area by using either Difference subtraction filling or direct solid filling, depending on the element type (ringed hole area or independent solid area). This ensures both the uniformity of the filling style for similar elements and the automation and standardization of the filling process.
[0050] In a preferred embodiment, after generating the filled drawing, the method further includes: generating a fill legend corresponding to each type of geometric element, wherein the fill legend includes a color and fill style displayed as a pattern, and ItemType instance data of the geometric element corresponding to the pattern.
[0051] In practical application, see Figure 4 For example, once the geometric elements of areas such as airport pavements and aprons are filled, the system automatically triggers the legend generation function. This function relies on the previously established mapping relationship between ItemType attribute values and fill styles, as well as the ItemType instance data for each type of geometric element. Specifically, the system iterates through all filled element categories, extracts the corresponding ItemType attribute values for each type of element (such as "pavement - 38cm thick cement concrete surface layer" and "shoulder - 14cm thick cement concrete surface layer"), and associates them with their preset fill colors and fill patterns (such as herringbone patterns and vine patterns), providing complete data support for legend generation.
[0052] The generated fill legend uses a combination of patterns and data. The pattern portion reproduces the color and fill style of the corresponding element (including details such as proportion and angle), while the data portion clearly marks the complete information of the ItemType instance corresponding to the pattern, allowing drawing users to intuitively understand the correspondence between the pattern and the component attributes. This legend not only follows the standard requirements of drawing templates but also achieves a visual association between fill styles and component information, effectively reducing the difficulty of interpreting airport engineering drawings. It provides a unified reference standard for design handover, construction coordination, and other stages, further improving the level of integrated design.
[0053] In a preferred embodiment, see Figure 5 The method further includes: reading a fill resource file based on a fill resource path input by the user; listing all fill styles based on the read fill resource file; generating a rectangle in the memory-level temporary model based on the target fill style and color selected by the user; filling the rectangle with the selected target fill style and color; and generating a preview window of the memory-level temporary model.
[0054] In practice, the acquisition and display of fill styles are user-input oriented. The system will traverse all fill resource files under the corresponding path (with a focus on .pat format files) based on the fill resource path provided by the user, and establish a file-level index table. Then, the system will perform syntax parsing on the read fill resource files, extract metadata such as pattern name, basic angle, line spacing, offset, and related array information, and finally organize and list all the parsed fill styles for the user to intuitively select the target fill style and color.
[0055] After the user determines the target fill style and color, the system calls CreateDgnModel() to create a memory-level temporary model (named according to the TempFill_Preview{GUID} rule, and its lifecycle is bound to the preview window), and constructs a 100mm×100mm rectangle with the origin (0,0,0) as the lower left corner; then it calls the AsAreaFillPropertiesEdit function, passing in the target fill style and color parameters selected by the user, performs filling on the rectangle, and generates complex elements to be written into the temporary model; finally, it generates a preview window, mounts the temporary model in it, adjusts the background color to match the drawing, and scales it to fit the window, realizing a real-time visual preview of the fill effect.
[0056] In a preferred embodiment, setting the color and fill style corresponding to each type of geometric element further includes: setting the color and fill style of the selected geometric element according to the user's setting instructions; and randomly setting a different color and fill style from the selected geometric element for the unselected geometric element.
[0057] The technical solution shown in this embodiment allows users to specify the color and fill style of certain geometric elements. For unselected geometric elements, the colors and fill styles can be set according to preset rules or randomly set to be different from those of the selected geometric elements.
[0058] In practical applications, taking the automated filling of airport pavement zones as an example, the following explanation is provided: First, based on the airport access BIM drawing model, a rapid zoning tool was used to complete the functional zoning design for the pavement, blast shield, and earthen surface areas. Each type of zoning automatically generated closed edges while simultaneously writing complete ItemType instance data from the database, laying the data foundation for subsequent automated classification and filling. The generated closed edges are the outer edges of each geometric element. See also... Figure 6 .
[0059] After activating the automated classification and filling function, the system lists all ItemType fields in the interface tree control according to the hierarchy of "library name - type name - attribute name". Users can select target attribute combinations according to design requirements (such as "total structural layer thickness + surface material"). The system automatically associates the drawing template with the filling style library, matching exclusive filling patterns (such as "herringbone pattern" for pavement and "water ripple pattern" for water areas), colors, and scale parameters, and counts the number of partitions in real time. Once the scheme is confirmed, it can be saved for later use. This step ultimately yields an information summary table, see [link / reference]. Figure 7 , Figure 7 The left side shows the tree control, and the right side displays a summary table of information.
[0060] Based on a preset scheme, the system automatically invokes a hole-filling algorithm. It identifies holes (such as manhole covers or equipment pre-drilled holes) within a zone through dual verification using bounding boxes and geometric center points. For ring-shaped areas, it uses a difference method to complete the hole-filling process, while independent zones are directly filled with solid fill. All filled elements are uniformly grouped into the "TC_Pattern Fill" layer, and the effect can be viewed with a single click, ensuring that the field structure representation is completed in one go with zero omissions. See the image below for the filled effect. Figure 8 .
[0061] After the filling is completed, the system automatically extracts the ItemType attribute values of various partitions (such as "38cm thick cement concrete surface layer + 20cm thick cement-stabilized crushed stone base layer") and the corresponding filling style, generates standardized legends according to the drawing specifications, and clearly marks the mapping relationship between patterns, colors and component attributes. No manual drawing is required, which provides a unified and intuitive reference for subsequent stages such as design disclosure and construction layout, and improves project collaboration efficiency.
[0062] In another embodiment, an automatic hole-filling device for drawings is provided, comprising: The main controller, and the memory connected to the main controller; The memory stores program instructions; The main controller is used to execute program instructions stored in the memory and perform any of the methods described above.
[0063] In another embodiment, a computer-readable storage medium is provided storing a computer program that, when executed by a processor, implements the method described in any of the preceding embodiments.
[0064] It is understood that the same or similar parts in the above embodiments can be referred to each other, and the contents not described in detail in some embodiments can be referred to the same or similar contents in other embodiments.
[0065] It should be noted that in the description of this invention, the terms "first," "second," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance. Furthermore, in the description of this invention, unless otherwise stated, "a plurality of" means at least two.
[0066] Any process or method description in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more executable instructions for implementing a particular logical function or process, and the scope of the preferred embodiments of the invention includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functions involved, as will be understood by those skilled in the art to which embodiments of the invention pertain.
[0067] It should be understood that various parts of the present invention can be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.
[0068] Those skilled in the art will understand that all or part of the steps of the methods in the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, the program includes one or a combination of the steps of the method embodiments.
[0069] Furthermore, the functional units in the various embodiments of the present invention can be integrated into a processing module, or each unit can exist physically separately, or two or more units can be integrated into a module. The integrated module can be implemented in hardware or as a software functional module. If the integrated module is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium.
[0070] The storage media mentioned above can be read-only memory, disk, or optical disk, etc.
[0071] In the description of this specification, references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0072] Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of the present invention.
Claims
1. A method of automatic hole filling of a drawing sheet, characterized by, include: Automatically read all visible geometric elements from the drawing to be filled, obtain the ItemType instance data corresponding to each geometric element, and calculate the minimum bounding box of each geometric element; Group geometric elements with the same ItemType instance data into one category, and set the color and fill style for each category of geometric elements; Based on the minimum bounding box and geometric center point of the geometric element, determine in turn whether the geometric element is an internal element of another geometric element; If so, then based on the outer edges of these two geometric elements, generate the cutout area for the outer geometric element; The inner edge of the closed line of the geometric element that does not have a hole area is used as the filling area, and the hole area of the geometric element that has a hole area is used as the filling area. Based on the color and fill style corresponding to each geometric element, the fill area is filled to generate a completed drawing.
2. The method of claim 1, wherein, Group geometric elements with the same ItemType instance data into one category, and set the color and fill style for each category of geometric elements, including: The ItemType instance data of the geometric element includes the library name, type name, attribute name, and attribute value; Based on the ItemType instance data of all geometric elements, construct a tree control that lists the elements hierarchically, with the first-level node being the library name, the second-level node being the type name, and the third-level node being the attribute name. Obtain the user's check mark command on the tree control, combine the attribute values of the node selected by the check mark command, and treat each combination as a set of elements; Set the color and fill style for each type of element collection; Place the geometric elements that meet the conditions into the corresponding element set.
3. The method of claim 2, wherein, Based on the minimum bounding box and geometric center point of each geometric element, determine in turn whether each geometric element is an interior element of another geometric element, including: Read the unique element ID of each geometry element; The element ID, attribute value, minimum bounding box, and geometric center point of each geometric element are combined into a quadruple; Choose any two geometric elements as a quadruple and designate them as the first and second geometric elements respectively. If there exists a minimum bounding box of the first geometric element that is inside the minimum bounding box of the second geometric element, and the geometric center of the first geometric element is inside the outer edge of the second geometric element, then the first geometric element is an internal element of the second geometric element.
4. The method of claim 2, wherein, Before filling the fill area of each geometric element, the following is also included: Obtain the user's preview checkbox instruction on the tree control, and determine the geometric element to be previewed based on the preview checkbox instruction; Create a memory-level temporary model, the lifecycle of which is bound to the preview window; Generate geometric elements to be previewed in the memory-level temporary model; Based on the color and fill style corresponding to the geometric element, a fill preview image of the geometric element is generated in the memory-level temporary model; A preview window for the memory-level temporary model is generated.
5. The method of claim 2, wherein, When filling the fill area of each geometric element, the following is also included: Establish a hash table mapping the attribute values of each type of geometric element to its color and fill style; The filling area of each geometric element is filled according to the mapping hash table.
6. The method of claim 1, wherein, After generating the filled-in drawing, the following is also included: Generate a fill legend for each type of geometric element. The fill legend includes the color and fill style displayed as a pattern, as well as the ItemType instance data of the geometric element corresponding to the pattern.
7. The method of claim 4, wherein, Also includes: Read the populate resource file based on the populate resource path entered by the user; List all fill styles based on the read fill resource file; Based on the target fill style and color selected by the user, a rectangle is generated in the memory-level temporary model, and the selected target fill style and color are filled in the rectangle. A preview window for the memory-level temporary model is generated.
8. The method of claim 7, wherein, Setting the color and fill style for each type of geometric element also includes: Based on the user's settings, set the color and fill style for the selected geometric elements; For unselected geometric elements, randomly set different colors and fill styles than those of the selected geometric elements.
9. An automatic hole filling equipment for drawing paper, characterized by include: The main controller, and the memory connected to the main controller; The memory stores program instructions; The main controller is used to execute program instructions stored in the memory to perform the method as described in any one of claims 1 to 8.
10. A computer readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1 to 8.
Citation Information
Patent Citations
Image and data organization, fusion loading and display method and system
CN117272495A
BIM (Building Information Modeling) full information analysis and conversion method based on light database
CN119179805A
Underground pipe network construction drawing generation and verification method and system based on image recognition
CN120493593A
Method, device and equipment for generating legend table of drawing based on airport engineering BIM forward design
CN120995571A
Commercial building plane automatic color filling method based on CAD embedded geometry engine
CN121414882A