Automatic equipment layout method and system based on geometric constraints and engineering rules
By adopting an automated equipment layout method based on geometric constraints and engineering rules, the problems of low efficiency and poor accuracy in equipment layout in irregular spaces are solved. This method enables efficient and accurate equipment layout and simultaneous generation of ancillary facilities, thereby improving the synergy and flexibility of the design.
Patent Information
- Application Number
- CN202511338920.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-18
- Publication Date
- 2026-02-10
AI Technical Summary
Existing technologies involve labor-intensive and lengthy design processes for equipment layout in irregular spaces, and lack integrated, intelligent, and automated layout solutions, making it difficult to maximize space utilization and ensure design accuracy.
An automated equipment layout method based on geometric constraints and engineering rules is adopted. By determining the target physical space and its unusable areas, the maximum usable rectangular area is calculated. Based on engineering margins and layout rules, equipment unit graphic entities and auxiliary entities are generated. Combined with the extended data function of the CAD platform, data persistence and differential updates are performed.
It significantly improves layout efficiency, ensures the standardization and accuracy of design, optimizes space utilization, realizes automated and integrated design of equipment layout, and reduces errors caused by human negligence.
Smart Images

Figure CN121502864A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer-aided design (CAD), and in particular to a device automatic layout method and system based on geometric constraints and engineering rules. BACKGROUND
[0002] In the engineering design of communication, power, data center and other industries, designers need to use CAD software to plan and deploy a large number of device units on the two-dimensional plan of a building such as a machine room or a factory building. This process faces the challenge of maximizing utilization in an irregular space containing obstacles.
[0003] In the prior art, this layout process mainly relies on manual operation by the designer: first, the irregular room boundary and internal permanent obstacles such as columns and walls need to be measured, and then the device tiles are dragged by repeatedly trying and error, using basic commands such as "copy" and "move", in order to maximize the use of space while meeting safety and maintenance spacing requirements. This process not only requires a lot of labor and a long design cycle, but also depends heavily on the personal experience of the designer, making it difficult to ensure optimality and accuracy.
[0004] At the same time, although there are isolated geometric space algorithms such as "maximum inscribed rectangle in a polygon" in the academic field, there is a significant gap in the prior art, i.e., the lack of an integrated and automated CAD solution that can deeply integrate and seamlessly interface such advanced geometric algorithms, specific engineering design specifications (such as multi-directional safety margins and non-uniform device specifications), and configurable layout strategies (such as multiple starting directions and arrangement rules). Therefore, how to convert pure algorithmic capabilities into practical productivity that can solve complex engineering constraints is a technical problem that needs to be solved in this field. SUMMARY
[0005] The present application provides a device automatic layout method and system based on geometric constraints and engineering rules to solve the technical gap that the prior art cannot provide an integrated and intelligent target physical space layout solution.
[0006] According to a first aspect, a device automatic layout method based on geometric constraints and engineering rules is provided in an embodiment, the method comprising:
[0007] In the building design drawing, the target physical space and its internal unusable area are determined;
[0008] The available area is determined, which is the largest rectangular area that can be accommodated in the target physical space and aligned with the coordinate axis while completely avoiding all unusable areas;
[0009] based on a preset or user-configured engineering margin value, inwardly shrinking the obtained available region to generate a final deployable region satisfying engineering specifications;
[0010] based on a preset set of layout rules, generating device unit graphical entities within the final deployable region, and synchronously generating auxiliary entities associated with the device unit layout.
[0011] Further, in the architectural design drawing, the target physical space and its internal unavailable region are determined, specifically including:
[0012] obtaining closed boundary geometry information specified by a user and used to define the target physical space, the target physical space being a two-dimensional or three-dimensional region defined by the closed boundary;
[0013] obtaining geometry information of one or more unavailable regions inside the target physical space, the unavailable region being any region that needs to be avoided when deploying devices inside the target physical space.
[0014] Further, the available region is determined, the available region being the largest rectangular region that can be accommodated in the target physical space and aligned with the coordinate axes on the premise of completely avoiding all unavailable regions, specifically including:
[0015] a. Spatial discretization: The minimum bounding box containing the target physical space is gridded to form an MxN binary matrix C, and the precision of the grid cell is dynamically determined according to the size of the space;
[0016] b. Unit state determination: Each cell C(i,j) in the matrix C is traversed, the center point coordinate of which is P(i,j), and the belonging of P(i,j) is determined by the ray method: if P(i,j) is inside the boundary of the target physical space and not inside any unavailable region, then the cell C(i,j) is an available cell, and C(i,j) is set to 1; otherwise, the cell C(i,j) is a disabled cell, and C(i,j) is set to 0;
[0017] c. Dynamic programming solution: Based on the state matrix C, an improved maximum rectangular area dynamic programming algorithm is used for solving, specifically as follows:
[0018] First, a height matrix H of the same size as C is constructed, and the value of H(i,j) represents the number of cells that are 1 in the upward direction at the position (i,j), and the corresponding recursive formula is:
[0019] H(i,j) = H(i-1,j) + 1, if C(i,j) = 1
[0020] H(i,j) = 0, if C(i,j) = 0
[0021] For the first row i = 0: H(0,j) = C(0,j);
[0022] Subsequently, for each row i of the height matrix H, it is treated as a histogram, and the maximum rectangle area algorithm in the histogram is applied to calculate the maximum rectangle area with row i as the base; after traversing all rows, the maximum area obtained is the maximum inscribed rectangle in the entire target physical space.
[0023] Furthermore, based on preset or user-configured engineering margin values, the obtained available area is shrunk inward to generate a final deployable area that meets engineering specifications, specifically including:
[0024] The engineering margin values include the shrinkage distances in four independently definable directions: top, bottom, left, and right.
[0025] Furthermore, based on preset or user-configured engineering margin values, the obtained available area is shrunk inward to generate a final deployable area that meets engineering specifications, specifically including:
[0026] Based on preset or user-configured engineering margin values, the calculated maximum rectangular region is shrunk inward to generate the final deployable region. The vertex coordinates of the final deployable region are in the range of [X'_min, X'_max] and [Y'_min, Y'_max]. The specific calculation formula is as follows:
[0027] X'_min=X_min+m_left
[0028] X'_max=X_max-m_right
[0029] Y'_min=Y_min+m_bottom
[0030] Y'_max=Y_max-m_top
[0031] Wherein, the engineering margin value M = {m_top,m_bottom,m_left,m_right}, where m_top,m_bottom,m_left,m_right are the contraction distances in the four directions of top, bottom, left, and right, respectively; the vertex coordinate range of the maximum rectangular region is [X_min,X_max] and [Y_min,Y_max].
[0032] Furthermore, based on a preset layout rule set, a device unit graphical entity is generated within the final deployable area, and simultaneously, associated entities related to the device unit layout are generated, specifically including:
[0033] Obtain structured source data, including a device list and a layout rule set; the device list contains a set D = {d_1, d_2, ..., d_n} of n device units to be deployed, and each device unit d_i contains at least its unique identifier ID_i, physical width_i, and physical depth_i attribute information; the layout rule set contains device unit size, device spacing, arrangement spacing, arrangement direction, and attached entity parameters;
[0034] An iterative filling algorithm is used to calculate the placement of device units, as detailed below:
[0035] a. Initialization:
[0036] Based on the arrangement direction Dir, determine the starting base vector P_base of the layout;
[0037] Initialize the current placement vector P_curr = P_base;
[0038] Initialize the maximum device depth of the current row, D_max_row, to 0.
[0039] b. Iterative layout loop:
[0040] For each device d_i in the device list D, where i ranges from 1 to n, perform the following operations:
[0041] Based on the arrangement direction Dir, determine the effective dimensions of the equipment to be placed in the CAD coordinate system: width w and depth d;
[0042] Automatic line wrapping determination: Determine whether placing device d_i at P_curr will cause it to exceed the boundary of the main arrangement axis. If it does, perform a line wrapping operation.
[0043] Place and update the status:
[0044] The calculation location for the recording device d_i is P_curr;
[0045] Update the maximum device depth of the current row: D_max_row = max(D_max_row, d);
[0046] Calculate and update the starting point P_curr of the next device, with the update amount ΔP determined by the arrangement direction Dir.
[0047] Furthermore, based on a preset layout rule set, a device unit graphical entity is generated within the final deployable area, and simultaneously, associated entities related to the device unit layout are generated, specifically including:
[0048] After the layout of the equipment units is completed, the centerline path coordinates of the associated associated entities of each equipment row are used to connect the coordinates of the already laid-out equipment rows and the parameters of the associated entities in the layout rule set, and the associated entities are generated.
[0049] Furthermore, the method also includes:
[0050] Data persistence: Utilize the XData extended data function of the CAD platform to associate key metadata containing physical attributes and logical relationship information with the generated graphic entities for subsequent identification and intelligent updates;
[0051] Reverse reading and data reconstruction: First, scan the CAD drawing space and identify all managed equipment entities by searching for XData with specific identifiers; then, reverse read all metadata from the XData of each entity and reconstruct the equipment list data structure in memory that is completely consistent with the current drawing.
[0052] Furthermore, the method also includes:
[0053] Differential update: Modify the reconstructed data structure through a parameterized input interface, and perform a differential update based on the modified content after receiving the update instruction.
[0054] According to a second aspect, one embodiment provides an automated equipment layout system based on geometric constraints and engineering rules, the system comprising:
[0055] The spatial information acquisition module is used to determine the target physical space and its unusable internal areas in architectural design drawings;
[0056] The available area calculation module is used to determine the available area, which is the largest rectangular area that can be accommodated in the target physical space and is aligned with the coordinate axis, provided that all unusable areas are completely avoided.
[0057] The engineering specification application module is used to shrink the obtained available area inward based on preset or user-configured engineering margin values to generate a final deployable area that meets the engineering specifications.
[0058] The intelligent layout generation module is used to generate device unit graphic entities within the final deployable area based on a preset layout rule set, and simultaneously generate auxiliary entities associated with the device unit layout.
[0059] This invention provides an automated equipment layout method and system based on geometric constraints and engineering rules, which has the following beneficial effects:
[0060] 1) Significantly improve efficiency: The original manual trial and error layout process, which used to take hours or even days, is shortened to an automated calculation process that takes only a few minutes.
[0061] 2) Ensure standardization and accuracy: By applying engineering margins and layout rules in a procedural manner, problems such as non-compliance with specifications or dimensional errors caused by human negligence are completely avoided.
[0062] 3) Optimize space utilization: The algorithm accurately calculates the maximum available space, ensuring that the space utilization rate of the layout scheme reaches or approaches the theoretical optimal value, which surpasses the limitations of human experience.
[0063] 4) Achieve integrated design: While laying out core equipment, auxiliary facilities such as cable trays can be generated simultaneously, ensuring the integrity of the design scheme, avoiding secondary design, and improving the collaboration of the design. Attached Figure Description
[0064] Figure 1 A flowchart illustrating an automated device layout method based on geometric constraints and engineering rules, provided as an embodiment of the present invention;
[0065] Figure 2 This is a schematic diagram of a user selecting a physical space closed boundary (101) in a CAD interface in an automated equipment layout method based on geometric constraints and engineering rules, provided as an embodiment of the present invention.
[0066] Figure 3 In an embodiment of the present invention, a method for automated device layout based on geometric constraints and engineering rules is provided, in which the user... Figure 2 A schematic diagram of interactive selection of unavailable areas (102) within the space;
[0067] Figure 4 A schematic diagram of the maximum inscribed rectangular region (201) automatically calculated and generated in an automated device layout method based on geometric constraints and engineering rules according to an embodiment of the present invention;
[0068] Figure 5 This is a schematic diagram of the final deployable area (301) formed by shrinking the maximum inscribed rectangular region (201) after engineering margin contraction in an automated device layout method based on geometric constraints and engineering rules according to an embodiment of the present invention.
[0069] Figure 6 This is a schematic diagram of the final effect after the automatic layout of equipment units (401, 402) and associated cable trays (403) is completed according to preset rules in an automated equipment layout method based on geometric constraints and engineering rules provided in an embodiment of the present invention. Detailed Implementation
[0070] The present invention will now be described in further detail with reference to specific embodiments and accompanying drawings. Similar elements in different embodiments are referred to by associated similar element reference numerals. In the following embodiments, many details are described to facilitate a better understanding of the invention. However, those skilled in the art will readily recognize that some features may be omitted in different situations, or may be replaced by other elements, materials, or methods. In some cases, certain operations related to the present invention are not shown or described in the specification. This is to avoid obscuring the core parts of the invention with excessive description. For those skilled in the art, detailed description of these related operations is not necessary; they can fully understand the related operations based on the description in the specification and general technical knowledge in the art.
[0071] Furthermore, the features, operations, or characteristics described in the specification can be combined in any suitable manner to form various embodiments. At the same time, the steps or actions in the method description can be rearranged or adjusted in a manner obvious to those skilled in the art. Therefore, the various orders in the specification and drawings are only for the clear description of a particular embodiment and do not imply a necessary order, unless otherwise stated that a particular order must be followed.
[0072] In this specification, some key terms are defined as follows:
[0073] Target physical space: refers to a two-dimensional or three-dimensional area defined by a closed boundary, such as a room or designated area in an architectural floor plan.
[0074] Unusable areas: refer to any areas within the target physical space that need to be avoided when deploying equipment, including but not limited to permanent facilities such as building load-bearing columns, walls, air ducts, and distribution boxes, or temporarily designated no-dispatch zones by the user.
[0075] Equipment unit: refers to any entity with a defined physical size that needs to be laid out within a target physical space, such as communication cabinets, server racks, power cabinets, etc.
[0076] Structured data source: refers to a data file or data stream that stores information such as the list, specifications, and quantity of equipment units to be deployed in a specific format (such as JSON, XML, CSV, etc.).
[0077] The first embodiment of this invention provides an automated equipment layout method based on geometric constraints and engineering rules, which can be implemented as a plug-in module or secondary development program of a CAD software platform. The following is in conjunction with... Figure 1 Please provide a detailed explanation.
[0078] like Figure 1As shown, in step S100, the target physical space and its unusable internal areas are determined in the architectural design drawings.
[0079] The above steps specifically include:
[0080] This step involves acquiring geometric information representing the target physical space and its unusable internal regions. The aim is to transform a visual engineering drawing problem into a computer-processable digital problem with geometric constraints. Specifically, this step includes the system prompting the user, through the interactive interface of the CAD platform, to identify areas within the current design drawing, such as... Figure 2 As shown, select a closed boundary entity 101 that can represent the target physical space, such as... Figure 3 As shown, one or more entities 102 representing unusable regions are selected. The system stores the obtained set of vertex coordinates {V_b} and {V_h1,V_h2,...} of the boundary and unusable regions in memory to prepare for subsequent calculations.
[0081] like Figure 1 As shown, in step S200, an available area is determined. The available area is the largest rectangular area that can be accommodated within the target physical space and is aligned with the coordinate axis, provided that all unusable areas are completely avoided.
[0082] The above steps specifically include:
[0083] Solving for the maximum inscribed rectangle. This step uses the geometric information obtained in step S100 as input parameters and calls the built-in core geometric calculation engine to solve the problem of "the maximum axis-aligned inscribed rectangle within a polygon with a hole". A practical implementation method is as follows:
[0084] a) Spatial discretization: The smallest bounding box containing the target physical space is meshed to form an M×N binary matrix C. The precision res of the mesh cell can be dynamically determined according to the spatial size.
[0085] b) Element State Determination: For each element C(i,j) in matrix C, its center point coordinates are P(i,j). The assignment of P(i,j) is determined using the Ray-Casting Algorithm, as follows:
[0086] If P(i,j) is inside the target physical space boundary 101 and not inside any unusable region 102, then the cell is a usable cell and C(i,j) = 1; otherwise, the cell is a disabled cell and C(i,j) = 0.
[0087] c) Dynamic Programming Solution: Based on the state matrix C, an improved dynamic programming algorithm for "maximum rectangle area" is adopted, as follows:
[0088] First, construct a height matrix H of the same size as C. The value of H(i,j) represents the number of consecutive "1"s above the position (i,j). Its recursive formula is:
[0089] H(i,j)=H(i-1,j)+1,ifC(i,j)=1;
[0090] H(i,j)=0,ifC(i,j)=0;
[0091] (For the first row i = 0, H(0,j) = C(0,j))
[0092] Subsequently, for each row i of the height matrix H, it is treated as a histogram, and the "maximum rectangle area in the histogram" algorithm (a classic algorithm that can be solved in O(N) time) is applied to calculate the area of the largest rectangle with that row as its base. After traversing all rows, the maximum area obtained corresponds to the largest inscribed rectangular region 201 in the entire space, as shown below. Figure 4 As shown.
[0093] like Figure 1 As shown, in step S300, based on the preset or user-configured engineering margin value, the obtained available area is shrunk inward to generate a final deployable area that meets the engineering specifications.
[0094] The above steps specifically include:
[0095] The final deployable region is generated using engineering margins. This step, based on preset or user-configured engineering margin values M = {m_top, m_bottom, m_left, m_right}, shrinks the calculated maximum inscribed rectangle region 201 (whose vertex coordinates range [X_min, X_max] and [Y_min, Y_max]) inwards to generate the final deployable region 301, as shown below. Figure 5 As shown, the formulas for calculating the new coordinate ranges [X'_min, X'_max] and [Y'_min, Y'_max] are as follows:
[0096] X'_min=X_min+m_left
[0097] X'_max=X_max-m_right
[0098] Y'_min=Y_min+m_bottom
[0099] Y'_max=Y_max-m_top
[0100] like Figure 1As shown, in step S400, based on a preset layout rule set, a device unit graphical entity is generated in the final deployable area, and ancillary entities associated with the device unit layout are generated simultaneously.
[0101] The above steps specifically include:
[0102] S410, Intelligent Filling Layout of Device Units Based on Layout Rule Set. This step, based on a configurable, structured engineering rule set, automatically completes the precise placement of all device units within the deployable area 301 determined in step S300, and can simultaneously generate associated auxiliary entities. This step specifically includes:
[0103] S411, Obtaining the Layout Rule Set and Data Source
[0104] First, obtain two types of core information from one or more preset data sources:
[0105] Device inventory data: A set D = {d_1, d_2, ..., d_n} containing n device units to be deployed. Each device unit d_i is a data structure, containing at least its unique identifier ID_i, physical width_i, and physical depth_i. This data source can be an external file (such as JSON or XML) or dynamically constructed by the user through a parameterized input interface.
[0106] Layout rule set parameters: A set of parameters R that defines the layout rules, including at least:
[0107] Arrangement Direction Strategy Dir: A strategy parameter used to define the starting point and primary / secondary arrangement axes of the layout. In this embodiment, the arrangement direction in the layout rule set includes at least eight strategy combinations (e.g., starting from the southwest corner, the arrangement faces west) to precisely control the starting point and primary / secondary arrangement axes of the layout. For example, an enumerated value can represent multiple combinations such as "starting from the southwest corner, the arrangement faces west" or "starting from the northeast corner, the arrangement faces north". This parameter determines the "growth" direction of the layout.
[0108] Geometric constraint parameters: such as the spacing between device cells S_dev and the spacing between device rows S_row.
[0109] Advanced constraint parameters: For example, a "safety buffer" d_buffer used to geometrically extend the unusable region (obstacle) 102 before calculating the maximum available space.
[0110] Attached entity parameters: such as the 3D elevation information of associated facilities like cable trays, used for subsequent generation.
[0111] S412, Execution of the iterative filling algorithm
[0112] Based on the acquired device list D and rule set R, an iterative filling algorithm is executed within the final deployable region 301 defined by [X'_min, X'_max] and [Y'_min, Y'_max]. Its mathematical description is as follows:
[0113] a) Initialization:
[0114] Based on the arrangement direction strategy Dir, determine the starting base point vector P_base of the layout. For example, if Dir is "starting from the southwest corner", then P_base = (X'_min, Y'_min);
[0115] Initialize the current placement vector P_curr = P_base;
[0116] Initialize the maximum device depth D_max_row of the current row to 0.
[0117] b) Iterative layout loop: For each device d_i (i from 1 to n) in the device list D, perform the following operations:
[0118] Based on the arrangement direction Dir, determine the effective dimensions (w, d) of the equipment to be placed in the CAD coordinate system. For example, when the equipment faces west or east, its actual width is its physical depth, and its depth is its physical width, so w = depth_i, d = width_i; when the equipment faces south or north, w = width_i, d = depth_i.
[0119] Automatic line wrapping determination: Determine whether placing device d_i at P_curr would cause it to exceed the boundary of the main arrangement axis. For example, if Dir determines that the main arrangement axis is the positive Y-axis, the determination condition is: P_curr.y+w>Y'_max. If this condition is true, a line wrapping operation is performed, as follows:
[0120] Update the X coordinate (secondary permutation axis coordinate) of P_curr: P_curr.x = P_curr.x + D_max_row + S_row;
[0121] Reset the Y-coordinate (major axis coordinate) of P_curr: P_curr.y = P_base.y;
[0122] Reset the maximum device depth of the current row: D_max_row = 0.
[0123] Place and update the status:
[0124] The calculation location for the recording device d_i is P_curr;
[0125] Update the maximum device depth of the current row: D_max_row = max(D_max_row, d);
[0126] Calculate and update the starting point P_curr for the next device, with the update vector ΔP determined by Dir. For example, if the main arrangement axis is the positive Y-axis, then ΔP = (0, w + S_dev), and the updated P_curr is P_curr_old + ΔP.
[0127] S413, Related Entity Generation (Cable Tray Path Calculation):
[0128] like Figure 6 As shown, after completing the layout calculation of all equipment units 401 and 402, the centerline path coordinates of associated entities such as the associated cable tray 403 used to connect these equipment rows are automatically calculated based on the recorded coordinate range of each row of equipment and the parameters of the associated entities in the rule set, thus preparing for the generation of the graphics.
[0129] S420, Data-Driven Graphics Generation
[0130] The calculated precise coordinates, dimensions, rotation angles, and other parameters of all device units and associated entities are serialized into an intermediate data file. Subsequently, a separate native code module is called by the program to parse this file and generate graphic entities in batches at high speed and with high accuracy in CAD. The advantage of this architecture is that it decouples complex business logic from high-performance underlying graphics operations, improving system stability and rendering efficiency in large-scale scenes.
[0131] S430, Persistence and Traceability of Design Data
[0132] By utilizing the Extended Data (XData) feature of the CAD platform, critical metadata can be directly attached to the generated graphic entities. For a generated device entity, its XData contains TypedValue pairs of the following types:
[0133] (DxfCode.ExtendedDataRegAppName,"MyAppName") A unique application name used for identification;
[0134] (DxfCode.ExtendedDataAsciiString,"Device ID:Cab-001");
[0135] (DxfCode.ExtendedDataReal, 600.0) depth;
[0136] (DxfCode.ExtendedDataReal, 800.0) width;
[0137] (DxfCode.ExtendedDataInteger32,1) is an enumeration value for the arrangement direction;
[0138] The handle to the deployment region entity to which (DxfCode.ExtendedDataHandle,"3E8F") belongs.
[0139] By persisting the physical attributes of entities and their logical relationships with other design elements (such as handles), each generated device entity has the ability to "describe itself," laying the foundation for subsequent intelligent identification and management.
[0140] S500, Interactive Closed-Loop Management Process
[0141] This embodiment also provides a closed-loop management process that supports design iteration. This process does not depend on a specific interface form, and its core logic includes:
[0142] a) Forward configuration and drivers:
[0143] Users provide the required device list and layout rule parameters through a parameterized input interface (which can be implemented as a dialog box, command line, or property panel, etc.). After receiving these parameters, the calculations in steps S412 and S413 are driven, and finally, the initial device layout drawing is generated in CAD.
[0144] b) Reverse reading and data reconstruction:
[0145] When it is necessary to modify an existing layout, the system can:
[0146] First, the CAD drawing space is scanned, and all device entities managed by this system are identified by searching for XData with the specific identifier "MyAppName".
[0147] Next, all metadata (ID, size, associated handle, etc.) of each entity is read in reverse from its XData, and the equipment list data structure that is completely consistent with the current drawing is reconstructed in memory.
[0148] Then, a coordinate intelligent sorting and grouping algorithm is invoked to analyze the read device entity coordinates. This algorithm uses a persistent arrangement direction strategy Dir and introduces a tolerance value deviation to handle minor misalignments, thereby accurately calculating the logical position of each device in the layout (e.g., its "column number" and "row number" in that column), and supplementing this logical position information into the data structure in memory.
[0149] Its beneficial effect is that it can losslessly convert a pure graphic layout back into a structured dataset with complete physical attributes and logical relationships, providing a data foundation for subsequent editing and verification.
[0150] c) Differentiated updates:
[0151] Users can modify the reconstructed dataset in step b) through the parameterized input interface (e.g., adjust the order, add or remove devices, change layout rules). Upon receiving the update instruction, the system will perform a differential update, which mainly includes:
[0152] Compare the datasets before and after the modification to identify devices with a status of "added", "deleted", or "attribute changed";
[0153] For devices whose position or orientation changes, the corresponding CAD entity is found through its unique handle, and a precise geometric transformation operation (TransformBy) is performed on it, instead of simply deleting and redrawing;
[0154] For devices that have been deleted, perform an erase operation.
[0155] For newly added devices, perform the creation operation.
[0156] Through this closed-loop workflow of "forward configuration -> reverse reading -> differentiated update", this embodiment transforms the original static CAD layout drawing into a dynamic, manageable, and iteratively optimized "living" design scheme, which greatly improves the flexibility of the design and the life cycle management capability. This constitutes a significant creative advancement of the present invention compared to the prior art.
[0157] Corresponding to the above-disclosed method for automated equipment layout based on geometric constraints and engineering rules, this invention also discloses an automated equipment layout system based on geometric constraints and engineering rules, which specifically includes:
[0158] The spatial information acquisition module is used to determine the target physical space and its unusable internal areas in architectural design drawings;
[0159] The available area calculation module is used to determine the available area, which is the largest rectangular area that can be accommodated in the target physical space and is aligned with the coordinate axis, provided that all unusable areas are completely avoided.
[0160] The engineering specification application module is used to shrink the obtained available area inward based on preset or user-configured engineering margin values to generate a final deployable area that meets the engineering specifications.
[0161] The intelligent layout generation module is used to generate device unit graphic entities within the final deployable area based on a preset layout rule set, and simultaneously generate auxiliary entities associated with the device unit layout.
[0162] It should be noted that for a detailed description of the automated equipment layout system based on geometric constraints and engineering rules provided in the embodiments of the present invention, please refer to the relevant description of the automated equipment layout method based on geometric constraints and engineering rules provided in the embodiments of the present invention, which will not be repeated here.
[0163] Those skilled in the art will understand that all or part of the functions of the various methods in the above embodiments can be implemented by hardware or by computer programs. When all or part of the functions in the above embodiments are implemented by computer programs, the program can be stored in a computer-readable storage medium, which may include: read-only memory, random access memory, disk, optical disk, hard disk, etc., and the program is executed by a computer to achieve the above functions. For example, the program can be stored in the memory of a device, and when the program in the memory is executed by the processor, all or part of the above functions can be achieved. In addition, when all or part of the functions in the above embodiments are implemented by computer programs, the program can also be stored in a server, another computer, disk, optical disk, flash drive, or external hard drive, etc., and can be downloaded or copied to the memory of a local device, or the system of the local device can be updated. When the program in the memory is executed by the processor, all or part of the functions in the above embodiments can be achieved.
[0164] The above examples illustrate the present invention only to aid in understanding it and are not intended to limit the scope of the invention. Those skilled in the art can make various simple deductions, modifications, or substitutions based on the principles of this invention.
Claims
1. A method for automated equipment layout based on geometric constraints and engineering rules, characterized in that, The method includes: In architectural design drawings, identify the target physical space and its unusable internal areas; Determine the available area, which is the largest rectangular area that can be accommodated within the target physical space and is aligned with the coordinate axis, provided that all unusable areas are completely avoided; Based on preset or user-configured engineering margin values, the obtained available area is shrunk inward to generate a final deployable area that meets engineering specifications. Based on a preset layout rule set, a device unit graphical entity is generated within the final deployable area, and ancillary entities associated with the device unit layout are generated simultaneously.
2. The automated equipment layout method based on geometric constraints and engineering rules as described in claim 1, characterized in that, In architectural design drawings, the target physical space and its unusable internal areas are identified, specifically including: Obtain the closed boundary geometry information specified by the user and used to define the target physical space, wherein the target physical space refers to a two-dimensional or three-dimensional region defined by the closed boundary; Obtain geometric information of one or more unusable areas within the target physical space, wherein the unusable areas are any areas that need to be avoided when deploying equipment within the target physical space.
3. The automated equipment layout method based on geometric constraints and engineering rules as described in claim 1, characterized in that, Determine the available area, which is the largest rectangular area within the target physical space that can be accommodated and is aligned with the coordinate axes, assuming all unusable areas are completely avoided. Specifically, it includes: a. Spatial discretization: The smallest bounding box containing the target physical space is meshed to form an M×N binary matrix C. The accuracy of the mesh cells is dynamically determined according to the spatial dimensions. b. Unit State Determination: Traverse each unit C(i,j) in matrix C and obtain its center point coordinates P(i,j). Determine the ownership of P(i,j) using the ray casting method: If P(i,j) is inside the target physical space boundary and not inside any unusable area, then unit C(i,j) is a usable unit, and C(i,j) = 1; otherwise, unit C(i,j) is a disabled unit, and C(i,j) = 0. c. Dynamic Programming Solution: Based on the state matrix C, an improved dynamic programming algorithm for finding the maximum rectangle area is used, as detailed below: First, construct a height matrix H of the same size as C. The value of H(i,j) represents the number of consecutive 1s above the position (i,j). The corresponding recursive formula is: H(i,j)=H(i-1,j)+1,ifC(i,j)=1 H(i,j)=0,ifC(i,j)=0 For the first row i = 0: H(0,j) = C(0,j); Subsequently, for each row i of the height matrix H, it is treated as a histogram, and the maximum rectangle area algorithm in the histogram is applied to calculate the maximum rectangle area with row i as the base; after traversing all rows, the maximum area obtained is the maximum inscribed rectangle in the entire target physical space.
4. The automated equipment layout method based on geometric constraints and engineering rules as described in claim 1, characterized in that, Based on preset or user-configured engineering margin values, the obtained available area is shrunk inward to generate a final deployable area that meets engineering specifications, specifically including: The engineering margin values include the shrinkage distances in four independently definable directions: top, bottom, left, and right.
5. The automated equipment layout method based on geometric constraints and engineering rules as described in claim 4, characterized in that, Based on preset or user-configured engineering margin values, the obtained available area is shrunk inward to generate a final deployable area that meets engineering specifications, specifically including: Based on preset or user-configured engineering margin values, the calculated maximum rectangular region is shrunk inward to generate the final deployable region. The vertex coordinates of the final deployable region are in the range of [X'_min, X'_max] and [Y'_min, Y'_max]. The specific calculation formula is as follows: X'_min=X_min+m_left X'_max=X_max-m_right Y'_min=Y_min+m_bottom Y'_max=Y_max-m_top Wherein, the engineering margin value M = {m_top,m_bottom,m_left,m_right}, where m_top,m_bottom,m_left,m_right are the contraction distances in the four directions of top, bottom, left, and right, respectively; the vertex coordinate range of the maximum rectangular region is [X_min,X_max] and [Y_min,Y_max].
6. The automated equipment layout method based on geometric constraints and engineering rules as described in claim 1, characterized in that, Based on a preset layout rule set, device unit graphical entities are generated within the final deployable area, and associated auxiliary entities related to the device unit layout are generated simultaneously, specifically including: Obtain structured source data, including a device list and a layout rule set; the device list contains a set D = {d_1, d_2, ..., d_n} of n device units to be deployed, and each device unit d_i contains at least its unique identifier ID_i, physical width_i, and physical depth_i attribute information; the layout rule set contains device unit size, device spacing, arrangement spacing, arrangement direction, and attached entity parameters; An iterative filling algorithm is used to calculate the placement of device units, as detailed below: a. Initialization: Based on the arrangement direction Dir, determine the starting base vector P_base of the layout; Initialize the current placement vector P_curr = P_base; Initialize the maximum device depth D_max_row of the current row to 0; b. Iterative layout loop: For each device d_i in the device list D, where i ranges from 1 to n, perform the following operations: Based on the arrangement direction Dir, determine the effective dimensions of the equipment to be placed in the CAD coordinate system: width w and depth d; Automatic line wrapping determination: Determine whether placing device d_i at P_curr will cause it to exceed the boundary of the main arrangement axis. If it does, perform a line wrapping operation. Place and update the status: The calculation location for the recording device d_i is P_curr; Update the maximum device depth of the current row: D_max_row = max(D_max_row, d); Calculate and update the starting point P_curr of the next device, with the update amount ΔP determined by the arrangement direction Dir.
7. The automated equipment layout method based on geometric constraints and engineering rules as described in claim 1, characterized in that, Based on a preset layout rule set, device unit graphical entities are generated within the final deployable area, and associated auxiliary entities related to the device unit layout are generated simultaneously, specifically including: After the layout of the equipment units is completed, the centerline path coordinates of the associated associated entities of each equipment row are used to connect the coordinates of the already laid-out equipment rows and the parameters of the associated entities in the layout rule set, and the associated entities are generated.
8. The automated equipment layout method based on geometric constraints and engineering rules as described in claim 1, characterized in that, The method further includes: Data persistence: Utilize the XData extended data function of the CAD platform to associate key metadata containing physical attributes and logical relationship information with the generated graphic entities for subsequent identification and intelligent updates; Reverse reading and data reconstruction: First, scan the CAD drawing space and identify all managed equipment entities by searching for XData with specific identifiers; then, reverse read all metadata from the XData of each entity and reconstruct the equipment list data structure in memory that is completely consistent with the current drawing.
9. The automated equipment layout method based on geometric constraints and engineering rules as described in claim 8, characterized in that, The method further includes: Differential update: Modify the reconstructed data structure through a parameterized input interface, and perform a differential update based on the modified content after receiving the update instruction.
10. An automated equipment layout system based on geometric constraints and engineering rules, characterized in that, The system includes: The spatial information acquisition module is used to determine the target physical space and its unusable internal areas in architectural design drawings; The available area calculation module is used to determine the available area, which is the largest rectangular area that can be accommodated in the target physical space and is aligned with the coordinate axis, provided that all unusable areas are completely avoided. The engineering specification application module is used to shrink the obtained available area inward based on preset or user-configured engineering margin values to generate a final deployable area that meets the engineering specifications. The intelligent layout generation module is used to generate device unit graphic entities within the final deployable area based on a preset layout rule set, and simultaneously generate auxiliary entities associated with the device unit layout.