Method, device and equipment for generating roof based on wall selection and storage medium

By automatically calculating roof generation parameters and displaying preview effects based on a wall selection method, the problems of cumbersome roof design operations and difficult adjustments in existing technologies are solved, and fast and efficient roof generation is achieved.

CN120654295APending Publication Date: 2025-09-16HANGZHOU QUNHE INFORMATION TECHNOLOGIES CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510715167.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-29
Publication Date
2025-09-16

AI Technical Summary

Technical Problem

In the existing technology, roof design operations are cumbersome, the learning cost is high, it is difficult to make quick adjustments, and generating a roof consumes a lot of manpower and time.

Method used

Through a wall selection-based method, the target wall group and roof type are analyzed, roof generation parameters are automatically calculated, and a preview effect is displayed to simplify the operation process.

Benefits of technology

Improved the speed and efficiency of roof generation, simplified the roof creation process, and reduced the learning cost.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120654295A_ABST
    Figure CN120654295A_ABST
Patent Text Reader

Abstract

The invention provides a method, device and equipment for generating a roof based on wall selection and a storage medium. The method comprises the following steps: in response to a roof generation command of a front end, analyzing the roof generation command to obtain at least one of a target wall group and a roof type; wherein the target wall group comprises a plurality of parallel walls selected at the front end; determining roof generation parameters according to the target wall group and the roof type; and generating a preview effect of a target roof corresponding to the roof type for the target wall group according to the roof generation parameter.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to technical fields such as three-dimensional modeling, virtual modeling, and virtual design. Background Art

[0002] When designing a roof using virtual 3D modeling software, each roof needs to be designed independently. This is cumbersome, has a high learning cost, is difficult to implement, and the generated roof cannot be quickly adjusted. After changing a certain parameter of the roof, the roof needs to be redesigned and generated a new one, which consumes a lot of manpower and time. Summary of the Invention

[0003] The present disclosure provides a method, apparatus, device, and storage medium for generating a roof based on wall selection, so as to solve or alleviate one or more technical problems in the prior art.

[0004] In a first aspect, the present disclosure provides a method for generating a roof based on wall selection, comprising:

[0005] In response to a roof generation command from a front end, parsing the roof generation command to obtain at least one of a target wall group and a roof type; wherein the target wall group includes a plurality of parallel walls selected by the front end;

[0006] determining roof generation parameters according to the target wall group and roof type;

[0007] A preview effect of a target roof corresponding to the roof type is generated for the target wall group according to the roof generation parameters.

[0008] In a second aspect, the present disclosure provides a device for generating a roof based on wall selection, comprising:

[0009] a parsing module, configured to respond to a roof generation command from a front end and parse the roof generation command to obtain at least one of a target wall group and a roof type; wherein the target wall group includes a plurality of parallel walls selected by the front end;

[0010] a determination module, configured to determine roof generation parameters according to the target wall group and roof type;

[0011] A generating module is used to generate a preview effect of a target roof corresponding to the roof type for the target wall group according to the roof generation parameters.

[0012] According to a third aspect, an electronic device is provided, including:

[0013] at least one processor; and

[0014] a memory communicatively connected to the at least one processor; wherein,

[0015] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform any method in the embodiments of the present disclosure.

[0016] In a fourth aspect, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute any method according to the embodiments of the present disclosure.

[0017] In a fifth aspect, a computer program product is provided, comprising a computer program, which implements any method according to the embodiments of the present disclosure when executed by a processor.

[0018] The beneficial effects of the technical solution provided by the present disclosure include at least: after obtaining the roof generation command, the roof generation parameters can be automatically calculated according to the parameters of the selected wall, and a preview effect of the wall generated according to the roof generation parameters can be displayed, thereby improving the speed of roof generation, simplifying the operation of creating the roof, and improving the efficiency of roof generation.

[0019] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present disclosure, nor are they intended to limit the scope of the present disclosure. Other features of the present disclosure will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In the accompanying drawings, unless otherwise specified, the same reference numerals throughout the multiple drawings represent the same or similar components or elements. These drawings are not necessarily drawn to scale. It should be understood that these drawings only depict some embodiments provided in accordance with the present disclosure and should not be regarded as limiting the scope of the present disclosure.

[0021] Figure 1 is a flowchart of a method for generating a roof based on wall selection according to an embodiment of the present disclosure;

[0022] Figure 2a and Figure 2b 1 is a schematic diagram of the process of generating a single-slope roof and a gable roof according to an embodiment of the present disclosure;

[0023] Figure 3 is a flowchart of a method for generating a roof based on wall selection according to another embodiment of the present disclosure;

[0024] Figure 4a and Figure 4b is a schematic diagram of a gable roof and a single slope roof according to an embodiment of the present disclosure;

[0025] Figures 5a to 5his a schematic diagram of roof generation according to an embodiment of the present disclosure;

[0026] Figure 6 is a flowchart of a method for generating a roof based on wall selection according to another embodiment of the present disclosure;

[0027] Figure 7 is a flowchart of a roof generation method according to an embodiment of the present disclosure;

[0028] Figures 8a to 8c is a schematic diagram of the effect of roof generation according to an embodiment of the present disclosure;

[0029] Figure 9 This is a schematic diagram of a legal wall scene according to an embodiment of the present disclosure;

[0030] Figure 10 is a schematic diagram of generating a roof on a legal wall according to an embodiment of the present disclosure;

[0031] Figure 11 This is a schematic diagram of an illegal wall scene according to an embodiment of the present disclosure;

[0032] Figure 12 is a schematic diagram of a gable roof generation effect according to an embodiment of the present disclosure;

[0033] Figure 13 is a schematic diagram of the single slope roof generation effect according to an embodiment of the present disclosure;

[0034] Figure 14 is a schematic diagram of generating a gable roof between walls of different heights according to an embodiment of the present disclosure;

[0035] Figure 15 is a schematic diagram of a scene of moving a wall according to an embodiment of the present disclosure;

[0036] Figure 16 is a schematic diagram of a scene of extending a roof edge according to an embodiment of the present disclosure;

[0037] Figure 17 is a schematic diagram of a scenario for adjusting the position of a roof ridge line according to an embodiment of the present disclosure;

[0038] Figure 18 is a structural schematic diagram of a device for generating a roof based on wall selection according to an embodiment of the present disclosure;

