A CAD construction drawing intelligent segmentation method and related equipment

By employing a recursive scattering algorithm and a dual recognition mechanism, the problems of missing elements and chaotic file management in CAD construction drawing segmentation are solved, achieving accurate element attribution and file optimization, and enabling intelligent segmentation of complex drawings.

CN121768031BActive Publication Date: 2026-07-03GUANGDONG KAITONG SOFTWARE DEV
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
GUANGDONG KAITONG SOFTWARE DEV
Filing Date
2025-12-29
Publication Date
2026-07-03

AI Technical Summary

Technical Problem

Existing methods for segmenting CAD construction drawings rely on manual operation, which is inefficient and prone to errors. Existing semi-automated tools are difficult to adapt to complex drawings, resulting in missing elements and chaotic file management, and failing to meet the needs of multi-disciplinary collaborative design.

Method used

A recursive shuffling algorithm is used to deeply analyze CAD drawing files. Combined with a dual recognition mechanism of geometric feature detection and semantic content verification, the drawing frame is identified and spatial attribution is determined based on the geometric attributes of the elements, generating independent CAD sub-files.

Benefits of technology

It achieves complete extraction of graphic element information, efficient identification of non-standard and nested drawing frames, generation of accurate CAD sub-files, optimization of multi-disciplinary collaborative design, reduction of design conflicts, and facilitates classification, storage, and retrieval.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121768031B_ABST
    Figure CN121768031B_ABST
Patent Text Reader

Abstract

The application discloses a CAD construction drawing intelligent segmentation method and related equipment, which realizes intelligent segmentation through steps such as graphic element recursive scattering analysis, double frame positioning identification and the like, acquires a CAD file and analyzes a basic graphic element set with geometric properties, identifies a frame, allocates graphic elements, and finally generates and outputs an independent sub-file containing corresponding graphic elements and attributes. Through recursive scattering and matrix transformation technology, the application deeply analyzes complex block entities and restores attributes, ensuring that graphic element information is not missed; in combination with the double mechanism of geometric feature detection and professional keyword verification, the application efficiently identifies non-standard and nested frames, breaking the limitations of traditional tools. A differentiated judgment system is established for different graphic element types, exclusive strategies are adopted to realize accurate classification of cross-frame elements, and information errors and omissions are avoided. The segmented sub-file is small in size and can be accurately distributed according to the profession, which not only optimizes multi-professional collaboration and reduces design conflicts, but also facilitates storage, retrieval and printing, and provides core support for communication drawing digitization.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of intelligent segmentation technology, and more specifically, to an intelligent segmentation method and related equipment for CAD construction drawings. Background Technology

[0002] Computer-aided design (CAD) technology is a core supporting tool for engineering design and construction. In the field of communication engineering, CAD construction drawings carry critical information such as fiber optic network cabling, base station layout, and equipment room floor plan design. They play an important guiding role in optimizing network structure and avoiding equipment conflicts, spanning the entire lifecycle from project planning to operation and maintenance. To meet the collaborative design needs of multiple disciplines such as civil engineering, communication, and electrical engineering, as well as operational requirements such as unified layer management and batch printing, design institutes generally store multiple project drawings in a single DXF file. While this centralized storage is convenient for management in the early stages of a project, it leads to a surge in file size to hundreds of megabytes, severely reducing the efficiency of drawing retrieval, archiving, collaboration, and subsequent processing. This becomes a prominent bottleneck restricting the progress and quality of design and review work. Therefore, developing efficient and automated CAD drawing segmentation methods has become an urgent need in the industry.

[0003] Current drawing segmentation methods in the industry have significant shortcomings. Traditional segmentation relies entirely on manual operation. Designers must visually identify drawing frame boundaries, manually select elements, copy and paste them to new files, and then save them in categories. This is not only extremely inefficient but also prone to problems such as missing elements and inconsistent file naming due to human error. While existing semi-automated auxiliary tools can improve efficiency to some extent, they have significant technical flaws: they rely too heavily on standard rectangular drawing frames or specific layer identifiers. However, communication engineering CAD drawings commonly feature nested block structures, non-standard shape drawing frames, and complex text encoding, making these tools difficult to adapt to actual needs, limiting their applicability, and failing to achieve accurate segmentation of complex drawings. Consequently, they cannot meet the industry's evolving requirements for drawing processing technology.

[0004] Therefore, there is an urgent need for a new intelligent segmentation scheme for CAD construction drawings to address the shortcomings of existing technologies. Summary of the Invention

[0005] This application provides a method and related equipment for intelligent segmentation of CAD construction drawings, which realizes the complete extraction of graphic element information in CAD construction drawings, efficient identification of non-standard and nested drawing frames, and accurate classification of graphic elements. The segmented CAD sub-files can optimize multi-disciplinary collaboration, facilitate management, and meet the current development needs of the industry.

[0006] A method for intelligent segmentation of CAD construction drawings, comprising:

[0007] Obtain the CAD drawing file to be segmented, perform deep analysis on the block reference entities in the CAD drawing file through a recursive shuffling algorithm, convert them into a set of basic primitives, and record the geometric attributes of each basic primitive.

[0008] Each segmented bounding box is identified from the basic primitive set through a dual recognition mechanism that includes geometric feature detection and semantic content verification;

[0009] For each segmentation frame, according to the spatial attribution determination algorithm corresponding to the geometric attributes of the basic graphic elements, each basic graphic element in the set of basic graphic elements is assigned to its corresponding segmentation frame, wherein different geometric attributes correspond to different spatial attribution determination algorithms;

[0010] Based on the allocation results, a new CAD sub-file is created for each of the segmented drawing frames, and the basic graphic elements, associated layers, and style attributes belonging to the segmented drawing frames are migrated to the corresponding CAD sub-file.

[0011] Output all newly created CAD subfiles.

[0012] Optionally, the step of performing deep parsing of block reference entities in the CAD drawing file using a recursive shuffling algorithm includes:

[0013] Starting from the current block reference entity, recursively retrieve the block definition content referenced by the current block reference entity;

[0014] In each level of recursion, the coordinate transformation of the entity contained in the current block reference is performed by applying the spatial transformation matrix of the current block reference;

[0015] The entity after coordinate transformation is added to the basic primitive set. If the entity is a nested block reference, it is recursively broken up until the maximum recursion depth is reached or there are no more block references to break up.

[0016] During the recursive process, circular reference checks are performed to avoid infinite recursion.

[0017] Optionally, the spatial transformation matrix is ​​defined as:

[0018]

[0019] Where M is the spatial transformation matrix. and Scaling factor For rotation angle, It is a translation vector.

[0020] Optionally, after the recursive shuffling, the basic primitive set is further subjected to entity type mapping and / or classification deduplication.

[0021] The execution process of the entity type mapping includes:

[0022] DXF entity types are mapped to internal data structures through predefined type mapping functions. Each internal data structure provides a unified geometric coordinate interface, attribute dictionary interface, and layer information interface.

[0023] The execution process of the classification and deduplication process includes:

[0024] For high-frequency basic primitives, the geometric hash value of the high-frequency basic primitives is calculated and the hash set is used to perform fast deduplication with O(n) complexity.

[0025] For low-frequency or complex basic primitives, similarity deduplication is performed in O(n²) complexity by traversing and comparing the geometric attributes of the low-frequency or complex basic primitives with the bounding box.

[0026] Optionally, the step of identifying each segmented bounding box from the basic primitive set through a dual recognition mechanism including geometric feature detection and semantic content verification includes:

[0027] Closed polyline entities are selected from the set of basic primitives, and the orthogonality deviation and area of ​​the closed polyline entities are calculated.

[0028] Polylines whose orthogonality deviation is less than a preset angle tolerance and whose area is greater than a preset area threshold are identified as candidate frames.

[0029] Within the preset title bar area of ​​each candidate frame, search for text entities that match a predefined database of communication industry keywords;

[0030] Candidate frames that match the text entities are identified as segmentation frames.

[0031] Optional, also includes:

