Automated modeling method, device and program product for gable roof buildings in digital space
By acquiring sketch outlines in digital space and generating a set of slope indexes, the problem of controlling splicing relationships in pitched roof modeling was solved, achieving accurate slope splicing and efficient 3D model construction.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-20
- Publication Date
- 2026-04-10
AI Technical Summary
Existing methods for modeling pitched roofs struggle to accurately control the splicing relationships between different slopes, especially at the intersection of the ridge line and the roof outline, where splicing errors, misalignments, or overlaps are prone to occur, resulting in insufficient modeling accuracy.
By acquiring the sketch outline, identifying the main outline, generating a set of slope indexes, and constructing a closed geometry, the slope splicing can be automatically controlled in digital space to avoid overlap or breakage and ensure that the ridge line intersects precisely with the target roof outline.
It achieves precise splicing of 3D models of pitched roofs, improves modeling efficiency and accuracy, and ensures the structural closure and logical rigor of the model in digital space.
Smart Images

Figure CN120976442B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of digital twinning, in particular to an automatic modeling method of a pitched roof building in a digital space, a computer device and a computer program product. BACKGROUND
[0002] With the wide application of city information model (CIM) and three-dimensional geographic information system (3D GIS), more and more building models are required to be constructed and expressed in a digital space to meet the intelligent needs of multiple scenarios such as city planning, digital twinning, emergency simulation, etc.
[0003] In these building modeling, the pitched roof structure becomes a key component in the modeling process because it is common in actual buildings.
[0004] The existing modeling method of the pitched roof depends on manual modeling, CAD sketches or templated components in BIM tools, which is difficult to accurately control the splicing relationship between the slopes in the slope construction process of the pitched roof. Especially at the intersection of the ridge line and the roof contour, splicing errors, slope misplacement, hanging or overlapping may occur, which leads to the difficulty of accurately intersecting the ridge line and the roof contour. SUMMARY
[0005] One object of the present application is to accurately control the splicing relationship between the slopes in the slope construction process of the pitched roof, and to provide an automatic modeling method of a pitched roof building in a digital space, a computer device and a computer program product.
[0006] According to one aspect of an embodiment of the present application, an automatic modeling method of a pitched roof building in a digital space is disclosed, the method comprising:
[0007] Obtaining a sketch contour line drawn for constructing a three-dimensional model of a pitched roof in a digital space, the sketch contour line being used to express the two-dimensional projection form of the overall outer contour of the pitched roof to be drawn;
[0008] Identifying a main contour forming a closed area from the sketch contour line, and determining the main contour as a target roof contour;
[0009] Generating a slope index set according to the geometric parameters associated with the effective line segments distributed in the target roof contour, and constructing a closed geometric body through the slope index set;
[0010] Obtaining a roof upper surface from the closed geometric body by extracting a face set in the upward direction;
[0011] Obtaining a three-dimensional model of a pitched roof by performing geometric body generation and merging operations on the roof upper surface.
[0012] According to an aspect of the embodiments of the present application, a computer device is disclosed, comprising a memory, a processor and a computer program stored in the memory, the processor executes the computer program to implement the steps of the method according to any one of the preceding embodiments.
[0013] According to an aspect of the embodiments of the present application, a computer program product is disclosed, comprising a computer program, the computer program is executed by a processor to implement the steps of the method according to any one of the preceding embodiments.
[0014] The embodiments of the present application take the structured slope surface construction process, take the drawn sketch contour line as the input, start from the identified target roof contour, and generate the slope roof three-dimensional model according to the geometric parameters of the effective line segment association in segments, so that the splicing relationship between the slope surfaces can be accurately controlled in the slope surface construction process of the slope roof, the ridge line generated can accurately intersect with the target roof contour, that is, the top line extended from the target roof contour is the ridge line, which accurately falls on the expected position of an effective line segment on another slope surface or target contour line, so that the slope surfaces are accurately spliced, and finally the modeling efficiency and model accuracy are significantly improved.
[0015] Further description is as follows. To construct the slope roof three-dimensional model of the digital space slope roof building, first, the drawn sketch contour line is obtained, the drawn sketch contour line is used to express the two-dimensional projection state of the overall outer contour of the slope roof to be drawn, after the drawn sketch contour line is obtained, the main contour of the closed area is formed by identifying the sketch contour line, the main contour is determined as the target roof contour, and the slope surface is accurately controlled inwards to form a closed geometric body based on the target roof contour through the effective line segment + geometric parameter, which will make the construction of all slope surfaces no longer be performed individually, but be uniformly executed in the unified geometric body structure, so that the overlap or breakage between the slope surfaces is avoided, the overlap or breakage of the slope surfaces on the ridge line is ensured, and finally the slope roof three-dimensional model of the roof upper surface is obtained through the execution of the geometric body generation and merging operation, the slope roof three-dimensional model is naturally folded to form the ridge line from the bottom to the top, the ridge line does not need to be manually specified, the slope roof three-dimensional model is ensured to be structurally closed and logically rigorous in the digital space, and can be used for accurate and rapid implementation of automatic modeling in subsequent simulation deduction.
[0016] Other characteristics and advantages of the present application will become apparent from the following detailed description, or will be learned by practice of the present application.
[0017] It should be understood that the foregoing general description and the following detailed description are only exemplary and are not limiting on the present application. BRIEF DESCRIPTION OF DRAWINGS
[0018] The above and other objects, features and advantages of the present application will become more apparent from the following detailed description when taken in conjunction with the accompanying drawings in which:
[0019] Figure 1 is a flow chart illustrating a method for automated modeling of a gable roof building in a digital space according to an embodiment.
[0020] Figure 2 is a flow chart illustrating a method for identifying a main contour from a sketch contour line identifying a closed region according to an embodiment. Figure 1 is a flow chart illustrating a method for identifying a main contour from a sketch contour line identifying a closed region according to an embodiment.
[0021] Figure 3 is a flow chart illustrating a method for extracting at least one closed polygonal ring from a sketch contour line according to an embodiment. Figure 2
[0022] Figure 4 is a diagram of a non-closed polygonal line. The non-closed polygonal line will be considered as an invalid sketch contour line, and the corresponding line segments will not be searched and used to form a closed polygonal ring in the searching process since there is no geometric connection between the line segments.
[0023] Figure 5 is a diagram of a self-intersecting closed polygonal ring.
[0024] Figure 6 is a diagram of a closed polygonal ring with a separation.
[0025] Figure 7 is a diagram of a valid closed polygonal ring with a two-layer nested distribution according to an embodiment.
[0026] Figure 8 is a flow chart illustrating a method for generating a slope index set according to geometric parameters associated with valid line segments distributed according to a target roof contour, and constructing a closed geometric body according to the slope index set according to an embodiment. Figure 1
[0027] is a flow chart illustrating a method for generating a slope index set according to geometric parameters associated with valid line segments distributed according to a target roof contour, and constructing a closed geometric body according to the slope index set according to an embodiment. Figure 9 Figure 1 is a flow chart illustrating a method for generating a three-dimensional model of a gable roof by performing geometric body generation and merging operations on a roof upper surface according to an embodiment.
[0028] Figure 10 is a diagram of a horizontal eave generated by offsetting a roof upper surface in a horizontal direction according to an embodiment.
[0029] Figure 11 is a schematic diagram of a vertical roof ridge generated by offsetting the roof top surface in the vertical direction according to an embodiment.
[0030] Figure 12 is a schematic diagram of a straight roof ridge generated by offsetting the roof top surface in the straight direction according to an embodiment.
[0031] Figure 13 is a schematic diagram of sketching in the implemented profile roof function according to an embodiment.
[0032] Figure 14 is Figure 13 is a schematic diagram of the parameter setting interface in the profile roof function according to an embodiment.
[0033] Figure 15 is a schematic diagram of the gable roof style of the gable roof three-dimensional model according to an embodiment. Figure 13
[0034] is a schematic diagram of the dormer roof style of the gable roof three-dimensional model according to an embodiment. Figure 16 Figure 13 is a schematic diagram of the flat roof according to an embodiment.
[0035] Figure 17 Figure 13 is a schematic diagram of the hipped roof according to an embodiment.
[0036] Figure 18 is a schematic diagram of the mansard roof according to an embodiment. Figure 13
[0037] is a schematic diagram of the single pitch roof according to an embodiment. Figure 19 Figure 13 DETAILED DESCRIPTION
[0038] Example implementations will now be described more fully with reference to the accompanying drawings. Example implementations may, however, be implemented in many different forms and should not be construed as limited to the examples set forth herein; rather, these example implementations are provided so that this disclosure will be thorough and complete, and will fully convey the scope of example implementations to those skilled in the art. Like reference numerals refer to like elements throughout the description. Repeated use of illustrations indicates reusability of a drawing figure across one or more aspects.
[0039] Moreover, the described features, structures, or characteristics can be combined in any suitable manner in one or more example embodiments. In the following description, numerous specific details are provided to give a thorough understanding of example embodiments. One skilled in the relevant art will recognize, however, that the technology can be practiced without one or more of the specific details, or with other methods, components, materials, and so forth. In other instances, well-known structures, methods, implementations, or operations are not shown or described in detail to avoid obscuring aspects of the disclosure.
[0040] Some of the block diagrams in the drawings show blocks in functional form and not in detailed hardware form. Where appropriate, some of the blocks in the drawings illustrate functions that can be implemented in software or firmware, or that can be implemented in one or more hardware modules or integrated circuits. Some of the blocks in the drawings can also be implemented in different network and / or processor devices and / or microcontrollers.
[0041] The embodiment of the present application is used for automatic modeling of slope roof buildings in digital space, so as to obtain high-precision slope roof buildings in digital space, enhance the geometric modeling capability, and provide support for vertical application of digital twin scene.
[0042] Referring to Figure 1 , Figure 1 is a flow chart for describing the automatic modeling method of slope roof buildings in digital space according to an embodiment. The automatic modeling method of slope roof buildings in digital space provided by the embodiment of the present application comprises the following steps.
[0043] In step S110, a sketch contour line drawn for constructing a three-dimensional model of a slope roof in digital space is obtained, and the sketch contour line is used to express the two-dimensional projection form of the overall outer contour of the slope roof to be drawn;
[0044] In step S120, a main contour forming a closed area is recognized from the sketch contour line, and the main contour is determined as a target roof contour;
[0045] In step S130, a slope index set is generated according to the geometric parameters associated with the effective line segments distributed in the target roof contour, and a closed geometric body is constructed through the slope index set;
[0046] In step S140, a face set in an upward direction is extracted from the closed geometric body to obtain a roof upper surface;
[0047] In step S150, a slope roof three-dimensional model is obtained by performing a geometric body generation and merging operation on the roof upper surface.
[0048] The following describes this step in detail.
[0049] For the digital space in the automated modeling of gable roof building, first need to draw sketch contour line, the sketch contour line can be user input, also can be the automatic modeling system generated, here is not limited.
[0050] With the user draws, or even imported by the automatic modeling system generated plane data, will be through step S110 for the current gable roof building automated modeling to obtain sketch contour line, for the construction of gable roof three-dimensional model based on sketch contour line.
[0051] In step S110, the sketch contour line is composed of a plurality of two-dimensional line segments, which constitutes at least one region, such as at least one closed region. Different eave style, the corresponding sketch contour line style will also be different. Exemplary, adapted to the eave style, the sketch contour line includes a main contour, or a combination of a main contour and at least one inner contour.
[0052] Eave style, including but not limited to full slope roof, gable roof, flat roof, hipped roof and single slope roof, so, adapted to different eave style, and considering the randomness of user drawing, sketch contour line is not fixed, need to be through the execution of step S120 from the main contour, and the possible existence of inner contour (such as in the presence of skylight, patio and other structures), in turn, for subsequent construction of gable roof three-dimensional model with different eave style.
[0053] In one exemplary embodiment, the user draws a sketch contour line composed of a plurality of straight lines, rectangles and the like in the drawing area, and sets the slope value of each line segment of the sketch contour line. The slope value indicates the angle between the plane generated by the corresponding line segment and the horizontal plane, i.e. the slope angle referred to later. Thus, the sketch contour line, slope and even height attribute parameters for controlling the generation of gable roof three-dimensional model can be obtained.
[0054] The sketch contour line is used to represent the projection shape of the overall outer contour of the gable roof in the horizontal direction. The automatic modeling of gable roof realized under the action of the sketch contour line can effectively reduce the complexity of user input, i.e. the user only needs to provide a simple two-dimensional contour. Since the sketch contour line determines the overall shape of the gable roof three-dimensional model in the horizontal direction, it provides an intuitive and controllable input basis for the automatic modeling to be initiated.
[0055] In step S120, the sketch contour line is identified to form a main contour of a closed area, and the main contour is determined as a target roof contour which will be used as the basis for subsequent modeling. For the automatic modeling of a gable roof building in a digital space, only the sketch contour line is needed to automatically identify the target roof contour and automatically model the gable roof three-dimensional model adapted to the target roof contour, which greatly simplifies the model construction process in the digital space and enhances the modeling capability.
[0056] The sketch contour line at least contains at least one closed polygon ring, so in the execution of step S120, the closed polygon ring is extracted to obtain at least one closed polygon ring, and then all the closed polygon rings are identified to obtain a main contour and at least one inner contour, and finally a gable roof three-dimensional model is obtained based on the main contour itself or the combination of the main contour and the inner contour.
[0057] In the closed polygon ring identified from the sketch contour line, the main contour can exist independently or in combination with one or more inner contours, and different combination forms can adapt to the modeling requirements of various roof styles.
[0058] For example, the at least one closed polygon ring extracted from the sketch contour line is identified to obtain a maximum ring and other inner rings, the maximum ring is the main contour, and the other inner rings can be used as inner contours to create openings in the gable roof three-dimensional model, thereby adapting to the gable roof three-dimensional model creation of a specific roof style.
[0059] Referring to Figure 2 , Figure 2 According to Figure 1 The method flowchart for describing the step of identifying the main contour of the closed area from the sketch contour line and determining the main contour as the target roof contour is shown in the corresponding embodiment.
[0060] The step S120 provided by the embodiment of the present application for identifying the main contour of the closed area from the sketch contour line and determining the main contour as the target roof contour comprises:
[0061] Step S121, extracting at least one closed polygon ring of the sketch contour line;
[0062] Step S122, identifying the maximum ring of all the extracted closed polygon rings as the main contour of the closed area, and determining the main contour as the target roof contour.
[0063] The two steps are described in detail as follows.
[0064] The sketch outline consists of all line segments drawn by the user in the digital space. Therefore, in the execution of step S121, all line segments drawn by the user are first obtained, and the topological connection relationship between the line segments is traversed in a loop to obtain the combination of line segments that can return to the starting point corresponding to the starting line segment to form a closed loop, thereby realizing the extraction of at least one closed polygonal loop.
[0065] The extracted at least one closed polygonal ring may include a large outer contour, i.e., the main contour, and several hole contours located inside the main contour, i.e., the inner contour of the main contour, in order to provide basic boundary input for subsequent pitched roof geometry modeling.
[0066] It should be understood that by automatically extracting closed boundaries through the execution of step S121, the user no longer needs to manually mark closed boundaries, which greatly improves the convenience of operation. In addition, it also enables geometric modeling to support the coexistence of multiple closed contours, providing the necessary data foundation for subsequent identification of main contours and inner contours.
[0067] For example, see Figure 3 , Figure 3 It is based on Figure 2 A flowchart illustrating the method for extracting at least one closed polygonal loop of a sketch outline, as shown in the corresponding embodiment.
[0068] Step S121 of this application embodiment for extracting at least one closed polygonal loop of sketch outline includes:
[0069] Step S201: Construct a set of unsearched line segments for all line segments in the sketch outline;
[0070] Step S202: Iteratively search for polygonal closed segments starting from a line segment in the set of unsearched line segments until the search returns to the starting line segment, obtaining at least one closed polygonal loop. The searched line segment is removed from the set of unsearched line segments.
[0071] The following is a detailed explanation of these two steps.
[0072] Each line segment of the sketch outline is treated as an independent object to be searched to confirm whether it participates in the construction of the closed polygonal loop. Each line segment is traversed in a loop to find the next line segment that connects to the previous line segment end by end. This process continues until the search returns to the starting point of the starting line segment, i.e., the current line segment whose endpoints coincide with the starting point of the starting line segment. This results in a closed polygonal loop.
[0073] In the specific implementation, firstly, all line segments of the sketch contour line are constructed into an unsearched line segment set through step S201, in other words, all the sketch line segments of the sketch contour line are loaded into the unsearched line segment set at one time. The unsearched line segment set is essentially a line segment list dynamically maintained in the memory and capable of being quickly added or deleted, which records all the line segments that have not participated in any closed search, each line segment is removed from the unsearched line segment set in time after forming a closed polygon ring, which provides support for the quick search and traversal of the line segments, and further provides a clean and controllable input set for the extraction of the closed polygon ring.
[0074] Under the action of step S201, the search boundary is determined, and any boundary information drawn by the user is not missed, which provides important support for the existence of the drawn sketch contour line with broken lines, non-sequential drawing, multiple closed regions and the like, and is also beneficial to the process control of the closed loop search.
[0075] For the constructed unsearched line segment set, step S202 controls the process of the closed loop search based on the unsearched line segment set, takes out a line segment from the unsearched line segment set to start the search and removes it from the unsearched line segment set after the identification is completed, so as to avoid repeated search and repeated participation of the closed polygon ring.
[0076] In step S202, a line segment is selected from the unsearched line segment set as a starting line segment, one end point of the starting line segment is a starting point, the next line segment connected with the starting line segment is found based on the existing geometric connection relationship (i.e. line segment end point coincidence) and direction consistency (such as clockwise or counterclockwise), until a closed loop is formed and returned to the starting point of the starting line segment.
[0077] Once a closed polygon ring is formed, all the line segments in the ring will be removed from the unsearched line segment set to avoid being used again or even multiple times for the extraction of other closed polygon rings.
[0078] With the acquisition of a closed polygon ring, on the one hand, the line segments searched for forming the closed polygon ring are removed from the unsearched line segment set, and on the other hand, the search of the polygon closed line segment is continued in the unsearched line segment set, and so on, at least one closed polygon ring is obtained through the search, until the unsearched line segment set is empty, or the line segments in the unsearched line segment set do not have a geometric connection relationship with each other, at which time the search process is ended.
[0079] For the search of each closed polygon ring, the consistency of the first and last end points between two line segments is taken as the judgment basis for connecting a line segment with the next line segment, and with the progress of the search, the line segment direction back to the starting point of the starting line segment is taken as the criterion to determine the closed polygon ring obtained by the current search.
[0080] Further illustrated, in searching the next line segment to form a closed loop for the current line segment, the line segment coinciding with the current line segment is judged, and the line segment coinciding with the current line segment is identified as the line segment forming a closed loop, i.e. a closed polygon ring, and then the search for the closed loop is continued with the line segment as the current line segment. Wherein, the judgment of whether the line segment coincides with the current line segment is an enlarged processing of the judgment basis of whether the two line segments are connected end to end, so as to make the slight deviation between the end points of the line segments not affect the search process, enhance the ability of the automatic construction of the sketch contour line of the slope roof, and ensure that the sketch contour line drawn by the user can also realize the model construction of the slope roof.
[0081] In summary, through the execution of steps S201 and S202, all legal closed regions are automatically identified from the sketch contour line, i.e. a closed polygon ring is obtained. Under the action of steps S201 and S202, the irregular or non-standard direction line segment drawn by the user can be adapted, and the robustness of automatic modeling is improved.
[0082] Under the control of the non-searched line segment set, the search for other closed polygon rings can be continued when a closed polygon ring is searched, so that the slope roof model construction with the sketch contour line as the input can support the structure recognition and construction ability of multiple contours and multiple holes, and effectively avoid the occurrence of repeated search and false closure, improve the extraction efficiency and accuracy of the closed polygon ring, and provide a stable and reliable basic boundary component for the subsequent identification of the main contour of the roof and the generation of the slope surface geometry.
[0083] In another embodiment, the step S122 of identifying the maximum ring as the main contour of the closed region and determining the main contour as the target roof contour provided by the embodiment of the present application to all the extracted closed polygon rings comprises:
[0084] Traversing all the valid closed polygons in the closed polygon ring, determining the valid closed polygon containing other rings except itself, and taking the valid closed polygon as the maximum ring to obtain the main contour of the closed region, and determining the main contour as the target roof contour.
[0085] Firstly, it is supplemented that the sketch contour line may be a line segment set drawn by the user at will, so that the corresponding constructed non-searched line segment set may have several line segments constituting an unclosed polygon, as shown in Figure 4 , Figure 4 is a schematic diagram of an unclosed polygon. The unclosed polygon will be regarded as an invalid sketch contour line, and the corresponding line segment will not be searched in the search process due to the absence of geometric connection relationship between each other and then be used to constitute a closed polygon ring.
[0086] But the search for the closed polygon ring, identify self-intersecting closed polygon ring and the closed polygon ring between the phase separation of closed polygon ring is invalid closed polygon ring, need to eliminate invalid closed polygon ring in the search for the closed polygon ring. Wherein, self-intersecting closed polygon ring can refer to Figure 5 As shown in the figure, the closed polygon ring separated from each other as shown in Figure 6 . Figure 5 A self-intersecting closed polygon ring is shown in the figure, Figure 6 Is the presence of a separate closed polygon ring schematic.
[0087] After identifying and eliminating invalid closed polygon ring, at least one effective closed polygon is obtained for the construction of the slope roof model. So when only one effective closed polygon is obtained, the main profile of the closed area is obtained directly by taking this as the maximum ring, and the main profile is determined as the target roof profile.
[0088] If the effective closed polygon obtained after identifying and eliminating invalid closed polygon ring is more than two, there is a nesting relationship between the two or more effective closed polygons, such as one large closed loop with one or more small closed loops. At this time, all effective closed polygons will be traversed to identify effective closed polygons containing only other rings except themselves.
[0089] Further, in order to adapt to the slope roof modeling, the effective closed polygon containing a closed loop is determined as the main profile, and then the main profile is designated as the target roof profile. That is, by identifying the maximum ring containing a closed loop as the main profile, the specific execution process includes: traversing all effective closed polygons (i.e. all closed loops) in turn, if the ring contains other effective closed polygons except itself, it means that the ring is the maximum ring.
[0090] It should be understood that the effective closed polygon containing only other rings except itself is two closed polygon rings with a nesting relationship. In the implemented slope roof modeling, only the two effective closed polygons in a nesting relationship are allowed to identify the maximum ring to determine the target roof profile. A nesting relationship is only allowed to nest one layer in an effective closed polygon, and it can be understood that in the mutual nesting of at least one effective closed polygon, the effective closed polygon with more than two layers of nesting distribution will be considered invalid and cannot be used for the current implemented slope roof modeling.
[0091] Figure 7 A schematic diagram of effective closed polygons with more than two layers of nesting distribution in one embodiment is shown, which set of effective closed polygons will be considered invalid.
[0092] In summary, the extraction of the closed polygonal ring by the sketch contour line, and the identification of the effective polygon as the target roof contour in the closed polygonal ring, further provide the target roof contour to the slope index set generation performed in step S130.
[0093] In step S130, based on the effective line segments distributed on the target roof contour, the effective slope corresponding to each effective line segment is determined, and the slope index set is formed for the resulting effective slope. It should be understood that through the execution of step S130, starting from the target roof contour, the slope is derived inward according to the properties bound by the effective line segments thereon, such as the slope, direction and height, etc. The growth direction and offset of the slope are precisely controlled by the effective line segments and geometric parameters, and the adjacent slopes can naturally converge to form a continuous ridge line according to the geometric rules, and the resulting ridge line is precisely the common edge of multiple straight face boundaries, ensuring geometric consistency with the target roof contour and high spatial accuracy.
[0094] In view of the effective line segments distributed on the target roof contour, the effective slope is obtained through the geometric parameters associated with each effective line segment, and the slope index set is generated. The execution of this process makes the implementation of the slope roof modeling not need to explicitly construct the ridge line, but to naturally evolve the ridge line in the slope construction. The entire process no longer needs to manually specify the ridge line coordinates, and the slope is precisely constructed inward by means of the geometric parameters, and the ridge line is automatically generated by the resulting multiple slope shared edges, thereby avoiding the problem of suspended or overlapping ridge line, and ensuring the structural closure of the slope roof three-dimensional model in the digital space.
[0095] In the execution process of step S130, since the target roof contour is actually an effective closed polygon composed of several line segments, such as target roof contour P = {L1, L2,..., Ln}, Li is a line segment distributed on the target roof contour. For the line segments distributed on the target roof contour, first, the effectiveness of each line segment is checked to determine the effective line segment, and then the slope is derived inward according to the associated geometric parameters based on the effective line segment as the starting point.
[0096] Further explanation, the effectiveness check for each line segment is to obtain the starting point and the end point of the line segment, and to check whether the line segment is zero by checking the starting point and the end point, such as checking that the line segment is zero, directly returning to the effectiveness check of the next line segment, such as checking that the line segment is an effective line segment, generating a slope index set based on the associated geometric parameters, and then constructing a closed geometric body through the slope index set.
[0097] Each effective line segment can correspond to a slope surface of the pitched roof, and the geometric parameters associated with the effective line segment are used to construct the corresponding slope surface. Exemplarily, the geometric parameters associated with the effective line segment include the coordinates of the starting point, the coordinates of the ending point, the slope angle, the height, etc.
[0098] In an exemplary embodiment, for step S130, the number of faces is calculated for the effective line segment, and all the constructable facets corresponding to the calculated number of faces are determined for the effective line segment, so as to obtain the index set of the slope surfaces of the pitched roof.
[0099] Exemplarily, the number of faces is calculated for each effective line segment. The number of faces is substantially a count of the triangular facets obtained by triangulating the region in which the current effective line segment is located. That is, the triangular facets of the current effective line segment are obtained through the triangulation process of the current effective line segment and other associated vertices (adjacent vertices), each triangular facet is counted as a slope surface (a constructable facet of the current effective line segment), and finally the number of faces of each effective line segment is calculated.
[0100] Thus, for each effective line segment, the number of faces is calculated to determine all the constructable facets of the effective line segment, and then the effective slope surfaces are screened from the constructable facets to form the index set of the slope surfaces. It should be pointed out that the screened effective slope surfaces are the roof surfaces involved in the modeling.
[0101] Exemplarily, after the number of faces is calculated for each effective line segment to obtain all the constructable facets, the screening of the effective slope surfaces is implemented by looping through all the facets, and then the obtained effective slope surfaces constitute the index set of the slope surfaces of the pitched roof.
[0102] In other words, the index set of the slope surfaces is used to represent all the effective slope surfaces corresponding to the effective line segments. Each constructable facet of the effective line segment has its corresponding height and slope angle. Therefore, the loop is started from the facet mapped by the highest point and loops through all the constructable facets. In one loop, the height and slope angle of the current facet are obtained, and it is determined whether the current facet is flat according to the slope angle. If the current facet is flat, it means that the constructable roof surface has no slope, and the loop is directly exited without searching for the effective slope surface. If the current facet is not flat, it is further determined whether the current facet is a downward slope surface compared with the previous effective slope surface. If yes, it is determined that the current facet is an effective slope surface, which is one loop of the screening of the effective slope surfaces. Similarly, the screening of the effective slope surfaces in all the facets is completed.
[0103] It should be clear that determining whether the current patch is flat is achieved by determining whether the slope angle of the current patch is 0, and if the slope angle is 0, it means that the current patch is not a slope. And in the specific implementation, whether the slope angle of the current patch is 0 is achieved by comparing whether the slope angle of the current patch is close to 0, in order to consider the floating point error.
[0104] And for the judgment process of whether the current patch is a downward slope compared to the previous patch, it is determined according to whether the height of the current patch is lower than the height of the previous effective slope, and if the height of the current patch is lower than the height of the previous effective slope, it means that the slope of the current patch is downward, and the current patch can be determined as an effective slope.
[0105] In summary, the slope roof is a slope that extends from high to low, that is, the slope that participates in modeling to form the roof extends from the high side to the low side, therefore, the effective line segment can construct the patch according to the extension direction from high to low, and the first patch corresponds to the highest point. The effective line segment can construct the patch, and the first patch is used as the starting point to determine whether each patch is an effective slope, and the determined effective slope is used to generate the slope roof structure.
[0106] Through this process, the face index of the screened effective slope can be added to the effective face index array to obtain a slope index set. For example, each effective slope is represented by a face index, and the face index is mapped to the vertex coordinates of the corresponding effective face. Therefore, the slope index set will at least include the face index of the effective slope, and then the face index can be mapped to the effective slope in the slope index set.
[0107] In an exemplary embodiment, each effective line segment, which can construct the effective slope in the patch, has corresponding slope information, for example, the slope information is the digital space index information of the effective slope, including but not limited to vertex index, normal vector direction, etc. All slope information is encapsulated and included in the slope index set by being associated with the face index.
[0108] After obtaining the slope index set suitable for the slope roof, a closed geometric body is constructed for the slope index set to implement the subsequent model construction operation.
[0109] As described above, the slope index set maps each effective slope, and the mapped effective slope will be used to form the slope of the closed geometric body, that is, all slopes in the slope index set are combined into a body in a geometric splicing manner to obtain a closed geometric body.
[0110] Exemplarily, the generation process of the closed geometry controlled by the slope index set includes: calculating the offset of all slopes in the slope index set to obtain the three-dimensional offset of the slope in the digital space, and then changing the flat profile of the slope into a slope roof structure with uneven height and slope under the control of the three-dimensional offset.
[0111] To this end, for the generation of the aforementioned slope index set and the construction of the closed geometry, it is supplemented that, for the construction of the closed geometry, in step S130, the target roof profile is first used to initialize an empty geometry, and the obtained empty geometry is used to add all slopes in the slope index set to gradually form a complete closed geometry. That is, the slope constructed in segments for the target roof profile will be inserted into the empty geometry under the control of the slope index set to ensure the precision and closure of the modeling.
[0112] It should be understood that all slopes in the slope index set are essentially two-dimensional profiles, which are mapped into three-dimensional roof slopes under the action of the calculated three-dimensional offset, and the slopes are embedded into the initialized geometry container, i.e., the aforementioned empty geometry, according to the three-dimensional offset, to gradually splice a complete closed three-dimensional roof geometry, i.e., the closed geometry.
[0113] Further, for the effective slope screening performed as described above, the face sheet mapped by the highest point needs to be processed for the overhang effect if it is determined to be not flat. The height of the face sheet needs to be removed to avoid counting the height of the internal room surface and causing inaccurate modeling of the slope roof in the digital space.
[0114] It should be understood that in step S130, the slope geometry structure is constructed in segments and integrated into a unified empty geometry to form a closed geometry based on the slope index, and then the face set in the upward direction is extracted from the closed geometry under the action of the subsequent steps S140 and S150 to automatically identify the roof upper surface, and the roof upper surface is processed in direction extrusion, topological merging, etc. Finally, a complete and operable slope roof three-dimensional model is obtained.
[0115] This does not require the user to perform three-dimensional operations, but only based on two-dimensional profile input, a highly automated roof modeling process can be realized, the slope construction is directly and automatically completed from the sketch, the modeling efficiency is improved, and it is especially suitable for large-scale model generation in application scenarios such as digital city, BIM system and GIS spatial analysis, and has universal applicability and high expansibility.
[0116] Moreover, this process is controlled by the slope index to splice the faces, so as to finally construct a closed model, effectively avoiding the problems of “missing face” and “floating”, and ensuring the precision and closure of the slope roof model construction.
[0117] Referring to Figure 8 , Figure 8 is generated according to Figure 1 The method flowchart is described by the steps of generating a slope index set associated with the geometric parameters of the effective line segments distributed according to the target roof contour and constructing a closed geometric body by using the slope index set.
[0118] The geometric parameters of the effective line segments associated with the target roof contour are generated to form a slope index set, and the step S130 of constructing a closed geometric body by using the slope index set is provided.
[0119] In step S131, the empty geometric body is initialized by using the target roof contour, and the empty geometric body is used to accommodate the slope surfaces constructed by the target roof contour in segments.
[0120] In step S132, the effective line segments are traversed according to the geometric parameters of the effective line segments associated with the target roof contour, and the slope index set of the slope surfaces adapted to the slope roof is obtained.
[0121] In step S133, the closed geometric body is generated by mapping each slope surface in the slope index set to the empty geometric body.
[0122] The step is described in detail below.
[0123] In step S131, the empty geometric body is an initialized geometric container, and it should be understood that the empty geometric body is an initially created empty model object for embedding the slope surfaces in the subsequent process.
[0124] In step S132, the effective line segments distributed on the target roof contour are the roof edges found, and therefore the effectiveness of the line segments on the target contour line needs to be checked in the process of generating the roof by using the target roof contour. The effective line segments determine which segment of the surface to be constructed subsequently.
[0125] The effectiveness of the line segments on the target roof contour can be achieved by the start point and the end point of the line segment, the length mapped according to the start point and the end point is used to determine the effective line segments distributed on the target roof contour, and the face number calculation is performed for each effective line segment to determine that the effective line segment corresponds to all the surface patches that can be constructed.
[0126] The highest point of the effective line segment is used as the starting point, and the surface patches are traversed in the order of extending from the high edge to the low edge. It is judged whether the traversed surface patch is adapted to the roof structure of the slope roof, so as to filter out the effective slope surface that is lower than the previous effective slope surface, and the effective slope surface becomes the roof surface participating in modeling.
[0127] For example, the corresponding segment attribute is obtained for the effective line segment, such as the number of faces of the current segment and the overhang value, wherein the number of faces of the current segment is calculated, and then the number of all face patches that can be constructed by the current segment is determined; the overhang value is used to remove the overhang influence on the face patch with a slope angle. That is, the number of all face patches that can be constructed by the effective line segment is determined by obtaining the number of faces of the effective line segment, and the slope face index set is initialized for subsequent addition of the face index corresponding to the effective slope face.
[0128] After determining the number of all face patches that can be constructed by the effective line segment, all face patches of the effective line segment are looped and traversed, and the height and slope angle of the looped and traversed face patch are obtained. If the current face patch is determined to be non-slope according to the slope angle, the traversal of the current effective line segment is stopped; if the current face patch is a slope, it is further determined whether the current face patch is down compared to the previous effective slope face. If so, the current face patch is determined to be an effective slope face, and the face index thereof is obtained and added to the slope face index set.
[0129] By analogy, the slope face index set of the adaptive slope roof is obtained by looping and traversing all effective line segments and all face patches that can be constructed by the effective line segments.
[0130] With the construction of the slope face index set, in the execution of step S133, first, the offset processing of the slope face mapped by the slope face index set is performed to lift the effective slope face upward and outward to form the true roof shape, and then the created empty geometry can be precisely embedded to obtain the closed body geometry.
[0131] The offset processing is to calculate the offset amount of each slope face to obtain the three-dimensional offset amount of the slope face in the digital space. The three-dimensional offset amount of the slope face in the digital space indicates the offset of the slope face in the height direction and the slope direction in the digital space, and then the three-dimensional slope of the entire roof is constructed.
[0132] For example, the execution process of the offset amount calculation includes: initializing the offset amount array, then looping and traversing all slope faces in the slope face index set, obtaining the corresponding height and slope angle of the traversed slope face, calculating the three-dimensional offset amount according to the height and slope angle, and the three-dimensional offset amount includes the overhang offset of the eave length along the slope direction and the offset amount in the height direction.
[0133] The calculated three-dimensional offset amount is sequentially written into the offset amount array, and then in the subsequent closed geometry generation, each slope face is constructed according to the offset amount to form the roof, and then the closed geometry is spliced.
[0134] That is, for each three-dimensional offset of the slope surface calculated, the corresponding vertex array and face data array are initialized, wherein the vertex array is used to store the coordinates of the vertices corresponding to the vertices distributed on the slope surface, and the face data array is used to store the vertex index of each slope surface. For each slope surface, the vertex index corresponding to the slope surface can be determined through the face index in the face data array, and the coordinates of each vertex on the slope surface can be obtained in the vertex array through the vertex index, and finally the three-dimensional offset can be combined to accurately embed the slope surface in the empty geometry to construct the roof and generate the closed geometry through the interface.
[0135] To ensure the closure of the generated closed geometry, special surface processing is performed before generating the closed geometry, including but not limited to patching the special slope surface, so that the generated closed geometry is continuous, closed, and structurally reasonable, avoiding mutations or voids.
[0136] For example, if the slope of the starting slope surface is zero, i.e., horizontal, a vertical surface is inserted at the end of the slope surface away from the target roof contour; if a certain slope surface located at the edge of the roof is higher than other slope surfaces located at the edge, a vertical surface is inserted to fill the gap, and no closed gap is left to affect the closure performance of the geometry.
[0137] At this point, the construction of the closed geometry is completed with the target roof contour as the starting point, and the upper surface of the obtained closed geometry is extracted to obtain the upwardly directed face set through the execution of step S140.
[0138] In step S140, the upwardly directed face set in the closed geometry is selected as the roof upper surface. The upwardly directed face set selection process is to determine the face direction of each slope surface in the closed geometry through the spatial normal, and then extract the slope surface with the spatial normal upward as the roof upper surface and include it in the upwardly directed face set.
[0139] The upwardly directed face set truly restores the three-dimensional slope surface structure of the roof, and the obtained layer top surface will be the key basis for subsequent structural merging, thereby ensuring that the ridge line intersects the target roof contour accurately and avoiding geometric discontinuity or floating.
[0140] In one exemplary embodiment, for step S140, the following execution process is involved, namely:
[0141] The position of each vertex in the digital space is calculated and updated through the adjacent faces of each vertex in the closed geometry, and the update means that the calculated new position is applied to the vertex.
[0142] The closed geometry with updated vertex position extracts all upwardly directed face sets to obtain the roof upper surface.
[0143] Specifically, the position calculation and update of the vertex involves smoothing the faces of the closed geometry, and applying the updated vertex position of the smoothing to the vertex to complete the smoothing update of the faces on the closed geometry.
[0144] Specifically, the position calculation and update of the vertex involves smoothing the faces of the closed geometry, and applying the updated vertex position of the smoothing to the vertex to complete the smoothing update of the faces on the closed geometry.
[0145] First, the collection of the relationship between the vertex and the face on the closed geometry is performed by traversing all the slope faces of the closed geometry, recording each vertex and its adjacent face, obtaining the set of adjacent faces of each vertex, and the set of adjacent faces contains all the adjacent faces of the corresponding vertex.
[0146] For each vertex, all adjacent faces are determined via the set of adjacent faces, and then the new position of the vertex is calculated through all the adjacent faces, and the calculated new position is applied to the vertex.
[0147] Thus, the smoothing of the faces in the closed geometry under the vertex normal recalculation and vertex position fine-tuning is completed, and the subsequently constructed roof is smoother and more natural.
[0148] Further, the new position calculation of each vertex includes: 1) if the vertex has three adjacent faces, the intersection of the three adjacent faces is calculated as the new position; 2) if the vertex has two adjacent faces, the intersection line of the two adjacent faces is calculated, and the point closest to the baseline on the intersection line is found as the new position; 3) if the vertex has only one adjacent face, the new position is obtained by offsetting along the normal direction of the adjacent face.
[0149] After the new position is calculated and applied to the vertex, the normals of all slope faces on the closed geometry are removed. It should be understood that the original normal information of the vertex on the closed geometry is inaccurate due to the application of the new position, and needs to be removed and the normal of all slope faces is reconstructed.
[0150] Further, before extracting the roof upper surface, the closed geometry can also be cleaned of garbage faces, and the closed geometry after garbage face cleaning will be used for the extraction of the roof upper surface.
[0151] In the garbage face cleaning, it should be understood that the vertical face is a redundant garbage face, so all the slope faces of the closed geometry are traversed, the vertical face existing in the slope face is identified according to the normal, and is deleted. Specifically, for the traversed slope face, it is checked whether the normal is vertical, if the normal is vertical, the current slope face is marked as to be deleted, and then the marked slope face is deleted after the traversal is completed, and the garbage face cleaning is completed. After the garbage face cleaning is completed, the roof upper surface is extracted from the closed geometry.
[0152] Once the roof surface is extracted, the geometry generation and merging operations on the roof surface can be performed through step S150 to obtain a three-dimensional model of the pitched roof.
[0153] In step S150, the topological surface of the roof is offset to extrude and generate a closed extruded geometry. Then, the extruded geometry is merged together through a merging operation to obtain a three-dimensional model of the pitched roof with thickness in digital space.
[0154] For example, the geometry generation operation is an operation adapted to extrude and generate extruded geometry for different eave styles, such as horizontal eaves, vertical eaves, and other eave styles, which have different extrusion directions.
[0155] Please also see Figure 9 , Figure 9 It is based on Figure 1 The flowchart shown in the corresponding embodiment describes the steps of obtaining a three-dimensional model of a pitched roof by performing geometry generation and merging operations on the upper surface of the roof.
[0156] The step S150 of obtaining a three-dimensional model of a pitched roof by performing geometry generation and merging operations on the upper surface of the roof, as provided in this embodiment of the application, includes:
[0157] Step S151: Traverse the roof surface, calculate the extrusion direction for each roof surface according to the eaves style, and generate the extruded geometry according to the calculated extrusion direction;
[0158] Step S152: Merge all extruded geometries to obtain a 3D model of a pitched roof. The 3D model of a pitched roof is a roof entity with thickness in digital space.
[0159] The following is a detailed explanation of these two steps.
[0160] Each roof surface is processed individually. The process involves calculating the extrusion direction and generating the extrusion geometry according to the obtained extrusion direction.
[0161] In the process of calculating the extrusion direction of each roof surface based on the eaves style, the extrusion direction of the roof surface is determined according to the orientation of the surface, the normal vector, and the eaves style parameters. The resulting extrusion direction can be downward or diagonally outward and downward.
[0162] For example, for a single-slope roof, the extrusion direction is the opposite of the normal direction of the roof's upper surface.
[0163] After calculating the extrusion direction, the roof surface can be used as the base surface to generate an extruded geometry with a solid thickness along the calculated extrusion direction, where the extrusion length can be determined according to the set thickness parameters.
[0164] Thus, by step S151, different styles of roof extrusion structures can be flexibly generated according to the adaptive roof style, and the consistency and rationality of the extrusion direction can be ensured for model construction, avoiding the direction errors or deflection problems caused by manual modeling. Each roof upper surface is independently subjected to extrusion processing, providing controllability and accuracy guarantee for subsequent combination.
[0165] After the extrusion geometry is generated on the roof upper surface, each extrusion geometry is a solid sheet. The merging operation is performed by step S152 to merge all extrusion geometries into a whole closed roof solid model, i.e., a slope roof three-dimensional model.
[0166] In step S152, the merging operation can be a geometric Boolean merging operation to realize the merging process through Boolean operation, so that seamless connection can be realized in this process, and model breakage and overlapping can be avoided.
[0167] Through this exemplary embodiment, the slope roof is realized in the digital space by the roof upper surface extrusion + geometry merging mode, which is convenient for splicing with other constructions in the digital space.
[0168] For example, the implementation of different styles of roof extrusion generation is different, such as Figure 10 As shown in FIG. 8, for a horizontal roof, the roof upper surface is offset in the horizontal direction to generate a horizontal roof; as shown in FIG. 9, for a vertical roof, the roof upper surface is offset in the vertical direction to generate a vertical roof; and as shown in FIG. 10, for a perpendicular roof, the roof upper surface is offset in the perpendicular direction to generate a perpendicular roof. Figure 11 Figure 12
[0169] In one exemplary embodiment, the sketch contour line includes a combination of a main contour and at least one inner contour, so that step S150 further includes:
[0170] The slope roof three-dimensional model is created with a hole according to the inner contour to obtain a slope roof three-dimensional model with a hole.
[0171] After the slope roof three-dimensional model is constructed, if the sketch contour line contains an inner contour (i.e., a closed polygon ring within the main contour), a hole structure will be further created according to the inner contour to adapt to a specific roof style, such as a roof structure with a skylight, a courtyard, a roof platform, or a light well.
[0172] The distribution of the inner contour indicates the position where the hole needs to be opened. The inner contour is projected onto the generated three-dimensional model of the gable roof. The three-dimensional model of the gable roof is determined to obtain a cutting line for performing a local geometric operation. Then, a Boolean subtraction operation is performed on the three-dimensional model of the gable roof according to the cutting line and the projection direction of the inner contour to generate a corresponding hollowed region to obtain a three-dimensional model of the gable roof with a hole.
[0173] Further, the three-dimensional model of the gable roof with a hole is also repaired to construct a structure around the hole to ensure the topological integrity and geometric closure of the model.
[0174] The three-dimensional model of the gable roof with a hole obtained by the Boolean subtraction operation can adapt to automatically process complex interfaces, avoid hanging, insertion and structure breakage.
[0175] Through the implementation of the embodiments of the present application, the model construction system has the contour roof function. Further, only by triggering the contour roof function through the sketch drawing as shown in Figure 13 and the parameter setting of the slope, height and the like as shown in Figure 14 , the three-dimensional model of the gable roof required can be automatically generated.
[0176] Based on this, when the slope value greater than 0 degrees and less than 90 degrees is set, the full gable roof as shown in Figure 15 can be automatically generated.
[0177] Two closed polygon rings containing each other are obtained from the drawn sketch, that is, the maximum ring is the main contour, and the other closed polygon ring is the inner contour, which is used as a hole. Thus, the hole roof as shown in Figure 16 can be generated.
[0178] When the slope is set to 0 degrees, a flat roof is generated, that is, as shown in Figure 17 . When the slope value of a certain edge on the target roof contour is set to 90 degrees, the edge will not generate a slope surface. The generated three-dimensional model of the gable roof is a hipped roof as shown in Figure 18 . Finally, as shown in Figure 19 , when the slope value of a certain edge on the target roof contour is set to 90 degrees, a single-pitched roof can be generated.
[0179] In one exemplary embodiment, the present application also provides a computer device including a memory, a processor and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of the method as described above.
[0180] In one exemplary embodiment, the present application also provides a computer program product including a computer program, wherein the computer program is executed by a processor to implement the steps of the method as described above.
[0181] In an example embodiment, the present application also provides a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the method as described above.
[0182] From the above description of the embodiments, those skilled in the art will readily appreciate that the example embodiments described herein can be implemented by software and / or by hardware combined with software. Accordingly, the technical solution according to the embodiments of the present application can be embodied in the form of a software product. The software product can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash disk, a mobile hard disk, or the like) or on a network, and includes a number of instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to perform the method according to the embodiments of the present application.
[0183] In the example embodiments of the present application, a computer program medium is also provided, which has stored thereon computer readable instructions that, when executed by a processor of a computer, cause the computer to perform the method described in the method embodiment part above.
[0184] According to one embodiment of the present application, a program product for implementing the method in the method embodiment above is also provided, which can be in the form of a portable compact disc read-only memory (CD-ROM) and includes program code and can be run on a terminal device, such as a personal computer. However, the program product of the present application is not limited to this, and in this document, the readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0185] The program product can be in the form of any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium, for example, can be but is not limited to an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples (non-exhaustive list) of the readable storage medium include an electrical connection having one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0186] A computer readable signal medium can include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated signal can take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium can be any computer readable medium that can be involved in
[0187] The code can be transmitted in any form, including, but not limited to, radio frequency, optical, electrical, or the like, or any suitable combination thereof.
[0188] The program code can be implemented in any of a variety of programming languages, including, but not limited to, Java, C++, or the like, and can be executed by one or more of a variety of operating systems. The program code can be executed on a single computer, on a plurality of computers, or on a plurality of computing devices connected by a network. The computing devices can be connected by a network in any form, including, but not limited to, a local area network (LAN) or a wide area network (WAN), or the like, or any suitable combination thereof.
[0189] It should be noted that although various modules or units of the devices for performing actions are referred to in the above detailed description, such division is not mandatory. Indeed, according to embodiments of the present application, features and functionalities of two or more modules or units described above can be embodied in one module or unit. Conversely, features and functionalities of one module or unit described above can be further divided into embodied by multiple modules or units.
[0190] Furthermore, although various steps of the methods of the present application are described in a particular order in the figures, this is not required or implied, nor is it required that all of the illustrated steps be performed to achieve the desired result. Additionally or alternatively, certain steps can be omitted, multiple steps can be combined into a single step, a single step can be broken into multiple steps, and the like.
[0191] Those skilled in the art can easily understand that the example embodiments described herein can be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solutions according to the embodiments of the present application can be embodied in the form of a software product. The software product can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash disk, a mobile hard disk, or the like) or a network, and includes a number of instructions to enable a computing device (which can be a personal computer, a server, a mobile terminal, or a network device, etc.) to perform the methods according to the embodiments of the present application.
[0192] Other embodiments of the present application will be apparent to those skilled in the art from consideration of the specification and practice of the application disclosed herein. It is intended that the present application cover any and all variations of the application that come within the scope of the present application, along with all of the equivalents thereof. It is intended that the specification and examples be considered exemplary only, with the true scope and spirit of the application being indicated by the appended claims.
Claims
1. An automated modeling method for pitched roof buildings in digital space, characterized in that, The method includes: Obtain the sketch outline for constructing a 3D model of a pitched roof in digital space. The sketch outline is used to express the two-dimensional projection shape of the overall outer contour of the pitched roof to be drawn. Identify the main outline that forms a closed region from the sketch outline, and determine the main outline as the target roof outline; A slope index set is generated based on the geometric parameters associated with the valid line segments distributed on the target roof contour. A closed geometry is then constructed using the slope index set. Specifically, this includes: initializing an empty geometry using the target roof contour, which is used to accommodate the slopes constructed segment by segment from the target roof contour; determining the valid line segments distributed on the target roof contour based on the lengths mapped from the start and end points; traversing all facets that can be constructed from the valid line segments based on the geometric parameters associated with them, and obtaining a slope index set that fits the pitched roof among all facets; and generating a closed geometry in the empty geometry using each slope mapped by the slope index set. The roof surface is obtained by extracting the set of faces facing upwards from the closed geometry; The three-dimensional model of the pitched roof is obtained by performing geometry generation and merging operations on the upper surface of the roof. Specifically, the upper surface of the roof is topologically offset to extrude and generate a closed extruded geometry, and then the extruded geometry is merged together through a merging operation to obtain a three-dimensional model of the pitched roof with thickness in digital space.
2. The method according to claim 1, characterized in that, To adapt to the eaves style, the sketch outline includes a main outline, or a combination of a main outline and at least one inner outline.
3. The method according to claim 1, characterized in that, The step of identifying the main contour of the closed region formed by the sketch outline and determining the main contour as the target roof outline includes: Extract at least one closed polygonal loop from the sketch outline; For all extracted closed polygonal rings, the largest ring is identified as the main contour forming the closed region, and the main contour is determined as the target roof contour.
4. The method according to claim 3, characterized in that, The extraction of at least one closed polygonal ring from the sketch outline includes: Construct a set of unsearched line segments for all line segments in the sketch outline; The search is performed iteratively on a polygonal closed loop starting from a line segment in the set of unsearched line segments until the search returns to the starting line segment and at least one closed polygonal loop is obtained. The searched line segment is then removed from the set of unsearched line segments.
5. The method according to claim 3, characterized in that, The step of identifying the largest loop among all extracted closed polygonal loops as the main contour forming the closed region, and determining the main contour as the target roof contour, includes: Traverse all valid closed polygons in the closed polygon rings, determine the valid closed polygons that include other rings besides themselves, obtain the main outline of the closed region with the valid closed polygons as the largest ring, and determine the main outline as the target roof outline.
6. The method according to claim 1, characterized in that, The method of extruding a closed-structure geometry by topologically offsetting the upper surface of the roof includes: Perform a traversal of the roof surface, calculate the extrusion direction for each roof surface based on the eaves style, and generate the extruded geometry according to the calculated extrusion direction.
7. The method according to claim 6, characterized in that, The sketch outline includes a combination of a main outline and at least one inner outline. The process of obtaining a 3D model of the pitched roof by performing geometry generation and merging operations on the roof's upper surface includes: To adapt to the eaves style, create openings on the 3D model of the pitched roof according to the inner contour, and obtain a 3D model of the pitched roof with openings.
8. A computer device, comprising a memory, a processor, and a computer program stored in the memory, characterized in that, The processor executes the computer program to implement the steps of the method according to any one of claims 1-7.
9. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method as described in any one of claims 1-7.
Citation Information
Patent Citations
Method for generating indoor house type 3D data through radar ranging
CN111308495A
Building intelligent three-dimensional mapping method based on multi-source remote sensing data
CN112489212A