[0039] Figure 19 is a structural schematic diagram of a device for generating a roof based on wall selection according to another embodiment of the present disclosure;

[0040] Figure 20 is a block diagram of an electronic device for implementing the method according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0041] The present disclosure will be described in further detail below with reference to the accompanying drawings. The same reference numerals in the accompanying drawings represent elements with the same or similar functions. Although various aspects of the embodiments are shown in the accompanying drawings, the drawings are not necessarily drawn to scale unless otherwise indicated.

[0042] In addition, numerous specific details are provided in the following detailed description to better illustrate the present disclosure. Those skilled in the art will appreciate that the present disclosure can be practiced without certain specific details. In some instances, methods, means, components, circuits, etc. well known to those skilled in the art are not described in detail in order to highlight the main purpose of the present disclosure.

[0043] Existing interactive methods for generating gable and pitched roofs suffer from limited generation conditions, cumbersome operations, high learning curves, and poor usability. These include: the inability to generate gable roofs with off-center ridge lines; the inability to align ridge lines when drawing irregular roofs; and the lack of a simple and intuitive method for generating irregular roof structures, such as convex and concave roofs.

[0044] Figure 1 FIG. 1 is a flow chart of a method for generating a roof based on wall selection according to an embodiment of the present disclosure. In one embodiment, the method includes:

[0045] S101, in response to a roof generation command from a front end, parsing the roof generation command to obtain at least one of a target wall group and a roof type; wherein the target wall group includes a plurality of parallel walls selected by the front end;

[0046] S102, determining roof generation parameters according to the target wall group and roof type;

[0047] S103: Generate a preview effect of a target roof corresponding to the roof type for the target wall group according to the roof generation parameters.

[0048] In the embodiment of the present disclosure, the method for generating a roof based on wall selection can be applied to a system including a front end and a back end. The front end can also be referred to as the front end, and the back end can also be referred to as the back end. The front end can be used to interact with the user, for example, to receive the user's roof generation requirements, or to display the generated roof to the user. The back end can be used to calculate roof parameters, for example, to calculate the size, style and angle of the roof to be generated based on the wall and roof types selected by the user. The walls and roofs can be three-dimensional models, and the three-dimensional models can include virtual models generated using computer virtual modeling software. That is, in the embodiment of the present disclosure, the walls can be understood as wall models or wall virtual models, and the roof can be understood as roof models or roof virtual models. The method for generating a roof based on wall selection can be used to control the three-dimensional modeling system to generate a roof model on the selected wall model.

[0049] In the embodiments of the present disclosure, the front-end may include a user interface, a web page, or the like, and may be run on a client device such as a personal computer or a smartphone, or on a server-side front-end device. The back-end may include a computing program, logic code, or the like, and may be run on a server-side device such as a cloud computing center, a cloud server, or a cloud computer, or on a client-side back-end device. The front-end and back-end may be deployed separately on different devices, or they may be deployed together on the same device.

[0050] In this disclosed embodiment, users can create a new target wall group on the front-end or select several walls in an existing 3D model as target wall groups. Users can also select the roof type to be generated on the front-end. After the front-end determines the target wall group and roof type, it can generate a roof generation command based on the target wall group and roof type and send it to the back-end.

[0051] In the disclosed embodiment, upon receiving a roof generation command, the backend can parse the command to obtain parameters for each wall in the target wall group and the roof type selected by the user. Roof types can include single-slope roofs and gable roofs, and wall parameters can include height, length, and position.

[0052] In the embodiment of the present disclosure, after the backend has parsed the target wall group and roof type, it can determine the roof generation parameters of the corresponding roof type based on the parameters of each wall in the target wall group. The roof generation parameters of a single-slope roof may include the angle between the roof and the wall and the length of the roof edge. Among them, the length of the roof edge can be determined based on the length of the wall, and the angle between the roof and the wall can be obtained by calculating the tangent angle or cotangent angle based on the distance between the walls and the height difference. An exemplary calculation method is as follows:

[0053]

[0054] Among them, ∠θ can represent the angle between the roof and the wall; d can represent the distance between the walls; Δh1 can represent the height difference between the walls.

[0055] For example, Figure 2a As shown, in the case where the target wall group includes wall A (wall length 3m, height 2.5m) and wall B (wall length 3m, height 3m), and the roof type is a single-slope roof, the length of the roof edge can be 3m. According to the respective positions of wall A and wall B, the distance between wall A and wall B is calculated to be 3m. According to the height difference of wall A and wall B of 0.5m, the angle between the roof and wall A is calculated to be approximately 99.462°, or the angle between the roof and wall B is calculated to be approximately 80.538°.

[0056] In the disclosed embodiment, the parameters for generating a gable roof may include the position of the ridge line, the angle between the roof and the wall, and the length of the roof side. The initial position of the ridge line can be set to the center between the two walls, with the same direction as the two walls and a height higher than the set value of one of the walls. The angle between the roof and the wall can be calculated based on the tangent angle or cotangent angle calculated from the height difference between the ridge line and any wall and half the distance between the walls. The length of the roof side can be determined based on the length of the wall. An exemplary calculation method is as follows:

[0057]

[0058] Here, ∠θ represents the angle between the roof and the wall; d represents the distance between the walls; Δh2 represents the height difference between the ridgeline and any wall; and ∠α represents the default angle, which can be the angle between the wall and the ground plane in the virtual modeling space, for example, 90°. For walls of varying heights, the angle between each roof face of a gable roof and the wall can be calculated separately.

[0059] For example, Figure 2b As shown, the target wall group includes wall C (3m long, 3m high) and wall D (3m long, 3m high), and when the roof type is a gable roof, the length of the roof edge can be 3m. According to the respective positions of walls C and D, the distance between walls C and D is calculated to be 4m. The ridge line is 1m higher than the wall and is located between walls C and D, 2m away from each wall. According to the height difference of 1m between the ridge line and the wall and 2m, which is half of the distance between the walls, the angle between the roof and walls C and D is calculated to be 116.565°.

[0060] In the embodiment of the present disclosure, when the roof generation parameters of the corresponding roof type are calculated, the background can generate a preview effect of the target roof on the front end according to the roof generation parameters. The preview effect of the roof can include a temporary display of the effect diagram of the roof, which can be a non-persistent virtual three-dimensional model. It can support the adjustment of the preview effect of the roof, such as adjusting the length of the roof or adjusting the position of the ridge line. For example, Figure 2a As shown in the figure, between wall A (3m long, 2.5m high) and wall B (3m long, 3m high), a preview effect of a single-slope roof covering walls A and B can be generated based on the length of the roof edge being 3m and the angle between the roof and wall A being 99.462°.