[0032] When candidate frames with overlapping or nested positions are identified, the inclusion relationship between the candidate frames with overlapping or nested positions is calculated, and the candidate frame with the smallest area that is not contained by any other candidate frame is selected as the dividing frame.

[0033] Optionally, the spatial attribution determination algorithm includes:

[0034] For point-type primitives, the "point inside polygon" algorithm is used to determine whether the point-type primitive is located within the boundary of the drawing frame, thereby determining its affiliation.

[0035] For line-type graphic elements, the system determines their affiliation by judging whether both endpoints of the line-type graphic element are located within the same drawing frame boundary. If not, it further judges the intersection relationship between the line-type graphic element and the drawing frame boundary or uses centroid judgment to determine the affiliation.

[0036] For circular arc and elliptical arc primitives, their affiliation is determined by judging the positional relationship between the center, endpoints, and sampling points of the circular arc and elliptical arc primitives and the graphic frame;

[0037] For filled surface region primitives, the affiliation is determined by calculating the centroid of the filled surface region primitive and determining whether the centroid is located within the boundary of the drawing frame;

[0038] For composite-type labeled elements, the composite-type labeled elements are decomposed into basic elements of leaders, text, and arrows, and their affiliation is determined by combining the positional relationship between the basic elements of leaders, text, and arrows and the drawing frame.

[0039] Optionally, migrating the basic graphic elements and associated layers and style attributes belonging to the segmented drawing frame to the corresponding CAD sub-file includes:

[0040] Establish a layer mapping relationship between the CAD drawing file and the CAD sub-file, and migrate the associated layers containing the basic graphic elements belonging to the segmented drawing frame to the CAD sub-file;

[0041] Obtain the style attribute set of the CAD drawing file, and copy and migrate the style attributes referenced by the basic graphic elements in the style attribute set to the CAD sub-file;

[0042] The migrated text entities are subjected to nested cleanup processes, which include nested Unicode escape sequence conversion, font definition control character removal, text format control character cleanup, and illegal character replacement in filenames.

[0043] Optional, also includes:

[0044] During the process of establishing the layer mapping relationship, it is checked whether the associated layer belongs to the preset filter layer set. If so, the layer is prevented from migrating to the CAD sub-file.

[0045] During the process of copying and migrating style attributes, check for style name conflicts. If a conflict occurs, use an overwrite or rename strategy to handle it.

[0046] A smart segmentation device for CAD construction drawings, comprising:

[0047] The recursive shuffling parsing unit is used to obtain the CAD drawing file to be segmented, perform deep parsing of the block reference entities in the CAD drawing file through the recursive shuffling algorithm, convert and generate a set of basic primitives, and record the geometric attributes of each basic primitive.

[0048] The frame dual recognition unit is used to identify each segmented frame from the basic primitive set through a dual recognition mechanism that includes geometric feature detection and semantic content verification.

[0049] A spatial attribution determination unit is used to assign each basic graphic element in the set of basic graphic elements to its corresponding segmentation frame according to a spatial attribution determination algorithm corresponding to the geometric attributes of the basic graphic elements, wherein different geometric attributes correspond to different spatial attribution determination algorithms.

[0050] The file migration construction unit is used to create a new CAD sub-file for each of the segmented drawing frames according to the allocation results, and migrate each basic graphic element and associated layer and style attribute belonging to the segmented drawing frame to the corresponding CAD sub-file;

[0051] The split file output unit is used to output all the newly created CAD sub-files.

[0052] A smart segmentation device for CAD construction drawings, including a memory and a processor;

[0053] The memory is used to store programs;

[0054] The processor is used to execute the program to implement each step of the intelligent segmentation method for CAD construction drawings as described in any of the above claims.

[0055] A readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the intelligent segmentation method for CAD construction drawings as described in any of the preceding claims.

[0056] A computer program product includes a computer program that, when run by a processor, executes the steps of the intelligent segmentation method for CAD construction drawings as described in any of the preceding claims.

[0057] As can be seen from the above technical solutions, the intelligent segmentation method and related equipment for CAD construction drawings provided in this application achieve intelligent segmentation through steps such as recursive scattering and parsing, dual recognition mechanism, and targeted spatial attribution judgment. Specifically, it obtains the CAD file to be segmented, parses and generates a set of basic graphic elements with geometric attributes, identifies the drawing frame and assigns graphic elements, and then generates and outputs a CAD sub-file containing the corresponding graphic elements and attributes, achieving multiple beneficial effects:

[0058] Firstly, it solves the problem of deep primitive parsing. This application uses recursive shuffling and matrix transformation techniques to perform deep traversal parsing of complex block entities, completely disassembles and accurately restores attribute information, ensuring that all basic primitive geometric attributes are fully recorded, completely avoiding primitive omissions, laying a solid data foundation for subsequent segmentation, and making up for the shortcomings of manual and semi-automated tools in processing complex primitives.

[0059] Secondly, it improves the efficiency of drawing frame recognition. This invention combines geometric feature detection and semantic content verification to construct a dual recognition mechanism, extracts the outline features of the drawing frame and matches them with professional keywords to assist in localization, efficiently identifies non-orthogonal, nested and overlapping drawing frames, significantly improves the recognition accuracy, breaks the dependence of traditional tools on standard drawing frames, and broadens the scope of application for processing communication engineering drawings.

[0060] Thirdly, it achieves accurate attribution of graphic elements. This invention establishes a differentiated judgment system based on the geometric attributes of graphic elements, employing discrimination strategies such as inclusion relationship verification for different element types to ensure accurate classification of complex elements such as cross-frame connecting lines, avoiding information errors and omissions. The resulting independent sub-files are small in size, allowing for precise distribution by discipline, optimizing multi-disciplinary collaboration, reducing design conflicts, and facilitating categorized storage, retrieval, and batch printing, providing core support for the digitization of communication engineering drawings. Attached Figure Description

[0061] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0062] Figure 1 This is a flowchart of an intelligent segmentation method for CAD construction drawings disclosed in an embodiment of this application;

[0063] Figure 2 This is a schematic diagram of an intelligent CAD construction drawing segmentation device disclosed in an embodiment of this application;

[0064] Figure 3 This is a hardware structure block diagram of an intelligent CAD construction drawing segmentation device disclosed in an embodiment of this application. Detailed Implementation

[0065] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0066] This application can be used in a wide variety of general-purpose or special-purpose computing device environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor devices, distributed computing environments including any of the above devices, etc.

[0067] The following section introduces the solution proposed in this application. The technical solution is as follows, and details are provided below.

[0068] Figure 1 This is a flowchart of an intelligent segmentation method for CAD construction drawings disclosed in an embodiment of this application.

[0069] like Figure 1 As shown, the method may include:

[0070] Step S1: Obtain the CAD drawing file to be segmented, perform deep analysis on the block reference entities in the CAD drawing file through a recursive shuffling algorithm, convert them into a set of basic primitives, and record the geometric attributes of each basic primitive.

[0071] Specifically, the process begins by acquiring the CAD drawing file to be segmented. This file is compatible with different versions of the DXF drawing format and adapts to common drawing versions used in engineering design. Then, a recursive shuffling algorithm is invoked to perform deep-level parsing of the block reference entities and nested block structures defined by the INSERT instruction in the CAD drawing file. By traversing the relationships between block references layer by layer, the encapsulation state of the block entities is broken, and they are completely converted into independent basic primitives such as lines, arcs, polylines, text, and symbols, forming a set of basic primitives. During the conversion process, the geometric attributes of each basic primitive are recorded simultaneously. These geometric attributes include at least the primitive's coordinate parameters (such as endpoint coordinates, center coordinates, radius, etc.), dimension data, shape features, and topological relationships between primitives, providing accurate and complete data support for subsequent frame recognition and primitive allocation. The recursive shuffling algorithm is equipped with a dynamic depth control module, which adaptively adjusts the parsing depth according to the block nesting level to avoid incomplete or over-parsing. Simultaneously, matrix transformation technology is used to correct the scaling, rotation, and other geometric transformation parameters of the block references, ensuring that the position and shape of the basic primitives after conversion are completely consistent with the original drawing.

