Roof model generation method, apparatus, and electronic device
Patent Information
- Application Number
- CN202310608334.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-24
- Publication Date
- 2026-09-04
- Estimated Expiration
- 2043-05-24
AI Technical Summary
[0002]相关技术中的自动化房屋制作方式,通常使用简单的立方盒子模型,在模型的立面放置房屋模型的窗户、墙面、门等模块,房屋模型的屋顶采用一个斜面或者平面代替,该制作方式简单,但是得到的房屋模型的屋顶造型效果单一;为了丰富屋顶效果,还可以由美术人员根据项目需求直接将房屋模型制作出来,但是该方式需要配合项目需求,普适性较差,而且该方式制作出来的房屋模型中的屋顶模型是一整块的,不利于后续对屋顶模型进行造型改造
[0009]This invention provides a method, apparatus, and electronic device for generating roof models. First, an initial house model is obtained, and its roof plane is determined. Then, the edge lines in the roof plane are moved towards the center of the roof plane, and roof edge lines are obtained based on the moved edge lines. Based on the roof edge lines and the roof plane, a roof elevation model is generated. This roof elevation model includes a bottom structure determined by the roof plane and a top structure determined by the roof vertices obtained from the roof edge lines. Next, based on the roof vertices, the placement position of a prefabricated roof model is determined within the bottom structure. Then, based on the distance between the roof vertices and the bottom structure, and the model parameters of the prefabricated roof model, the scaling ratio of the prefabricated roof model is determined. Finally, based on the placement position and scaling ratio, the prefabricated roof model is placed at the placement position of the bottom structure, resulting in a roof model composed of the prefabricated roof model and the roof elevation model. This method can automatically generate a roof elevation model from an initial house model, and then place the prefabricated roof model on the roof elevation model to generate the final roof model. This method improves the generation speed of roof models, and users can quickly modify the final roof model by adjusting the shape of the prefabricated roof model, increasing the freedom of roof model modification.
Smart Images