[0061] According to the embodiment of the present disclosure, after obtaining the roof generation command, the roof generation parameters can be automatically calculated according to the parameters of the selected wall, and a preview effect of the wall generated according to the roof generation parameters can be displayed, thereby improving the speed of roof generation, simplifying the operation of creating a roof, and improving the efficiency of generating the roof.

[0062] In one embodiment, the roof generation command is generated by the front end according to the selection of wall and roof types when the multiple parallel walls are selected; the roof generation command includes the selected wall information and the selected roof type information.

[0063] In the embodiment of the present disclosure, after the user selects multiple walls through the front end, the front end can determine the positional relationship between the walls. When the multiple walls are parallel to each other, a roof generation command is obtained in combination with the roof type selected by the user. When the multiple walls are not parallel, a warning or prompt can be issued. For example, the user selects wall A and wall B that are parallel to each other, and selects the roof type as a single slope roof. A roof generation command containing the information of wall A, the information of wall B and the roof type as a single slope roof can be generated. The roof generation command can include specific wall parameters, such as the length, height and position of the wall, and can also include the corresponding identifier of the wall. The identifier corresponding to the wall can be used to indicate the wall and query the wall parameters. After receiving the roof generation command, the background can parse the specific wall parameters from the roof generation command, or parse the identifier corresponding to the wall, and then query the specific wall parameters based on the identifier corresponding to the wall.

[0064] According to the embodiment of the present disclosure, the wall group and the desired wall type that the user expects to generate the roof can be obtained, and a roof generation command containing the above information can be generated. The roof generation command can instruct the background to automatically generate a preview effect of the roof, thereby improving the efficiency of roof generation and making the operation easier.

[0065] Figure 3This is a flow chart of a method for generating a roof based on wall selection according to another embodiment of the present disclosure. This method may include one or more features of the aforementioned method for generating a roof based on wall selection. In one embodiment, S101 responds to a roof generation command from a front-end, and parses the roof generation command to obtain at least one of the target wall group and the roof type, including:

[0066] S301, receiving the roof generation command sent by the front end;

[0067] S302: parsing the target wall group selected at the front end according to the roof generation command;

[0068] S303: Parse and obtain the selected roof type according to the roof generation command.

[0069] In the embodiment of the present disclosure, the roof type may include a single slope roof or a gable roof.

[0070] In the embodiment of the present disclosure, the backend can monitor the roof generation command sent by the frontend. When the roof generation command is obtained, the roof generation command can be parsed to obtain the target wall group and select the roof type. Among them, the roof type can include single slope roof and gable roof, etc. Figure 4a As shown in Figure 1, a single-slope roof can be a roof that only has one face. Figure 4b As shown, the gable roof may be a roof including two sides and a ridge line. The target wall group may include a plurality of selected parallel walls and parameter information of the parallel walls.

[0071] In the disclosed embodiment, the parameter information of the multiple parallel walls in the target wall group may include the position, length, and height of each wall. The backend can obtain the parameter information of the multiple parallel walls by parsing the roof generation command, or can obtain the identification information of the multiple parallel walls by parsing the roof generation command. The backend then obtains the parameter information of the corresponding walls based on the identification information of the multiple parallel walls.

[0072] In the disclosed embodiment, different roof types may correspond to different roof parameter calculation strategies. When the background analyzes and obtains the selected roof type, it may select its corresponding roof parameter calculation strategy, process the parameter information of multiple parallel walls, and obtain the roof generation parameters. For example, when the analyzed selected roof type is a single slope roof, one or more walls may be selected from multiple parallel walls as reference walls. When calculating the angle between the roof and the wall, the angle between the roof and the reference wall is calculated; when calculating the length of the roof edge, the length of the reference wall is used as the length of the roof edge. For another example, when the analyzed selected roof type is a gable roof, when calculating the angle between the roof and the wall, the angle between each roof surface and the wall to which it is connected is calculated; when calculating the length of the roof edge, the length of the reference wall may be obtained, and the length of the reference wall may be used as the length of the roof edge.

[0073] In the disclosed embodiment, different roof types may correspond to different roof parameter calculation units. When the background analyzes and obtains the selected roof type, the corresponding roof parameter calculation unit may be used to calculate the roof generation parameters based on the parameter information of multiple parallel walls. For example, when the analyzed selected roof type is a single-slope roof, the roof parameter calculation unit corresponding to the single-slope roof may be used to calculate the single-slope roof generation parameters based on the parameter information of the wall. For another example, when the analyzed selected roof type is a gable roof, the roof parameter calculation unit corresponding to the gable roof may be used to calculate the gable roof generation parameters based on the parameter information of the wall.

[0074] In the disclosed embodiment, different roof types may correspond to different roof preview effect generation units. When the background calculates and obtains the roof generation parameters corresponding to the selected roof type, the background may use the corresponding roof preview effect generation unit according to the roof type to generate a roof preview effect of the corresponding type according to the roof generation parameters. For example, when the single-slope roof generation parameters are calculated, the single-slope roof preview effect generation unit may be used to generate a single-slope roof preview effect according to the single-slope roof generation parameters. For another example, when the gable roof generation parameters are calculated, the gable roof preview effect generation unit may be used to generate a gable roof preview effect according to the gable roof generation parameters.

[0075] According to the embodiment of the present disclosure, the background can parse the wall and roof types selected by the user in the front end, providing a basis for calculating the roof generation parameters and generating the roof preview effect, simplifying the operation of manually setting the roof parameters and improving the efficiency of generating the roof.

[0076] In one embodiment, the roof type may include a gable roof. S102 determines the roof generation parameters according to the target wall group and the roof type, which may include:

[0077] When the lengths of the walls in the target wall group are equal, the first roof generation parameters are determined according to the height difference of the walls in the target wall group; wherein the first roof generation parameters include the ridge line position, the angle between the roof and the wall, and the length of the roof edge, and the length of the roof edge is determined according to the length of the walls in the target wall group.