[0072] Step S2: Identify each segmented frame from the basic primitive set through a dual recognition mechanism that includes geometric feature detection and semantic content verification.

[0073] Specifically, step S2 is the segmentation frame recognition step, used to accurately locate the target segmentation unit from a complex set of basic primitives. The specific implementation is as follows: based on the set of basic primitives generated in step S1, a dual recognition mechanism including geometric feature detection and semantic content verification is initiated to complete the recognition of each segmentation frame. Geometric feature detection first filters closed contour primitives in the set of basic primitives, extracting geometric parameters such as the side length ratio, line thickness, and chamfer features of the contours, and matching them with a preset feature library of communication engineering drawing frames to initially select candidate frames. Semantic content verification then performs key character recognition on the text primitives inside and around the candidate frames, extracting key semantic information such as drawing numbers, professional identifiers, and area names. Semantic matching is completed using a communication engineering terminology dictionary. Through cross-validation of the geometric feature matching results and the semantic verification results, interference from false frames such as decorative contours and equipment borders is eliminated, ultimately accurately identifying all eligible segmentation frames, especially showing good recognition adaptability for non-orthogonal, partially overlapping, and nested frames.

[0074] Step S3: For each segmentation frame, according to the spatial attribution judgment algorithm corresponding to the geometric attributes of the basic graphic element, each basic graphic element in the set of basic graphic elements is assigned to its respective segmentation frame, wherein different geometric attributes correspond to different spatial attribution judgment algorithms.

[0075] Specifically, for each identified segmentation frame, a spatial attribution judgment algorithm system matching the geometric attributes of the basic primitives is constructed. Based on the different geometric attributes of the basic primitives, the corresponding judgment logic is called to accurately assign each basic primitive in the set of basic primitives to its respective segmentation frame. Different geometric attributes correspond to different spatial attribution judgment algorithms.

[0076] The spatial attribution determination algorithm constructs a differentiated judgment logic system for the diverse primitive types in communication engineering CAD drawings, in order to achieve accurate matching between basic primitives and segmented drawing frames. The judgment methods for each type of primitive are as follows:

[0077] For point-type primitives, the "point inside polygon" algorithm is used to determine whether the point-type primitive is located within the boundary of the drawing frame, thereby determining its affiliation.

[0078] For line-type graphic elements, the system determines their affiliation by judging whether both endpoints of the line-type graphic element are located within the same drawing frame boundary. If not, it further judges the intersection relationship between the line-type graphic element and the drawing frame boundary or uses centroid judgment to determine the affiliation.

[0079] For circular arc and elliptical arc primitives, their affiliation is determined by judging the positional relationship between the center, endpoints, and sampling points of the circular arc and elliptical arc primitives and the graphic frame;

[0080] For filled surface region primitives, the affiliation is determined by calculating the centroid of the filled surface region primitive and determining whether the centroid is located within the boundary of the drawing frame;

[0081] For composite-type labeled elements, the composite-type labeled elements are decomposed into basic elements of leaders, text, and arrows, and their affiliation is determined by combining the positional relationship between the basic elements of leaders, text, and arrows and the drawing frame.

[0082] Specifically, for point-type primitives, the algorithm "point inside polygon" is used as the core judgment criterion. By abstracting the segmented frame into a closed polygon boundary, the two-dimensional coordinates of the point-type primitives are extracted. The ray-mapping method is called to traverse the boundary segments of the frame, and the number of intersections between the rays and the boundary is counted. If the number of intersections is odd, the point-type primitive is determined to be inside the frame boundary and belongs to the current frame; if the number is even, it is determined to be outside the frame, and the judgment process for the next frame begins. This algorithm uses a coordinate precision control module to eliminate floating-point error interference, ensuring the accuracy of the judgment results.

[0083] For line-type primitives, a hierarchical judgment strategy is implemented: First, the coordinates of the two endpoints of the line-type primitive are extracted, and it is determined whether they are both located within the same drawing frame boundary. If so, the assignment is directly determined; otherwise, the intersection relationship between the line-type primitive and the drawing frame boundary is further analyzed. By calculating the intersection parameters of the line segment with each side of the drawing frame, it is determined whether the line segment has a valid intersection with the drawing frame. If the intersection length accounts for a preset threshold of the total length of the line-type primitive, it is assigned to the corresponding drawing frame; if the intersection relationship is unclear, the centroid calculation method is used. The centroid is obtained by weighted averaging of the coordinates of the two endpoints, and the point-within-a-polygon algorithm is called to determine the centroid assignment, thereby determining the drawing frame to which the line-type primitive belongs.

[0084] For circular and elliptical arc primitives, a multi-feature fusion judgment model is constructed: First, the core parameters of the circular arc, such as the center, radius, and start and end angles, or the center, major semi-axis, minor semi-axis, and rotation angle of the elliptical arc, are extracted to determine whether the center (or center) is located within the drawing frame. If so, the initial classification is determined. If the center (or center) is located outside the drawing frame, the two endpoints of the circular and elliptical arcs and several evenly distributed sampling points are further extracted. The proportion of each point located within the drawing frame is counted. When the proportion reaches a preset standard, the classification is determined. At the same time, arc length projection analysis is combined to calculate the projection length of the arc segment within the drawing frame boundary to help verify the classification judgment results and avoid misjudgment due to the primitive extending out of the drawing frame.

[0085] For filled region primitives, centroid positioning is the core determination method: the centroid coordinates of the region primitive are calculated by integrating the boundary coordinates of the filled region or by using a discrete point weighted average method. These centroid coordinates reflect the geometric center position of the region. Then, the "point within polygon" algorithm is called to determine whether the centroid is located within the boundary of the segmented frame. If the result is yes, the filled region primitive is assigned to the corresponding frame. For complex filled primitives composed of multiple sub-regions, the centroid assignment of each sub-region is calculated first, and then the overall assignment is determined based on the proportion of the area of ​​the sub-regions assigned to the same frame reaching a set ratio.

[0086] For composite annotation elements, the first step is to decompose the composite annotation into three basic elements through element association attribute parsing: leader lines (line type), text (text type), and arrows (point or line type). The initial assignment of each element is determined using the corresponding basic element's judgment algorithm, with text elements having the highest weight due to carrying core annotation information, while leader lines and arrows have equal weight. The comprehensive weight score of each segmented frame is calculated, and the composite annotation element is assigned to the frame with the highest score. If scores are the same, the assignment result of the text element is used as the final determination criterion, ensuring the relevance between the annotation information and the content of the corresponding frame.

[0087] Step S4: Based on the allocation results, create a new CAD sub-file for each of the segmented drawing frames, and migrate the basic graphic elements, associated layers, and style attributes belonging to the segmented drawing frames to the corresponding CAD sub-file.

[0088] Specifically, based on the element allocation results, an independent CAD sub-file is created for each segmented drawing frame. The format of the CAD sub-file is consistent with the original CAD drawing file to ensure compatibility with subsequent engineering design software. Then, the attribute migration engine is activated to completely migrate all basic elements belonging to that segmented drawing frame, along with their associated layer information and style attributes, to the corresponding CAD sub-file. Specifically, layer information migration includes the precise copying of attributes such as layer name, layer color, line type, and line width, ensuring that the sub-file's layer system is consistent with the original... Figure 1 The style attribute migration covers all related styles, including text styles, annotation styles, block definition styles, and fill styles. It achieves complete reading and writing of style parameters by calling the CAD file attribute interface, avoiding abnormal display of sub-files due to style loss. During the migration process, an attribute conflict detection module is set up to automatically add unique identifiers to duplicate layer names, block definitions, etc., to ensure the independence and usability of sub-files.

[0089] Step S5: Output all newly created CAD sub-files.

