Rectangular splitting method and system for polygonal contour of structural platform
By generating projection point sets, filtering compliant rectangles, and optimizing search algorithms, the problem of low efficiency in polygon outline splitting of structural platforms was solved, achieving efficient and automated rectangle splitting, generating multiple feasible solutions, and improving design efficiency and quality.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-22
- Publication Date
- 2026-04-03
AI Technical Summary
In existing technologies, the rectangular decomposition method for the polygonal outline of structural platforms is inefficient and cannot meet the design requirements of complex outlines, especially when arranging columns and beams, where there is a lack of automated and efficient solutions.
By acquiring the outline of the structural platform, generating a set of projection points, filtering compliant rectangles, and using an optimization algorithm to search for the optimal rectangle combination, combined with a depth-first search algorithm and an area pruning strategy, a variety of feasible rectangle division schemes are automatically generated.
It achieves efficient and automated rectangle splitting, and the generated rectangle combination completely covers the original polygon. It provides a variety of design options for designers to choose from, improving design efficiency and quality. It is suitable for complex polygons and structural platforms containing concave parts.
Smart Images

Figure CN121786931A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of structural platform design technology, and in particular to a method and system for rectangular decomposition of the polygonal outline of a structural platform. Background Technology
[0002] In the field of industrial design, structural platforms often require irregular polygonal outlines to meet the specific requirements of different equipment. To accommodate load-bearing components such as columns and beams on these platforms, these complex outlines need to be decomposed into multiple rectangular units to form a column grid. The endpoints of the rectangles represent the column positions, and the lines connecting the endpoints represent the beam positions. Traditional methods rely on designers manually dividing these rectangular areas, which is inefficient, results in suboptimal division schemes, and struggles to meet the requirements of complex outlines (such as those with concave corners). Therefore, a method is needed that can automatically and efficiently decompose arbitrary polygonal platform outlines into rectangular units that meet structural design requirements, providing a foundation for automated column and beam placement. Summary of the Invention
[0003] To address the inefficiency of manually dividing rectangular units in existing technologies, a method and system for rectangle decomposition of polygonal contours in structural platforms is proposed. This method generates projection points for each vertex of the polygon along each edge, and candidate rectangles are generated based on the combinations of these projection points and the original vertices. After multi-level filtering, an optimization algorithm is used to search for the optimal rectangle combination. This method offers high decomposition efficiency and quality, and can be widely applied in fields such as industrial design and architectural layout.
[0004] The technical solution of this invention is: a method for rectangular segmentation of polygonal outlines of structural platforms, specifically including the following steps: 1) Obtain the outline of the structural platform in the structural data drawing; 2) Extract all vertices of the polygonal structure platform obtained in step 1), and project each vertex vertically and horizontally onto all edges of the polygon to obtain all projected points on all edges, forming a point set. Then, remove duplicates to obtain the point set. 3) Use the points from the point set in step 2) to form a set of rectangles; 4) Filter out the compliant rectangles set by the designer that are completely located inside the polygon of the structural platform, and remove the non-compliant rectangles; 5) Search for combinations of non-overlapping rectangles that satisfy the condition of having the same area as the outline; 6) Present all compliant combinations found in step 5) for designers to choose from.
[0005] Furthermore, the specific implementation method of step 4) is as follows: 4.1) By setting compliant rectangles through the designer, that is, setting the column spacing information of the minimum and maximum side lengths of the rectangles, rectangles with side lengths within the preset range are retained; 4.2) Use the contains method of Python's shapely library to determine whether a rectangle is inside the original outline, so as to retain rectangles that are completely inside the original polygon; 4.3) Eliminate rectangles that do not contain or contain only one polygon vertex to meet design requirements.
[0006] Furthermore, the specific implementation method of step 5) is as follows: 5.1) Calculate the area of the outer contour and the area of the compliant rectangles, and sort the areas of the compliant rectangles in ascending order to obtain the set of compliant rectangles; 5.2) Based on the sorting in step 5.1), starting from the smallest area in the set of compliant rectangles, search for rectangle combinations in increments of length k. The initial value of k is 1, where k is the number of rectangles in the combination. In each loop, each rectangle in the set of compliant rectangles is searched, and the value of k is incremented by 1 after each loop. The k value obtained after each search must satisfy the following condition: the total area of the rectangle combination corresponding to the current k value is less than or equal to the outer contour area. Once the sum of the rectangle areas corresponding to the current k value exceeds the target area, the search ends, and all possible rectangle combinations are obtained. Then, check whether the sum of the rectangles in each obtained rectangle combination is equal to the outer contour area. If they are equal, keep them; otherwise, discard them. Finally, obtain the required rectangle combination. 5.3) Print out the rectangular indices that meet the criteria graphically for the designer's reference.
[0007] A rectangular segmentation system for the polygonal outline of a structural platform, comprising: The data acquisition module is used to acquire the outline of the structural platform in the structural data drawing; The Split Rectangle Builder is used to create a set of rectangles using the vertices of the platform outline. The method for obtaining the rectangle set in the split rectangle construction module is as follows: extract all vertices of the polygon of the structural platform outline, and project each vertex vertically and horizontally onto all sides of the polygon to obtain all projection points on all sides. After forming a point set, deduplication is performed to obtain the point set. The points in the point set are used to form a rectangle set. The rectangle extraction module is used to filter split rectangles according to the compliant rectangles set by the designer; The rectangle extraction module employs the following filtering methods: Rectification is achieved by setting the minimum and maximum side lengths of the rectangles using column spacing information; rectangles with side lengths within a preset range are retained; the `contains` method of Python's `shapely` library is used to determine whether a rectangle is within the original outline, thus retaining rectangles completely within the original polygon; rectangles that do not contain or contain only one polygon vertex are excluded to meet design requirements. The rectangle combination filtering module is used to filter rectangle combinations based on the area inside the outline of the structural platform to obtain compliant rectangle splitting schemes for designers to choose from. The method for obtaining compliant rectangle splitting schemes in the rectangle combination filtering module is as follows: Calculate the area of the outer contour and the area of the compliant rectangles, and sort the compliant rectangle areas in ascending order to obtain a set of compliant rectangles; Based on the sorting of compliant rectangle areas, starting from the smallest area in the compliant rectangle set, search for rectangle combinations in ascending order of rectangle combination length k. The initial value of k is 1, where k is the number of rectangles in the rectangle combination. In each loop, each rectangle in the compliant rectangle set is searched, and the value of k is incremented by 1 after each loop. The obtained k value after each search must satisfy: the total area of the rectangle combination corresponding to the current k value ≤ the outer contour area. Once the sum of the rectangle areas corresponding to the current k value exceeds the target area, the search ends, and all possible rectangle combinations are obtained; Then, check whether the sum of the rectangles in each obtained rectangle combination is equal to the outer contour area. If they are equal, keep them; otherwise, discard them. Finally, obtain the required rectangle combinations, and each rectangle combination is a compliant rectangle splitting scheme.
[0008] An electronic device includes a processor and a computer program running on the processor, the computer program being executed by the processor to implement the steps in the rectangular subdivision method for the polygonal outline of a structural platform.
[0009] A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps in the rectangular subdivision method for the polygonal outline of a structural platform.
[0010] The beneficial effects of this invention are as follows: The rectangular decomposition method and system for the polygonal outline of the structural platform of this invention can perform rapid decomposition through point set deduplication, selection of compliant rectangles, and depth-first search algorithm and area pruning strategy, achieving efficient decomposition; it ensures that the generated rectangle combination completely covers the original polygon, and provides multiple schemes for designers to choose from, achieving high-quality decomposition; it can precisely control the size range of the generated rectangles; it can handle complex polygons containing concave parts and holes, and has wide applicability. Attached Figure Description
[0011] Figure 1 This is an overall flowchart of the method of the present invention; Figure 2 This is a schematic diagram of the platform's outline. Figure 3 This is a schematic diagram illustrating the generation of the point set of projection points and vertices in the method of the present invention; Figure 4 This is a schematic diagram of candidate rectangle generation in the method of the present invention; Figure 5 This is a schematic diagram of rectangular compliance screening in an embodiment of the method of the present invention (maximum side length 2, minimum side length 1). Figure 6This is a schematic diagram of a rectangular combination in an embodiment of the method of the present invention (maximum side length 2, minimum side length 1). Figure 7 This is a schematic diagram of rectangular compliance screening in an embodiment of the method of the present invention (maximum side length 3, minimum side length 1). Figure 8 This is a schematic diagram of a rectangular combination in an embodiment of the method of the present invention (maximum side length 3, minimum side length 1). Detailed Implementation
[0012] The present invention will now be described in detail with reference to the accompanying drawings and specific embodiments. These embodiments are based on the technical solution of the present invention and provide detailed implementation methods and specific operating procedures. However, the scope of protection of the present invention is not limited to the following embodiments.
[0013] This invention's method acquires the platform outline and processes the hypotenuses according to the main structural direction; it generates a dense point set through vertex projection, thus generating a large number of candidate rectangles; then, combining the column grid size constraints (minimum and maximum column spacing) input from the structural design, it filters out rectangles that are completely within the outline and whose dimensions are compliant; finally, it uses an optimized search algorithm to find compliant rectangle combinations that completely cover the original outline, have equal areas, and do not overlap. This method can automatically and efficiently generate multiple feasible rectangle partitioning schemes, each corresponding to a potential column grid and primary / secondary beam layout pattern for designers to choose from, thereby significantly improving the design efficiency and quality of structural platforms.
[0014] This invention provides a method and system for rectangular segmentation of polygonal outlines of structural platforms. For example... Figure 1 The flowchart shown illustrates the method, which includes the following steps: Step 1: Obtain the outline of the structural platform in the structural data drawing; Step 2: Extract all vertices of the polygonal structure platform obtained in Step 1, and project each vertex vertically and horizontally onto all edges of the polygon to obtain all projected points on all edges, forming a point set. Then, remove duplicates to obtain the point set. Step 3: Use the points from the point set in Step 2 to form a set of rectangles; Step 4: Select compliant rectangles set by the designer that are completely located inside the polygon of the structural platform, and remove the non-compliant rectangles; Step 5: Search for a combination of non-overlapping rectangles that have the same area as the outline; Step 6: Display all the combinations found in Step 5 for designers to choose from.
[0015] According to the method described in step 2, all vertices of the polygon are projected onto all edges to obtain projected points. After forming a point set and removing duplicates, a point set of the rectangle's vertices is obtained, which includes: Step 2.1: The projection points are the vertical and horizontal projection points of the vertex onto each edge; Step 2.2: Combine the projected points with the existing points to form a point set; Step 2.3: Remove duplicates from the point set to obtain the point set of the rectangle's vertices.
[0016] The method described in step 3, which uses the points from the de-emphasis set in step 2 to form a rectangle, includes: Step 3.1: A point from the set of vertices of a rectangle and another point form the diagonal of the rectangle. If the diagonal is horizontal or vertical, it is not generated. Step 3.2: Repeat step 3.1 to generate all rectangles; Step 3.3: After reconstructing the order of the rectangle vertex coordinates, compare the coordinates of all rectangle vertices to delete completely overlapping rectangles, thus achieving the deduplication effect.
[0017] According to the method described in step 4, compliant rectangles are filtered out, and non-compliant rectangles are removed. This includes: Step 4.1: Set compliant rectangles through the designer, that is, set the column spacing information of the minimum and maximum side lengths of the rectangles, and retain rectangles with side lengths within the preset range; Step 4.2: Use the contains method of Python's shapely library to determine whether the rectangle is inside the original outline, so as to retain the rectangle that is completely inside the original polygon; Step 4.3: Exclude rectangles that do not contain or contain only one polygon vertex to meet design requirements.
[0018] According to the method described in step 5, a search is performed for non-overlapping rectangle combinations that satisfy the condition of having the same area as the outline. The search includes: Step 5.1: Calculate the area of the outer contour and the area of the compliant rectangles, and sort the areas of the compliant rectangles in ascending order to obtain the set of compliant rectangles. For example, if the area of the outer contour is 100, the set of compliant rectangles = [rect1, rect2, rect3, rect4, rect5], with areas of rect1=30, rect2=40, rect3=60, rect4=25, rect5=35. Then sort them in ascending order by area: rect4, rect1, rect5, rect2, rect3, with areas of 25, 30, 35, 40, 60 respectively.
[0019] Step 5.2: Based on the sorting in Step 5.1, starting from the smallest area in the set of compliant rectangles, search for rectangle combinations in ascending order of length k. The initial value of k is 1, where k represents the number of rectangles in the combination. Each loop searches each rectangle in the set of compliant rectangles, incrementing k by 1 after each loop. The resulting k value after each search must satisfy the following condition: the total area of the rectangle combination corresponding to the current k value ≤ the outer contour area. Calculate whether the sum of the rectangle areas corresponding to the current k value is less than or equal to the outer contour area. Since the rectangles have already been sorted in ascending order of area, if the sum of the rectangle areas corresponding to the current k value exceeds the target area, it means that increasing the number of rectangles will only increase the area, making it impossible to match the target. At this point, k is at its maximum, and the matched rectangle combination is all possible rectangle combinations, ending the search. Then, check whether the sum of the rectangles in each obtained rectangle combination is equal to the outer contour area. If they are equal, keep them; otherwise, discard them, finally obtaining the required rectangle combination.
[0020] The following examples further illustrate this: If k=1: the smallest area is 25 < 100, then search for a single rectangle and check if the area = 25, 30, 35, 40, 60 ≈ 100. If there is no match, continue.
[0021] If k=2: the minimum area of two rectangles = 25 + 30 = 55 ≤ 100, search for all combinations of two rectangles: (25,30)=55, (25,35)=60, (25,40)=65, (25,60)=85, (30,35)=65, (30,40)=70, (30,60)=90, (35,40)=75, (35,60)=95, (40,60)=100, find (40,60) matching, check if the two rectangles overlap, if they do not overlap, keep the rectangle number and continue.
[0022] If k=3, the minimum area of the three rectangles is 25+30+35=90 ≤ 100. Search all combinations of three rectangles: (25,30,35)=90, (25,30,40)=95, (25,30,60)=115>100, (25,35,40)=100 matches, (25,35,60)=120>100, (25,40,60)=125>100, (30,35,40)=105>100, and all other combinations exceed 100. Find (25,35,40)=100, which matches. Check if these two rectangles overlap. If they do not overlap, keep the rectangle number and continue.
[0023] If k=4, the minimum area of the 4 rectangles is 25+30+35+40=130>100, so k=4 and above does not meet the requirements and the search is stopped. This method can significantly reduce invalid searches. Step 5.3: Print out the rectangular indices that meet the criteria graphically for the designer's reference.
[0024] The following describes in further detail a rectangular segmentation method and system for structural platform outlines according to the present invention, with reference to specific embodiments: Please refer to Figure 2 This figure shows the outline of a concave platform structure. The coordinates of the vertices of the outline polygon are [(0,0),(0,3),(1,3),(1,1),(2,1),(2,2),(3,2),(3,0),(0,0)]. The Polygon function in the shapely library is used to form a polygon from these points.
[0025] Please refer to Figure 3 This diagram illustrates how to project all vertices of a polygon onto all its edges to obtain projected points. After removing duplicates, the resulting set represents the vertices of a rectangle. The projection method involves horizontally and vertically projecting all vertices of the polygon onto its edges, combining them with the original vertices to form a point set, and then removing duplicates. In this example, the point set contains 14 points.
[0026] Please refer to Figure 4 This diagram shows how rectangles are formed by using each point in the point set and other points as the diagonals of a rectangle. In this example, a total of 33 rectangles were generated, and their coordinates are as follows: Rectangle 1: [(0.0, 1.0), (1.0, 1.0), (1.0, 2.0), (0.0, 2.0)], Rectangle 2: [(0.0, 1.0), (2.0, 1.0), (2.0, 0.0), (0.0, 0.0)], Rectangle 3: [(0.0, 1.0), (3.0, 1.0), (3.0, 0.0), (0.0, 0.0)], Rectangle 4: [(0.0, 1.0), (2.0, 1.0), (2.0, 2.0), (0.0, 2.0)], Rectangle 5: [(0.0, 1.0), (1.0, 1.0), (1.0, 0.0), (0.0, 0.0)], Rectangle 6: [(0.0, 1.0), (3.0, 1.0), (3.0, 2.0), (0.0, 2.0)], Rectangle 7: [(0.0, 1.0), (1.0, 1.0), (1.0, 3.0), (0.0, 3.0)], Rectangle 8: [(1.0, 2.0), (2.0, 2.0), (2.0, 1.0), (1.0, 1.0)], Rectangle 9: [(1.0, 2.0), (0.0, 2.0), (0.0, 0.0), (1.0, 0.0)], Rectangle 10: [(1.0, 2.0), (3.0, 2.0), (3.0, 1.0), (1.0, 1.0)], Rectangle 11: [(1.0, 2.0), (0.0, 2.0), (0.0, 3.0), (1.0, 3.0)], Rectangle 12: [(1.0, 2.0), (2.0, 2.0), (2.0, 0.0), (1.0, 0.0)], Rectangle 13: [(1.0, 2.0), (3.0, 2.0), (3.0, 0.0), (1.0, 0.0)], Rectangle 14: [(2.0, 1.0), (0.0, 1.0), (0.0, 3.0), (2.0, 3.0)], Rectangle 15: [(2.0, 1.0), (3.0, 1.0), (3.0, 0.0), (2.0, 0.0)], Rectangle 16: [(2.0, 1.0), (1.0, 1.0), (1.0, 0.0), (2.0, 0.0)], Rectangle 17: [(2.0, 1.0), (3.0, 1.0), (3.0, 2.0), (2.0, 2.0)], Rectangle 18: [(2.0, 1.0), (1.0, 1.0), (1.0, 3.0), (2.0, 3.0)], Rectangle 19: [(0.0, 0.0), (2.0, 0.0), (2.0, 2.0), (0.0, 2.0)], Rectangle 20: [(0.0, 0.0), (3.0, 0.0), (3.0, 2.0), (0.0, 2.0)], Rectangle 21: [(0.0, 0.0), (1.0, 0.0), (1.0, 3.0), (0.0, 3.0)], Rectangle 22: [(3.0, 1.0), (0.0, 1.0), (0.0, 3.0), (3.0, 3.0)], Rectangle 23: [(3.0, 1.0), (1.0, 1.0), (1.0, 0.0), (3.0, 0.0)], Rectangle 24: [(3.0, 1.0), (1.0, 1.0), (1.0, 3.0), (3.0, 3.0)], Rectangle 25: [(0.0, 3.0), (2.0, 3.0), (2.0, 0.0), (0.0, 0.0)], Rectangle 26: [(0.0, 3.0), (3.0, 3.0), (3.0, 0.0), (0.0, 0.0)], Rectangle 27: [(0.0, 3.0), (2.0, 3.0), (2.0, 2.0), (0.0, 2.0)], Rectangle 28: [(0.0, 3.0), (3.0, 3.0), (3.0, 2.0), (0.0, 2.0)], Rectangle 29: [(2.0, 0.0), (3.0, 0.0), (3.0, 2.0), (2.0, 2.0)], Rectangle 30: [(2.0, 0.0), (1.0, 0.0), (1.0, 3.0), (2.0, 3.0)], Rectangle 31: [(3.0, 0.0), (1.0, 0.0), (1.0, 3.0), (3.0, 3.0)], Rectangle 32: [(2.0, 2.0), (1.0, 2.0), (1.0, 3.0), (2.0, 3.0)], Rectangle 33: [(3.0, 2.0), (1.0, 2.0), (1.0, 3.0), (3.0, 3.0)].
[0027] Please refer to Figure 5The 33 rectangles underwent compliance checks, including checking if they were inside the polygon outline, if they met the maximum and minimum side lengths of a rectangle (set to 2 and 1 respectively in this case), and if any rectangles had only one or no overlapping point with a vertex. After filtering, 10 valid rectangles were retained: Valid rectangle 1: [(0.0, 1.0), (2.0, 1.0), (2.0, 0.0), (0.0, 0.0)], Valid rectangle 2: [(0.0, 1.0), (1.0, 1.0), (1.0, 0.0), (0.0, 0.0)], Valid rectangle 3: [(0.0, 1.0), (1.0, 1.0), (1.0, 3.0), (0.0, 3.0)], Valid rectangle 4: [(1.0, 2.0), (0.0, 2.0), (0.0, 0.0), (1.0, 0.0)], Valid rectangle 5: [(1.0, 2.0), (0.0, 2.0), (0.0, 3.0), (1.0, 3.0)], Valid rectangle 6: [(2.0, 1.0), (3.0, 1.0), (3.0, 0.0), (2.0, 0.0)], Valid rectangle 7: [(2.0, 1.0), (1.0, 1.0), (1.0, 0.0), (2.0, 0.0)], Valid rectangle 8: [(2.0, 1.0), (3.0, 1.0), (3.0, 2.0), (2.0, 2.0)], Valid rectangle 9: [(3.0, 1.0), (1.0, 1.0), (1.0, 0.0), (3.0, 0.0)], Valid rectangle 10: [(2.0, 0.0), (3.0, 0.0), (3.0, 2.0), (2.0, 2.0)].
[0028] Please refer to Figure 6 We found 8 optimal rectangle combinations.
[0029] Combination 1: Rectangle 1: [(0.0, 1.0), (2.0, 1.0), (2.0, 0.0), (0.0, 0.0)], Rectangle 2: [(0.0, 1.0), (1.0, 1.0), (1.0, 3.0), (0.0, 3.0)], Rectangle 3: [(2.0, 0.0), (3.0, 0.0), (3.0, 2.0), (2.0, 2.0)].
[0030] Combination 2: Rectangle 1: [(0.0, 1.0), (1.0, 1.0), (1.0, 0.0), (0.0, 0.0)], Rectangle 2: [(2.0, 1.0), (1.0, 1.0), (1.0, 0.0), (2.0, 0.0)], Rectangle 3: [(0.0, 1.0), (1.0, 1.0), (1.0, 3.0), (0.0, 3.0)], Rectangle 4: [(2.0, 0.0), (3.0, 0.0), (3.0, 2.0), (2.0, 2.0)].
[0031] Combination 3: Rectangle 1: [(0.0, 1.0), (1.0, 1.0), (1.0, 0.0), (0.0, 0.0)], Rectangle 2: [(2.0, 1.0), (3.0, 1.0), (3.0, 2.0), (2.0, 2.0)], Rectangle 3: [(0.0, 1.0), (1.0, 1.0), (1.0, 3.0), (0.0, 3.0)], Rectangle 4: [(3.0, 1.0), (1.0, 1.0), (1.0, 0.0), (3.0, 0.0)].
[0032] Combination 4: Rectangle 1: [(1.0, 2.0), (0.0, 2.0), (0.0, 3.0), (1.0, 3.0)], Rectangle 2: [(2.0, 1.0), (1.0, 1.0), (1.0, 0.0), (2.0, 0.0)], Rectangle 3: [(1.0, 2.0), (0.0, 2.0), (0.0, 0.0), (1.0, 0.0)], Rectangle 4: [(2.0, 0.0), (3.0, 0.0), (3.0, 2.0), (2.0, 2.0)].
[0033] Combination 5: Rectangle 1: [(1.0, 2.0), (0.0, 2.0), (0.0, 3.0), (1.0, 3.0)], Rectangle 2: [(2.0, 1.0), (3.0, 1.0), (3.0, 2.0), (2.0, 2.0)], Rectangle 3: [(1.0, 2.0), (0.0, 2.0), (0.0, 0.0), (1.0, 0.0)], Rectangle 4: [(3.0, 1.0), (1.0, 1.0), (1.0, 0.0), (3.0, 0.0)].
[0034] Combination 6: Rectangle 1: [(2.0, 1.0), (3.0, 1.0), (3.0, 0.0), (2.0, 0.0)], Rectangle 2: [(2.0, 1.0), (3.0, 1.0), (3.0, 2.0), (2.0, 2.0)], Rectangle 3: [(0.0, 1.0), (2.0, 1.0), (2.0, 0.0), (0.0, 0.0)], Rectangle 4: [(0.0, 1.0), (1.0, 1.0), (1.0, 3.0), (0.0, 3.0)].
[0035] Combination 7: Rectangle 1: [(0.0, 1.0), (1.0, 1.0), (1.0, 0.0), (0.0, 0.0)], Rectangle 2: [(2.0, 1.0), (3.0, 1.0), (3.0, 0.0), (2.0, 0.0)], Rectangle 3: [(2.0, 1.0), (1.0, 1.0), (1.0, 0.0), (2.0, 0.0)], Rectangle 4: [(2.0, 1.0), (3.0, 1.0), (3.0, 2.0), (2.0, 2.0)], Rectangle 5: [(0.0, 1.0), (1.0, 1.0), (1.0, 3.0), (0.0, 3.0)].
[0036] Combination 8: Rectangle 1: [(1.0, 2.0), (0.0, 2.0), (0.0, 3.0), (1.0, 3.0)], Rectangle 2: [(2.0, 1.0), (3.0, 1.0), (3.0, 0.0), (2.0, 0.0)], Rectangle 3: [(2.0, 1.0), (1.0, 1.0), (1.0, 0.0), (2.0, 0.0)], Rectangle 4: [(2.0, 1.0), (3.0, 1.0), (3.0, 2.0), (2.0, 2.0)].
[0037] Next is and Figure 5 and Figure 6 The same demonstration, except the maximum and minimum side lengths are set to 3 and 1, respectively. Figure 5 and Figure 6 The maximum and minimum side lengths are set to 2 and 1, respectively.
[0038] Please refer to Figure 7 This diagram shows the compliance checks performed on 33 rectangles, including whether they are inside the polygon outline, whether they meet the maximum and minimum side lengths of a rectangle (set to 3 and 1 respectively in this case), and whether any rectangles have no or only one point overlapping with a vertex. After filtering, 12 valid rectangles are retained. Valid rectangle 1: [(0.0, 1.0), (2.0, 1.0), (2.0, 0.0), (0.0, 0.0)], Valid rectangle 2: [(0.0, 1.0), (3.0, 1.0), (3.0, 0.0), (0.0, 0.0)], Valid rectangle 3: [(0.0, 1.0), (1.0, 1.0), (1.0, 0.0), (0.0, 0.0)], Valid rectangle 4: [(0.0, 1.0), (1.0, 1.0), (1.0, 3.0), (0.0, 3.0)], Valid rectangle 5: [(1.0, 2.0), (0.0, 2.0), (0.0, 0.0), (1.0, 0.0)], Valid rectangle 6: [(1.0, 2.0), (0.0, 2.0), (0.0, 3.0), (1.0, 3.0)], Valid rectangle 7: [(2.0, 1.0), (3.0, 1.0), (3.0, 0.0), (2.0, 0.0)], Valid rectangle 8: [(2.0, 1.0), (1.0, 1.0), (1.0, 0.0), (2.0, 0.0)], Valid rectangle 9: [(2.0, 1.0), (3.0, 1.0), (3.0, 2.0), (2.0, 2.0)], Valid rectangle 10: [(0.0, 0.0), (1.0, 0.0), (1.0, 3.0), (0.0, 3.0)], Valid rectangle 11: [(3.0, 1.0), (1.0, 1.0), (1.0, 0.0), (3.0, 0.0)], Valid rectangle 12: [(2.0, 0.0), (3.0, 0.0), (3.0, 2.0), (2.0, 2.0)].
[0039] Please refer to Figure 8 We found 12 regular geometric combinations, as shown below. Since the maximum side length is 3, we can find combinations that include all... Figure 6 With the maximum side length being 2, there are 4 more combinations with a side length of 3.
[0040] Combination 1: Rectangle 1: [(2.0, 1.0), (1.0, 1.0), (1.0, 0.0), (2.0, 0.0)], Rectangle 2: [(2.0, 0.0), (3.0, 0.0), (3.0, 2.0), (2.0, 2.0)], Rectangle 3: [(0.0, 0.0), (1.0, 0.0), (1.0, 3.0), (0.0, 3.0)].
[0041] Combination 2: Rectangle 1: [(2.0, 1.0), (3.0, 1.0), (3.0, 2.0), (2.0, 2.0)], Rectangle 2: [(0.0, 1.0), (1.0, 1.0), (1.0, 3.0), (0.0, 3.0)], Rectangle 3: [(0.0, 1.0), (3.0, 1.0), (3.0, 0.0), (0.0, 0.0)].
[0042] Combination 3: Rectangle 1: [(2.0, 1.0), (3.0, 1.0), (3.0, 2.0), (2.0, 2.0)], Rectangle 2: [(3.0, 1.0), (1.0, 1.0), (1.0, 0.0), (3.0, 0.0)], Rectangle 3: [(0.0, 0.0), (1.0, 0.0), (1.0, 3.0), (0.0, 3.0)].
[0043] Combination 4: Rectangle 1: [(0.0, 1.0), (2.0, 1.0), (2.0, 0.0), (0.0, 0.0)], Rectangle 2: [(0.0, 1.0), (1.0, 1.0), (1.0, 3.0), (0.0, 3.0)], Rectangle 3: [(2.0, 0.0), (3.0, 0.0), (3.0, 2.0), (2.0, 2.0)].
[0044] Combination 5: Rectangle 1: [(0.0, 1.0), (1.0, 1.0), (1.0, 0.0), (0.0, 0.0)], Rectangle 2: [(2.0, 1.0), (1.0, 1.0), (1.0, 0.0), (2.0, 0.0)], Rectangle 3: [(0.0, 1.0), (1.0, 1.0), (1.0, 3.0), (0.0, 3.0)], Rectangle 4: [(2.0, 0.0), (3.0, 0.0), (3.0, 2.0), (2.0, 2.0)].
[0045] Combination 6: Rectangle 1: [(0.0, 1.0), (1.0, 1.0), (1.0, 0.0), (0.0, 0.0)], Rectangle 2: [(2.0, 1.0), (3.0, 1.0), (3.0, 2.0), (2.0, 2.0)], Rectangle 3: [(0.0, 1.0), (1.0, 1.0), (1.0, 3.0), (0.0, 3.0)], Rectangle 4: [(3.0, 1.0), (1.0, 1.0), (1.0, 0.0), (3.0, 0.0)].
[0046] Combination 7: Rectangle 1: [(1.0, 2.0), (0.0, 2.0), (0.0, 3.0), (1.0, 3.0)], Rectangle 2: [(2.0, 1.0), (1.0, 1.0), (1.0, 0.0), (2.0, 0.0)], Rectangle 3: [(1.0, 2.0), (0.0, 2.0), (0.0, 0.0), (1.0, 0.0)], Rectangle 4: [(2.0, 0.0), (3.0, 0.0), (3.0, 2.0), (2.0, 2.0)].
[0047] Combination 8: Rectangle 1: [(1.0, 2.0), (0.0, 2.0), (0.0, 3.0), (1.0, 3.0)], Rectangle 2: [(2.0, 1.0), (3.0, 1.0), (3.0, 2.0), (2.0, 2.0)], Rectangle 3: [(1.0, 2.0), (0.0, 2.0), (0.0, 0.0), (1.0, 0.0)], Rectangle 4: [(3.0, 1.0), (1.0, 1.0), (1.0, 0.0), (3.0, 0.0)].
[0048] Combination 9: Rectangle 1: [(2.0, 1.0), (3.0, 1.0), (3.0, 0.0), (2.0, 0.0)], Rectangle 2: [(2.0, 1.0), (1.0, 1.0), (1.0, 0.0), (2.0, 0.0)], Rectangle 3: [(2.0, 1.0), (3.0, 1.0), (3.0, 2.0), (2.0, 2.0)], Rectangle 4: [(0.0, 0.0), (1.0, 0.0), (1.0, 3.0), (0.0, 3.0)].
[0049] Combination 10: Rectangle 1: [(2.0, 1.0), (3.0, 1.0), (3.0, 0.0), (2.0, 0.0)], Rectangle 2: [(2.0, 1.0), (3.0, 1.0), (3.0, 2.0), (2.0, 2.0)], Rectangle 3: [(0.0, 1.0), (2.0, 1.0), (2.0, 0.0), (0.0, 0.0)], Rectangle 4: [(0.0, 1.0), (1.0, 1.0), (1.0, 3.0), (0.0, 3.0)].
[0050] Combination 11: Rectangle 1: [(0.0, 1.0), (1.0, 1.0), (1.0, 0.0), (0.0, 0.0)], Rectangle 2: [(2.0, 1.0), (3.0, 1.0), (3.0, 0.0), (2.0, 0.0)], Rectangle 3: [(2.0, 1.0), (1.0, 1.0), (1.0, 0.0), (2.0, 0.0)], Rectangle 4: [(2.0, 1.0), (3.0, 1.0), (3.0, 2.0), (2.0, 2.0)], Rectangle 5: [(0.0, 1.0), (1.0, 1.0), (1.0, 3.0), (0.0, 3.0)].
[0051] Combination 12: Rectangle 1: [(1.0, 2.0), (0.0, 2.0), (0.0, 3.0), (1.0, 3.0)], Rectangle 2: [(2.0, 1.0), (3.0, 1.0), (3.0, 0.0), (2.0, 0.0)], Rectangle 3: [(2.0, 1.0), (1.0, 1.0), (1.0, 0.0), (2.0, 0.0)], Rectangle 4: [(2.0, 1.0), (3.0, 1.0), (3.0, 2.0), (2.0, 2.0)], Rectangle 5: [(1.0, 2.0), (0.0, 2.0), (0.0, 0.0), (1.0, 0.0)].
[0052] The embodiments described above merely illustrate specific implementations of the present invention, and while the descriptions are detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these all fall within the protection scope of the present invention. Therefore, the protection scope of this invention patent should be determined by the appended claims.
Claims
1. A method for rectangular segmentation of polygonal outlines of structural platforms, characterized in that, The specific steps are as follows: 1) Obtain the outline of the structural platform in the structural reference drawing; 2) Extract all vertices of the polygon of the structural platform obtained in step 1), and project each vertex vertically and horizontally onto all edges of the polygon to obtain all projected points on all edges, form a point set, and then remove duplicates to obtain a point set; 3) Use the points from the point set in step 2) to form a set of rectangles; 4) Filter the rectangles that are completely inside the polygon of the structural platform and set by the designer to meet the requirements, and remove the rectangles that do not meet the requirements; 5) Search for non-overlapping rectangle combinations that are equal in area to the outline; 6) Present all the compliant combinations searched in step 5) for the designer to choose from.
2. The rectangular segmentation method for the polygonal outline of a structural platform according to claim 1, characterized in that, The specific implementation method of step 4) is as follows: 4.1) The designer sets compliant rectangles, that is, sets the column spacing information of the minimum and maximum side lengths of the rectangles, and retains rectangles with side lengths within the preset range. 4.2) Use the contains method of Python's shapely library to determine whether a rectangle is inside the original outline, so as to retain rectangles that are completely inside the original polygon; 4.3) Exclude rectangles that do not contain or contain only one polygon vertex to meet design requirements.
3. The rectangular segmentation method for the polygonal outline of a structural platform according to claim 1, characterized in that, The specific implementation method of step 5) is as follows: 5.1) Calculate the area of the outer contour and the area of the compliant rectangles, and sort the areas of the compliant rectangles in ascending order to obtain a set of compliant rectangles; 5.2) According to the sorting in step 5.1), starting from the smallest area in the set of compliant rectangles, search for rectangle combinations in ascending order of rectangle combination length k. The initial value of k is 1, and k is the number of rectangles in the rectangle combination. In each loop, each rectangle in the set of compliant rectangles is searched. After each loop, the value of k is incremented by 1. The k value obtained after each search must satisfy: the total area of the rectangle combination corresponding to the current k value ≤ the area of the outer contour. Once the sum of the rectangle areas corresponding to the current k value exceeds the target area, the search ends and all possible rectangle combinations are obtained; then check whether the sum of the rectangles in each obtained rectangle combination is equal to the area of the outer contour. If they are equal, they are retained; if they are not equal, they are discarded. Finally, the required rectangle combination is obtained. 5.3) Print out the rectangular indices that meet the criteria graphically for the designer's reference.
4. A rectangular segmentation system for polygonal outlines of structural platforms, characterized in that, include: The data acquisition module is used to acquire the outline of the structural platform in the structural data map; the rectangle construction module is used to construct a set of rectangles using the vertices of the platform outline. The rectangle set acquisition method in the split rectangle construction module is as follows: Extract all vertices of the polygon outline of the structural platform, project each vertex vertically and horizontally onto all edges of the polygon, obtain all projected points on all edges, form a point set, then remove duplicates to obtain a point set, and use the points of the point set to form a rectangle set; The rectangle extraction module is used to filter the split rectangles according to the compliant rectangles set by the designer. The filtering method in the rectangle extraction module is as follows: Retain rectangles with side lengths within the preset range by using the compliant rectangles set by the designer, i.e., setting the minimum and maximum side length column spacing information of the rectangles; Use the contains method of Python's shapely library to determine whether the rectangle is inside the original outline to retain rectangles completely inside the original polygon; Exclude rectangles that do not contain or only contain one polygon vertex to meet design requirements; The rectangle combination filtering module is used to filter rectangle combinations based on the area inside the structural platform outline. The system provides compliant rectangle splitting schemes for designers to choose from. The method for obtaining compliant rectangle splitting schemes in the rectangle combination filtering module is as follows: Calculate the area of the outer contour and the area of the compliant rectangles, and sort the compliant rectangle areas in ascending order to obtain a set of compliant rectangles. Based on the sorting of compliant rectangle areas, starting from the smallest area in the compliant rectangle set, search for rectangle combinations in ascending order of rectangle combination length k. The initial value of k is 1, where k is the number of rectangles in the rectangle combination. Each loop searches each rectangle in the compliant rectangle set, and the value of k is incremented by 1 after each loop. The obtained k value after each search must satisfy the following condition: the total area of the rectangle combination corresponding to the current k value ≤ the outer contour area. Once the sum of the rectangle areas corresponding to the current k value exceeds the target area, the search ends, and all possible rectangle combinations are obtained. Then, check whether the sum of the rectangles in each obtained rectangle combination is equal to the outer contour area. If they are equal, keep them; otherwise, discard them. Finally, obtain the required rectangle combinations, each of which is a compliant rectangle splitting scheme.
5. An electronic device, comprising a processor and a computer program running on the processor, characterized in that, When the computer program is executed by the processor, it implements the steps in the rectangular splitting method for the polygonal outline of a structural platform as described in any one of claims 1 to 3.
6. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps in the rectangular splitting method for the polygonal outline of a structural platform as described in any one of claims 1 to 3.