[0078] In the embodiment of the present disclosure, when the background analysis finds that the selected roof type is a gable roof and the lengths of the walls in the target wall group are equal, the distance between the walls in the target wall group can be calculated, and then the position of the ridge line can be calculated based on the preset elevation height of the ridge line. For example, Figure 5a As shown, a ridge line can be set between two walls with a distance of 4m between them, 2m away from each wall and 1m higher than one of the walls, with the ridge line parallel to the two walls. Once the position of the ridge line is determined, the tangent angle can be calculated based on the height difference between the ridge line and each wall and half the distance between the walls. The default angle of the wall, such as 90°, can be added to the tangent angle to obtain the angle between the roof and the wall. The backend can also determine the length of the roof edge based on the length of the wall. For example, if the wall length is 3m, the length of the roof edge can be set to 3m.

[0079] In one embodiment, the roof type may include a gable roof; S102 determines roof generation parameters according to the target wall group and the roof type, and may further include:

[0080] When the lengths of the walls in the target wall group are not equal, the second roof generation parameters are determined based on the height difference of the walls in the target wall group and the reference wall in the target wall group; wherein the second roof generation parameters include the ridge line position, the angle between the roof and the wall, and the length of the roof edge, and the length of the roof edge is determined based on the length of the reference wall in the target wall group.

[0081] In the embodiment of the present disclosure, when the background analysis finds that the selected roof type is a gable roof and the lengths of the walls in the target wall group are not equal, the distance between the walls in the target wall group can be calculated, and then the position of the ridge line can be calculated based on the preset elevation height of the ridge line. For example, Figure 5bAs shown, the ridge line can be set between two walls with a wall distance of 4m, 2m away from each wall, and 1m higher than the reference wall, and the ridge line is parallel to the two walls. When the position of the ridge line is determined, the tangent angle can be calculated based on the height difference between the ridge line and each wall and half of the distance between the walls. The default angle of the wall is added to the tangent angle to get the angle between the roof and the wall. The background can also determine the length of the roof edge based on the length of the reference wall. For example, the wall length of wall A in the target wall group is 3m, the wall length of wall B is 4m, the reference wall is wall B, and the length of the roof edge can be set to 4m. If the reference wall is wall A, such as Figure 5c As shown, the length of the roof edge can be set to 3m.

[0082] In one embodiment, the roof type may include a single-slope roof; S102, determining roof generation parameters according to the target wall group and the roof type, may also include:

[0083] When the walls in the target wall group have equal lengths, determining a third roof generation parameter based on the height difference of the walls in the target wall group; wherein the third roof generation parameter includes an angle between the roof and the wall and a length of a roof side, and the length of the roof side is determined based on the length of the walls in the target wall group;

[0084] In the embodiment of the present disclosure, when the background analysis finds that the selected roof type is a single slope roof and the lengths of the walls in the target wall group are equal, Figure 5d As shown, the distance between the walls and the height difference between the walls in the target wall group can be calculated. When the distance between the walls and the height difference between the walls are determined, the tangent angle can be calculated based on the distance between the walls and the height difference between the walls. When calculating the angle between the taller wall and the roof, the tangent angle can be used as the angle between the roof and the wall. When calculating the angle between the shorter wall and the roof, the default angle of the wall, such as 90°, can be added to the tangent angle to obtain the angle between the roof and the wall. When the heights of the walls in the target wall group are the same, the angle between the roof and the wall can be 90°. The background can also determine the length of the roof side based on the length of the wall. For example, if the length of the wall is 3m, the length of the roof side can be set to 3m.

[0085] In one embodiment, the roof type may include a single-slope roof; S102 determines roof generation parameters according to the target wall group and the roof type, and may further include:

[0086] When the lengths of the walls in the target wall group are not equal, the fourth roof generation parameter is determined based on the height difference of the walls in the target wall group and the reference wall in the target wall group; wherein the fourth roof generation parameter includes the angle between the roof and the wall and the length of the roof edge, and the length of the roof edge is determined based on the length of the reference wall in the target wall group.

[0087] In the embodiment of the present disclosure, when the background analysis finds that the selected roof type is a single slope roof and the lengths of the walls in the target wall group are not equal, Figure 5e As shown, the distance between the walls in the target wall group and the height difference between the walls can be calculated. When the distance between the walls and the height difference between the walls are determined, the angle between the roof and the wall can be calculated. The background can also determine the length of the roof edge based on the length of the reference wall. For example, the length of wall A in the target wall group is 3m, the length of wall B is 4m, and the reference wall is wall B. The length of the roof edge can be set to 4m. If the reference wall is wall A, as shown in Figure 5f As shown, the length of the roof edge can be set to 3m.

[0088] In the embodiment of the present disclosure, the reference wall can also be determined based on the overlapping area of ​​the walls in the target wall group, and the overlapping area between the walls in the target wall group can be segmented to obtain the reference wall. Figure 5g As shown in the figure, the length of wall A in the target wall group is 3m, the length of wall B is 4m, and the length of the overlapping area between the two is 2m. Wall A can be segmented to obtain the overlapping area with wall B. The segmented part of wall A can be used as the reference wall, and the length of the reference wall is 2m. When generating a gable roof, the length of the roof edge can be determined based on the length of the segmented reference wall. For example, if the segmented reference wall length is 2m, the length of the roof edge can be set to 2m. If you want to generate a single slope roof, such as Figure 5h As shown, the length of the divided reference wall is 2m, and the length of the roof edge can be set to 2m.

[0089] In the disclosed embodiment, if the backend cannot parse the roof type from the roof generation command, or if the user has not set the roof type, the roof generation parameters can be calculated based on the default roof type. If the default roof type is a gable roof, the first roof generation parameter or the second roof generation parameter can be calculated. If the default roof type is a single-slope roof, the third roof generation parameter or the fourth roof generation parameter can be calculated.

[0090] In the embodiment of the present disclosure, if the roof type cannot be parsed from the roof generation command in the background, or the user has not set the roof type, if the walls in the target wall group have the same height or a small difference in height, the roof type to be generated can be assumed to be a gable roof, and the first roof generation parameter or the second roof generation parameter can be calculated. If the walls in the target wall group have different heights or a large difference in height, the roof type to be generated can be assumed to be a single-slope roof, and the third roof generation parameter or the fourth roof generation parameter can be calculated.