[0090] Specifically, all newly created CAD sub-files undergo integrity verification to confirm that no elements, layers, or style attributes are missing or incorrect. Then, all sub-files are output according to preset output rules. These rules include sub-file naming conventions and storage path configurations. Sub-file names can use a combination of the original filename, drawing frame number, and professional type to ensure clear and traceable file identification. Storage paths support user-defined settings and provide batch export functionality. A segmentation report is generated synchronously during the output process. The report includes original drawing information, the number of segmented drawing frames, the number of elements in each sub-file, attribute migration details, and verification results. This facilitates user review and management of the segmentation results, meeting the practical needs of multi-disciplinary collaboration and drawing archiving in engineering design.

[0091] As can be seen from the above technical solutions, the intelligent segmentation method and related equipment for CAD construction drawings provided in this application achieve intelligent segmentation through steps such as recursive scattering and parsing, dual recognition mechanism, and targeted spatial attribution judgment. Specifically, it obtains the CAD file to be segmented, parses and generates a set of basic graphic elements with geometric attributes, identifies the drawing frame and assigns graphic elements, and then generates and outputs a CAD sub-file containing the corresponding graphic elements and attributes, achieving multiple beneficial effects:

[0092] Firstly, it solves the problem of deep primitive parsing. This application uses recursive shuffling and matrix transformation techniques to perform deep traversal parsing of complex block entities, completely disassembles and accurately restores attribute information, ensuring that all basic primitive geometric attributes are fully recorded, completely avoiding primitive omissions, laying a solid data foundation for subsequent segmentation, and making up for the shortcomings of manual and semi-automated tools in processing complex primitives.

[0093] Secondly, it improves the efficiency of drawing frame recognition. This invention combines geometric feature detection and semantic content verification to construct a dual recognition mechanism, extracts the outline features of the drawing frame and matches them with professional keywords to assist in localization, efficiently identifies non-orthogonal, nested and overlapping drawing frames, significantly improves the recognition accuracy, breaks the dependence of traditional tools on standard drawing frames, and broadens the scope of application for processing communication engineering drawings.

[0094] Thirdly, it achieves accurate attribution of graphic elements. This invention establishes a differentiated judgment system based on the geometric attributes of graphic elements, employing discrimination strategies such as inclusion relationship verification for different element types to ensure accurate classification of complex elements such as cross-frame connecting lines, avoiding information errors and omissions. The resulting independent sub-files are small in size, allowing for precise distribution by discipline, optimizing multi-disciplinary collaboration, reducing design conflicts, and facilitating categorized storage, retrieval, and batch printing, providing core support for the digitization of communication engineering drawings.

[0095] In some embodiments of this application, the process of performing deep parsing of block reference entities in the CAD drawing file using a recursive shuffling algorithm in step S1 is described, which may specifically include:

[0096] Step S11: Starting from the current block reference entity, recursively obtain the block definition content referenced by the current block reference entity.

[0097] Specifically, the block reference entity exists in the CAD drawing file as an associated pointer. It does not contain complete drawing data, but only records the identification information and reference parameters of the block definition. This step calls the CAD file parsing interface to locate the corresponding block definition based on the identification information of the current block reference entity, and extracts all entity data contained in the block definition, such as basic entities like lines, arcs, and text, as well as nested block reference entities, to form the entity list of the current level. When the extracted entities contain a new block reference, the new block reference is used as the new current block reference entity, and the above block definition acquisition operation is repeated to realize the recursive extension of the parsing process.

[0098] Step S12: In each level of recursion, apply the spatial transformation matrix of the current block reference to perform coordinate transformation on the entities contained in the current block reference.

[0099] Specifically, when referencing a block definition, a block reference entity carries spatial transformation parameters. These parameters are integrated into a spatial transformation matrix, which contains geometric transformation information such as translation, scaling, rotation angle, and tilt coefficient. After obtaining the block definition entity corresponding to the current block reference, the original coordinates of each entity are correlated with the spatial transformation matrix through matrix multiplication to obtain the actual coordinates of the entity in the global coordinate system of the CAD drawing. This process ensures that entities in nested block references can still accurately restore their spatial position in the original drawing after multiple transformations, avoiding errors in subsequent element attribution judgments due to coordinate offsets.

[0100] The spatial transformation matrix is ​​defined as follows:

[0101]

[0102] Where M is the spatial transformation matrix. and Scaling factor For rotation angle, It is a translation vector.

[0103] Step S13: Add the entity after coordinate transformation to the basic primitive set. If the entity is a nested block reference, continue to recursively break it up until the set maximum recursion depth is reached or there are no more block references to break up.

[0104] Specifically, non-block reference entities after coordinate transformation are directly added to the global basic primitive set as basic primitives, and their original attribute information is synchronously associated. If the entity is still a block reference entity (i.e., a nested block reference), it is determined whether it meets the recursion continuation condition. When the current recursion level does not exceed the preset maximum recursion depth, and the block reference entity is not marked as resolved, the entity is used as the new current block reference, and the parsing process is returned to step S11 to be executed again. The setting of the maximum recursion depth is determined based on the actual block nesting level of the communication engineering CAD drawing, which ensures sufficient parsing of deep nested blocks while avoiding invalid recursion occupying too many system resources.

[0105] Step S14: During the recursion process, perform circular reference detection to avoid infinite recursion.

[0106] Specifically, a circular reference refers to a closed-loop relationship between block reference entities, such as block A referencing block B, block B referencing block C, and block C referencing block A. Without detection, this can lead to an infinite loop in the recursive process. This step implements loop detection by constructing a block reference recursion path stack. Before each recursive resolution, the identifier of the current block reference entity is pushed onto the stack. After obtaining the next level of block reference entities, it is checked whether the entity identifier already exists in the path stack. If it exists, it is determined to be a circular reference, the current recursive branch is immediately terminated, and the block reference entities involved in the circular reference are marked and processed according to preset rules, such as retaining the outermost block reference and prompting the user. If it does not exist, the recursion continues. When a certain level of resolution is completed, the current block reference identifier is popped from the path stack, ensuring that the path stack always reflects the current recursive resolution trajectory.

[0107] Considering that in practical applications, CAD drawing files have complex entity types and inconsistent formats, and that the recursive shuffling process may introduce duplicate elements, leading to data redundancy and affecting the efficiency of subsequent frame recognition and element allocation, the process after the recursive shuffling also includes entity type mapping and / or classification deduplication of the basic element set.

[0108] The execution process of the entity type mapping includes:

[0109] DXF entity types are mapped to internal data structures through predefined type mapping functions. Each internal data structure provides a unified geometric coordinate interface, attribute dictionary interface, and layer information interface.

[0110] Specifically, the predefined type mapping function constructs an association table between standard DXF entity types and custom internal data structures, covering entity types such as lines, arcs, polylines, text, and block references. Each DXF entity type has a predefined mapping rule. During mapping, the DXF type identifier of the entity is first extracted and matched against the target internal data structure in the association table. This internal data structure adopts an object-oriented design; its unified geometric coordinate interface outputs standardized coordinate parameters of primitives, such as the endpoint coordinates of lines and the center and radius coordinates of arcs. The attribute dictionary interface integrates inherent attributes such as the entity's color, line type, and line width. The layer information interface associates the name, status, and association identifier of the layer to which the entity belongs. Through this mapping process, DXF entities of different formats are converted into a unified data carrier, eliminating the interference of format differences on subsequent processing and providing a standardized data foundation for geometric feature extraction and spatial relationship judgment. For extended DXF entity types, the mapping function can call the extended interface for type parsing, ensuring that special entities can also be effectively mapped.

[0111] The execution process of the classification and deduplication process includes:

[0112] For high-frequency basic primitives, the geometric hash value of the high-frequency basic primitives is calculated and the hash set is used to perform fast deduplication with O(n) complexity.

[0113] For low-frequency or complex basic primitives, similarity deduplication is performed in O(n²) complexity by traversing and comparing the geometric attributes of the low-frequency or complex basic primitives with the bounding box.

