Automatic identification system for multi-type material points of CAD drawings
By using layer extraction, primitive space construction, and Hu invariant moment recognition technology, material points in CAD drawings are automatically identified, solving the problems of cumbersome operation and human error in traditional methods, and achieving efficient and accurate material point statistics.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- TAIYUAN TONGYANG TECH ENG CO LTD
- Filing Date
- 2026-05-22
- Publication Date
- 2026-06-19
AI Technical Summary
Traditional methods are cumbersome and prone to human error when identifying multiple types of material locations in CAD drawings, resulting in low statistical efficiency and low accuracy.
The module utilizes a layer extraction module, a primitive space construction module, a mapping processing module, and a shape determination module to identify material points in CAD drawings using Hu invariant moments and generate a material point statistical report.
It improves the efficiency and accuracy of material location statistics and reduces the possibility of human error.
Smart Images

Figure CN122244896A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of CAD drawing recognition technology, and in particular to an automatic recognition system for multiple types of material locations in CAD drawings. Background Technology
[0002] Currently, in industries such as construction engineering, low-voltage electrical engineering, and integrated network construction, engineers must identify and count the quantities of various material locations in CAD drawings, such as network port panels, information sockets, power switches, sockets, cameras, wireless APs, access control equipment, sensors, and distribution boxes, when preparing construction materials, calculating costs, quoting projects, submitting materials for approval, and managing on-site construction.
[0003] Traditional methods for identifying multiple material locations in CAD drawings involve a series of manual processes, including visually inspecting and counting the elements on each layer, before finally compiling a report on the number and type of material locations. This process is cumbersome, prone to inefficiency due to repetitive steps, and susceptible to human error, further compromising the accuracy of material location statistics. Summary of the Invention
[0004] To address the aforementioned technical problems, this invention provides an automatic identification system for multiple material locations in CAD drawings. The technical solution of this invention is as follows: An automatic identification system for multiple material locations in CAD drawings, including: The layer extraction module is used to parse the target CAD file after validating its validity, obtain the target CAD drawing, and retrieve all layers of the target CAD drawing; The primitive space construction module is used to extract all primitives in each layer and construct a primitive space based on all primitives. The primitive space is composed of multiple primitive clusters. The mapping processing module is used to obtain the geometric center of each primitive cluster, and map all primitives into the grayscale grid according to the geometric center of each primitive cluster to obtain the pixel primitives corresponding to each primitive cluster. The shape determination module is used to determine the Hu invariant moments of each primitive cluster based on the pixel primitives corresponding to each primitive cluster, and to determine the shape features of each primitive cluster based on the Hu invariant moments of each primitive cluster. The material point identification module is used to determine the material point corresponding to each graphic element cluster based on the shape characteristics of each graphic element cluster, and to generate a material point statistical report in the target CAD file based on the material point corresponding to each graphic element cluster.
[0005] Preferably, the primitive space construction module includes: The extraction unit is used to extract entity points on each layer, treat each entity point as a primitive, and generate attribute information for each primitive. The primitive space construction unit is used to generate a primitive space composed of multiple primitive clusters based on the attribute information of each primitive.
[0006] Preferably, the primitive space construction unit includes: Initialize the sub-unit to build an empty-balanced tree based on the number of layers; Insert sub-units are used to insert all primitives into the empty balanced tree according to the attribute information of each primitive, so as to obtain a primitive tree; The spatial generation subunit is used to divide the primitive tree into multiple primitive clusters based on spatial proximity relationships, and all primitive clusters constitute the primitive space.
[0007] Preferably, the space generation subunit includes: The nearest neighbor search submodule is used to perform a root-downward traversal search in the primitive tree based on the query rectangle. For any primitive in the primitive tree, if the bounding box of any primitive intersects with the query rectangle, the search continues downward to search for the child primitives of the primitive in the primitive tree until the bounding box of the child primitive does not intersect with the query rectangle. The search stops when the bounding box of the child primitive does not intersect with the query rectangle, and all the traversed child primitives from the primitive to the child primitives that do not intersect with the query rectangle are constructed into an edge set. The primitive cluster generation submodule is used to calculate the size of each edge set, cluster all edge sets according to their size, and obtain multiple edge set clusters. All primitives in each edge set cluster constitute the primitive cluster corresponding to each edge set cluster. The spatial construction submodule is used to obtain the coordinates of all primitives in the attribute information of each primitive cluster, and the primitive space is composed of the coordinates of each primitive in each primitive cluster.
[0008] Preferably, the mapping processing module includes: The geometric center calculation unit is used to calculate the geometric center of each primitive cluster; The effective radius calculation and determination unit is used to calculate the Euclidean distance between each primitive in each primitive cluster and the geometric center of the primitive cluster it belongs to, and the maximum value of the Euclidean distance is used as the effective spatial radius of each primitive cluster. Mesh building unit, used to build grayscale meshes with preset mesh unit sizes; The grayscale tensor calculation unit is used to calculate the grayscale tensor of each primitive in each primitive cluster based on the effective spatial radius of each primitive cluster and the attribute information of each primitive in each primitive cluster, and to determine the pixel coordinates of each primitive in each primitive cluster on the grayscale grid based on the grayscale tensor of each primitive. The mapping unit is used to map all the primitives of each primitive cluster to the grayscale grid according to the pixel coordinates of each primitive in each primitive cluster on the grayscale grid, so as to obtain the pixel primitives corresponding to each primitive cluster.
[0009] Preferably, the geometric center calculation unit includes: The graphics construction subunit is used to construct the graphics corresponding to each primitive cluster based on the coordinates of each primitive in the primitive space. The contribution calculation subunit is used to connect every two adjacent primitives in the graphic corresponding to each primitive cluster into a line segment, calculate the length of each line segment in the graphic corresponding to each primitive cluster, and calculate the contribution of each primitive in each primitive cluster based on the length of each line segment in the graphic corresponding to each primitive cluster. The geometric center calculation sub-unit is used to calculate the geometric center of each primitive cluster based on the contribution of each primitive in each primitive cluster.
[0010] Preferably, the shape determination module includes: Density building unit, used to construct the density function of each primitive cluster based on the pixel primitives corresponding to each primitive cluster; The central moment calculation unit is used to calculate the central moment of each primitive cluster based on the density function of each primitive cluster; The Hu invariant moment construction unit is used to normalize the central moments of each primitive cluster to obtain the normalized central moments of each primitive cluster, and to construct 7 Hu invariant operators for each primitive cluster based on the normalized central moments of each primitive cluster, and to construct the Hu invariant moments of each primitive cluster based on the 7 Hu invariant operators of each primitive cluster. The shape feature determination unit is used to determine the shape features of each primitive cluster based on the Hu invariant moments of each primitive cluster.
[0011] Preferably, the central moment calculation unit includes: The geometric moment generation subunit is used to generate the geometric moment function for each primitive cluster based on the pixel primitives of each primitive cluster; The centroid calculation sub-unit is used to calculate the centroid of each primitive cluster based on the geometric moment function of each primitive cluster; The central moment generation sub-unit is used to calculate the central moment of each primitive cluster based on the centroid of each primitive cluster.
[0012] Preferably, the material location identification module includes: The standard acquisition unit is used to acquire the standard features of various standard material locations. The similarity calculation unit is used to calculate the similarity between the shape features of each primitive cluster and the standard features of each standard material point. The determination unit is used to determine the material point corresponding to each primitive cluster based on the similarity between the shape features of each primitive cluster and the standard features of each standard material point. The material point data statistics unit is used to count the material points of each layer in the target CAD file based on the material points corresponding to each element cluster, and to generate a material point statistics report of the target CAD file based on the material point statistics results of each layer.
[0013] All of the above-mentioned optional technical solutions can be combined arbitrarily, and the present invention will not provide a detailed description of the structure after each combination.
[0014] By means of the above solution, the beneficial effects of the present invention are as follows: This invention obtains all layers of the target CAD drawing by parsing the target CAD file, then extracts all primitives in each layer, and constructs a primitive space composed of multiple primitive clusters. All primitives in each primitive cluster are mapped to a grayscale grid to obtain the corresponding pixel primitives. Hu invariant moments of each primitive cluster are then generated, and the shape characteristics of each primitive cluster are determined accordingly. This provides a method for automatically identifying material points in CAD drawings, solving the problems of cumbersome operation procedures and potential human error in traditional manual identification methods. It improves the statistical accuracy and, by automatically identifying and statistically analyzing material points across multiple layers of the target CAD drawing, enhances the efficiency of material point statistics.
[0015] The above description is merely an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention and to implement it in accordance with the contents of the specification, the preferred embodiments of the present invention are described in detail below with reference to the accompanying drawings. Attached Figure Description
[0016] Figure 1 This is a schematic diagram of the structure of the automatic identification system for multiple types of material locations in CAD drawings provided by the present invention.
[0017] Figure 2 This is a schematic diagram of the structure of a subtree in an embodiment of the present invention. Detailed Implementation
[0018] The specific embodiments of the present invention will be described in further detail below with reference to the accompanying drawings and examples. The following examples are for illustrative purposes only and are not intended to limit the scope of the invention.
[0019] like Figure 1 As shown in the embodiment of the present invention, the automatic identification system for multiple types of material locations in CAD drawings includes: The layer extraction module is used to parse the target CAD file after validating its validity, obtain the target CAD drawing, and retrieve all layers of the target CAD drawing; The primitive space construction module is used to extract all primitives in each layer and construct a primitive space based on all primitives. The primitive space is composed of multiple primitive clusters. The mapping processing module is used to obtain the geometric center of each primitive cluster, and map all primitives into the grayscale grid according to the geometric center of each primitive cluster to obtain the pixel primitives corresponding to each primitive cluster. The shape determination module is used to determine the Hu invariant moments of each primitive cluster based on the pixel primitives corresponding to each primitive cluster, and to determine the shape features of each primitive cluster based on the Hu invariant moments of each primitive cluster. The material point identification module is used to determine the material point corresponding to each graphic element cluster based on the shape characteristics of each graphic element cluster, and to generate a material point statistical report in the target CAD file based on the material point corresponding to each graphic element cluster.
[0020] Specifically, in the layer extraction module, the validity verification of the target CAD file is implemented through AutoCAD Engine software. After the validity verification is passed by AutoCAD Engine software, AutoCAD Engine software parses all layers of the target CAD drawing.
[0021] In the primitive space construction module, a primitive refers to a solid point in each layer of the target CAD drawing. In this embodiment of the invention, the primitive space is formed by grouping multiple primitives into multiple primitive clusters according to their spatial relationships, and then using all primitive clusters from all layers to constitute the primitive space.
[0022] In the mapping processing module, the grayscale grid is a two-dimensional grid structure, and each grid cell in the grayscale grid is labeled with a grayscale tensor range.
[0023] In the shape determination module, Hu invariant moments are mathematical invariants used to describe the shape characteristics of primitive clusters. Hu invariant moments consist of 7 Hu invariant operators.
[0024] In the material location identification module, material locations in this embodiment of the invention include network port panels, information sockets, power switches, five-hole sockets, cameras, and wireless access points (APs). The material location statistics report is responsible for statistically analyzing the type and quantity of each type of material location in the target CAD file. The specific types of material locations include network port panels, power switches, sockets, wireless APs, and cameras. Among these, the material location type for both five-hole sockets and information sockets is socket.
[0025] In one specific embodiment, the primitive space construction module includes: The extraction unit is used to extract entity points on each layer, treat each entity point as a primitive, and generate attribute information for each primitive. The primitive space construction unit is used to generate a primitive space composed of multiple primitive clusters based on the attribute information of each primitive.
[0026] Specifically, each graphic element in the target CAD drawing is an isolated point. Only the layer and coordinates of the element are known; the relationship between the element and other elements is not apparent. Therefore, this embodiment of the invention uses element clusters and element space to group elements into spatially related clusters, facilitating subsequent research on material locations. In the extraction unit, the attribute information of the graphic element includes its layer and coordinates in the CAD coordinate system.
[0027] In one specific embodiment, the primitive space construction unit includes: Initialize the sub-unit to build an empty-balanced tree based on the number of layers; Insert sub-units are used to insert all primitives into the empty balanced tree according to the attribute information of each primitive, so as to obtain a primitive tree; The spatial generation subunit is used to divide the primitive tree into multiple primitive clusters based on spatial proximity relationships, and all primitive clusters constitute the primitive space.
[0028] Specifically, in the initialization sub-unit, for the sake of spatial data analysis, in this embodiment of the invention, the empty balance tree is selected as an R-tree, and the subtrees of the empty balance tree correspond one-to-one with the layers, that is, the number of subtrees of the empty balance tree is equal to the number of layers.
[0029] In the insertion sub-unit, all primitives of each layer are inserted into the corresponding subtree of the empty balance tree, resulting in a primitive tree. Specifically, for any layer, the primitive closest to the origin of the CAD coordinate system is selected as the root primitive of the corresponding subtree in the empty balance tree. Then, the distance between each other primitive in that layer and the root primitive is calculated. Multiple other primitives with smaller distances to the root primitive are selected as child nodes, and these child nodes are inserted into level 1 of the corresponding subtree. This process continues until the number of child nodes equals the preset capacity. Then, other child nodes are inserted into the next level of the corresponding subtree. This process is repeated until all primitives are inserted into their corresponding levels. The structure of a subtree is as follows: Figure 2 As shown, the subtree consists of M levels, each with a preset capacity of 3, and the m child node primitives are all the primitives of the layer corresponding to the subtree.
[0030] In spatial generation sub-units, spatial proximity refers to the mutual relationship between certain graphic elements in space.
[0031] In one specific embodiment, the space generation subunit includes: The nearest neighbor search submodule is used to perform a root-downward traversal search in the primitive tree based on the query rectangle. For any primitive in the primitive tree, if the bounding box of any primitive intersects with the query rectangle, the search continues downward to search for the child primitives of the primitive in the primitive tree until the bounding box of the child primitive does not intersect with the query rectangle. The search stops when the bounding box of the child primitive does not intersect with the query rectangle, and all the nodes traversed from the primitive to its child primitives that do not intersect with the query rectangle are constructed into an edge set. The primitive cluster generation submodule is used to calculate the size of each edge set, cluster all edge sets according to their size, and obtain multiple edge set clusters. All primitives in each edge set cluster constitute the primitive cluster corresponding to each edge set cluster. The spatial construction submodule is used to obtain the coordinates of all primitives in the attribute information of each primitive cluster, and the primitive space is composed of the coordinates of each primitive in each primitive cluster.
[0032] Specifically, in the nearest neighbor search submodule, the query rectangle in this embodiment of the invention is a rectangle of a preset size, and the origin of the CAD coordinate system is the center of the query rectangle. For a root element in the element tree, if the intersection of the query rectangle and the bounding box of the root element (the size is preset, and the root element is located at the geometric center of its bounding box) is not empty, then the search continues downwards for the child elements of the root element in the element tree until the bounding boxes of the child elements do not intersect with the query rectangle, at which point the search stops.
[0033] In the primitive cluster generation submodule, for a given edge set, the number of primitives in the edge set is obtained by searching for all child primitives below the root primitive. The number of primitives in the edge set (including the root primitive and child primitives) represents the size of the edge set. When clustering all edge sets according to their size, the K-means clustering algorithm is used. Specifically, during clustering, an edge set is randomly selected as the centroid of a cluster based on a pre-set number of clusters and the mean distance. Several other edge sets whose distance to the centroid of this cluster is less than or equal to the mean distance are added to this cluster. Then, the remaining edge set is randomly selected as the centroid of the next cluster, and the above steps are repeated to obtain multiple edge set clusters.
[0034] In the spatial construction submodule, the coordinates in the attribute information of a graphic element refer to its coordinates in the CAD coordinate system. Each graphic element cluster is mapped to a set with spatial attributes using the coordinates of each graphic element, and the graphic elements of all graphic element clusters constitute the graphic element space. In the graphic element space, the coordinates of a graphic element in a graphic element cluster of the i-th layer can be represented as: (x-coordinate, y-coordinate, i), where the x-coordinate and y-coordinate represent the coordinates of the graphic element in the CAD coordinate system.
[0035] In one specific embodiment, the mapping processing module includes: The geometric center calculation unit is used to calculate the geometric center of each primitive cluster; The effective radius calculation and determination unit is used to calculate the Euclidean distance between each primitive in each primitive cluster and the geometric center of the primitive cluster it belongs to, and the maximum value of the Euclidean distance is used as the effective spatial radius of each primitive cluster. Mesh building unit, used to build grayscale meshes with preset mesh unit sizes; The grayscale tensor calculation unit is used to calculate the grayscale tensor of each primitive in each primitive cluster based on the effective spatial radius of each primitive cluster and the attribute information of each primitive in each primitive cluster, and to determine the pixel coordinates of each primitive in each primitive cluster on the grayscale grid based on the grayscale tensor of each primitive. The mapping unit is used to map all the primitives of each primitive cluster to the grayscale grid according to the pixel coordinates of each primitive in each primitive cluster on the grayscale grid, so as to obtain the pixel primitives corresponding to each primitive cluster.
[0036] Specifically, in the geometric center calculation unit, the geometric center of a certain primitive cluster refers to the average spatial position of all primitives in the primitive space.
[0037] In the grayscale tensor calculation unit, when calculating the grayscale tensor W of a certain primitive within a primitive cluster, the formula is: ;in, The x-coordinate represents the geometric center of the primitive cluster. R represents the ordinate of the geometric center of the primitive cluster, and R represents the effective spatial radius of the primitive cluster. This represents the x-coordinate in the attribute information of the graphic element. This represents the ordinate in the coordinates of the attribute information of the primitive. Further, it represents the grayscale tensor of the primitive within the primitive cluster. This serves as the pixel coordinate of the primitive on the grayscale grid.
[0038] In the mapping unit, when analyzing material points, regular graphics are analyzed, not irregular point sets. Therefore, in this embodiment of the invention, each primitive cluster is converted from all irregular primitives into regular pixel primitives. The graphic formed by the pixel coordinates of all primitives in the grayscale grid of each primitive cluster is used as the pixel primitive corresponding to each primitive cluster.
[0039] In one specific embodiment, the geometric center calculation unit includes: The graphics construction subunit is used to construct the graphics corresponding to each primitive cluster based on the coordinates of each primitive in the primitive space. The contribution calculation subunit is used to connect every two adjacent primitives in the graphic corresponding to each primitive cluster into a line segment, calculate the length of each line segment in the graphic corresponding to each primitive cluster, and calculate the contribution of each primitive in each primitive cluster based on the length of each line segment in the graphic corresponding to each primitive cluster. The geometric center calculation sub-unit is used to calculate the geometric center of each primitive cluster based on the contribution of each primitive in each primitive cluster.
[0040] Specifically, in the graphics construction subunit, when constructing the graphics corresponding to a certain primitive cluster, the coordinates of all primitives in the primitive cluster in the primitive space are first obtained. Then, all primitives are connected according to their coordinates in the primitive space to obtain the graphics corresponding to the primitive cluster. In this embodiment of the invention, the graphics corresponding to each primitive cluster include closed graphics and non-closed graphics.
[0041] In the contribution calculation subunit, when calculating the contribution of a certain element in a certain element cluster, first obtain all the line segments corresponding to the element, calculate the average length of all the line segments corresponding to the element as the element line segment length of the element, and then the contribution calculation formula of the element is: element line segment length of the element ÷ sum of the lengths of all the line segments in the element cluster.
[0042] In the geometric center calculation subunit, because all elements within the same element cluster reside on the same layer, the coordinates of each element in the cluster in the CAD coordinate system are used as the coordinates of each element when analyzing all elements in a cluster. Assuming a element cluster contains three elements: element 1 (a1, b1), element 2 (a2, b2), and element 3 (a3, b3), where a1, a2, and a3 represent the x-coordinates of elements 1, 2, and 3 in the CAD coordinate system, and b1, b2, and b3 represent the y-coordinates of elements 1, 2, and 3 in the CAD coordinate system, and element 1 contributes 0.4, element 2 contributes 0.1, and element 3 contributes 0.2, then the x-coordinate of the geometric center of this element cluster is... for: ; The ordinate of the geometric center of this primitive cluster for: .
[0043] In one specific embodiment, the shape determination module includes: Density building unit, used to construct the density function of each primitive cluster based on the pixel primitives corresponding to each primitive cluster; The central moment calculation unit is used to calculate the central moment of each primitive cluster based on the density function of each primitive cluster; The Hu invariant moment construction unit is used to normalize the central moments of each primitive cluster to obtain the normalized central moments of each primitive cluster, and to construct 7 Hu invariant operators for each primitive cluster based on the normalized central moments of each primitive cluster, and to construct the Hu invariant moments of each primitive cluster based on the 7 Hu invariant operators of each primitive cluster. The shape feature determination unit is used to determine the shape features of each primitive cluster based on the Hu invariant moments of each primitive cluster.
[0044] Specifically, within the density building unit, the density function of a certain primitive cluster can be expressed as: Where h represents the preset bandwidth parameter, Let (x, y) represent the grayscale tensor of the j-th primitive in the primitive cluster, n represent the number of primitives in the primitive cluster, and (X, Y) represent the coordinates (including x and y coordinates) of any point in the graphic corresponding to the primitive cluster. This represents the coordinates of the j-th element in the CAD coordinate system.
[0045] In the Hu invariant moment construction unit, the central moments of a certain primitive cluster are normalized to obtain the normalized central moments of the primitive cluster. The calculation formula is: ,in, Represents the central moments based on orders q and t. This represents the zero-order central moment with order q and order t both being 0. q and t are both order parameters, taking values of 0, 1, 2, or 3. This is because low-order moments (central moments with orders 0-3) can fully describe the overall geometric characteristics of a primitive cluster, while high-order moments (central moments with orders greater than 3) amplify the positional noise and glitches of the primitive cluster, resulting in an excessively large dynamic range of the geometric characteristics of the primitive cluster, which makes it impossible to accurately describe the shape features of the primitive cluster.
[0046] Based on this, the seven Hu invariant operators Z1-Z7 of the primitive cluster, constructed according to the normalized central moments of the primitive cluster, are as follows: , , , , , and The seven Hu invariant operators of the primitive cluster are used to form a 1-row, 7-column Hu invariant moment for the primitive cluster.
[0047] In the shape feature determination unit, the Hu invariant moment of each primitive cluster is used as the shape feature of each primitive cluster.
[0048] In one specific embodiment, the central moment calculation unit includes: The geometric moment generation subunit is used to generate the geometric moment function for each primitive cluster based on the pixel primitives of each primitive cluster; The centroid calculation sub-unit is used to calculate the centroid of each primitive cluster based on the geometric moment function of each primitive cluster; The central moment generation sub-unit is used to calculate the central moment of each primitive cluster based on the centroid of each primitive cluster.
[0049] Specifically, in the geometric moment generation sub-unit, according to the above embodiment, the geometric moment function of the primitive cluster is expressed as: .
[0050] In the centroid calculation sub-unit, the centroid of this primitive cluster The calculation formula is: and ,in, This represents the x-coordinate of the j-th primitive in the primitive cluster. This represents the ordinate of the j-th element in the element cluster.
[0051] In the central moment generation sub-unit, based on the above embodiments, the central moment of this primitive cluster is represented as: Where X and Y represent the x-coordinate and y-coordinate of any point in the graphic corresponding to the primitive cluster, respectively. This represents the x-coordinate of the centroid of the primitive cluster. The ordinate represents the centroid of the primitive cluster. The central moment is a variable, and its value depends on the q-th and t-th orders.
[0052] In one specific embodiment, the material location identification module includes: The standard acquisition unit is used to acquire the standard features of various standard material locations. The similarity calculation unit is used to calculate the similarity between the shape features of each primitive cluster and the standard features of each standard material point. The determination unit is used to determine the material point corresponding to each primitive cluster based on the similarity between the shape features of each primitive cluster and the standard features of each standard material point. The material point data statistics unit is used to count the material points of each layer in the target CAD file based on the material points corresponding to each element cluster, and to generate a material point statistics report of the target CAD file based on the material point statistics results of each layer.
[0053] Specifically, in the standard acquisition unit, when acquiring the standard features of each standard material point, the pre-defined pixel primitives for each standard material point are first acquired. Then, a density function for the pre-defined pixel primitives for each standard material point is constructed. Based on the density function, the central moments of the pre-defined pixel primitives for each standard material point are calculated. After normalizing the central moments, seven Hu-invariant operators for the pre-defined pixel primitives are constructed. These seven Hu-invariant operators are used as the Hu-invariant moments of the pre-defined pixel primitives for each standard material point, and these Hu-invariant moments are used as the standard features of each standard material point. The calculation methods for the density function, central moments, and Hu-invariant operators are similar to those in the shape determination module described in the previous embodiment, and will not be repeated here.
[0054] In the similarity calculation unit, cosine similarity is used to calculate the similarity between the shape features of each primitive cluster and the standard features of each standard material point.
[0055] Within a defined unit, the standard material point with the highest cosine similarity between the shape features of each primitive cluster and the standard features of all standard material points is selected as the material point corresponding to each primitive cluster.
[0056] In the material location data statistics unit, the material location statistics report of the target CAD file is shown in Table 1.
[0057]
[0058] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the technical principles of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. An automatic recognition system of multi-type material points of CAD drawings, characterized in that, include: The layer extraction module is used to parse the target CAD file after validating its validity, obtain the target CAD drawing, and retrieve all layers of the target CAD drawing; The primitive space construction module is used to extract all primitives in each layer and construct a primitive space based on all primitives. The primitive space is composed of multiple primitive clusters. The mapping processing module is used to obtain the geometric center of each primitive cluster, and map all primitives into the grayscale grid according to the geometric center of each primitive cluster to obtain the pixel primitives corresponding to each primitive cluster. The shape determination module is used to determine the Hu invariant moments of each primitive cluster based on the pixel primitives corresponding to each primitive cluster, and to determine the shape features of each primitive cluster based on the Hu invariant moments of each primitive cluster. The material point identification module is used to determine the material point corresponding to each graphic element cluster based on the shape characteristics of each graphic element cluster, and to generate a material point statistical report in the target CAD file based on the material point corresponding to each graphic element cluster.
2. The system for automatic identification of multi-type material points of CAD drawings according to claim 1, characterized in that, The primitive space construction module includes: The extraction unit is used to extract entity points on each layer, treat each entity point as a primitive, and generate attribute information for each primitive. The primitive space construction unit is used to generate a primitive space composed of multiple primitive clusters based on the attribute information of each primitive.
3. The system for automatic identification of multi-type material points of CAD drawings according to claim 2, characterized in that, The primitive space construction unit includes: Initialize the sub-unit to build an empty-balanced tree based on the number of layers; Insert sub-units are used to insert all primitives into the empty balanced tree according to the attribute information of each primitive, so as to obtain a primitive tree; The spatial generation subunit is used to divide the primitive tree into multiple primitive clusters based on spatial proximity relationships, and all primitive clusters constitute the primitive space.
4. The system for automatic identification of multi-type material points of CAD drawings according to claim 3, characterized in that, The space generation subunit includes: The nearest neighbor search submodule is used to perform a root-downward traversal search in the primitive tree based on the query rectangle. For any primitive in the primitive tree, if the bounding box of any primitive intersects with the query rectangle, the search continues downward to search for the child primitives of the primitive in the primitive tree until the bounding box of the child primitive does not intersect with the query rectangle. The search stops when the bounding box of the child primitive does not intersect with the query rectangle, and all the traversed child primitives from the primitive to the child primitives that do not intersect with the query rectangle are constructed into an edge set. The primitive cluster generation submodule is used to calculate the size of each edge set, cluster all edge sets according to their size, and obtain multiple edge set clusters. All primitives in each edge set cluster constitute the primitive cluster corresponding to each edge set cluster. The spatial construction submodule is used to obtain the coordinates of all primitives in the attribute information of each primitive cluster, and the primitive space is composed of the coordinates of each primitive in each primitive cluster.
5. The system for automatic identification of multi-type material points of CAD drawings according to claim 1, characterized in that, The mapping processing module includes: The geometric center calculation unit is used to calculate the geometric center of each primitive cluster; The effective radius calculation and determination unit is used to calculate the Euclidean distance between each primitive in each primitive cluster and the geometric center of the primitive cluster it belongs to, and the maximum value of the Euclidean distance is used as the effective spatial radius of each primitive cluster. Mesh building unit, used to build grayscale meshes with preset mesh unit sizes; The grayscale tensor calculation unit is used to calculate the grayscale tensor of each primitive in each primitive cluster based on the effective spatial radius of each primitive cluster and the attribute information of each primitive in each primitive cluster, and to determine the pixel coordinates of each primitive in each primitive cluster on the grayscale grid based on the grayscale tensor of each primitive. The mapping unit is used to map all the primitives of each primitive cluster to the grayscale grid according to the pixel coordinates of each primitive in each primitive cluster on the grayscale grid, so as to obtain the pixel primitives corresponding to each primitive cluster.
6. The automatic identification system for multiple material locations in CAD drawings according to claim 5, characterized in that, The geometric center calculation unit includes: The graphics construction subunit is used to construct the graphics corresponding to each primitive cluster based on the coordinates of each primitive in the primitive space. The contribution calculation subunit is used to connect every two adjacent primitives in the graphic corresponding to each primitive cluster into a line segment, calculate the length of each line segment in the graphic corresponding to each primitive cluster, and calculate the contribution of each primitive in each primitive cluster based on the length of each line segment in the graphic corresponding to each primitive cluster. The geometric center calculation sub-unit is used to calculate the geometric center of each primitive cluster based on the contribution of each primitive in each primitive cluster.
7. The automatic identification system for multiple material locations in CAD drawings according to claim 1, characterized in that, The shape determination module includes: Density building unit, used to construct the density function of each primitive cluster based on the pixel primitives corresponding to each primitive cluster; The central moment calculation unit is used to calculate the central moment of each primitive cluster based on the density function of each primitive cluster; The Hu invariant moment construction unit is used to normalize the central moments of each primitive cluster to obtain the normalized central moments of each primitive cluster, and to construct 7 Hu invariant operators for each primitive cluster based on the normalized central moments of each primitive cluster, and to construct the Hu invariant moments of each primitive cluster based on the 7 Hu invariant operators of each primitive cluster. The shape feature determination unit is used to determine the shape features of each primitive cluster based on the Hu invariant moments of each primitive cluster.
8. The automatic identification system for multiple material locations in CAD drawings according to claim 7, characterized in that, The central moment calculation unit includes: The geometric moment generation subunit is used to generate the geometric moment function for each primitive cluster based on the pixel primitives of each primitive cluster; The centroid calculation sub-unit is used to calculate the centroid of each primitive cluster based on the geometric moment function of each primitive cluster; The central moment generation sub-unit is used to calculate the central moment of each primitive cluster based on the centroid of each primitive cluster.
9. The automatic identification system for multiple material locations in CAD drawings according to claim 1, characterized in that, The material location identification module includes: The standard acquisition unit is used to acquire the standard features of various standard material locations. The similarity calculation unit is used to calculate the similarity between the shape features of each primitive cluster and the standard features of each standard material point. The determination unit is used to determine the material point corresponding to each primitive cluster based on the similarity between the shape features of each primitive cluster and the standard features of each standard material point. The material point data statistics unit is used to count the material points of each layer in the target CAD file based on the material points corresponding to each element cluster, and to generate a material point statistics report of the target CAD file based on the material point statistics results of each layer.