[0091] According to the embodiment of the present disclosure, the roof generation parameters of the roof to be generated can be calculated based on the roof type and wall parameters obtained through analysis, and the calculation of the roof generation parameters is automatically performed by the background, which simplifies the setting process of the roof generation parameters, improves the efficiency of calculating the roof generation parameters, and thus improves the roof generation efficiency.

[0092] Figure 6 This is a flow chart of a method for generating a roof based on wall selection according to another embodiment of the present disclosure. The method may include one or more features of the above-mentioned method for generating a roof based on wall selection. In one embodiment, the method may also include:

[0093] S601: In response to a click instruction on a roof length adjustment control of a preview effect of the target roof, extend or shorten the roof edge along a slope direction.

[0094] In the disclosed embodiment, the roof length adjustment control may include a button, an icon, a prompt box, etc., and may be set at any position in the preview effect, for example, at two positions where the roof and the wall are connected in the preview effect. The roof length adjustment control may include a roof extension sub-control and / or a roof shortening sub-control. The roof extension sub-control may support the operation of extending the roof along the direction of the angle between the roof and the wall, and the roof shortening sub-control may support the operation of shortening the roof along the direction of the angle between the roof and the wall. When using the roof length adjustment control, the angle between the roof and the wall may not be changed, and the length of the roof side may not be changed.

[0095] In one embodiment, Figure 6 As shown, the method may further include:

[0096] S602. In response to a click instruction of the active ridge line moving control for the preview effect of the target roof, the ridge line is moved according to the indicated direction of the ridge line moving control, and the roof generation parameters are adjusted at the same time to regenerate the preview effect of the target roof.

[0097] In the disclosed embodiment, the ridge line movement control may include a button, an icon, a prompt box, etc., and may be set at any position in the preview effect, for example, on the ridge line of the generated gable roof. The ridge line movement control may include at least one of an active ridge line move-down sub-control, a ridge line move-down sub-control, a ridge line move-left sub-control, and a ridge line move-right sub-control. The ridge line move-up sub-control may support adjusting the ridge line upward from its current position; the ridge line move-down sub-control may support adjusting the ridge line downward from its current position; the ridge line move-left sub-control may support adjusting the ridge line to the left from its current position; and the ridge line move-right sub-control may support adjusting the ridge line to the right from its current position. When using the ridge line movement control, the length of the roof edge does not change, but the angle between the roof and the wall is adjusted in real time based on the distance between the plane parallel to the wall where the ridge line is located and each wall, and the height difference between the ridge line and each wall.

[0098] In one embodiment, Figure 6 As shown, the method may further include:

[0099] S603: In response to the command to delete the target wall group, the target wall group is deleted, and the preview effect of the target roof is retained.

[0100] In the embodiment of the present disclosure, the generated preview effect (e.g., preview image) may include a preview effect of the target wall group and a preview effect of the target roof selected by the user. If the preview effect of the target wall group is deleted, the preview effect of the target roof may be retained.

[0101] In one embodiment, Figure 6 As shown, the method may further include:

[0102] S604: In response to a command to move the target wall group, move the target wall group and the preview effect of the target roof together.

[0103] In the embodiment of the present disclosure, in the generated preview effect, if the position of the preview effect relative to the target wall group needs to be adjusted, the preview effect of the target roof will move synchronously with the preview effect of the target wall group.

[0104] In the disclosed embodiment, the generated preview effect of the target roof can be bound to the preview effect of the wall. If the preview effect of the wall bound to the preview effect of the target roof moves, the preview effect of the target roof can move synchronously with the preview effect of the wall. The generated preview effect of the target roof can also be unbound to the preview effect of the wall. If the preview effect of the wall not bound to the preview effect of the target roof moves, the preview effect of the target roof can remain unchanged.

[0105] According to the embodiment of the present disclosure, flexible adjustments can be made based on the preview effect of the target roof, which can make the generated roof more diverse. In addition, the adjustments to the roof are displayed in the form of a preview effect, which simplifies the logic of adjusting the roof parameters, facilitates user use, and improves the efficiency of roof generation.

[0106] In one embodiment, the method further comprises:

[0107] When preview effects of multiple target roofs are generated, the roof edges and / or ridge lines of the preview effects of the multiple target roofs are adjusted so that the roof edges and / or the ridge lines are adsorbed to each other to obtain a preview effect of a complex roof.

[0108] In the disclosed embodiment, the user can select multiple target wall groups. The backend will generate different roof preview effects based on the different target wall groups and display them together. The frontend can adjust the roof preview effect using the roof length adjustment control and / or the ridge line movement control. If the adjusted roof preview effects need to be spliced ​​together, or if the distance is close enough, the ridge lines and / or roof edges of the different roof preview effects can be made to adsorb to each other to generate a preview effect of a complex roof.

[0109] According to the embodiments of the present disclosure, a complex roof can be quickly generated, the workload of editing roof parameters is reduced, the roof design process is simplified, and the efficiency of complex roof generation is improved.

[0110] In one embodiment, the method further comprises:

[0111] In response to a confirmation command from the front end, a roof corresponding to the roof type is generated on the selected wall according to the preview effect of the roof.

[0112] In the disclosed embodiment, after the adjustment of the roof preview effect is completed, the user can confirm it. After confirming the roof preview effect corresponding to the roof to be generated, the roof model is generated on the corresponding wall model at the front end based on the various parameters of the current roof preview effect.

[0113] According to the embodiments of the present disclosure, the efficiency of generating a roof model can be improved, and the roof model is generated according to the roof preview effect, which improves the visibility and operability of the generation process and improves the user experience.

[0114] Figure 7 FIG. 1 is a flow chart of a roof generation method according to an embodiment of the present disclosure, which specifically includes:

[0115] S701: The user selects the wall for which a roof needs to be generated on the front end and determines the type of roof to be generated;

[0116] S702, generating a roof generation command according to the selected wall and roof types;

[0117] S703: The background analyzes the roof generation command to obtain the wall parameters of the target wall group and the roof type selected by the user;

[0118] S704: Determine the type of roof. If the roof is a single-slope roof, execute S705; if the roof is a gable roof, execute S706.

[0119] S705, calculating and obtaining single slope roof generation parameters based on wall parameters;

[0120] S706, calculating and obtaining gable roof generation parameters based on wall parameters;

[0121] S707: Generate a roof preview effect based on the single-slope roof generation parameters or the gable roof generation parameters;

[0122] S708: Adjust the roof surface length and / or ridge line position of the roof preview effect to obtain a desired roof preview effect;