[0114] Specifically, the system first categorizes entities into high-frequency and low-frequency types by statistically analyzing the frequency of occurrence of each entity type in the basic primitive set. Entities such as lines, simple arcs, and standard text, whose occurrence rate exceeds a preset proportion, are classified as high-frequency types. Composite annotations and special entities derived from the decomposition of custom blocks are classified as low-frequency or complex types. For high-frequency primitives, the geometric hash value is calculated using the core geometric attributes of the primitive as input. For example, a line uses the hash combination of the coordinates of its two endpoints as its feature value, and an arc uses the hash values ​​of its center, radius, and start and end angles as its feature values. The calculated geometric hash values ​​are stored in a hash set. If the hash value of a new primitive already exists in the set, it is considered a duplicate and is removed, achieving efficient deduplication. For low-frequency or complex primitives, the minimum bounding rectangle of the primitive is first calculated to initially screen out candidate comparison groups with overlapping bounding boxes. Then, the geometric attributes of the primitives in the candidate group, such as the leader path of the composite annotation and the boundary vertex sequence of the region, are compared parameter by parameter. Combined with the preset similarity threshold, it is determined whether they are duplicate primitives. For example, when the geometric attribute matching degree of two primitives reaches the set standard and the bounding box overlap degree meets the requirements, the earliest appearing primitive is retained and the duplicate is deleted, which ensures the accuracy of deduplication and avoids affecting the processing efficiency of high-frequency primitives.

[0115] In some embodiments of this application, the process of identifying each segmented bounding box from the basic primitive set through a dual recognition mechanism including geometric feature detection and semantic content verification in step S2 is described, which may specifically include:

[0116] Step S21: Select closed polyline entities from the set of basic primitives, and calculate the orthogonality deviation and area of ​​the closed polyline entities.

[0117] Specifically, in communication engineering CAD drawings, segmented drawing frames are often represented by closed polylines. Therefore, the initial step is to extract all polyline entities that meet the criteria of coinciding start and end points and no breakpoints from the basic primitive set, based on entity type identification and topological relationships, as the initial objects for drawing frame recognition. Orthogonality deviation calculation targets the angle between adjacent sides of the polyline, using vector dot product to obtain the difference between the actual angle and a 90° right angle; a smaller difference indicates higher squareness of the drawing frame. Area calculation uses the polygon area formula to calculate the actual coverage area of ​​the entity by applying the coordinates of the polyline vertices, providing data for subsequent filtering and elimination of small decorative outlines.

[0118] Step S22: Determine the polyline whose orthogonality deviation is less than the preset angle tolerance and whose area is greater than the preset area threshold as a candidate frame.

[0119] Specifically, the preset angle tolerance and area threshold are set based on industry standards for communication engineering drawings. The angle tolerance is used to accommodate slight tilting of non-standard drawing frames, while the area threshold is determined in conjunction with the minimum size of common drawing sheets. Through dual-condition filtering, pseudo-drawing frame entities such as irregular contours with poor orthogonality, equipment borders with too small area, and annotation boxes can be quickly eliminated, retaining only polylines whose shapes conform to the drawing frame characteristics as candidate drawing frames. This significantly reduces the processing load of subsequent semantic verification and improves the overall recognition efficiency.

[0120] Step S23: Within the preset title bar area of ​​each candidate frame, search for text entities that match a predefined communication industry keyword library.

[0121] Specifically, the preset title bar area is determined based on industry drawing habits, and is usually a fixed-scale area in the lower right or lower left corner of the candidate drawing frame. The boundary range of this area is located by coordinate conversion. The predefined communication industry keyword library covers professional terms such as base station number, fiber optic link, equipment room number, and design stage, as well as common title bar fields such as drawing code, scale, and date. A string fuzzy matching algorithm is used to perform content retrieval on the text entities in the title bar area, and it also supports combination matching to adapt to complex drawing text description scenarios.

[0122] Step S24: Confirm the candidate frames that match the text entities as segmentation frames.

[0123] Specifically, if at least one text entity matching the keyword database is found within the title bar area of ​​a candidate drawing frame, the candidate drawing frame is determined to carry the core identification information of the drawing and meets the definition of a segmented drawing frame, thus being identified as the target segmented drawing frame. If no matching text is found, it is determined to be a non-drawing frame entity and excluded. For candidate drawing frames with partial occlusion or blurred text, a text integrity restoration algorithm is used to optimize the matching effect, ensuring accurate identification of segmented drawing frames even when the drawing quality is poor.

[0124] Based on the above, since CAD drawings for communication engineering often contain detailed drawings nested within overview drawings, or overlapping of multiple disciplines' drawings leading to overlapping candidate drawing frames, direct confirmation can easily result in confusion regarding the segmentation range. Therefore, this application also includes:

[0125] When candidate frames with overlapping or nested positions are identified, the inclusion relationship between the candidate frames with overlapping or nested positions is calculated, and the candidate frame with the smallest area that is not contained by any other candidate frame is selected as the dividing frame.

[0126] Specifically, the spatial relationship between candidate frames is first determined by comparing boundary coordinates. For any two candidate frames A and B, their minimum boundary rectangles (MBRs) are extracted. If the overlap area of ​​the MBR exceeds a preset value, it is considered a positional overlap. If all vertices of frame A are within the boundary of frame B, and the area of ​​frame A is smaller than that of frame B, it is considered that frame A is nested within frame B. Then, an inclusion relationship tree of candidate frames is constructed. The included candidate frames are attached as child nodes to the parent node containing them. This tree structure is traversed to filter out the set of candidate frames without parent nodes (i.e., not included by other candidate frames). Finally, the candidate frame with the smallest area is selected from this set as the final segmentation frame. This logic is based on the industry characteristic that the smallest frame in communication engineering drawings corresponds to an independent drawing unit, ensuring that the segmented sub-files accurately correspond to the drawing content of a single profession or local function, avoiding information redundancy caused by frame nesting or overlap.

[0127] In some embodiments of this application, the process of migrating the basic graphic elements and associated layers and style attributes belonging to the segmented drawing frame in step S4 to the corresponding CAD sub-file is described, which may specifically include:

[0128] Step S41: Establish the layer mapping relationship between the CAD drawing file and the CAD sub-file, and map and migrate the associated layers containing the basic graphic elements belonging to the segmented drawing frame to the CAD sub-file.

[0129] Step S42: Obtain the style attribute set of the CAD drawing file, and copy and migrate the style attributes referenced by the basic graphic elements in the style attribute set to the CAD sub-file.

[0130] Step S43: Perform nested cleanup processing on the migrated text entities. The nested cleanup processing includes nested Unicode escape sequence conversion, font definition control character removal, text format control character cleanup, and illegal character replacement in filenames.

[0131] Specifically, the process begins by traversing all basic primitives belonging to the target segmentation frame, extracting layer association identifiers for each primitive, and forming a primitive-layer association table. Based on this table, layer mapping rules between the original image and sub-files are constructed, fully preserving the core attributes of the layers during the mapping process, including layer name, color value, line type, line width parameters, and visibility status. If a layer with the same name already exists in a sub-file, it is renamed by appending the unique identifier of the segmentation frame to the original layer name to avoid attribute conflicts. Simultaneously, the source information of the migrated layers is marked to facilitate subsequent tracing of the association between the sub-files and the original image, ensuring that the migrated layer system is both independent and complete, while maintaining attribute consistency with the original image.

[0132] The style attribute set encompasses all non-geometric attribute resources in CAD drawings, including text styles, annotation styles, block definition styles, fill styles, and linetype definitions. By traversing the attribute reference fields of the target basic elements, a subset of actually referenced style attributes is selected, excluding redundant styles that are not referenced. During copying and migration, the CAD file's style cloning interface is called to achieve precise field-by-field copying of style parameters. For example, the font type, character height, and character spacing of text styles, and the arrow style, dimensional tolerances, and baseline settings of annotation styles, are all completely consistent with the original drawing. After migration, a style reference verification mechanism is established to ensure that the style references of all elements in the sub-file are valid, avoiding abnormal element display due to missing styles.