Figure CN116822004B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of model making technology, and in particular to a method, apparatus and electronic device for generating roof models. Background Technology
[0002] Automated house construction methods in related technologies typically use simple cubic box models. Windows, walls, doors, and other modules are placed on the model's facade, and the roof is replaced by a sloping or flat surface. This method is simple, but the resulting roof design is monotonous. To enrich the roof effect, artists can also directly create the house model according to project requirements. However, this method requires specific project requirements and has poor versatility. Furthermore, the roof model created using this method is a single piece, which is not conducive to subsequent modifications to the roof design. Summary of the Invention
[0003] The purpose of this invention is to provide a method, apparatus, and electronic device for generating roof models, so as to quickly generate roof models and arbitrarily modify the shape of the roof models.
[0004] In a first aspect, the present invention provides a method for generating a roof model, the method comprising: obtaining an initial house model and determining the roof plane of the initial house model; moving the edge lines in the roof plane toward the center of the roof plane, and obtaining roof edge lines based on the moved edge lines; generating a roof elevation model based on the roof edge lines and the roof plane; wherein the roof elevation model includes a bottom structure determined by the roof plane and a top structure determined by the roof vertices obtained from the roof edge lines; determining the placement position of a prefabricated roof model in the bottom structure based on the roof vertices; determining the scaling ratio of the prefabricated roof model based on the distance between the roof vertices and the bottom structure, and the model parameters of the prefabricated roof model; and placing the prefabricated roof model at the placement position of the bottom structure based on the placement position and the scaling ratio, thereby obtaining a roof model composed of the prefabricated roof model and the roof elevation model.
[0005] Secondly, the present invention provides a roof model generation device, comprising: a plane determination module for acquiring an initial house model and determining the roof plane of the initial house model; a roof edge determination module for moving the edge lines in the roof plane towards the center of the roof plane and obtaining the roof edge lines based on the moved edge lines; a facade model generation module for generating a roof facade model based on the roof edge lines and the roof plane; wherein the roof facade model includes a bottom structure determined by the roof plane and a top structure determined by the roof vertices obtained from the roof edge lines; a placement position determination module for determining the placement position of the prefabricated roof model in the bottom structure based on the roof vertices; a scaling ratio determination module for determining the scaling ratio of the prefabricated roof model based on the distance between the roof vertices and the bottom structure, and the model parameters of the prefabricated roof model; and a roof model generation module for placing the prefabricated roof model at the placement position of the bottom structure based on the placement position and the scaling ratio, thereby obtaining a roof model composed of the prefabricated roof model and the roof facade model.
[0006] Thirdly, the present invention provides an electronic device including a processor and a memory, the memory storing machine-executable instructions that can be executed by the processor, the processor executing the machine-executable instructions to implement the above-described roof model generation method.
[0007] Fourthly, the present invention provides a computer-readable storage medium storing computer-executable instructions that, when invoked and executed by a processor, cause the processor to implement the above-described roof model generation method.
[0008] The embodiments of the present invention bring the following beneficial effects:
[0009] This invention provides a method, apparatus, and electronic device for generating roof models. First, an initial house model is obtained, and its roof plane is determined. Then, the edge lines in the roof plane are moved towards the center of the roof plane, and roof edge lines are obtained based on the moved edge lines. Based on the roof edge lines and the roof plane, a roof elevation model is generated. This roof elevation model includes a bottom structure determined by the roof plane and a top structure determined by the roof vertices obtained from the roof edge lines. Next, based on the roof vertices, the placement position of a prefabricated roof model is determined within the bottom structure. Then, based on the distance between the roof vertices and the bottom structure, and the model parameters of the prefabricated roof model, the scaling ratio of the prefabricated roof model is determined. Finally, based on the placement position and scaling ratio, the prefabricated roof model is placed at the placement position of the bottom structure, resulting in a roof model composed of the prefabricated roof model and the roof elevation model. This method can automatically generate a roof elevation model from an initial house model, and then place the prefabricated roof model on the roof elevation model to generate the final roof model. This method improves the generation speed of roof models, and users can quickly modify the final roof model by adjusting the shape of the prefabricated roof model, increasing the freedom of roof model modification.
[0010] Other features and advantages of the invention will be set forth in the following description, or some features and advantages may be inferred from the description or determined without doubt, or may be learned by practicing the techniques described above.
[0011] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0012] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0013] Figure 1 A flowchart illustrating a method for generating a roof model according to an embodiment of the present invention;
[0014] Figure 2 A flowchart illustrating another method for generating a roof model provided in an embodiment of the present invention;
[0015] Figure 3 A schematic diagram of an initial house model provided for an embodiment of the present invention;
[0016] Figure 4 A schematic diagram of a roof edge line provided in an embodiment of the present invention;
[0017] Figure 5 A flowchart illustrating another method for generating a roof model provided in an embodiment of the present invention;
[0018] Figure 6 A schematic diagram of an initial roof facade model with a pointed roof structure provided in an embodiment of the present invention;
[0019] Figure 7 This is a schematic diagram illustrating the determination of a roof vertex on a bounding box, as provided in an embodiment of the present invention.
[0020] Figure 8 A schematic diagram of a roof facade model provided in an embodiment of the present invention;
[0021] Figure 9 A schematic diagram of the facade in a roof facade model provided in an embodiment of the present invention;
[0022] Figure 10 This is a schematic diagram of the generated roof facade model provided in an embodiment of the present invention;
[0023] Figure 11 A schematic diagram of a roof model consisting of a prefabricated roof model and a roof facade model, provided for an embodiment of the present invention;
[0024] Figure 12 This is a schematic diagram of the structure of a roof model generation device provided in an embodiment of the present invention;
[0025] Figure 13 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0026] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.
[0027] Therefore, the following detailed description of the embodiments of the invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the invention without inventive effort are within the scope of protection of the invention.
[0028] Automated house generation is a worthy research topic within automated generation pipelines. Compared to walls, house roofs have more complex geometries. Fully automated roof generation algorithms are often complex and have limited applicability, while standard roof model placement algorithms are too simple to handle sloping roofs. How to combine detailed roof models created by artists with a more complex automated roof generation process is a current research focus.
[0029] Most automated house creation processes in related technologies are customized to specific project requirements, resulting in poor universality. The answer can be divided into two approaches. One approach prioritizes speed, resulting in a cubic box-shaped building with little regard for aesthetics. Windows, walls, and doors are placed inside, and the roof is represented by a sloping or flat surface. This method is simple, but the resulting roof design is monotonous. The other approach involves artists directly creating the house model based on project requirements. This method allows for richer effects but requires complex algorithms, has low generation efficiency, and typically produces a single roof model, hindering subsequent optimization.
[0030] To address the aforementioned issues, this invention provides a method, apparatus, and electronic device for generating roof models. This technology can be applied to virtual building creation scenarios, particularly to the automatic generation of roofs for virtual houses.
[0031] To facilitate understanding of the embodiments of the present invention, a method for generating a roof model disclosed in the embodiments of the present invention will first be described in detail, such as... Figure 1 As shown, the method includes the following specific steps:
[0032] Step S102: Obtain the initial house model and determine the roof plan of the initial house model.
[0033] The initial house model described above is typically a white box created by artists. An initial house model can consist of at least one white box, each of which usually refers to a simplified model used in the construction of the house. This white box can be represented by a cube structure. The top surface of each white box is the roof plane of the initial house model, which is usually a horizontal plane.
[0034] Step S104: Move the edge line in the roof plane toward the center of the roof plane, and obtain the roof edge line based on the moved edge line.
[0035] The edge lines of the aforementioned roof plane typically refer to the outline formed around the roof plane. For example, when the roof plane is rectangular, the edge lines refer to the four sides of the rectangle; if the roof plane is circular, the edge lines refer to the outline of the circle. The edge lines in the roof plane are moved towards the center of the roof plane. When the moved edge lines coincide, the movement stops, and the roof edge lines are obtained based on the moved edge lines. Specifically, the specific structural type of the roof model can also be determined based on the roof edge lines. This structural type includes pointed roof structures and flat roof structures. When the roof model is a pointed roof structure, the following steps are performed; when the roof model is a flat roof structure, the roof plane is determined as the final roof model.
[0036] Step S106: Generate a roof elevation model based on the roof edge line and the roof plane; wherein the roof elevation model includes the bottom structure determined by the roof plane and the top structure determined by the roof vertices obtained from the roof edge line.
[0037] In practical implementation, when the roof model is a pointed structure, the top surface structure is a pointed shape, and the bottom surface structure is the roof plane. The roof vertices in the top surface structure can be determined based on the two endpoints of the roof edge line. The initial roof elevation model can be obtained by connecting the roof vertices with the vertices of the roof plane. The roof elevation model is then generated based on the initial roof elevation model and its bounding box.
[0038] Step S108: Determine the placement position of the prefabricated roof model in the bottom structure based on the roof apex.
[0039] The aforementioned prefabricated roof models are typically models of roof shapes with certain aesthetic effects, pre-made by artists according to requirements. The roof facade model is merely a simple roof model; artists can decorate and modify the prefabricated roof model. Therefore, artists can place the prefabricated roof model on the roof facade model to beautify it and obtain the final roof model. In practical implementation, the edge line for placing the prefabricated roof model in the bottom structure can be determined based on the position of the roof apex in the roof facade model. A preset position on this edge line is then designated as the placement location of the prefabricated roof model. This preset position can be determined according to development requirements; for example, it could be a fixed point on the edge line or the midpoint of the edge line.
[0040] Step S110: Determine the scaling ratio of the prefabricated roof model based on the distance between the roof apex and the bottom structure, as well as the model parameters of the prefabricated roof model.
[0041] Since the size of the prefabricated roof model may not match the size of the roof facade model, the size of the prefabricated roof model needs to be adjusted in order to place it on the same position as the roof facade model. Therefore, the scaling ratio of the prefabricated roof model needs to be determined based on the ratio of the size of the prefabricated roof model to the distance between the roof apex and the bottom structure.
[0042] Step S112: Based on the placement position and scaling ratio, place the prefabricated roof model at the placement position of the bottom structure to obtain a roof model composed of the prefabricated roof model and the roof facade model.
[0043] Based on the scaling ratio, the prefabricated roof model is scaled to obtain a scaled prefabricated roof model that matches the roof facade model. The scaled prefabricated roof model is then placed on the bottom structure of the roof facade model to obtain a roof model composed of the scaled prefabricated roof model and the roof facade model.
[0044] This invention provides a method for generating a roof model. First, an initial house model is obtained, and its roof plane is determined. Then, the edge lines in the roof plane are moved towards the center of the roof plane, and the roof edge lines are obtained based on these moved edge lines. Based on the roof edge lines and the roof plane, a roof elevation model is generated. This roof elevation model includes a bottom structure determined by the roof plane and a top structure determined by the roof vertices obtained from the roof edge lines. Next, based on the roof vertices, the placement position of a prefabricated roof model is determined within the bottom structure. Then, based on the distance between the roof vertices and the bottom structure, and the model parameters of the prefabricated roof model, the scaling ratio of the prefabricated roof model is determined. Finally, based on the placement position and scaling ratio, the prefabricated roof model is placed at the placement position of the bottom structure, resulting in a roof model composed of the prefabricated roof model and the roof elevation model. This method can automatically generate a roof elevation model from an initial house model, and then place the prefabricated roof model on the roof elevation model to generate the final roof model. This method improves the generation speed of the roof model, and users can quickly modify the final roof model by adjusting the shape of the prefabricated roof model, increasing the freedom of roof model modification.
[0045] This invention also provides a method for generating a roof model. In this method, the steps of obtaining an initial house model and determining the roof plane of the initial house model may specifically include: obtaining an initial house model; the initial house model is composed of at least one cube box; for each cube box, the top surface of the current cube box is determined as the roof plane corresponding to the current cube box in the initial house model.
[0046] The roof edge line passes through the center of the roof plane.
[0047] This invention also provides a method for generating a roof model, wherein the roof plane includes four edge lines. In this method, the step of moving the edge lines in the roof plane towards the center of the roof plane and obtaining the roof edge lines based on the moved edge lines specifically includes: moving each edge line in the roof plane towards the center of the roof plane at a preset speed, stopping the movement when two moved edge lines coincide; determining the coincident line generated after the two moved edge lines coincide when the movement stops; determining two target edge lines in the roof plane other than the two edge lines corresponding to the coincident line, and the intersection point of each moved target edge line with the coincident line; and determining the line segment between two intersection points of the coincident line as the roof edge line.
[0048] This invention also provides a method for generating a roof model. In this method, before generating a roof facade model based on the roof edge line and the roof plane, the method may further include: determining that the structural type of the roof model is a pointed roof structure; wherein the structural type is determined based on the roof edge line, and the structural type includes either a pointed roof structure or a flat roof structure.
[0049] The process of determining the structural type of the roof model may include: calculating the distance from the endpoint of the roof edge line to each edge line of the roof plane, and determining the maximum value of the distance as the edge parameter; determining whether the edge parameter is greater than a preset distance threshold; if it is greater, determining the structural type of the roof model as a pointed roof structure; if it is not greater, determining the structural type of the roof model as a flat roof structure.
[0050] This invention also provides a method for generating a roof model. In this method, the step of generating a roof facade model based on the roof edge line and the roof plane may specifically include: offsetting the roof edge line upward by a preset distance to obtain the offset roof edge line; obtaining an initial roof facade model based on the line connecting the endpoint of the offset roof edge line and the vertex of the roof plane; and generating a roof facade model based on the initial roof facade model and the bounding box of the initial roof facade model.
[0051] The above-mentioned feasible method for generating a roof facade model based on an initial roof facade model and its bounding box includes: generating a bounding box for the initial roof facade model; starting from each endpoint of the offset roof edge, emitting rays in the opposite direction of the offset roof edge, and determining the intersection of each ray with the bounding box as the roof vertex; and obtaining the roof facade model based on the roof vertex and the roof plane.
[0052] The above-mentioned methods for generating the bounding box of the initial roof facade model include: extending each edge line in the roof plane vertically upward to obtain a bounding box that surrounds the roof plane and the offset roof edge lines.
[0053] In this roof model generation method, the step of determining the placement position of the prefabricated roof model in the bottom structure based on the roof vertex may specifically include: determining a first edge line from the bottom structure that is on the same target surface as the roof vertex located in the bounding box; and determining the midpoint of the first edge line as the placement position of the prefabricated roof model in the bottom structure.
[0054] In this roof model generation method, the model parameters of the prefabricated roof model include: the size of the prefabricated roof model; and the step of determining the scaling ratio of the prefabricated roof model based on the distance between the roof vertex and the bottom structure, and the model parameters of the prefabricated roof model. Specifically, this may include: calculating the distance between the midpoint of the first edge line of the same target surface as the roof vertex located in the bounding box and the roof vertex, to obtain the target distance value; and determining the scaling ratio of the prefabricated roof model based on the size of the prefabricated roof model and the target distance value.
[0055] This invention also provides another method for generating a roof model, which is implemented based on the above embodiments. This method focuses on describing the specific process of obtaining an initial house model and determining the roof plane of the initial house model (specifically implemented through steps S202-S204 below), and the specific process of moving the edge lines in the roof plane towards the center of the roof plane, and obtaining the roof edge lines based on the moved edge lines (specifically implemented through steps S206-S212 below); as... Figure 2 As shown, the steps for obtaining an initial house model and determining the roof plan of the initial house model include the following specific steps:
[0056] Step S202: Obtain an initial house model; the initial house model consists of at least one cube box.
[0057] The initial house model described above is typically a white box created by the artist. This initial house model can consist of at least one white box, which is a cube. This cube can be a cuboid, a cube, or other cube-like shape. The number and shape of the cubes included in this initial house model can be set according to the artist's needs.
[0058] Step S204: For each cube box, determine the top surface of the current cube box as the roof plane corresponding to the current cube box in the initial house model; wherein, the roof plane includes four edge lines.
[0059] In practical implementation, the roof plane corresponding to each cube can be obtained by using the coordinates of the top face of each cube. Typically, the number of cubes in the initial house model matches the number of roof planes. For example... Figure 3The diagram shown is a schematic representation of an initial house model provided in an embodiment of the present invention. This initial house model consists of two cube boxes, each with its top surface being a roof plane. Figure 3 The darker area is the roof plane.
[0060] It should be noted that the algorithm of this invention is a loop structure that finds the top face of each cube box, thereby obtaining the roof plane corresponding to each cube box, so that the top face of all cube boxes will generate a roof.
[0061] The step of moving the edge line in the roof plane towards the center of the roof plane and obtaining the roof edge line based on the moved edge line includes steps S206 to S212, including:
[0062] Step S206: Move each edge line in the roof plane towards the center of the roof plane at a preset speed, and stop moving when the two moved edge lines coincide.
[0063] In practical applications, the polyexpand node can be used to move each edge line in the roof plane towards the center of the roof plane, stopping the movement when two moved edge lines coincide. The polyexpand node is a node in Houdini software that extends lines of a plane inwards or outwards at certain intervals.
[0064] Step S208: Determine the coincident line generated after the two moved edge lines coincide when the movement stops.
[0065] In practical applications, the line formed by the overlap of two moved edge lines can be defined as the overlapping line.
[0066] Step S210: Determine two target edge lines in the roof plane other than the two edge lines corresponding to the coincident line, and the intersection point of each moved target edge line with the coincident line.
[0067] The aforementioned target edge line is the edge line that does not coincide with other edge lines in the roof plane when it stops moving during the movement of the edge line, and the target edge line intersects with the coinciding line.
[0068] Step S212: Determine the line segment between the two intersection points of the coincident lines as the roof edge line.
[0069] In practical applications, the roof edge line passes through the center of the roof plane, and the aforementioned coincident lines also pass through the center of the roof plane. For example... Figure 4The diagram illustrates a roof edge line according to an embodiment of the present invention. The four edge lines of the roof plane include: line segment 1 formed by connecting vertices 0 and 1; line segment 2 formed by connecting vertices 1 and 3; line segment 3 formed by connecting vertices 3 and 2; and line segment 4 formed by connecting vertices 0 and 2. After moving the four edge lines towards the center of the roof plane, the moved line segments 1 and 4 will coincide, forming a coincident line. The intersection of the moved line segment 1 and the coincident line is vertex 5, and the intersection of the moved line segment 3 and the coincident line is vertex 4. Therefore, the line segment between vertex 4 and vertex 5 in the coincident line is the roof edge line.
[0070] Step S214: Generate a roof elevation model based on the roof edge line and the roof plane; wherein the roof elevation model includes the bottom structure determined by the roof plane and the top structure determined by the roof vertices obtained from the roof edge line.
[0071] Step S216: Determine the placement position of the prefabricated roof model in the bottom structure based on the roof apex.
[0072] Step S218: Determine the scaling ratio of the prefabricated roof model based on the distance between the roof apex and the bottom structure, as well as the model parameters of the prefabricated roof model.
[0073] Step S220: Based on the placement position and scaling ratio, place the prefabricated roof model at the placement position of the bottom structure to obtain a roof model composed of the prefabricated roof model and the roof facade model.
[0074] The aforementioned roof model generation method generates building roofs in a modular manner while maximizing the preservation of the artistic design. Furthermore, this method automatically places prefabricated roof models onto the calculated roof structure, thereby increasing the speed of roof model generation.
[0075] This invention also provides another method for generating a roof model, which is implemented based on the above embodiments. This method focuses on describing the specific process of generating a roof facade model based on the roof edge line and roof plane (specifically implemented through steps S508-S512 below), the specific process of determining the placement position of the prefabricated roof model in the bottom structure based on the roof vertices (implemented through steps S514-S516 below), and the specific process of determining the scaling ratio of the prefabricated roof model based on the distance between the roof vertices and the bottom structure, and the model parameters of the prefabricated roof model (implemented through steps S518-S520 below); Figure 5 As shown, the method includes the following specific steps:
[0076] Step S502: Obtain the initial house model and determine the roof plan of the initial house model.
[0077] Step S504: Move the edge line in the roof plane toward the center of the roof plane, and obtain the roof edge line based on the moved edge line.
[0078] Step S506: Determine the structural type of the roof model as a pointed roof structure; wherein, the structural type is determined based on the roof edge line, and the structural type includes either a pointed roof structure or a flat roof structure.
[0079] In practical applications, the structural type of the roof model can be determined through the following steps 10-11:
[0080] Step 10: Calculate the distance from the endpoint of the roof edge line to each edge line of the roof plane, and determine the maximum value of the distance as the edge parameter.
[0081] like Figure 4 As shown, the endpoints of the roof edge are vertices 4 and 5. Calculate the distance from vertex 4 to each edge line of the roof plane, and then calculate the distance from vertex 5 to each edge line. Determine the maximum value of the distance as the edge parameter and store the edge parameter in a preset position.
[0082] Step 11: Determine whether the edge parameter is greater than the preset distance threshold; determine the roof model's structural type as a pointed roof structure; if it is not greater, determine the roof model's structural type as a flat roof structure.
[0083] The specific value of the aforementioned preset distance threshold can be determined according to research and development needs. For example, the preset distance threshold can be 0.1 or 0.5, etc.
[0084] Step S508: Offset the roof edge line upward by a preset distance to obtain the offset roof edge line.
[0085] In practical implementation, if the roof model has a pointed roof structure, the roof edge needs to be offset upwards along the roof plane, that is, offset the roof edge by a preset distance in the positive direction of the Y-axis to obtain the offset roof edge. This preset distance can be set according to user needs; for example, it can be set to 10 or 15.
[0086] Step S510: Obtain the initial roof facade model by connecting the endpoints of the offset roof edge line with the vertices of the roof plane.
[0087] like Figure 6 The image shown is a schematic diagram of an initial roof facade model with a pointed roof structure provided in an embodiment of the present invention. Figure 4 The line segments corresponding to vertices 4 and 5 (equivalent to the roof edge lines) are offset upwards by a preset distance to obtain... Figure 6The diagram shows vertices 4 and 5 above the roof plane. Vertex 4 is then connected to vertices 2 and 3, and vertex 5 is connected to vertices 0 and 1. This yields an initial roof facade model composed of the offset roof edge and the roof plane. Specifically, vertices 4 and 5 are the endpoints of the roof edge, and the plane containing vertices 0, 1, 2, and 3 is the roof plane.
[0088] Step S512: Generate the roof facade model based on the initial roof facade model and the bounding box of the initial roof facade model.
[0089] In a practical implementation, step S512 above can be achieved through the following steps 20-22:
[0090] Step 20: Generate the bounding box of the initial roof facade model.
[0091] Extend each edge line in the roof plane vertically upwards to obtain a bounding box that encloses the roof plane and the offset roof edges. In practice, a polyextrude node can be used to move each edge line in the roof plane upwards along the positive Y-axis to obtain a bounding box that can enclose the roof plane and the offset roof edges.
[0092] In practical applications, it is also necessary to generate the normal of each vertex of the bounding box as a parameter for the subsequent roof vertex offset direction.
[0093] Step 21: Starting from each endpoint of the offset roof edge, emit rays in the opposite direction of the offset roof edge, and determine the intersection of each ray with the bounding box as the roof vertex.
[0094] In the specific implementation, firstly, the two endpoints of the offset roof edge are extracted. Then, rays are emitted from these two endpoints in the opposite direction to the offset roof edge. The intersection of each ray and the bounding box is determined as the roof vertex. For example... Figure 7 The diagram shows how to determine the roof vertices on the bounding box. Figure 7 The two lines with arrows are rays emanating from their two endpoints in the opposite direction to the offset roof edge. The cube of the line group is the bounding box, and the intersection of the ray and the bounding box is the roof vertex.
[0095] Step 22: Obtain the roof facade model based on the roof apex and roof plane.
[0096] Both facades of the roof facade model are perpendicular to the ground structure, such as... Figure 8 The image shown is a schematic diagram of a roof facade model provided in an embodiment of the present invention.
[0097] Step S514: From the bottom structure, determine the first edge line of the target surface that is located on the same target surface as the roof vertex in the bounding box.
[0098] In practical applications, the facade can be separated from the roof facade model. This facade is the target face to which the roof vertex belongs in the bounding box. The edge line of the bottom structure located on this target face is determined as the first edge line.
[0099] Step S516: Determine the midpoint of the first edge line as the placement position of the prefabricated roof model in the bottom structure.
[0100] In practical implementation, the midpoint of the first edge line can be determined as the placement position of a designated point in the prefabricated roof model on the bottom structure; wherein, the designated point is used to control the prefabricated roof model to be placed on the placement position of the bottom structure in a preset posture.
[0101] Step S518: Calculate the distance between the midpoint of the first edge line of the same target face as the roof vertex and the roof vertex, and obtain the target distance value.
[0102] like Figure 8 The image shown is a schematic diagram of the facade in a roof facade model. Figure 8 The length of the dashed line segment in the diagram is the target distance value. Figure 8 The positions of the two dots in the diagram represent the midpoints of the two first edge lines, respectively.
[0103] Step S520: Determine the scaling ratio of the prefabricated roof model based on the size of the prefabricated roof model and the target distance value.
[0104] In practice, the scaling ratio of the prefabricated roof model can be determined based on the ratio of the target distance value to the size of the prefabricated roof model.
[0105] Step S522: Based on the placement position and scaling ratio, place the prefabricated roof model at the placement position of the bottom structure to obtain a roof model composed of the prefabricated roof model and the roof facade model.
[0106] In practical applications, steps S502-S520 above can be implemented in Houdini software, and this method can be packaged into an HAD file for use by the game engine. This allows the game engine to place the prefabricated roof model at the designated location and render a roof model composed of the prefabricated roof model and the roof facade model. Figure 10 The diagram shown is a schematic diagram of generating a roof facade model according to an embodiment of the present invention. Figure 11 The image shows a schematic diagram of a roof model consisting of a prefabricated roof model and a roof facade model. (Comparison) Figure 10 and Figure 11As can be seen, adding the prefabricated roof model optimized the roof model, making it more aesthetically pleasing.
[0107] The above-mentioned roof model generation method can save the number of model faces and optimize the roof generation performance by using an initial roof model and a roof facade model. Moreover, it takes about three days to make a roof manually, while this invention can shorten the manual production time to one day, saving human resources. At the same time, compared with ordinary automated roofs, this solution can adjust the roof model according to the artistic needs, which helps to improve the model effect.
[0108] Corresponding to the above method embodiments, this invention provides a roof model generation device, such as... Figure 12 As shown, the device includes:
[0109] The plan determination module 90 is used to obtain the initial house model and determine the roof plan of the initial house model.
[0110] The roof edge line determination module 91 is used to move the edge line in the roof plane toward the center of the roof plane, and obtain the roof edge line based on the moved edge line.
[0111] The facade model generation module 92 is used to generate a roof facade model based on the roof edge line and the roof plane; wherein, the roof facade model includes the bottom structure determined by the roof plane and the top structure determined by the roof vertices obtained from the roof edge line.
[0112] The placement determination module 93 is used to determine the placement position of the prefabricated roof model in the bottom structure based on the roof apex.
[0113] The scaling ratio determination module 94 is used to determine the scaling ratio of the prefabricated roof model based on the distance between the roof vertex and the bottom structure, as well as the model parameters of the prefabricated roof model.
[0114] The roof model generation module 95 is used to place the prefabricated roof model at the placement position of the bottom structure according to the placement location and scaling ratio, so as to obtain a roof model composed of the prefabricated roof model and the roof facade model. 。
[0115] The aforementioned roof model generation device first acquires an initial house model and determines its roof plane. Then, it moves the edge lines of the roof plane towards its center, obtaining the roof edge lines based on these moved edge lines. Based on the roof edge lines and the roof plane, a roof elevation model is generated. This roof elevation model includes a bottom structure determined by the roof plane and a top structure determined by the roof vertices obtained from the roof edge lines. Next, based on the roof vertices, the placement position of the prefabricated roof model is determined within the bottom structure. Then, based on the distance between the roof vertices and the bottom structure, and the model parameters of the prefabricated roof model, the scaling ratio of the prefabricated roof model is determined. Finally, based on the placement position and scaling ratio, the prefabricated roof model is placed at the placement position of the bottom structure, resulting in a roof model composed of the prefabricated roof model and the roof elevation model. This method can automatically generate a roof elevation model from an initial house model, and then place the prefabricated roof model on the roof elevation model to generate the final roof model. This method improves the generation speed of the roof model, and users can quickly modify the final roof model by adjusting the shape of the prefabricated roof model, increasing the freedom of roof model modification.
[0116] Specifically, the aforementioned plane determination module 90 is used to: obtain an initial house model; the initial house model consists of at least one cube box; for each cube box, determine the top surface of the current cube box as the roof plane corresponding to the current cube box in the initial house model.
[0117] In practical applications, the aforementioned roof edge line passes through the center of the roof plane.
[0118] In a specific implementation, the aforementioned roof plane includes four edge lines; the aforementioned roof edge line determination module 91 is used to: move each edge line in the roof plane towards the center of the roof plane at a preset speed, and stop moving when two moved edge lines coincide; determine the coincident line generated after the two moved edge lines coincide when the movement stops; determine two target edge lines in the roof plane other than the two edge lines corresponding to the coincident line, and the intersection point of each moved target edge line and the coincident line; and determine the line segment between two intersection points of the coincident line as the roof edge line.
[0119] Furthermore, the aforementioned device also includes a structure determination module, used to: determine the structure type of the roof model as a pointed roof structure before generating the roof facade model based on the roof edge line and the roof plane; wherein the structure type is determined based on the roof edge line, and the structure type includes either a pointed roof structure or a flat roof structure.
[0120] In specific implementation, the above-mentioned structure determination module is also used to: calculate the distance from the endpoint of the roof edge line to each edge line of the roof plane, and determine the maximum value of the distance as the edge parameter; determine whether the edge parameter is greater than a preset distance threshold. If it is greater, determine that the structure type of the roof model is a pointed roof structure; if it is not greater, determine that the structure type of the roof model is a flat roof structure.
[0121] Furthermore, the aforementioned facade model generation module 92 is used to: offset the roof edge line upward by a preset distance to obtain the offset roof edge line; obtain an initial roof facade model based on the line connecting the endpoint of the offset roof edge line to the vertex of the roof plane; and generate a roof facade model based on the initial roof facade model and the bounding box of the initial roof facade model.
[0122] In a specific implementation, the aforementioned facade model generation module 92 is also used to: generate the bounding box of the initial roof facade model; start from each endpoint of the offset roof edge line and emit rays in the opposite direction of the offset roof edge line, and determine the intersection of each ray with the bounding box as the roof vertex; and obtain the roof facade model based on the roof vertex and the roof plane.
[0123] Specifically, the aforementioned facade model generation module 92 is also used to: extend each edge line in the roof plane vertically upward to obtain a bounding box that surrounds the roof plane and the offset roof edge lines.
[0124] Furthermore, the aforementioned placement position determination module 93 is used to: determine, from the bottom structure, a first edge line on the same target surface as the roof vertex located in the bounding box; and determine the midpoint of the first edge line as the placement position of the prefabricated roof model in the bottom structure.
[0125] In specific implementation, the model parameters of the prefabricated roof model include: the size of the prefabricated roof model; the scaling ratio determination module 94 is used to: calculate the distance between the midpoint of the first edge line of the same target surface as the roof vertex and the roof vertex, and obtain the target distance value; and determine the scaling ratio of the prefabricated roof model according to the size of the prefabricated roof model and the target distance value.
[0126] The roof model generation device provided in this embodiment of the invention has the same implementation principle and technical effect as the aforementioned method embodiment. For the sake of brevity, any parts not mentioned in the device embodiment can be referred to the corresponding content in the aforementioned method embodiment.
[0127] This invention also provides an electronic device, such as... Figure 13 As shown, the electronic device includes a processor and a memory, the memory storing machine-executable instructions that can be executed by the processor, which executes the machine-executable instructions to implement the above-described roof model generation method.
[0128] Specifically, the above-mentioned roof model generation method includes: obtaining an initial house model and determining the roof plane of the initial house model; moving the edge lines in the roof plane towards the center of the roof plane, and obtaining the roof edge lines based on the moved edge lines; generating a roof elevation model based on the roof edge lines and the roof plane; wherein, the roof elevation model includes a bottom structure determined by the roof plane and a top structure determined by the roof vertices obtained from the roof edge lines; determining the placement position of the prefabricated roof model in the bottom structure based on the roof vertices; determining the scaling ratio of the prefabricated roof model based on the distance between the roof vertices and the bottom structure, and the model parameters of the prefabricated roof model; and placing the prefabricated roof model at the placement position of the bottom structure based on the placement position and the scaling ratio, thereby obtaining a roof model composed of the prefabricated roof model and the roof elevation model.
[0129] The above-described roof model generation method can automatically generate a roof facade model based on an initial house model. Then, the prefabricated roof model can be placed on the roof facade model to generate the final roof model. This method improves the generation speed of the roof model, and users can quickly modify the final roof model by adjusting the shape of the prefabricated roof model, thus increasing the freedom of roof model modification.
[0130] In an optional embodiment, the steps of obtaining the initial house model and determining the roof plane of the initial house model include: obtaining the initial house model; the initial house model consists of at least one cube box; for each cube box, the top surface of the current cube box is determined as the roof plane corresponding to the current cube box in the initial house model.
[0131] In an alternative embodiment, the roof edge line passes through the center of the roof plane.
[0132] In an optional embodiment, the roof plane includes four edge lines; the step of moving the edge lines in the roof plane towards the center of the roof plane and obtaining the roof edge line based on the moved edge lines includes: moving each edge line in the roof plane towards the center of the roof plane at a preset speed, stopping the movement when two moved edge lines coincide; determining the coincident line generated after the two moved edge lines coincide when the movement stops; determining two target edge lines in the roof plane other than the two edge lines corresponding to the coincident line, and the intersection point of each moved target edge line and the coincident line; and determining the line segment between the two intersection points of the coincident line as the roof edge line.
[0133] In an optional embodiment, before generating the roof facade model based on the roof edge line and the roof plane, the method further includes: determining the structural type of the roof model as a pointed roof structure; wherein the structural type is determined based on the roof edge line, and the structural type includes either a pointed roof structure or a flat roof structure.
[0134] In an optional embodiment, the method further includes: calculating the distance from the endpoint of the roof edge line to each edge line of the roof plane, and determining the maximum value of the distance as the edge parameter; determining whether the edge parameter is greater than a preset distance threshold, and if it is greater, determining that the structure type of the roof model is a pointed roof structure; if it is not greater, determining that the structure type of the roof model is a flat roof structure.
[0135] In an optional embodiment, the step of generating a roof facade model based on the roof edge line and the roof plane includes: offsetting the roof edge line upward by a preset distance to obtain the offset roof edge line; obtaining an initial roof facade model based on the line connecting the endpoint of the offset roof edge line and the vertex of the roof plane; and generating a roof facade model based on the initial roof facade model and the bounding box of the initial roof facade model.
[0136] In an optional embodiment, generating the roof facade model based on the initial roof facade model and the bounding box of the initial roof facade model includes: generating the bounding box of the initial roof facade model; emitting rays from each endpoint of the offset roof edge line in the opposite direction of the offset roof edge line, and determining the intersection of each ray with the bounding box as the roof vertex; and obtaining the roof facade model based on the roof vertex and the roof plane.
[0137] In an optional embodiment, the above-mentioned method for generating the bounding box of the initial roof facade model includes: extending each edge line in the roof plane vertically upward to obtain a bounding box that surrounds the roof plane and the offset roof edge lines.
[0138] In an optional embodiment, the step of determining the placement position of the prefabricated roof model in the bottom structure based on the roof vertex includes: determining a first edge line from the bottom structure that is on the same target surface as the roof vertex located in the bounding box; and determining the midpoint of the first edge line as the placement position of the prefabricated roof model in the bottom structure.
[0139] In an optional embodiment, the model parameters of the prefabricated roof model include: the size of the prefabricated roof model; the step of determining the scaling ratio of the prefabricated roof model based on the distance between the roof vertex and the bottom structure, and the model parameters of the prefabricated roof model, includes: calculating the distance between the midpoint of the first edge line of the same target surface as the roof vertex located in the bounding box and the roof vertex, to obtain a target distance value; and determining the scaling ratio of the prefabricated roof model based on the size of the prefabricated roof model and the target distance value.
[0140] Furthermore, Figure 13 The electronic device shown also includes a bus 102 and a communication interface 103, with the processor 101, the communication interface 103 and the memory 100 connected via the bus 102.
[0141] The memory 100 may include high-speed random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Communication between this system network element and at least one other network element is achieved through at least one communication interface 103 (which can be wired or wireless), such as the Internet, wide area network, local area network, or metropolitan area network. The bus 102 may be an ISA bus, PCI bus, or EISA bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 13 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.
[0142] Processor 101 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of processor 101 or by instructions in software form. Processor 101 can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this invention. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this invention can be directly manifested as execution by a hardware decoding processor, or execution by a combination of hardware and software modules in the decoding processor. The software module can reside in a readily available storage medium in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory 100, and processor 101 reads information from memory 100 and, in conjunction with its hardware, completes the steps of the method described in the foregoing embodiments.
[0143] This invention also provides a computer-readable storage medium storing computer-executable instructions. When these computer-executable instructions are called and executed by a processor, they cause the processor to implement the above-described roof model generation method. For specific implementation details, please refer to the method embodiments, which will not be repeated here.
[0144] Specifically, the above-mentioned roof model generation method includes: obtaining an initial house model and determining the roof plane of the initial house model; moving the edge lines in the roof plane towards the center of the roof plane, and obtaining the roof edge lines based on the moved edge lines; generating a roof elevation model based on the roof edge lines and the roof plane; wherein, the roof elevation model includes a bottom structure determined by the roof plane and a top structure determined by the roof vertices obtained from the roof edge lines; determining the placement position of the prefabricated roof model in the bottom structure based on the roof vertices; determining the scaling ratio of the prefabricated roof model based on the distance between the roof vertices and the bottom structure, and the model parameters of the prefabricated roof model; and placing the prefabricated roof model at the placement position of the bottom structure based on the placement position and the scaling ratio, thereby obtaining a roof model composed of the prefabricated roof model and the roof elevation model.
[0145] The above-described roof model generation method can automatically generate a roof facade model based on an initial house model. Then, the prefabricated roof model can be placed on the roof facade model to generate the final roof model. This method improves the generation speed of the roof model, and users can quickly modify the final roof model by adjusting the shape of the prefabricated roof model, thus increasing the freedom of roof model modification.
[0146] In an optional embodiment, the steps of obtaining the initial house model and determining the roof plane of the initial house model include: obtaining the initial house model; the initial house model consists of at least one cube box; for each cube box, the top surface of the current cube box is determined as the roof plane corresponding to the current cube box in the initial house model.
[0147] In an alternative embodiment, the roof edge line passes through the center of the roof plane.
[0148] In an optional embodiment, the roof plane includes four edge lines; the step of moving the edge lines in the roof plane towards the center of the roof plane and obtaining the roof edge line based on the moved edge lines includes: moving each edge line in the roof plane towards the center of the roof plane at a preset speed, stopping the movement when two moved edge lines coincide; determining the coincident line generated after the two moved edge lines coincide when the movement stops; determining two target edge lines in the roof plane other than the two edge lines corresponding to the coincident line, and the intersection point of each moved target edge line and the coincident line; and determining the line segment between the two intersection points of the coincident line as the roof edge line.
[0149] In an optional embodiment, before generating the roof facade model based on the roof edge line and the roof plane, the method further includes: determining the structural type of the roof model as a pointed roof structure; wherein the structural type is determined based on the roof edge line, and the structural type includes either a pointed roof structure or a flat roof structure.
[0150] In an optional embodiment, the method further includes: calculating the distance from the endpoint of the roof edge line to each edge line of the roof plane, and determining the maximum value of the distance as the edge parameter; determining whether the edge parameter is greater than a preset distance threshold, and if it is greater, determining that the structure type of the roof model is a pointed roof structure; if it is not greater, determining that the structure type of the roof model is a flat roof structure.
[0151] In an optional embodiment, the step of generating a roof facade model based on the roof edge line and the roof plane includes: offsetting the roof edge line upward by a preset distance to obtain the offset roof edge line; obtaining an initial roof facade model based on the line connecting the endpoint of the offset roof edge line and the vertex of the roof plane; and generating a roof facade model based on the initial roof facade model and the bounding box of the initial roof facade model.
[0152] In an optional embodiment, generating the roof facade model based on the initial roof facade model and the bounding box of the initial roof facade model includes: generating the bounding box of the initial roof facade model; emitting rays from each endpoint of the offset roof edge line in the opposite direction of the offset roof edge line, and determining the intersection of each ray with the bounding box as the roof vertex; and obtaining the roof facade model based on the roof vertex and the roof plane.
[0153] In an optional embodiment, the above-mentioned method for generating the bounding box of the initial roof facade model includes: extending each edge line in the roof plane vertically upward to obtain a bounding box that surrounds the roof plane and the offset roof edge lines.
[0154] In an optional embodiment, the step of determining the placement position of the prefabricated roof model in the bottom structure based on the roof vertex includes: determining a first edge line from the bottom structure that is on the same target surface as the roof vertex located in the bounding box; and determining the midpoint of the first edge line as the placement position of the prefabricated roof model in the bottom structure.
[0155] In an optional embodiment, the model parameters of the prefabricated roof model include: the size of the prefabricated roof model; the step of determining the scaling ratio of the prefabricated roof model based on the distance between the roof vertex and the bottom structure, and the model parameters of the prefabricated roof model, includes: calculating the distance between the midpoint of the first edge line of the same target surface as the roof vertex located in the bounding box and the roof vertex, to obtain a target distance value; and determining the scaling ratio of the prefabricated roof model based on the size of the prefabricated roof model and the target distance value.
[0156] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, essentially, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, a terminal device, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0157] In the description of this invention, it should be noted that the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are used only for the convenience of describing the invention and for simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on the invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.
[0158] Finally, it should be noted that the above-described embodiments are merely specific implementations of the present invention, used to illustrate the technical solutions of the present invention, and not to limit it. The scope of protection of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments within the technical scope disclosed in the present invention, or make equivalent substitutions for some of the technical features; and these modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A method for generating a roof model, characterized in that, The method includes: Obtain an initial house model and determine the roof plan of the initial house model; Move the edge line in the roof plane toward the center of the roof plane. When the moved edge lines coincide, stop moving and obtain the roof edge line based on the moved edge lines. A roof elevation model is generated based on the roof edge line and the roof plane; wherein, the roof elevation model includes a bottom structure determined by the roof plane and a top structure determined by the roof vertices obtained from the roof edge line; the roof vertices are determined as follows: an initial roof elevation model is obtained by connecting the endpoints of the offset roof edge line with the vertices of the roof plane; starting from each endpoint of the offset roof edge line, rays are emitted in the opposite direction of the offset roof edge line, and the intersection of each ray with the bounding box of the initial roof elevation model is determined as the roof vertex; the offset roof edge line is obtained by offsetting the roof edge line upward by a preset distance; Based on the roof apex, determine the placement position of the prefabricated roof model in the bottom structure; The scaling ratio of the prefabricated roof model is determined based on the distance between the roof vertex and the bottom structure, and the model parameters of the prefabricated roof model. Based on the placement position and the scaling ratio, the prefabricated roof model is placed at the placement position of the bottom structure to obtain a roof model composed of the prefabricated roof model and the roof facade model.
2. The method according to claim 1, characterized in that, The steps of obtaining an initial house model and determining the roof plan of the initial house model include: Obtain an initial house model; the initial house model consists of at least one cube box; For each of the cube boxes, the top surface of the current cube box is determined as the roof plane corresponding to the current cube box in the initial house model.
3. The method according to claim 1, characterized in that, The roof edge line passes through the center of the roof plane.
4. The method according to claim 3, characterized in that, The roof plane includes four edge lines; The step of moving the edge line in the roof plane towards the center of the roof plane, stopping the movement when the moved edge lines coincide, and obtaining the roof edge line based on the moved edge lines includes: According to a preset speed, each edge line in the roof plane is moved towards the center of the roof plane, and the movement stops when two moved edge lines coincide. Determine the coincident line generated after the two moved edge lines coincide when the movement stops; Determine two target edge lines in the roof plane other than the two edge lines corresponding to the coincident line, and the intersection point of each moved target edge line with the coincident line; The line segment between the two intersection points of the overlapping line is defined as the roof edge line.
5. The method according to claim 1, characterized in that, Before the step of generating the roof facade model based on the roof edge line and the roof plane, the method further includes: The structure type of the roof model is determined to be a pointed roof structure; wherein, the structure type is determined based on the roof edge line, and the structure type includes either a pointed roof structure or a flat roof structure.
6. The method according to claim 5, characterized in that, The method further includes: Calculate the distance from the endpoint of the roof edge line to each edge line of the roof plane, and determine the maximum value of the distance as the edge parameter; Determine whether the edge parameter is greater than a preset distance threshold. If it is, determine that the structure type of the roof model is a pointed roof structure; if it is not, determine that the structure type of the roof model is a flat roof structure.
7. The method according to claim 1, characterized in that, The step of generating a roof facade model based on the roof edge line and the roof plane includes: A roof facade model is generated based on the initial roof facade model and its bounding box.
8. The method according to claim 7, characterized in that, The step of generating a roof facade model based on the initial roof facade model and its bounding box includes: Generate the bounding box of the initial roof facade model; Starting from each endpoint of the offset roof edge, rays are emitted in the opposite direction of the offset roof edge, and the intersection of each ray with the bounding box is determined as the roof vertex; Based on the roof apex and the roof plane, the roof facade model is obtained.
9. The method according to claim 8, characterized in that, The bounding box for generating the initial roof facade model includes: Each edge line in the roof plane is extended vertically upwards to obtain a bounding box that surrounds the roof plane and the offset roof edge lines.
10. The method according to claim 8, characterized in that, The step of determining the placement position of the prefabricated roof model in the bottom structure based on the roof vertex includes: From the bottom structure, determine the first edge line of the same target surface as the roof vertex located in the enclosing box; The midpoint of the first edge line is determined as the placement position of the prefabricated roof model in the bottom structure.
11. The method according to claim 10, characterized in that, The model parameters of the prefabricated roof model include: the dimensions of the prefabricated roof model; The step of determining the scaling ratio of the prefabricated roof model based on the distance between the roof vertex and the bottom structure, and the model parameters of the prefabricated roof model, includes: Calculate the distance between the midpoint of the first edge line of the same target face as the roof vertex located in the bounding box and the roof vertex to obtain the target distance value; The scaling ratio of the prefabricated roof model is determined based on the size of the prefabricated roof model and the target distance value.
12. A roof model generation device, characterized in that, The device includes: A plane determination module is used to obtain an initial house model and determine the roof plane of the initial house model; The roof edge line determination module is used to move the edge line in the roof plane towards the center of the roof plane. When the moved edge lines coincide, the movement stops, and the roof edge line is obtained based on the moved edge lines. A facade model generation module is used to generate a roof facade model based on the roof edge line and the roof plane. The roof facade model includes a bottom structure determined by the roof plane and a top structure determined by the roof vertices obtained from the roof edge line. The roof vertices are determined as follows: an initial roof facade model is obtained by connecting the endpoints of the offset roof edge line to the vertices of the roof plane; rays are emitted from each endpoint of the offset roof edge line in the opposite direction, and the intersection of each ray with the bounding box of the initial roof facade model is determined as the roof vertex; the offset roof edge line is obtained by offsetting the roof edge line upwards by a preset distance. The placement position determination module is used to determine the placement position of the prefabricated roof model in the bottom structure based on the roof vertex. The scaling ratio determination module is used to determine the scaling ratio of the prefabricated roof model based on the distance between the roof vertex and the bottom structure, and the model parameters of the prefabricated roof model. The roof model generation module is used to place the prefabricated roof model at the placement position of the bottom structure according to the placement position and the scaling ratio, so as to obtain a roof model composed of the prefabricated roof model and the roof facade model.
13. An electronic device, characterized in that, The method includes a processor and a memory, the memory storing machine-executable instructions that can be executed by the processor, the processor executing the machine-executable instructions to implement the roof model generation method according to any one of claims 1 to 11.
14. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions that, when invoked and executed by a processor, cause the processor to implement the roof model generation method according to any one of claims 1 to 11.
Citation Information
Patent Citations
3D building modeling systems
US20190051043A1
Home decoration plan automatic design method and apparatus, computer device, and storage medium
WO2022141887A1