[0123] S709: Generate a virtual three-dimensional model of the roof according to the desired roof preview effect.

[0124] The embodiment of the present disclosure provides a method for drawing gable roofs and single-slope roofs, which can realize the simple drawing of gable roofs, single-slope roofs, and irregular roofs (especially irregular roofs formed by the combination of gable roofs and single-slope roofs), reducing the operational difficulty of roof generation and improving the efficiency of roof generation.

[0125] The disclosed embodiment can provide a simple method for generating several types of roofs, such as gable roof, single slope roof, custom slope roof, flat roof, flat-sloped roof, etc. Users can draw a closed area, select the closed area and assign a certain roof type to the area.

[0126] In the disclosed embodiment, after the user selects a gable roof type and generates a preview of the gable roof, the user can modify the position of the ridge line, the angle (slope) between the two roof planes and the wall, and adjust the roof length. After the user selects a single-slope roof type and generates a preview of the single-slope roof, the user can select a specific roof plane as a single-slope roof and modify the length of the single-slope roof plane.

[0127] Users can also choose to customize the roof. Customized roofs support modifying the slope and length of each roof surface. By modifying the slope, it can be changed to a gable roof or a single-slope roof.

[0128] Irregular roofs usually require drawing and combining two or more single-slope roofs or gable roofs.

[0129] In the embodiment of the present disclosure, the gable roof generation method based on wall selection may include the following functions:

[0130] 1. By selecting parallel walls to generate gable roofs, you can quickly design multiple gable roofs when designing complex roofs.

[0131] 2. Supports ridge line position adjustment. By dragging the ridge line, you can move it up, down, left, and right, making it easier to generate a roof with an off-center gable roof, and to align the ridge lines of multiple gable roofs.

[0132] 3. The roof side length can be dragged, and the roof side can be stretched along the original slope of the roof to achieve the generation of a gable roof with a centered ridge line and unequal side lengths.

[0133] In the embodiments of the present disclosure, the roof generation method of wall selection can achieve the following functions:

[0134] 1. Such as Figure 8a As shown, the roof generation page on the front end may include a design area, a header toolbar, a sidebar, and operation buttons. A virtual 3D model can be displayed in the design area, and users can select different elements, such as walls, within the displayed virtual 3D model. The header toolbar includes buttons such as Open File, Save, Back, and Forward. The sidebar may include areas for selecting a roof type and setting a roof style. Operation buttons may include "Cancel Generation" and "Generate Roof." On the roof generation page on the front end, select parallel walls, select a gable roof, and set the roof style. Click Generate Roof to automatically fill in the roof area and generate a gable roof. When the parallel walls are of different lengths, a trapezoidal gable roof can be formed, or a rectangular gable roof or a parallelogram gable roof can be generated with the length of the longer or shorter wall as the roof side length. By dragging the wall length, a new gable roof can be generated.

[0135] 2. Depending on the height of the selected parallel walls, you can choose to generate a gable roof or a single-slope roof. When generating a single-slope roof, the roof slope is automatically calculated based on the height difference between the walls.

[0136] 3. Such as Figure 8b As shown in the figure, dragging the ridge line position (up, down, left, or right) will recalculate the roof slope. If the ridge line cannot generate a legal roof after dragging, the function will be rolled back. If a legal roof can be generated, the function will recalculate the roof generation parameters based on the roof edge slope and regenerate a new gable roof.

[0137] 4. Such as Figure 8c As shown, when the roof surface is stretched, the roof can be regenerated based on the original roof side slope.

[0138] 5. It can support retaining the roof after deleting the wall, and the drawing trajectory and other parameters can be modified in the roof sketch environment.

[0139] In the embodiment of the present disclosure, when selecting a wall, the legality of the wall can be determined by judging whether the walls are parallel and / or whether there is an overlapping area between the parallel walls. A wall without an overlapping area is an illegal wall and roof generation may not be performed. An example of a legal wall is as follows: Figure 9 shown.

[0140] In the embodiment of the present disclosure, if the walls selected by the user are parallel and of the same length, a roof can be generated; when the user selects walls that are parallel to each other and of different lengths, but there are overlapping parallel areas between the walls, a roof can also be generated.

[0141] In the embodiment of the present disclosure, Figure 10 As shown, when generating a roof, the walls can be automatically divided to ensure that the roof is generated on parallel walls of the same length.

[0142] In the embodiment of the present disclosure, if two walls are not parallel or there is no overlap between parallel walls, they can be determined as illegal walls. An example of an illegal wall is Figure 11 As shown, although the two walls are parallel, there is no overlapping area between them.

[0143] In the embodiment of the present disclosure, Figure 12 As shown, after selecting legal parallel walls, taking the gable roof type as an example, the ridge line of the generated roof is centered by default, and the slope is 30° by default. A method of generating roof generation parameters based on wall parameters (attributes) can achieve the following functions:

[0144] 1. The ridge line height can be automatically determined based on the roof slope.

[0145] 2. The roof slope can be automatically calculated when the ridge line height is adjusted.

[0146] 3. Automatically calculate the roof slope when the ridge line moves horizontally. (Constrain the range of horizontal movement of the ridge line to ensure the slope is less than 90° for legal use.)

[0147] In the embodiment of the present disclosure, Figure 13 As shown in the figure, after selecting legal parallel walls, the roof type is a single-slope roof. The single-slope roof provides default height and slope parameters. The user selects the slope direction and generates the single-slope roof based on the default parameters. The slope or height can be modified after generation. If the walls have the same height, a flat roof can be generated.

[0148] In the embodiment of the present disclosure, Figure 14As shown, when the wall heights are different, the slopes of the two sides of the gable roof will also be different. This can be achieved by specifying a default ridgeline height and then generating the roof based on the default ridgeline height and the wall heights. After generating a preview of the roof, the user can modify the ridgeline height or the slopes of the individual roof sides to achieve the desired effect. The roof slopes can be recalculated when the ridgeline moves up or down or left or right. If the roof slopes are different on both sides, a maximum slope of less than 90° is considered legal and can be generated.

[0149] In the embodiment of the present disclosure, the automatically generated roof and the wall have a linkage logic, that is, when the wall is moved, the roof will follow the wall and rebuild. Figure 15 As shown in the figure below, if one side of the roof is not attached to a wall, the roof will not move when the unattached wall is dragged. As shown in the figure below, if you move Wall 1, the roof will not move with it; if you move Wall 2, the roof will move with the wall.