[0133] Unicode escape sequence conversion uses a preset encoding mapping table to convert escape characters in text entities into their corresponding visual characters, resolving the issue of garbled characters for special symbols. Font definition control characters remove hidden control fields generated for AutoCAD, preserving their corresponding symbol meanings while deleting the original control characters. Text format control character cleanup removes redundant formatting symbols such as paragraph marks and line breaks from the text, ensuring neat text formatting. Illegal character replacement in filenames replaces illegal characters in text entities that may be used for subfile naming with valid alternative characters, preventing subsequent subfile naming errors. These cleanup steps are executed sequentially and nested, with format validation performed after each step to ensure the usability and standardization of the text entities.

[0134] Furthermore, in the attribute migration stage of the intelligent segmentation method for CAD construction drawings in this application, to further improve the conciseness and usability of the segmented CAD sub-files and avoid redundant attributes consuming resources and file anomalies caused by attribute conflicts, this application may also include two key optimization checking mechanisms, which are applied to the layer mapping and style attribute migration processes, respectively. The specific implementation methods are as follows:

[0135] Filtering and checking mechanisms in layer mapping:

[0136] This mechanism is applied to the process of establishing layer mapping relationships between CAD drawing files and CAD sub-files. Its core purpose is to filter out redundant layers that are irrelevant to the core content of the sub-files. Specifically, it is implemented as follows:

[0137] During the process of establishing the layer mapping relationship, it is checked whether the associated layer belongs to the preset filter layer set. If so, the layer is prevented from migrating to the CAD sub-file.

[0138] Specifically, after extracting the basic primitive associated layers belonging to the segmented frame, the layer filtering check process is first started to check whether the identification information of the associated layers belongs to the preset filter layer set.

[0139] The preset filter layer set is a set of layers pre-defined based on the drawing habits and industry needs of communication engineering CAD drawings. The layer types it contains are mainly auxiliary and temporary layers, such as auxiliary line layers used for the overall layout of the original drawing, temporary annotation layers used only as design references, draft layers generated during the drawing process, and management layers used to store drawing version information. The layer identifiers and names of this filter layer set are stored in a configurable XML file, which allows users to dynamically adjust it according to the actual scenario.

[0140] During the inspection, the associated layers and the filter layer set are compared using precise matching of layer identifiers. If the associated layer belongs to the filter layer set, a layer migration prevention command is triggered, and the layer will not be migrated to the CAD subfile. To avoid the loss of basic elements belonging to the filter layer, the system will automatically temporarily attach these elements to the default reserved layer of the CAD subfile. The attributes of the default reserved layer are set to neutral values ​​to ensure that the elements are displayed correctly. If the associated layer does not belong to the filter layer set, the complete migration of layer attributes is completed according to the normal process. If a layer with the same name exists, it is renamed by attaching a unique identifier for the split drawing frame to ensure the independence of the layer system.

[0141] Conflict handling mechanism in style property migration:

[0142] This mechanism is applied during the copying and migration of style attributes. Its core purpose is to resolve style name conflicts between CAD subfiles and the original drawing, ensuring that style attributes can be referenced correctly after migration. The specific implementation is as follows:

[0143] During the process of copying and migrating style attributes, check for style name conflicts. If a conflict occurs, use an overwrite or rename strategy to handle it.

[0144] Specifically, the process compares the style name to be migrated with existing style names in the CAD sub-file to determine if there are any duplicates. If a style name conflict is detected, a differentiated processing strategy is adopted based on the style type. For CAD system default styles, an overriding strategy is used, meaning the default style parameters in the CAD sub-file are overridden with the style parameters of the original drawing to be migrated, ensuring that the basic style of the sub-file remains consistent with the original drawing and avoiding display deviations of elements due to style differences. For user-defined styles, a renaming strategy is used, generating a new unique style name by appending a unique ID of the dividing frame to the original style name. Simultaneously, the original style name and source drawing information are recorded in the style's remarks attribute field for easy traceability and modification by users later.

[0145] Regardless of the handling strategy adopted, a style reference verification process will be initiated after the conflict is resolved. This process iterates through the style reference fields of all basic elements in the CAD sub-file to confirm that the style names referenced by each element are valid. This avoids problems such as text corruption and annotation anomalies caused by invalid style references, thus ensuring the availability of the sub-file.

[0146] The two mechanisms mentioned above optimize the attribute migration process from the two dimensions of simplification and stability, respectively. They reduce the size of sub-files by filtering redundant layers and ensure the integrity of sub-file attributes by conflict handling, thus improving the practicality and robustness of the intelligent segmentation method in this application.

[0147] The following describes an intelligent CAD construction drawing segmentation device provided in the embodiments of this application. The intelligent CAD construction drawing segmentation device described below and the intelligent CAD construction drawing segmentation method described above can be referred to and correspond to each other.

[0148] See Figure 2 , Figure 2 This is a schematic diagram of an intelligent CAD construction drawing segmentation device disclosed in an embodiment of this application.

[0149] like Figure 2 As shown, the intelligent CAD construction drawing segmentation device may include:

[0150] The recursive shuffling parsing unit 110 is used to obtain the CAD drawing file to be segmented, perform deep parsing of the block reference entities in the CAD drawing file through the recursive shuffling algorithm, convert and generate a set of basic primitives, and record the geometric attributes of each basic primitive.

[0151] The frame dual recognition unit 120 is used to identify each segmented frame from the basic primitive set through a dual recognition mechanism that includes geometric feature detection and semantic content verification.

[0152] The spatial attribution determination unit 130 is used to assign each basic graphic element in the set of basic graphic elements to its respective segmentation frame according to the spatial attribution determination algorithm corresponding to the geometric attribute of the basic graphic element for each segmentation frame, wherein different geometric attributes correspond to different spatial attribution determination algorithms.

[0153] The file migration construction unit 140 is used to create a new CAD sub-file for each of the segmented drawing frames according to the allocation result, and migrate each basic graphic element and associated layer and style attribute belonging to the segmented drawing frame to the corresponding CAD sub-file.

[0154] The split file output unit 150 is used to output all the newly created CAD sub-files.

[0155] As can be seen from the above technical solutions, the intelligent segmentation method and related equipment for CAD construction drawings provided in this application achieve intelligent segmentation through steps such as recursive scattering and parsing, dual recognition mechanism, and targeted spatial attribution judgment. Specifically, it obtains the CAD file to be segmented, parses and generates a set of basic graphic elements with geometric attributes, identifies the drawing frame and assigns graphic elements, and then generates and outputs a CAD sub-file containing the corresponding graphic elements and attributes, achieving multiple beneficial effects:

[0156] Firstly, it solves the problem of deep primitive parsing. This application uses recursive shuffling and matrix transformation techniques to perform deep traversal parsing of complex block entities, completely disassembles and accurately restores attribute information, ensuring that all basic primitive geometric attributes are fully recorded, completely avoiding primitive omissions, laying a solid data foundation for subsequent segmentation, and making up for the shortcomings of manual and semi-automated tools in processing complex primitives.

[0157] Secondly, it improves the efficiency of drawing frame recognition. This invention combines geometric feature detection and semantic content verification to construct a dual recognition mechanism, extracts the outline features of the drawing frame and matches them with professional keywords to assist in localization, efficiently identifies non-orthogonal, nested and overlapping drawing frames, significantly improves the recognition accuracy, breaks the dependence of traditional tools on standard drawing frames, and broadens the scope of application for processing communication engineering drawings.

[0158] Thirdly, it achieves accurate attribution of graphic elements. This invention establishes a differentiated judgment system based on the geometric attributes of graphic elements, employing discrimination strategies such as inclusion relationship verification for different element types to ensure accurate classification of complex elements such as cross-frame connecting lines, avoiding information errors and omissions. The resulting independent sub-files are small in size, allowing for precise distribution by discipline, optimizing multi-disciplinary collaboration, reducing design conflicts, and facilitating categorized storage, retrieval, and batch printing, providing core support for the digitization of communication engineering drawings.

[0159] Optionally, the step of performing deep parsing of block reference entities in the CAD drawing file using a recursive shuffling algorithm includes:

