Courtyard layout planning method and device, electronic equipment, product and medium
By meshing and layout planning of ancient plots and combining seed filling algorithms, the problem of difficulty in large-scale automatic planning of ancient houses and courtyards in the existing technology is solved, and the automated layout and reasonable distribution of ancient buildings are realized.
Patent Information
- Application Number
- CN202510293571.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-13
- Publication Date
- 2025-04-11
- Estimated Expiration
- 2045-03-13
AI Technical Summary
It is difficult for existing technology to achieve large-scale automatic planning of non-existing ancient houses and courtyards, and modern building planning algorithms cannot be applied to ancient architectural planning.
By meshing and morphological judgment of plot objects, regular courtyard layout planning is carried out using horizontal or vertical layout methods, and mixed courtyard layout planning is carried out in combination with seed filling algorithms, comprehensively considering the constraints of ancient building planning.
A large-scale automated layout of non-existing ancient houses has been realized, ensuring that the plot is fully used, the courtyard orientation conforms to ancient laws, and the reasonable distribution of different types of buildings has been achieved, imitating the mixed layout of regular courtyards and miscellaneous courtyards of ancient houses.
Smart Images

Figure CN119808255A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of virtual space technology, and in particular relates to methods, devices, electronic equipment, products and media for courtyard layout planning. Background Art
[0002] In the process of large-scale automatic virtual restoration of non-existing ancient residential courtyards, the restoration of the architectural courtyard layout is an important part. Due to the lack of sophisticated surveying and mapping methods on ancient maps, the architectural layout and plane structure on the map are rough and inaccurate. At the same time, the shape of ancient urban plots is very complex. At present, it is generally restored by manually placing a small number of ancient residential building courtyard models in the virtual scene. Even if an automated method is used, it is difficult to comprehensively consider many architectural planning constraints, such as full use of plots, courtyard orientation, courtyard gate orientation, street reservation, and reasonable distribution of different types of buildings. As a result, the automatically planned ancient residential building courtyards are either neat and very rigid, or messy and unreasonable, and it is difficult to achieve natural and reasonable, and row upon row. In addition, there are significant differences between modern architectural planning concepts and ancient architectural planning concepts, so modern architectural planning algorithms cannot be applied to ancient architectural planning application scenarios.
[0003] Therefore, there is an urgent need for a technical solution to achieve large-scale automatic planning of non-existing ancient residential buildings. Summary of the invention
[0004] The embodiments of the present application provide a method, device, electronic equipment, product and medium for courtyard layout planning, which can solve the technical problem that the prior art lacks a technical solution for large-scale automatic planning of non-existing ancient residential buildings.
[0005] In a first aspect, an embodiment of the present application provides a method for courtyard layout planning, including: Obtain one or more plot objects included in the map for courtyard layout planning; Regular courtyard layout planning and miscellaneous courtyard layout planning are performed on each plot object, so that the map obtains a layout plan that is mixed with regular courtyards and miscellaneous courtyards.
[0006] In a possible implementation of the first aspect, performing regular courtyard layout planning and miscellaneous courtyard layout planning on each plot object so that the map obtains a layout plan mixed with regular courtyards and miscellaneous courtyards, includes: The following steps are performed for each plot object, so that the map obtains a layout plan that is mixed with regular courtyards and miscellaneous courtyards: Conduct regular courtyard layout planning for the plot object to obtain the regular courtyard layout planning area; From the plot object, cutting out the regular courtyard layout planning area to obtain the remaining area; Performing miscellaneous courtyard layout planning on the plot object to obtain a miscellaneous courtyard layout planning area; According to the remaining area, performing mask clipping on the miscellaneous courtyard layout planning area to obtain an intersection miscellaneous courtyard layout planning area; The intersection miscellaneous courtyard layout planning area is merged with the regular courtyard layout planning area to obtain the courtyard layout planning of the merged plot object.
[0007] In a possible implementation of the first aspect, performing regular courtyard layout planning on the plot object to obtain a regular courtyard layout planning area includes: Meshing the land parcel object to obtain a plurality of mesh objects included in the land parcel object; Determine the shape of the land object, wherein the shape includes a horizontal shape or a vertical shape; If the shape of the plot object is a vertical shape, a plurality of grid objects in the plot object are regularly arranged in a courtyard layout plan according to a vertical layout mode; If the shape of the plot object is a horizontal shape, a plurality of grid objects in the plot object are regularly arranged in a horizontal layout manner.
[0008] In a possible implementation manner of the first aspect, if the shape of the plot object is a vertical shape, performing regular courtyard layout planning on multiple grid objects in the plot object in a vertical layout manner includes: Determine a first starting mesh object; Scanning along the X-axis direction from the first starting grid object to determine the first grid object whose attribute is true and whose occupied attribute is false in the land parcel; Determine the type of one or more regular courtyards that can be set for the first grid object according to the sizes of the various orientations of the regular courtyards of various types and the available size in the X-axis direction where the first grid object is located; Determine a type of a regular courtyard from one or more types of regular courtyards that can be set in the first grid object; Determining the determined type of the regular courtyard as the type of the regular courtyard set in the first grid object; The above steps are repeated until all grid objects in the plot object whose in-plot attribute is true and whose occupied attribute is false are provided with regular courtyards.
[0009] In a possible implementation manner of the first aspect, if the shape of the plot object is a horizontal shape, performing regular courtyard layout planning on multiple grid objects in the plot object in a horizontal layout manner includes: Determine a second starting mesh object; Scanning along the Y-axis direction from the second starting grid object to determine a second grid object whose attribute is true and whose occupied attribute is false in the land parcel; Determine the type of one or more regular courtyards that can be set for the second grid object according to the sizes of the various directions corresponding to the various types of regular courtyards and the available size in the Y-axis direction where the second grid object is located; Determine a type of a regular courtyard from one or more types of regular courtyards that can be set by the second grid object; Determining the determined type of the regular courtyard as the type of the regular courtyard set in the second grid object; The above steps are repeated until all grid objects in the plot object whose in-plot attribute is true and whose occupied attribute is false are provided with regular courtyards.
[0010] In a possible implementation manner of the first aspect, performing miscellaneous courtyard layout planning on the plot object to obtain a miscellaneous courtyard layout planning area includes: Gridding the land parcel object to obtain a plurality of grid objects included in the land parcel object, wherein the size of the grid objects is larger than the size of the smallest compound; Determining the total number of grid objects to be planned according to the size of a courtyard and the size of the grid objects; Based on the seed filling algorithm, a courtyard layout planning is performed in a plurality of grid objects included in the plot object until the number of grid objects with true occupied attributes reaches the total number of grid objects to be planned.
[0011] In a second aspect, an embodiment of the present application provides a device for courtyard layout planning, including: A first obtaining module is used to obtain one or more plot objects included in a map for courtyard layout planning; The second planning module is used to carry out regular courtyard layout planning and miscellaneous courtyard layout planning for each plot object, so that the map obtains a layout plan that is a mixture of regular courtyards and miscellaneous courtyards.
[0012] In a third aspect, an embodiment of the present application provides an electronic device, comprising a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the electronic device implements the method described in the first aspect above.
[0013] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method described in the first aspect above is implemented.
[0014] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program, wherein when the computer program is executed, the method described in the first aspect above is executed.
[0015] It can be understood that the beneficial effects of the second to fifth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here.
[0016] Compared with the prior art, the embodiments of the present invention have the following beneficial effects: This application obtains one or more plot objects included in the map for courtyard layout planning; regular courtyard layout planning and miscellaneous courtyard layout planning are performed on each plot object, so that the map obtains a layout plan mixed with regular courtyards and miscellaneous courtyards. This application can be used to realize the automated layout of non-existing ancient residential courtyards on a large scale. This application uses regular courtyards and miscellaneous courtyards such as the first courtyard, second courtyard, third courtyard, and fourth courtyard of the quadrangle as restoration objects, and comprehensively considers the planning constraints of the ancient residential courtyards. It can achieve full use of the plot, make the courtyard orientation conform to the ancient rules, and also realize the reasonable distribution of different types of buildings according to the plot use attributes, maximizing the imitation of the architectural planning of the mixed layout of regular courtyards and miscellaneous courtyards of ancient residential buildings. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0018] Figure 1 It is a flow chart of a courtyard layout planning method provided in one embodiment of the present application; Figure 2 is a flow chart of a courtyard layout planning method provided by another embodiment of the present application; Figure 3 is a schematic diagram of a plot object provided by an embodiment of the present application; Figure 4 It is a structural schematic diagram of a device for courtyard layout planning provided in one embodiment of the present application; Figure 5 It is a schematic diagram of the structure of an electronic device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0019] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0020] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.
[0021] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0022] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.
[0023] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0024] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0025] The courtyard layout planning method provided in the embodiment of the present application can be applied to electronic devices such as mobile phones, tablet computers, wearable devices, vehicle-mounted devices, augmented reality (AR) / virtual reality (VR) devices, laptop computers, ultra-mobile personal computers (UMPC), netbooks, personal digital assistants (PDA), etc. The embodiment of the present application does not impose any restrictions on the specific types of electronic devices.
[0026] For example, the electronic device may be a station (STAION, ST) in a WLAN, a cellular phone, a cordless phone, a Session Initiation Protocol (SIP) phone, a Wireless Local Loop (WLL) station, a Personal Digital Assistant (PDA) device, a handheld device with wireless communication function, a computing device or other processing device connected to a wireless modem, a vehicle-mounted device, a vehicle networking terminal, a computer, a laptop computer, a handheld communication device, a handheld computing device, a satellite wireless device, a wireless modem card, a TV set top box (STB), a customer premises equipment (CPE) and / or other devices for communicating on a wireless system and a next generation communication system, for example, a mobile terminal in a 5G network or a mobile terminal in a future evolved Public Land Mobile Network (PLMN) network, etc.
[0027] With the rapid development of virtual reality technology and digital twin technology, the demand for virtual restoration of historical cities is increasing. In general, in order to restore the style of historical ancient cities as much as possible, the ancient city maps handed down are used as important restoration basis and reference. However, on the one hand, due to the backwardness of ancient surveying and mapping technology, the urban building layout in ancient maps is very rough and not measurable. On the other hand, basically most of the buildings are non-existing buildings, and the specific layout is even more difficult to verify. Therefore, how to virtually restore the historical layout of non-existing buildings as much as possible based on the rough expression of urban building layout in ancient maps is a very critical issue. Ancient Chinese cities are generally huge in scale. Taking Beijing during the Qianlong period as an example, there are at least 600,000 residential buildings within the four-nine city. It is obviously unrealistic to use manual methods to carry out large-scale non-existing building restoration work. Automated algorithms must be used to achieve automatic layout planning. At the same time, since the layout of ancient architectural courtyards is very particular, the automated layout planning algorithm must be able to comprehensively consider the layout constraints of many architectural courtyards.
[0028] In the existing technology, there are few cases of virtual restoration of large-scale ancient city residential scenes, and most of them are fine manual restoration of small-scale scenes, or use very simple automatic building placement rules to generate residential scenes, resulting in a single layout and rigid presentation effect. The automatic layout of non-existing ancient residential courtyards either uses a random algorithm based on the shape constraints of the plot, or uses a regular row and column placement algorithm, which cannot comprehensively consider a variety of layout constraints. The residential scenes generated are either messy or neat and tidy, and the effect is rigid.
[0029] Figure 1 It is a flow chart of a courtyard layout planning method provided in one embodiment of the present application.
[0030] S11, obtaining one or more plot objects included in a map for courtyard layout planning.
[0031] Here, the map for courtyard layout planning is usually an electronic map. The map for courtyard layout planning can be imported by maintenance personnel. For example, an electronic map of an ancient city can be used as a map to be restored and for courtyard layout planning. The map for courtyard layout planning may include multiple plots and multiple roads. By vectorizing multiple plots, one or more plot objects included in the map for courtyard layout planning can be obtained, and the plot objects can be planar vector objects. By vectorizing multiple roads, one or more road objects included in the map for courtyard layout planning can be obtained, and the road objects can be planar vector objects or linear vector objects. Type attributes can be indicated for different types of objects to distinguish road objects from plot objects.
[0032] S12, performing regular courtyard layout planning and miscellaneous courtyard layout planning on each plot object, so that the map obtains a layout plan that is a mixture of regular courtyards and miscellaneous courtyards.
[0033] Here, regular courtyard layout planning refers to layout planning according to regular courtyards such as one-courtyard, two-courtyard, three-courtyard, and four-courtyard. Miscellaneous courtyard layout planning refers to layout planning according to miscellaneous courtyards without any regulations. Regular courtyard layout planning and miscellaneous courtyard layout planning can be performed on each plot object separately, so that each plot object included in the map includes regular courtyards and miscellaneous courtyards, so that the map obtains a layout plan mixed with regular courtyards and miscellaneous courtyards.
[0034] This application obtains one or more plot objects included in the map for courtyard layout planning; regular courtyard layout planning and miscellaneous courtyard layout planning are performed on each plot object, so that the map obtains a layout plan mixed with regular courtyards and miscellaneous courtyards. This application can be used to realize the automated layout of non-existing ancient residential courtyards on a large scale. This application uses regular courtyards and miscellaneous courtyards such as the first courtyard, second courtyard, third courtyard, and fourth courtyard of the quadrangle as restoration objects, and comprehensively considers the planning constraints of the ancient residential courtyards. It can achieve full use of the plot, make the courtyard orientation conform to the ancient rules, and also realize the reasonable distribution of different types of buildings according to the plot use attributes, maximizing the imitation of the architectural planning of the mixed layout of regular courtyards and miscellaneous courtyards of ancient residential buildings.
[0035] Figure 2 It is a flow chart of a courtyard layout planning method provided in another embodiment of the present application.
[0036] S21, obtaining one or more plot objects included in the map for courtyard layout planning.
[0037] The specific implementation method of S21 is Figure 1 The specific implementation of S11 is similar or close and will not be described in detail here.
[0038] S22, performing the following steps S221 to S225 on each plot object, so that the map obtains a layout plan that is mixed with regular courtyards and miscellaneous courtyards.
[0039] Here, the following steps S221 to S225 are performed for each plot object included in the map, or for several plot objects included in the map, so that the map obtains a layout plan mixed with regular courtyards and miscellaneous courtyards. In the following, for the sake of simple explanation, the process of performing regular courtyard layout planning and miscellaneous courtyard layout planning on a plot object is described. Those skilled in the art should understand that the process of performing regular courtyard layout planning and miscellaneous courtyard layout planning on other plot objects in the map is similar or similar, and will not be repeated here.
[0040] S221, performing regular courtyard layout planning on the plot object to obtain a regular courtyard layout planning area.
[0041] Regular courtyard layout planning refers to the layout planning according to regular courtyards such as one-courtyard, two-courtyard, three-courtyard, four-courtyard, etc. Regular courtyard layout planning can be carried out on the plot object so that regular courtyards such as one-courtyard, two-courtyard, three-courtyard, four-courtyard, etc. are set in some areas of the plot object. The area with regular courtyards such as one-courtyard, two-courtyard, three-courtyard, four-courtyard, etc. is called the regular courtyard layout planning area.
[0042] S222: Cut out the regular courtyard layout planning area from the plot object to obtain a remaining area.
[0043] Since the regular courtyard layout planning area includes the planned regular courtyards, the regular courtyard layout planning area is clipped from the plot object, and the remaining area obtained is the area where the regular courtyard is not yet planned. The remaining area can be, for example, a polygonal plot with a hole, referred to as P.
[0044] S223, performing miscellaneous courtyard layout planning on the plot object to obtain a miscellaneous courtyard layout planning area.
[0045] The miscellaneous courtyard layout planning refers to the layout planning of miscellaneous courtyards without any regulations. The miscellaneous courtyard layout planning for the plot object can make some areas of the plot object have miscellaneous courtyards without any regulations. The area where the miscellaneous courtyards are set is called the miscellaneous courtyard layout planning area.
[0046] S224: Perform mask clipping on the miscellaneous courtyard layout planning area according to the remaining area to obtain an intersection miscellaneous courtyard layout planning area.
[0047] Here, according to the remaining area, the miscellaneous courtyard layout planning area is masked and cropped, and the intersection part where the remaining area and the miscellaneous courtyard layout planning area intersect can be retained, and the intersection part is called the intersection miscellaneous courtyard layout planning area.
[0048] S225, merging the intersection miscellaneous courtyard layout planning area with the regular courtyard layout planning area to obtain a courtyard layout plan of the merged plot object.
[0049] Since the intersection miscellaneous courtyard layout planning area is the intersection of the remaining area and the miscellaneous courtyard layout planning area, the shape of the intersection miscellaneous courtyard layout planning area is the same as the remaining area. Furthermore, since the remaining area can be merged with the regular courtyard layout planning area to form a complete plot object, the intersection miscellaneous courtyard layout planning area can also be merged with the regular courtyard layout planning area, and after the merger, a plot object with a mixture of regular courtyards and miscellaneous courtyards can be obtained.
[0050] This application can be used to realize the automatic layout of non-existing ancient residential courtyards on a large scale. This application takes the regular courtyards and miscellaneous courtyards such as the first courtyard, the second courtyard, the third courtyard, and the fourth courtyard of the quadrangle as the restoration objects, comprehensively considers the planning constraints of the ancient residential courtyards, can realize the full use of the plot, make the courtyard orientation conform to the ancient rules, and can also realize the reasonable distribution of different types of buildings according to the use attributes of the plot, and maximize the imitation of the architectural planning of the mixed layout of the regular courtyards and miscellaneous courtyards of ancient residential buildings. In addition, by observing the ancient topographic map, it can be found that the miscellaneous courtyards have no regulations at all, and they are built completely according to local conditions and inserted. Therefore, when the application is planning the courtyard layout, the regular courtyard layout planning is first carried out, and then the miscellaneous courtyard layout planning is carried out for the blank remaining space area left by each plot object, so that the entire plot object finally includes both regular courtyards and miscellaneous courtyards, and the layout planning of the mixed layout of regular courtyards and miscellaneous courtyards is realized.
[0051] In one embodiment, the step of performing regular courtyard layout planning on the plot object to obtain a regular courtyard layout planning area includes: Meshing the land parcel object to obtain a plurality of mesh objects included in the land parcel object; Determine the shape of the land object, wherein the shape includes a horizontal shape or a vertical shape; If the shape of the plot object is a vertical shape, a plurality of grid objects in the plot object are regularly arranged in a courtyard layout plan according to a vertical layout mode; If the shape of the plot object is a horizontal shape, a plurality of grid objects in the plot object are regularly arranged in a horizontal layout manner.
[0052] Here, the circumscribed rectangular box of the plot object can be calculated. The rectangular box is meshed to obtain multiple mesh objects included in the plot object. Each mesh object is uniformly assigned the attribute "in the plot" (inField). The "in the plot" attribute (inField) indicates whether the mesh object is in the plot and can be used to plan the courtyard. If the mesh object intersects with the plot object, "in the plot" is assigned a value of true (True), otherwise it is assigned a value of false (False). In addition, each mesh object can also be uniformly assigned the attribute "occupied" (Occupied). When "occupied" is false (False), it means that the mesh object has not been occupied by the courtyard. Here, the size of the mesh object can be determined according to the final effect required for urban restoration. The smaller the mesh object, the closer the courtyard fits the road. Conversely, the larger the mesh object, the farther the courtyard may be from the road, which may cause a loss of authenticity. In addition, it is necessary to pay attention to balancing the computing pressure caused by over-fine meshing. Therefore, the size of the mesh object needs to be reasonably determined.
[0053] Determine the shape of the circumscribed rectangle of the plot object. If the length (distance in the Y-axis direction) is greater than the width (distance in the X-axis direction), the plot object is defined as a vertical shape. Figure 3 If the length (the distance in the Y-axis direction) is less than the width (the distance in the X-axis direction), the land object is defined as a horizontal shape, such as Figure 3 As shown in (b) in the figure. The morphological judgment of the plot object is of great significance for whether the plot object can be fully utilized in the future, and how to reasonably use the scanning algorithm to locate the starting position of the courtyard. Because in general, for a vertical plot object, there are at most two rows of courtyards in the X-axis direction. Because if there are three rows of courtyards in the X-axis direction, it is difficult for the courtyard door to face the road, which is inconsistent with the ancient courtyard planning style. For a horizontal plot object, there are generally at most two rows of courtyards in the Y-axis direction. Similarly, if there are three rows of courtyards in the Y-axis direction, it is difficult for the courtyard door to face the road, which is inconsistent with the ancient courtyard planning style.
[0054] After determining the shape of the plot object, multiple grid objects in the horizontal plot object can be planned for regular courtyard layout according to the horizontal layout mode. Multiple grid objects in the vertical plot object can be planned for regular courtyard layout according to the vertical layout mode.
[0055] In one embodiment, if the shape of the plot object is a vertical shape, a plurality of grid objects in the plot object are subjected to regular courtyard layout planning according to a vertical layout mode, including: Determine a first starting mesh object; Scanning along the X-axis direction from the first starting grid object to determine the first grid object whose attribute is true and whose occupied attribute is false in the land parcel; Determine the type of one or more regular courtyards that can be set in the first grid object according to the sizes of the various directions corresponding to the various types of regular courtyards and the size of the first grid object in the X-axis direction; Determine a type of a regular courtyard from one or more types of regular courtyards that can be set in the first grid object; Determining the determined type of the regular courtyard as the type of the regular courtyard set in the first grid object; The above steps are repeated until all grid objects in the plot object whose in-plot attribute is true and whose occupied attribute is false are provided with regular courtyards.
[0056] For example, S31, the idea of scanning marks can be used to first start from the grid object (0, 0) in the upper left corner of the circumscribed rectangle of the plot object (the first starting grid object) and scan horizontally from left to right along the X-axis, and find the first grid object whose attribute is true (inField=True) and whose occupied attribute is false (Occupied=False) in the plot, recorded as (x0, y0). The occupied attribute is false, indicating that the first grid object is available. The first grid object is used as the starting point of the upper left corner of the courtyard to be planned. Then, the type of regular courtyard is selected according to the size of the courtyard to determine the regular courtyard. S32, the size of regular courtyards such as the first courtyard, the second courtyard, the third courtyard, and the fourth courtyard can be read cyclically, and the size is measured from the two courtyard layouts of sitting north facing south and sitting west facing east (because in ancient times, it was believed that sitting north facing south was the best, sitting south facing north and sitting west facing east were second, and sitting east facing west was the worst). Read a courtyard type T and size, try two layouts, one facing north and the other facing west and east, calculate how many courtyards can be laid out with the size of the plot object in the X-axis direction, set the size of this type of courtyard in the X-axis direction to a, set the available size of the row where x0 is located to b, and calculate the value c of ba. If c<0, it means that this courtyard size cannot be accommodated and another courtyard size needs to be selected. If c>0, and c is less than the size of a courtyard, then store this type T in array W as a backup courtyard. If c>0, and c is greater than or equal to the sum of the size of a courtyard plus the size of a grid object, then store this type T in array W as a backup courtyard. Read other courtyard types and sizes, repeat the above steps, and you can determine the type of one or more regular courtyards that can be set for the first grid object. S33, read all available courtyard types from array W. Within this range, a courtyard type can be randomly determined according to the probability of occurrence of various types of courtyards specified by the use attribute in the plot object, and formally planned into the first grid object. At the same time, the first grid object in the plot occupied by the courtyard is expanded by one grid in the X-axis and Y-axis directions, and their occupied attribute (Occupied) is marked as true (True), which means that the grid object has been used for the determined courtyard type, and the expanded grid is used as a reserved road between courtyards, and the array W is cleared at the same time. S34, for the case where c>0, and c is greater than or equal to the sum of the size of a courtyard plus the size of a grid object, scan from the rightmost end of the row where x0 is located, find the first grid object (xn, yn) whose attribute is true (inField=True) in the plot and whose occupied attribute is false (Occupied=False), as the starting point of the upper right corner of the courtyard to be planned, and use the horizontal scanning plus vertical scanning grid method to determine the courtyard arrangement of this type of courtyard in the X-axis direction. S35, using the vertical scanning method to find the next (x0, y0) grid point as the starting point of the upper left corner of the second courtyard to be planned in the Y-axis direction, and repeat the above steps S32 to S34 for planning.Repeat the above steps S32 to S35 for planning until all grid objects whose attributes inField=True and whose occupied attributes are false (Occupied=False) in the plot are scanned, and no suitable courtyard type can be found for planning, then the planning of the courtyard in the vertical morphology plot object is completed.
[0057] In one embodiment, if the shape of the plot object is a horizontal shape, a plurality of grid objects in the plot object are regularly arranged in a horizontal layout manner, including: Determine a second starting mesh object; Scanning along the Y-axis direction from the second starting grid object to determine a second grid object whose attribute is true and whose occupied attribute is false in the land parcel; Determine the type of one or more regular courtyards that can be set in the second grid object according to the sizes of the various directions corresponding to the various types of regular courtyards and the size of the second grid object in the X-axis direction; Determine a type of a regular courtyard from one or more types of regular courtyards that can be set by the second grid object; Determining the determined type of the regular courtyard as the type of the regular courtyard set in the second grid object; The above steps are repeated until all grid objects in the plot object whose in-plot attribute is true and whose occupied attribute is false are provided with regular courtyards.
[0058] S51, using the idea of scanning and marking, first start from the grid object (0, 0) in the upper left corner of the circumscribed rectangle of the plot (the second starting grid object), and scan vertically from top to bottom along the Y axis, and find the first second grid object whose attribute is true (inField=True) and whose occupied attribute is false (Occupied=False) in the plot, recorded as (x0, y0). The second grid object can be used as the starting point of the upper left corner of the courtyard to be planned. Then, start to select the type of regular courtyard according to the size of the courtyard and determine the regular courtyard. S52, you can cyclically read the size of regular courtyards such as one-courtyard, two-courtyard, three-courtyard, and four-courtyard, and measure the size from the two courtyard layouts of sitting north facing south and sitting west facing east. Read a courtyard type T and size, try two layouts, one facing north and the other facing west and east, calculate how many courtyards can be laid out with the available size of the plot object in the Y-axis direction, set the Y-axis size of this type of courtyard to a, set the available size of the column where y0 is located to b, and calculate the value c of ba. If c<0, it means that this courtyard size cannot be accommodated and another courtyard size needs to be selected. If c>0, and c is less than the size of a courtyard, then store this type T in array W as a backup courtyard. If c>0, and c is greater than or equal to the sum of the size of a courtyard plus a grid size, then store this type T in array W as a backup courtyard. Read other courtyard types and sizes, repeat the above steps, and you can determine the type of one or more regular courtyards that can be set for the second grid object. S53, read all available courtyard types from array W, and within this range, randomly select a courtyard type according to the probability of occurrence of each type of courtyard in the plot object, and formally plan it into the plot object, and at the same time expand the second grid object in the plot object occupied by the courtyard by one grid in the X-axis and Y-axis directions, and set their occupied attributes to false (Occupied=False), which means that the grid object has been used to determine the courtyard, and the expanded grid is used as a reserved road between courtyards, and clear the array W at the same time. S54, for the case where c>0, and c is greater than or equal to the sum of the size of a courtyard plus a grid size, scan from the bottom of the column where y0 is located, find the first grid (xn, yn) whose attribute is true (inField=True) in the plot and whose occupied attribute is false (Occupied=False), as the starting point of the lower left corner of the courtyard to be planned, and use the horizontal scanning plus vertical scanning grid method to determine the courtyard arrangement of this type of courtyard in the Y-axis direction. S55, using the lateral scanning method to find the next (x0, y0) grid point as the starting point of the upper left corner of the second courtyard to be planned in the X-axis direction, and repeating steps S52-S54 for planning.S6, repeat steps S52-S55 for planning until all grid objects whose attributes inField=True and whose occupied attributes are false (Occupied=False) in the plot are scanned, and no suitable courtyard type can be found for planning, then the planning of the courtyard in the horizontal morphological plot object is completed.
[0059] In one embodiment, performing miscellaneous courtyard layout planning on the plot object to obtain a miscellaneous courtyard layout planning area includes: Gridding the land parcel object to obtain a plurality of grid objects included in the land parcel object, wherein the size of the grid objects is larger than the size of the smallest compound; Determining the total number of grid objects to be planned according to the size of a courtyard and the size of the grid objects; Based on the seed filling algorithm, a courtyard layout planning is performed in a plurality of grid objects included in the plot object until the number of grid objects with true occupied attributes reaches the total number of grid objects to be planned.
[0060] S8, the circumscribed rectangle of a single plot object can be used to re-grid to generate multiple grid objects. The size of the grid object needs to be larger than the size of the smallest courtyard in the single three-dimensional courtyard house model to be laid out. Preferably, the size of the grid object needs to be larger than about 1.5 times the size of the smallest courtyard in the single three-dimensional courtyard house model to be laid out, to ensure that even if a grid size is randomly generated in the courtyard in the future, at least one three-dimensional courtyard house model can be placed, and all grids are uniformly assigned an occupied attribute of false (Occupied=False). S9, referencing the seed filling algorithm, randomly generate preliminary courtyards in the regenerated grid object. S91, randomly select a grid object A from all grid objects with an occupied attribute of false (Occupied=False), randomly expand one grid A1 in four directions around A based on connectivity, and assign the occupied attribute (Occupied) of the A and A1 grids to true (true). Then, using the A1 grid as the seed, randomly expand one grid A2 in four directions around A1 based on connectivity, and the A2 grid must satisfy the occupancy attribute of false (Occupied=False). After randomly determining the A2 grid, assign its occupancy attribute (Occupied) to true (true). Similarly, the grid objects are continuously expanded until An is reached to complete the preliminary generation of a miscellaneous courtyard. The upper limit nmax of n depends on the size S of the courtyard, which needs to satisfy S>M * nmax (M is the area of a single grid object). The final value of n is a random integer in the interval [1, nmax]. S92, generate a preliminary miscellaneous courtyard in a loop according to the method steps of S91.
[0061] This application uses the grid object method to grid the plot object to obtain the grid object, and uses the horizontal and vertical bidirectional scanning algorithm to quickly determine the starting point of each courtyard, and then combines the grid object occupancy attribute mark, which greatly accelerates the efficiency of spatial relationship analysis and quickly calculates whether there will be a covering relationship between courtyards. At the same time, it also guarantees the effect of adapting to local conditions and randomness of courtyard planning to the greatest extent, making the regular courtyard planning layout more row upon row and avoiding rigidity. In addition, the probability of occurrence of various types of courtyards to be planned is added to the plot attributes, so that the courtyard matching that is more in line with the rationality of historical style can be effectively planned according to the use of the plot. Further, for the blank areas left in the plot, the grid idea is adopted and the seed filling algorithm is used to generate miscellaneous courtyards, and the blank plot is used to perform secondary intersection and clipping on the initially generated miscellaneous courtyards, thereby generating a richer and more diverse miscellaneous courtyard style, and the use of the grid size can well ensure that the miscellaneous courtyards can be placed as much as possible, and ensure that the miscellaneous courtyards are not empty in most cases.
[0062] This application makes full use of the idea and method of gridding the plots, which not only avoids the massive amount of manual work, but also greatly improves the gridding calculation effect compared to traditional vector calculation. At the same time, the gridding method can fully consider the full use and adaptability of the plots when planning regular courtyards, and fully demonstrate the unity of courtyard diversity and randomness when planning miscellaneous courtyards, effectively improving the efficiency and effect of the automated planning of ancient residential courtyards.
[0063] Figure 4 It is a structural schematic diagram of a device for courtyard layout planning provided in one embodiment of the present application.
[0064] like Figure 4 As shown, the device 4 comprises: A first obtaining module 41 is used to obtain one or more plot objects included in a map for courtyard layout planning; The second planning module 42 is used to perform regular courtyard layout planning and miscellaneous courtyard layout planning on each plot object, so that the map obtains a layout plan that is mixed with regular courtyards and miscellaneous courtyards.
[0065] Another embodiment of the present invention discloses a device 4. In the above Figure 4 Based on the corresponding embodiment, the second planning module 42 is used for: The following steps are performed for each plot object, so that the map obtains a layout plan that is mixed with regular courtyards and miscellaneous courtyards: Conduct regular courtyard layout planning for the plot object to obtain a regular courtyard layout planning area; From the plot object, cutting out the regular courtyard layout planning area to obtain the remaining area; Performing miscellaneous courtyard layout planning on the plot object to obtain a miscellaneous courtyard layout planning area; According to the remaining area, performing mask clipping on the miscellaneous courtyard layout planning area to obtain an intersection miscellaneous courtyard layout planning area; The intersection miscellaneous courtyard layout planning area is merged with the regular courtyard layout planning area to obtain the courtyard layout planning of the merged plot object.
[0066] Another embodiment of the present invention discloses a device 4. In the above Figure 4 Based on the corresponding embodiment, the second planning module 42 is used for: Meshing the land parcel object to obtain a plurality of mesh objects included in the land parcel object; Determine the shape of the land object, wherein the shape includes a horizontal shape or a vertical shape; If the shape of the plot object is a vertical shape, a plurality of grid objects in the plot object are regularly arranged in a courtyard layout plan according to a vertical layout mode; If the shape of the plot object is a horizontal shape, a plurality of grid objects in the plot object are regularly arranged in a horizontal layout manner.
[0067] Another embodiment of the present invention discloses a device 4. In the above Figure 4 Based on the corresponding embodiment, the second planning module 42 is used for: Determine a first starting mesh object; Scanning along the X-axis direction from the first starting grid object to determine the first grid object whose attribute is true and whose occupied attribute is false in the land parcel; Determine the type of one or more regular courtyards that can be set for the first grid object according to the sizes of the various orientations of the regular courtyards of various types and the available size in the X-axis direction where the first grid object is located; Determine a type of a regular courtyard from one or more types of regular courtyards that can be set in the first grid object; Determining the determined type of the regular courtyard as the type of the regular courtyard set in the first grid object; The above steps are repeated until all grid objects in the plot object whose in-plot attribute is true and whose occupied attribute is false are provided with regular courtyards.
[0068] Another embodiment of the present invention discloses a device 4. In the above Figure 4 Based on the corresponding embodiment, the second planning module 42 is used for: Determine a second starting mesh object; Scanning along the Y-axis direction from the second starting grid object to determine a second grid object whose attribute is true and whose occupied attribute is false in the land parcel; Determine the type of one or more regular courtyards that can be set for the second grid object according to the sizes of the various directions corresponding to the various types of regular courtyards and the available size in the Y-axis direction where the second grid object is located; Determine a type of a regular courtyard from one or more types of regular courtyards that can be set by the second grid object; Determining the determined type of the regular courtyard as the type of the regular courtyard set in the second grid object; The above steps are repeated until all grid objects in the plot object whose in-plot attribute is true and whose occupied attribute is false are provided with regular courtyards.
[0069] Another embodiment of the present invention discloses a device 4. In the above Figure 4 Based on the corresponding embodiment, the second planning module 42 is used for: Gridding the land parcel object to obtain a plurality of grid objects included in the land parcel object, wherein the size of the grid objects is larger than the size of the smallest compound; Determining the total number of grid objects to be planned according to the size of a courtyard and the size of the grid objects; Based on the seed filling algorithm, a courtyard layout planning is performed in a plurality of grid objects included in the plot object until the number of grid objects with true occupied attributes reaches the total number of grid objects to be planned.
[0070] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.
[0071] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0072] The present application also provides an electronic device, such as Figure 5 As shown, the electronic device 5 includes: at least one processor 50, a memory 51, and a computer program 52 stored in the memory 51 and executable on the at least one processor 50, and when the processor 50 executes the computer program 52, the steps in any of the above-mentioned method embodiments are implemented.
[0073] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.
[0074] An embodiment of the present application provides a computer program product, including a computer program. When the computer program is executed, the steps in the above-mentioned method embodiments are executed.
[0075] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium can at least include: any entity or device that can carry the computer program code to the camera / electronic device, recording medium, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, RandomAccess Memory), electric carrier signal, telecommunication signal and software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.
[0076] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0077] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0078] In the embodiments provided in the present application, it should be understood that the disclosed devices / electronic devices and methods can be implemented in other ways. For example, the device / electronic device embodiments described above are merely schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0079] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0080] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A method for courtyard layout planning, characterized in that: include: Obtain one or more plot objects included in the map for courtyard layout planning; Regular courtyard layout planning and miscellaneous courtyard layout planning are performed on each plot object, so that the map obtains a layout plan that is mixed with regular courtyards and miscellaneous courtyards.
2. The method according to claim 1, characterized in that The step of performing regular courtyard layout planning and miscellaneous courtyard layout planning on each plot object so that the map obtains a layout plan mixed with regular courtyards and miscellaneous courtyards includes: The following steps are performed for each plot object, so that the map obtains a layout plan that is mixed with regular courtyards and miscellaneous courtyards: Conduct regular courtyard layout planning for the plot object to obtain the regular courtyard layout planning area; From the plot object, cutting out the regular courtyard layout planning area to obtain the remaining area; Performing miscellaneous courtyard layout planning on the plot object to obtain a miscellaneous courtyard layout planning area; According to the remaining area, performing mask clipping on the miscellaneous courtyard layout planning area to obtain an intersection miscellaneous courtyard layout planning area; The intersection miscellaneous courtyard layout planning area is merged with the regular courtyard layout planning area to obtain the courtyard layout planning of the merged plot object.
3. The method according to claim 2, characterized in that The step of performing regular courtyard layout planning on the plot object to obtain a regular courtyard layout planning area includes: Meshing the land parcel object to obtain a plurality of mesh objects included in the land parcel object; Determine the shape of the land object, wherein the shape includes a horizontal shape or a vertical shape; If the shape of the plot object is a vertical shape, a plurality of grid objects in the plot object are regularly arranged in a courtyard layout plan according to a vertical layout mode; If the shape of the plot object is a horizontal shape, a plurality of grid objects in the plot object are regularly arranged in a horizontal layout manner.
4. The method according to claim 3, characterized in that If the shape of the plot object is a vertical shape, a plurality of grid objects in the plot object are arranged in a regular courtyard layout plan according to a vertical layout mode, including: Determine a first starting mesh object; Scanning along the X-axis direction from the first starting grid object to determine the first grid object whose attribute is true and whose occupied attribute is false in the land parcel; Determine the type of one or more regular courtyards that can be set for the first grid object according to the sizes of the various orientations of the regular courtyards of various types and the available size in the X-axis direction where the first grid object is located; Determine a type of a regular courtyard from one or more types of regular courtyards that can be set in the first grid object; Determining the determined type of the regular courtyard as the type of the regular courtyard set in the first grid object; The above steps are repeated until all grid objects in the plot object whose in-plot attribute is true and whose occupied attribute is false are provided with regular courtyards.
5. The method according to claim 3 or 4, characterized in that If the shape of the plot object is a horizontal shape, a plurality of grid objects in the plot object are arranged in a regular courtyard layout plan according to a horizontal layout mode, including: Determine a second starting mesh object; Scanning along the Y-axis direction from the second starting grid object to determine a second grid object whose attribute is true and whose occupied attribute is false in the land parcel; Determine the type of one or more regular courtyards that can be set for the second grid object according to the sizes of the various directions corresponding to the various types of regular courtyards and the available size in the Y-axis direction where the second grid object is located; Determine a type of a regular courtyard from one or more types of regular courtyards that can be set by the second grid object; Determining the determined type of the regular courtyard as the type of the regular courtyard set in the second grid object; The above steps are repeated until all grid objects in the plot object whose in-plot attribute is true and whose occupied attribute is false are provided with regular courtyards.
6. The method according to claim 3, characterized in that The performing miscellaneous courtyard layout planning on the plot object to obtain the miscellaneous courtyard layout planning area includes: Gridding the land parcel object to obtain a plurality of grid objects included in the land parcel object, wherein the size of the grid objects is larger than the size of the smallest compound; Determining the total number of grid objects to be planned according to the size of a courtyard and the size of the grid objects; Based on the seed filling algorithm, a courtyard layout planning is performed in a plurality of grid objects included in the plot object until the number of grid objects with true occupied attributes reaches the total number of grid objects to be planned.
7. A device for courtyard layout planning, characterized in that: include: A first obtaining module is used to obtain one or more plot objects included in a map for courtyard layout planning; The second planning module is used to carry out regular courtyard layout planning and miscellaneous courtyard layout planning for each plot object, so that the map obtains a layout plan that is a mixture of regular courtyards and miscellaneous courtyards.
8. An electronic device, characterized in that: The electronic device comprises a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the electronic device implements the method according to any one of claims 1 to 6.
9. A computer program product, characterized in that The invention comprises a computer program, which, when being executed, enables the method according to any one of claims 1 to 6 to be performed.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Automatic planning and layout method for residential land, electronic equipment and storage medium
CN115391870A
Automatic commercial land layout method, electronic equipment and storage medium
CN115391871A
Smart city planning optimization method and system based on big data
CN116862063A
Deployment planning method and device for machine room equipment
CN117892924A
Traffic noise map rapid calculation method and device, electronic equipment and medium
CN118133572A