[0150] In the embodiment of the present disclosure, Figure 16 As shown in the figure, when you hover the mouse over the roof edge extension control, the control is activated. Click the roof edge extension control to extend the roof edge along the slope direction of the roof edge.

[0151] In the embodiment of the present disclosure, Figure 17 As shown, when you hover your mouse over the ridge line control, it becomes highlighted and activated, allowing you to drag the ridge line. The ridge line can be moved up and down, left and right. After adjusting the ridge line, you need to recalculate the roof slope and determine if it is legal. When determining whether the roof slope is legal, a range of 0 < Slope < 90 degrees is acceptable.

[0152] In the disclosed embodiments, irregular house types usually need to be assembled by assembling multiple roofs, such as single-slope roof + gable roof, single-slope roof + single-slope roof, gable roof + gable roof + single-slope roof, etc. The roof ridge lines can be aligned by adjusting the length of the slope roof, moving the ridge line, etc., so as to achieve the effect of consistent roof height and slope.

[0153] Figure 18 1 is a schematic diagram of a device for generating a roof based on wall selection according to an embodiment of the present disclosure. In one embodiment, the device may include:

[0154] A parsing module 1801 is configured to respond to a roof generation command from a front-end and parse the roof generation command to obtain at least one of a target wall group and a roof type; wherein the target wall group includes a plurality of parallel walls selected by the front-end;

[0155] A calculation module 1802 is configured to determine roof generation parameters based on the target wall group and roof type;

[0156] The generating module 1803 is configured to generate a preview effect of a target roof corresponding to the roof type for the target wall group according to the roof generating parameters.

[0157] In one embodiment, the roof generation command is generated by the front end according to the selection of wall and roof types when the multiple parallel walls are selected; the roof generation command includes the selected wall information and the selected roof type information.

[0158] Figure 19 is a schematic diagram of the structure of an apparatus for generating a roof based on wall selection according to another embodiment of the present disclosure. The apparatus may include one or more features of the apparatus for generating a roof based on wall selection described above. In one embodiment, the parsing module 1801 includes:

[0159] Receiving submodule 1901, configured to receive the roof generation command sent by the front end;

[0160] The wall determination submodule 1902 is configured to parse the roof generation command to obtain the target wall group selected at the front end;

[0161] The roof determination submodule 1903 is configured to parse the roof generation command to obtain the selected roof type; wherein the roof type includes a single slope roof or a gable roof.

[0162] In one embodiment, the roof type includes a gable roof; the calculation module 1802 may also be used for one of the following:

[0163] When the walls in the target wall group have equal lengths, determining first roof generation parameters based on the height differences of the walls in the target wall group; wherein the first roof generation parameters include the position of the ridge line, the angle between the roof and the wall, and the length of the roof side, and the length of the roof side is determined based on the lengths of the walls in the target wall group;

[0164] When the lengths of the walls in the target wall group are not equal, the second roof generation parameters are determined based on the height difference of the walls in the target wall group and the reference wall in the target wall group; wherein the second roof generation parameters include the ridge line position, the angle between the roof and the wall, and the length of the roof edge, and the length of the roof edge is determined based on the length of the reference wall in the target wall group.

[0165] In one embodiment, the roof type includes a single-slope roof; the calculation module 1802 may also be used for one of the following:

[0166] When the walls in the target wall group have equal lengths, determining a third roof generation parameter based on the height difference of the walls in the target wall group; wherein the third roof generation parameter includes an angle between the roof and the wall and a length of a roof side, and the length of the roof side is determined based on the length of the walls in the target wall group;

[0167] When the lengths of the walls in the target wall group are not equal, the fourth roof generation parameter is determined based on the height difference of the walls in the target wall group and the reference wall in the target wall group; wherein the fourth roof generation parameter includes the angle between the roof and the wall and the length of the roof edge, and the length of the roof edge is determined based on the length of the reference wall in the target wall group.

[0168] In one embodiment, Figure 19 As shown, the device may further include at least one of the following:

[0169] An extension module 1904 is configured to extend or shorten the roof edge along the slope direction in response to a click instruction of a roof length adjustment control of the preview effect of the target roof;

[0170] A roof movement module 1905 is configured to respond to a click instruction of the active ridge line movement control of the preview effect of the target roof, move the ridge line according to the direction indicated by the ridge line movement control, and simultaneously adjust the roof generation parameters to regenerate the preview effect of the target roof;

[0171] A deletion module 1906 is configured to delete the target wall group in response to a command to delete the target wall group, and retain the preview effect of the target roof;

[0172] The wall moving module 1907 is configured to move the target wall group and the preview effect of the target roof together in response to a command to move the target wall group.

[0173] In one embodiment, Figure 19 As shown, the device may also include:

[0174] Adsorption module 1908 is used to adjust the roof edges and / or ridge lines of the preview effects of multiple target roofs when preview effects of the multiple target roofs are generated, so that the roof edges and / or ridge lines are adsorbed to each other to obtain a preview effect of a complex roof.

[0175] In one embodiment, Figure 19 As shown, the device may also include:

[0176] The confirmation module 1909 is configured to generate a virtual model of the target roof corresponding to the roof type on the selected wall according to the preview effect of the target roof in response to the confirmation command of the front end.

[0177] For the description of specific functions and examples of each module and submodule of the device in the embodiment of the present disclosure, please refer to the relevant description of the corresponding steps in the above method embodiment, which will not be repeated here.

[0178] In the technical solutions disclosed herein, the acquisition, storage, and application of user personal information involved comply with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0179] Figure 20 FIG. 1 is a structural block diagram of an electronic device according to an embodiment of the present disclosure. Figure 20 As shown, the electronic device includes: a memory 2010 and a processor 2020. The memory 2010 stores a computer program that can be executed on the processor 2020. The number of memory 2010 and processor 2020 can be one or more. The memory 2010 can store one or more computer programs. When the one or more computer programs are executed by the electronic device, the electronic device performs the method provided by the above method embodiment. The electronic device may also include: a communication interface 2030 for communicating with external devices and performing data exchange.

[0180] If the memory 2010, the processor 2020, and the communication interface 2030 are implemented independently, the memory 2010, the processor 2020, and the communication interface 2030 can be connected to each other via a bus and communicate with each other. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 20 Only one thick line is used in the diagram, but this does not mean that there is only one bus or one type of bus.