[0160] Starting from the current block reference entity, recursively retrieve the block definition content referenced by the current block reference entity;

[0161] In each level of recursion, the coordinate transformation of the entity contained in the current block reference is performed by applying the spatial transformation matrix of the current block reference;

[0162] The entity after coordinate transformation is added to the basic primitive set. If the entity is a nested block reference, it is recursively broken up until the maximum recursion depth is reached or there are no more block references to break up.

[0163] During the recursive process, circular reference checks are performed to avoid infinite recursion.

[0164] Optionally, the spatial transformation matrix is ​​defined as:

[0165]

[0166] Where M is the spatial transformation matrix. and Scaling factor For rotation angle, It is a translation vector.

[0167] Optionally, after the recursive shuffling, the basic primitive set is further subjected to entity type mapping and / or classification deduplication.

[0168] The execution process of the entity type mapping includes:

[0169] DXF entity types are mapped to internal data structures through predefined type mapping functions. Each internal data structure provides a unified geometric coordinate interface, attribute dictionary interface, and layer information interface.

[0170] The execution process of the classification and deduplication process includes:

[0171] For high-frequency basic primitives, the geometric hash value of the high-frequency basic primitives is calculated and the hash set is used to perform fast deduplication with O(n) complexity.

[0172] For low-frequency or complex basic primitives, similarity deduplication is performed in O(n²) complexity by traversing and comparing the geometric attributes of the low-frequency or complex basic primitives with the bounding box.

[0173] Optionally, the step of identifying each segmented bounding box from the basic primitive set through a dual recognition mechanism including geometric feature detection and semantic content verification includes:

[0174] Closed polyline entities are selected from the set of basic primitives, and the orthogonality deviation and area of ​​the closed polyline entities are calculated.

[0175] Polylines whose orthogonality deviation is less than a preset angle tolerance and whose area is greater than a preset area threshold are identified as candidate frames.

[0176] Within the preset title bar area of ​​each candidate frame, search for text entities that match a predefined database of communication industry keywords;

[0177] Candidate frames that match the text entities are identified as segmentation frames.

[0178] Optional, also includes:

[0179] When candidate frames with overlapping or nested positions are identified, the inclusion relationship between the candidate frames with overlapping or nested positions is calculated, and the candidate frame with the smallest area that is not contained by any other candidate frame is selected as the dividing frame.

[0180] Optionally, the spatial attribution determination algorithm includes:

[0181] For point-type primitives, the "point inside polygon" algorithm is used to determine whether the point-type primitive is located within the boundary of the drawing frame, thereby determining its affiliation.

[0182] For line-type graphic elements, the system determines their affiliation by judging whether both endpoints of the line-type graphic element are located within the same drawing frame boundary. If not, it further judges the intersection relationship between the line-type graphic element and the drawing frame boundary or uses centroid judgment to determine the affiliation.

[0183] For circular arc and elliptical arc primitives, their affiliation is determined by judging the positional relationship between the center, endpoints, and sampling points of the circular arc and elliptical arc primitives and the graphic frame;

[0184] For filled surface region primitives, the affiliation is determined by calculating the centroid of the filled surface region primitive and determining whether the centroid is located within the boundary of the drawing frame;

[0185] For composite-type labeled elements, the composite-type labeled elements are decomposed into basic elements of leaders, text, and arrows, and their affiliation is determined by combining the positional relationship between the basic elements of leaders, text, and arrows and the drawing frame.

[0186] Optionally, migrating the basic graphic elements and associated layers and style attributes belonging to the segmented drawing frame to the corresponding CAD sub-file includes:

[0187] Establish a layer mapping relationship between the CAD drawing file and the CAD sub-file, and migrate the associated layers containing the basic graphic elements belonging to the segmented drawing frame to the CAD sub-file;

[0188] Obtain the style attribute set of the CAD drawing file, and copy and migrate the style attributes referenced by the basic graphic elements in the style attribute set to the CAD sub-file;

[0189] The migrated text entities are subjected to nested cleanup processes, which include nested Unicode escape sequence conversion, font definition control character removal, text format control character cleanup, and illegal character replacement in filenames.

[0190] Optional, also includes:

[0191] During the process of establishing the layer mapping relationship, it is checked whether the associated layer belongs to the preset filter layer set. If so, the layer is prevented from migrating to the CAD sub-file.

[0192] During the process of copying and migrating style attributes, check for style name conflicts. If a conflict occurs, use an overwrite or rename strategy to handle it.

[0193] The intelligent CAD construction drawing segmentation device provided in this application embodiment can be applied to intelligent CAD construction drawing segmentation equipment. Figure 3 The hardware structure block diagram of the intelligent segmentation device for CAD construction drawings is shown. (Refer to...) Figure 3 The hardware structure of the intelligent segmentation device for CAD construction drawings may include: at least one processor 1, at least one communication interface 2, at least one memory 3, and at least one communication bus 4.

[0194] In this embodiment of the application, the number of processor 1, communication interface 2, memory 3, and communication bus 4 is at least one, and processor 1, communication interface 2, and memory 3 communicate with each other through communication bus 4;

[0195] Processor 1 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement embodiments of the present invention.

[0196] Memory 3 may include high-speed RAM, and may also include non-volatile memory, such as at least one disk storage device;

[0197] The memory stores a program, which the processor can call. The program is used for:

[0198] Obtain the CAD drawing file to be segmented, perform deep analysis on the block reference entities in the CAD drawing file through a recursive shuffling algorithm, convert them into a set of basic primitives, and record the geometric attributes of each basic primitive.

[0199] Each segmented bounding box is identified from the basic primitive set through a dual recognition mechanism that includes geometric feature detection and semantic content verification;

[0200] For each segmentation frame, according to the spatial attribution determination algorithm corresponding to the geometric attributes of the basic graphic elements, each basic graphic element in the set of basic graphic elements is assigned to its corresponding segmentation frame, wherein different geometric attributes correspond to different spatial attribution determination algorithms;

[0201] Based on the allocation results, a new CAD sub-file is created for each of the segmented drawing frames, and the basic graphic elements, associated layers, and style attributes belonging to the segmented drawing frames are migrated to the corresponding CAD sub-file.

[0202] Output all newly created CAD subfiles.

[0203] Optionally, the refined and extended functions of the program can be referred to the above description.

[0204] This application embodiment also provides a readable storage medium that can store a program suitable for execution by a processor, the program being used for:

[0205] Obtain the CAD drawing file to be segmented, perform deep analysis on the block reference entities in the CAD drawing file through a recursive shuffling algorithm, convert them into a set of basic primitives, and record the geometric attributes of each basic primitive.

[0206] Each segmented bounding box is identified from the basic primitive set through a dual recognition mechanism that includes geometric feature detection and semantic content verification;

[0207] For each segmentation frame, according to the spatial attribution determination algorithm corresponding to the geometric attributes of the basic graphic elements, each basic graphic element in the set of basic graphic elements is assigned to its corresponding segmentation frame, wherein different geometric attributes correspond to different spatial attribution determination algorithms;

[0208] Based on the allocation results, a new CAD sub-file is created for each of the segmented drawing frames, and the basic graphic elements, associated layers, and style attributes belonging to the segmented drawing frames are migrated to the corresponding CAD sub-file.

[0209] Output all newly created CAD subfiles.

[0210] Optionally, the refined and extended functions of the program can be referred to the above description.

[0211] This application also provides a computer program product, including a computer program, wherein the computer program is executed by a processor using the following method:

[0212] Obtain the CAD drawing file to be segmented, perform deep analysis on the block reference entities in the CAD drawing file through a recursive shuffling algorithm, convert them into a set of basic primitives, and record the geometric attributes of each basic primitive.

[0213] Each segmented bounding box is identified from the basic primitive set through a dual recognition mechanism that includes geometric feature detection and semantic content verification;

[0214] For each segmentation frame, according to the spatial attribution determination algorithm corresponding to the geometric attributes of the basic graphic elements, each basic graphic element in the set of basic graphic elements is assigned to its corresponding segmentation frame, wherein different geometric attributes correspond to different spatial attribution determination algorithms;

[0215] Based on the allocation results, a new CAD sub-file is created for each of the segmented drawing frames, and the basic graphic elements, associated layers, and style attributes belonging to the segmented drawing frames are migrated to the corresponding CAD sub-file.

[0216] Output all newly created CAD subfiles.

[0217] Optionally, the refined and extended functions of the program can be referred to the above description.

[0218] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0219] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.

[0220] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for intelligent segmentation of CAD construction drawings, characterized in that, include: Obtain the CAD drawing file to be segmented, perform deep analysis on the block reference entities in the CAD drawing file through a recursive shuffling algorithm, convert them into a set of basic primitives, and record the geometric attributes of each basic primitive. Each segmented bounding box is identified from the basic primitive set through a dual recognition mechanism that includes geometric feature detection and semantic content verification; For each segmentation frame, according to the spatial attribution judgment algorithm corresponding to the geometric attribute of the basic graphic element, each basic graphic element in the set of basic graphic elements is assigned to its corresponding segmentation frame, wherein different geometric attributes correspond to different spatial attribution judgment algorithms; Based on the allocation results, a new CAD sub-file is created for each of the segmented drawing frames, and the basic graphic elements, associated layers, and style attributes belonging to the segmented drawing frames are migrated to the corresponding CAD sub-file; Output all newly created CAD subfiles; The method of identifying segmented bounding boxes from the basic primitive set through a dual recognition mechanism that includes geometric feature detection and semantic content verification includes: Closed polyline entities are selected from the set of basic primitives, and the orthogonality deviation and area of ​​the closed polyline entities are calculated. Polylines whose orthogonality deviation is less than a preset angle tolerance and whose area is greater than a preset area threshold are identified as candidate frames. Within the preset title bar area of ​​each candidate frame, search for text entities that match a predefined database of communication industry keywords; Candidate frames that match the text entities are identified as segmentation frames.

2. The method according to claim 1, characterized in that, The deep parsing of block reference entities in the CAD drawing file using a recursive shuffling algorithm includes: Starting from the current block reference entity, recursively retrieve the block definition content referenced by the current block reference entity; In each level of recursion, the coordinate transformation of the entity contained in the current block reference is performed by applying the spatial transformation matrix of the current block reference; The entity after coordinate transformation is added to the basic primitive set. If the entity is a nested block reference, it is recursively broken up until the maximum recursion depth is reached or there are no more block references to break up. During the recursive process, circular reference checks are performed to avoid infinite recursion.

3. The method according to claim 2, characterized in that, The spatial transformation matrix is ​​defined as follows: Where M is the spatial transformation matrix. and Scaling factor For rotation angle, It is a translation vector.

4. The method according to claim 1, characterized in that, After the recursive shuffling, the process also includes entity type mapping and / or classification deduplication of the basic primitive set; The execution process of the entity type mapping includes: DXF entity types are mapped to internal data structures through predefined type mapping functions. Each internal data structure provides a unified geometric coordinate interface, attribute dictionary interface, and layer information interface. The execution process of the classification and deduplication process includes: For high-frequency basic primitives, the geometric hash value of the high-frequency basic primitives is calculated and the hash set is used to perform fast deduplication with O(n) complexity. For low-frequency or complex basic primitives, similarity deduplication is performed in O(n²) complexity by traversing and comparing the geometric attributes of the low-frequency or complex basic primitives with the bounding box.

5. The method according to claim 1, characterized in that, Also includes: When candidate frames with overlapping or nested positions are identified, the inclusion relationship between the candidate frames with overlapping or nested positions is calculated, and the candidate frame with the smallest area that is not contained by any other candidate frame is selected as the dividing frame.

6. The method according to claim 1, characterized in that, The spatial attribution determination algorithm includes: For point-type primitives, the "point inside polygon" algorithm is used to determine whether the point-type primitive is located within the boundary of the drawing frame, thereby determining its affiliation. For line-type graphic elements, the system determines their affiliation by judging whether both endpoints of the line-type graphic element are located within the same drawing frame boundary. If not, it further judges the intersection relationship between the line-type graphic element and the drawing frame boundary or uses centroid judgment to determine the affiliation. For circular arc and elliptical arc primitives, their affiliation is determined by judging the positional relationship between the center, endpoints, and sampling points of the circular arc and elliptical arc primitives and the graphic frame; For filled surface region primitives, the affiliation is determined by calculating the centroid of the filled surface region primitive and determining whether the centroid is located within the boundary of the drawing frame; For composite-type labeled elements, the composite-type labeled elements are decomposed into basic elements of leaders, text, and arrows, and their affiliation is determined by combining the positional relationship between the basic elements of leaders, text, and arrows and the drawing frame.

7. The method according to claim 1, characterized in that, The step of migrating the basic graphic elements and associated layers and style attributes belonging to the segmented drawing frame to the corresponding CAD sub-file includes: Establish a layer mapping relationship between the CAD drawing file and the CAD sub-file, and migrate the associated layers containing the basic graphic elements belonging to the segmented drawing frame to the CAD sub-file; Obtain the style attribute set of the CAD drawing file, and copy and migrate the style attributes referenced by the basic graphic elements in the style attribute set to the CAD sub-file; The migrated text entities are subjected to nested cleanup processes, which include nested Unicode escape sequence conversion, font definition control character removal, text format control character cleanup, and illegal character replacement in filenames.

8. The method according to claim 7, characterized in that, Also includes: During the process of establishing the layer mapping relationship, it is checked whether the associated layer belongs to the preset filter layer set. If so, the layer is prevented from migrating to the CAD sub-file. During the process of copying and migrating style attributes, check for style name conflicts. If a conflict occurs, use an overwrite or rename strategy to handle it.

9. A smart segmentation device for CAD construction drawings, characterized in that, include: The recursive shuffling parsing unit is used to obtain the CAD drawing file to be segmented, perform deep parsing of the block reference entities in the CAD drawing file through the recursive shuffling algorithm, convert and generate a set of basic primitives, and record the geometric attributes of each basic primitive. The frame dual recognition unit is used to identify each segmented frame from the basic primitive set through a dual recognition mechanism that includes geometric feature detection and semantic content verification. A spatial attribution determination unit is used to assign each basic graphic element in the set of basic graphic elements to its corresponding segmentation frame according to a spatial attribution determination algorithm corresponding to the geometric attributes of the basic graphic elements, wherein different geometric attributes correspond to different spatial attribution determination algorithms. The file migration construction unit is used to create a new CAD sub-file for each of the segmented drawing frames according to the allocation results, and migrate each basic graphic element and associated layer and style attribute belonging to the segmented drawing frame to the corresponding CAD sub-file; The split file output unit is used to output all the newly created CAD sub-files; The method of identifying segmented bounding boxes from the basic primitive set through a dual recognition mechanism that includes geometric feature detection and semantic content verification includes: Closed polyline entities are selected from the set of basic primitives, and the orthogonality deviation and area of ​​the closed polyline entities are calculated. Polylines whose orthogonality deviation is less than a preset angle tolerance and whose area is greater than a preset area threshold are identified as candidate frames. Within the preset title bar area of ​​each candidate frame, search for text entities that match a predefined database of communication industry keywords; Candidate frames that match the text entities are identified as segmentation frames.

10. A smart segmentation device for CAD construction drawings, characterized in that, Including memory and processor; The memory is used to store programs; The processor is used to execute the program to implement each step of the intelligent segmentation method for CAD construction drawings as described in any one of claims 1-8.

11. A readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements each step of the intelligent segmentation method for CAD construction drawings as described in any one of claims 1-8.

12. A computer program product, comprising a computer program, characterized in that, The computer program is executed by the processor to perform each step of the intelligent segmentation method for CAD construction drawings as described in any one of claims 1-8.

Citation Information

Patent Citations

  • CN104408269A

  • CN118015649A