[0181] Optionally, in a specific implementation, if the memory 2010, the processor 2020 and the communication interface 2030 are integrated on a chip, the memory 2010, the processor 2020 and the communication interface 2030 can communicate with each other through an internal interface.

[0182] It should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc. It is worth noting that the processor may be a processor that supports the Advanced RISC Machines (ARM) architecture.

[0183] Furthermore, optionally, the above-mentioned memory may include a read-only memory and a random access memory, and may also include a non-volatile random access memory. The memory may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may include a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may include a random access memory (RAM), which is used as an external cache. By way of example but not limitation, many forms of RAM are available. For example, static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM) and direct memory bus random access memory (DR RAM).

[0184] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer instructions are loaded and executed on a computer, the process or function described in the embodiment of the present disclosure is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center via a wired (e.g., coaxial cable, optical fiber, data subscriber line (DSL)) or wireless (e.g., infrared, Bluetooth, microwave, etc.) method. The computer-readable storage medium can be any available medium that a computer can access, or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, or a magnetic tape), an optical medium (e.g., a digital versatile disc (DVD)), or a semiconductor medium (e.g., a solid-state drive (SSD)). It is worth noting that the computer-readable storage medium mentioned in the present disclosure may be a non-volatile storage medium, in other words, a non-transient storage medium.

[0185] Those skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware, or by a program to instruct the relevant hardware, and the program may be stored in a computer-readable storage medium, which may be a read-only memory, a disk, or an optical disk, etc.

[0186] In the description of the embodiments of the present disclosure, the reference terms "one embodiment," "some embodiments," "example," "specific example," or "some examples" mean that the specific features, structures, materials, or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present disclosure. Moreover, the specific features, structures, materials, or characteristics described may be combined in any appropriate manner in any one or more embodiments or examples. In addition, those skilled in the art may combine and combine different embodiments or examples described in this specification, as well as features of different embodiments or examples, unless they are mutually inconsistent.

[0187] In the description of the embodiments of the present disclosure, unless otherwise specified, " / " means or. For example, A / B can mean A or B. "And / or" in this document is only a description of the association relationship between related objects, indicating that three relationships can exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone.

[0188] In the description of the embodiments of the present disclosure, the terms "first" and "second" are used for descriptive purposes only and should not be understood to indicate or imply relative importance or implicitly specify the number of the technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of the embodiments of the present disclosure, unless otherwise specified, "plurality" means two or more.

[0189] The above description is merely an exemplary embodiment of the present disclosure and is not intended to limit the present disclosure. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present disclosure shall be included in the scope of protection of the present disclosure.

Claims

1. A method for generating a roof based on wall selection, comprising: In response to a roof generation command from a front end, parsing the roof generation command to obtain at least one of a target wall group and a roof type; wherein the target wall group includes a plurality of parallel walls selected by the front end; determining roof generation parameters according to the target wall group and roof type; A preview effect of a target roof corresponding to the roof type is generated for the target wall group according to the roof generation parameters.

2. The method according to claim 1, wherein The roof generation command is generated by the front end according to the selection of the wall and roof types when the multiple parallel walls are selected; the roof generation command includes the selected wall information and the selected roof type information.

3. The method according to claim 1 or 2, wherein: The roof type includes a gable roof; and determining a roof generation parameter according to the target wall group and the roof type includes one of the following: When the walls in the target wall group have equal lengths, determining first roof generation parameters based on the height differences of the walls in the target wall group; wherein the first roof generation parameters include the position of the ridge line, the angle between the roof and the wall, and the length of the roof side, and the length of the roof side is determined based on the lengths of the walls in the target wall group; When the lengths of the walls in the target wall group are not equal, the second roof generation parameters are determined based on the height difference of the walls in the target wall group and the reference wall in the target wall group; wherein the second roof generation parameters include the ridge line position, the angle between the roof and the wall, and the length of the roof edge, and the length of the roof edge is determined based on the length of the reference wall in the target wall group.

4. The method according to claim 1 or 2, wherein The roof type includes a single-slope roof; and determining a roof generation parameter according to the target wall group and the roof type includes one of the following: When the walls in the target wall group have equal lengths, determining a third roof generation parameter based on the height difference of the walls in the target wall group; wherein the third roof generation parameter includes an angle between the roof and the wall and a length of a roof side, and the length of the roof side is determined based on the length of the walls in the target wall group; When the lengths of the walls in the target wall group are not equal, the fourth roof generation parameter is determined based on the height difference of the walls in the target wall group and the reference wall in the target wall group; wherein the fourth roof generation parameter includes the angle between the roof and the wall and the length of the roof edge, and the length of the roof edge is determined based on the length of the reference wall in the target wall group.

5. The method according to any one of claims 1 to 4, further comprising at least one of the following: In response to a click instruction of a roof length adjustment control of the preview effect of the target roof, extending or shortening the roof edge along the slope direction; In response to a click instruction of the active ridge line moving control for the preview effect of the target roof, the ridge line is moved according to the indicated direction of the ridge line moving control, and the roof generation parameters are adjusted simultaneously to regenerate the preview effect of the target roof; In response to a command to delete the target wall group, the target wall group is deleted, and a preview effect of the target roof is retained; In response to a command to move the target wall group, the target wall group and the preview effect of the target roof are moved together.

6. The method according to any one of claims 1 to 5, further comprising: When preview effects of multiple target roofs are generated, the roof edges and / or ridge lines of the preview effects of the multiple target roofs are adjusted so that the roof edges and / or the ridge lines are adsorbed to each other to obtain a preview effect of a complex roof.

7. The method according to any one of claims 1 to 6, further comprising: In response to a confirmation command from the front end, a virtual model of the target roof corresponding to the roof type is generated on the selected wall according to the preview effect of the target roof.

8. A device for generating a roof based on wall selection, comprising: a parsing module, configured to respond to a roof generation command from a front end and parse the roof generation command to obtain at least one of a target wall group and a roof type; wherein the target wall group includes a plurality of parallel walls selected by the front end; a determination module, configured to determine roof generation parameters according to the target wall group and roof type; A generating module is used to generate a preview effect of a target roof corresponding to the roof type for the target wall group according to the roof generation parameters.

9. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 7.

10. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 7.

11. A computer program product comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 7.