A modeling method, device and electronic equipment for a building roof

By receiving and converting two-dimensional outlines into a three-dimensional coordinate system in the map client, and constructing the three-dimensional shape of the eaves, the problem of large downlink traffic in the eaves OBJ model is solved, and the display efficiency of the map software is improved.

CN116310195BActive Publication Date: 2026-06-19ALIBABA (CHINA) CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
ALIBABA (CHINA) CO LTD
Filing Date
2023-02-24
Publication Date
2026-06-19

AI Technical Summary

Technical Problem

In existing technologies, when map software displays buildings, the downlink traffic of the OBJ model of the eaves is large, which affects the display efficiency of the client.

Method used

By receiving the two-dimensional outlines of the floors and eaves from the server, the vertex is split and normals are generated according to the normal direction of the vertices, converted to a three-dimensional coordinate system, the three-dimensional shape of the eaves is constructed, and rendered in the map client.

Benefits of technology

This reduces the downlink traffic from the server to the client, improves the modeling efficiency of the 3D shape of the eaves, and speeds up the rendering and display speed on the client.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116310195B_ABST
    Figure CN116310195B_ABST
Patent Text Reader

Abstract

This specification provides one or more embodiments of a method, apparatus, and electronic device for modeling building eaves. The method includes: receiving a two-dimensional outline of a floor and a two-dimensional outline of an eave from a server; the eave is to be placed on the edge of the floor, and the two-dimensional outline of the eave represents the cross-sectional outline of the eave; splitting the two-dimensional outlines of the floor and the eave according to the normal direction of the vertices to obtain a set of vertices on the two-dimensional outlines, and generating a normal corresponding to each vertex in the vertex set; based on the vertex set corresponding to the floor and the eave and the normal, converting the two-dimensional outline of the eave to a three-dimensional coordinate system to obtain rendering data of the three-dimensional shape of the eave; rendering according to the rendering data, and displaying the three-dimensional shape of the eave on the floor; the floor is rendered based on the two-dimensional outline of the floor. This specification embodiment reduces the downlink traffic sent from the server to the client.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This specification relates to one or more embodiments in the field of map rendering technology, and more particularly to a method, apparatus and electronic device for modeling building eaves. Background Technology

[0002] In addition to providing services such as location display and driving navigation, map software is increasingly striving to offer users a more realistic and detailed map experience. For example, when displaying buildings within a certain geographical area on the map, efforts are being made to display the buildings more realistically, rendering them as vivid three-dimensional shapes.

[0003] In related technologies, for buildings displayed on map software clients, if the building includes eaves, the entire OBJ model of the building is usually sent directly to the client. However, the downlink traffic of this OBJ model is relatively large, affecting the display efficiency on the client side. Summary of the Invention

[0004] In view of this, one or more embodiments of this specification provide a method, apparatus and electronic device for modeling building eaves, so as to improve the modeling efficiency of building eaves.

[0005] To achieve the above objectives, one or more embodiments of this specification provide the following technical solutions:

[0006] According to a first aspect of the embodiments of this specification, a method for modeling the eaves of a building is provided, the method comprising:

[0007] The system receives two-dimensional outlines of the floor and eaves from the server. The eaves are to be set on the edge of the floor, and the two-dimensional outlines of the eaves are used to represent the cross-sectional outline of the eaves.

[0008] Based on the normal direction of the vertices, the two-dimensional contour lines of the floors and eaves are split into vertices to obtain the vertex set on the two-dimensional contour lines, and the normal line corresponding to each vertex in the vertex set is generated.

[0009] Based on the vertex set corresponding to the floor and the eaves and the normal, the two-dimensional outline of the eaves is transformed into a three-dimensional coordinate system to obtain the rendering data of the three-dimensional shape of the eaves;

[0010] The rendering is performed based on the rendering data, and the three-dimensional shape of the eaves is displayed on the floor; the floor is rendered based on the two-dimensional outline of the floor.

[0011] According to a second aspect of the embodiments of this specification, a modeling apparatus for building eaves is provided, the apparatus comprising:

[0012] The data acquisition module is used to receive the two-dimensional outline of the floor and the two-dimensional outline of the eaves sent by the server; the eaves are to be set on the edge of the floor, and the two-dimensional outline of the eaves is used to represent the cross-sectional outline of the eaves.

[0013] The vertex acquisition module is used to split the two-dimensional contour lines of the floors and eaves into vertices according to the normal direction of the vertices, to obtain the vertex set on the two-dimensional contour lines, and to generate the normal corresponding to each vertex in the vertex set.

[0014] The coordinate system transformation module is used to transform the two-dimensional outline of the eaves to a three-dimensional coordinate system based on the vertex set corresponding to the floor and the eaves and the normal, so as to obtain the rendering data of the three-dimensional shape of the eaves;

[0015] The rendering and display module is used to render according to the rendering data and display the three-dimensional shape of the eaves on the floor; the floor is rendered based on the two-dimensional outline of the floor.

[0016] According to a third aspect of the embodiments of this specification, an electronic device is provided, the device comprising:

[0017] processor;

[0018] Memory used to store processor-executable instructions;

[0019] The processor implements the method of any embodiment of this specification by running the executable instructions.

[0020] According to a fourth aspect of the embodiments of this specification, a computer-readable storage medium is provided that stores computer instructions thereon, which, when executed by a processor, implement the methods of any embodiment of this specification.

[0021] The modeling method, apparatus, and electronic device for building eaves in this specification reduce the downlink traffic sent from the server to the client by sending two-dimensional outlines of floors and eaves to the client, and then converting these two-dimensional outlines to a three-dimensional coordinate system on the client side to construct the three-dimensional shape of the eaves. Moreover, this modeling method is simple to implement, which enables the three-dimensional shape of the eaves to be constructed quickly on the client side, thereby accelerating the rendering and display efficiency on the client side. Attached Figure Description

[0022] To more clearly illustrate the technical solutions in one or more embodiments or related technologies of this disclosure, the accompanying drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments recorded in one or more embodiments of this disclosure. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0023] Figure 1 This is a flowchart of a modeling method for the eaves of a building, provided as an exemplary embodiment.

[0024] Figure 2A This is an exemplary embodiment of a modeled roof eaves diagram.

[0025] Figure 2B This is a schematic diagram of a two-dimensional outline of a roof, provided in an exemplary embodiment.

[0026] Figure 2C This is a schematic diagram of a two-dimensional outline of a floor provided in an exemplary embodiment.

[0027] Figure 3 This is a schematic diagram of vertex splitting of a floor outline provided in an exemplary embodiment.

[0028] Figure 4 This is a schematic diagram of vertex splitting of an eaves outline provided in an exemplary embodiment.

[0029] Figure 5 This is a schematic diagram of a rounded corner interpolation provided in an exemplary embodiment.

[0030] Figure 6 This is a schematic diagram of coordinate system rotation provided in an exemplary embodiment.

[0031] Figure 7 This is a schematic diagram illustrating the principle of normal rotation as provided in an exemplary embodiment.

[0032] Figure 8 This is a schematic diagram of a triangular face provided in an exemplary embodiment.

[0033] Figure 9 This is a schematic diagram of a triangle face generation skipping method provided in an exemplary embodiment.

[0034] Figure 10 This is a schematic diagram of the structure of a modeling device for the eaves of a building, provided in an exemplary embodiment.

[0035] Figure 11 This is a schematic diagram of the hardware structure of an electronic device provided in an exemplary embodiment. Detailed Implementation

[0036] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with one or more embodiments of this specification. Rather, they are merely examples of apparatuses and methods consistent with some aspects of one or more embodiments of this specification as detailed in the appended claims.

[0037] It should be noted that the steps of the corresponding methods are not necessarily performed in the order shown and described in this specification in other embodiments. In some other embodiments, the methods may include more or fewer steps than described in this specification. Furthermore, a single step described in this specification may be broken down into multiple steps in other embodiments; and multiple steps described in this specification may be combined into a single step in other embodiments.

[0038] This specification provides a method for modeling the eaves of a building. The eaves of the building can be a geometric shape resembling a railing. The method of this specification can perform three-dimensional modeling of the eaves using vector modeling. Furthermore, this method aims to reduce the amount of downlink traffic to improve the modeling efficiency of the eaves.

[0039] Figure 1 This is a flowchart illustrating a method for modeling the eaves of a building, as provided in an exemplary embodiment. This method can be performed by a client for displaying a three-dimensional building model. In an example scenario, if the three-dimensional building model is a building displayed on a map, the client can be a map software client.

[0040] like Figure 1 As shown, the method may include the following processing:

[0041] In step 100, the server receives the two-dimensional outline of the floor and the two-dimensional outline of the eaves; the eaves are to be set on the edge of the floor, and the two-dimensional outline of the eaves is used to represent the cross-sectional outline of the eaves.

[0042] In this step, the client can receive the two-dimensional outlines of the floors and the two-dimensional outlines of the eaves from the server.

[0043] In this context, it is meant that the two-dimensional outlines of the floors and the eaves can both be sent from the server to the client. However, they can be sent at different times or simultaneously. This embodiment does not impose any restrictions on this.

[0044] For example, when a user requests the display of a specific area on a map through a map software client, the client retrieves the 2D outlines of the building floors and rooftops for that area from the server. Since rooftop outlines are applicable to various building types, the client can store this data locally. When displaying other buildings in the map area, the locally stored rooftop outlines can be used, eliminating the need for the server to re-send them and saving downlink bandwidth.

[0045] For example, in addition to the two-dimensional outlines of the floors and eaves mentioned above, the system can also receive eaves style data from the server, such as eaves width. Following the same principle, the eaves width can be sent out at different times or simultaneously with the two-dimensional outlines of the floors and eaves, without restriction. The same eaves width can also be applied to multiple types of buildings or multiple types of eaves. When the map software client has reusable eaves two-dimensional outlines and widths stored locally, the server only needs to send out the floor's two-dimensional outline, saving downlink bandwidth.

[0046] For example, the buildings to be modeled can be of various types. Different types of buildings can use the same type of eaves or different types of eaves. Similarly, different types of eaves can use the same eave width or different eave widths. In practice, the data required for modeling can be sent to the client according to the actual business settings and needs. As mentioned earlier, reusable data can be stored locally by the client for future use, avoiding repeated sending by the server and saving downlink bandwidth.

[0047] The eaves are to be installed at the edge of the floor. The floor can be the roof or an intermediate floor. For example, some intermediate floors have extended balconies, and the edge of the balcony can also be fitted with a railing-like structure, which is called the eaves.

[0048] For example, please see Figure 2A ,Should Figure 2A This shows a roof that has already been modeled. (Example) Figure 2A As shown, the roof of building 21 is provided with an eave 22, which appears as a three-dimensional, railing-like structure on the roof. In the embodiments of this specification, the construction of this eave will be used as an example to describe the modeling method of the embodiments of this specification. However, it should be understood that this should not be considered a limitation, and the modeling method of the embodiments of this specification can also be applied to the construction of other eaves.

[0049] In this step, the two-dimensional outline of the eaves can be used to represent the cross-sectional outline of the eaves. For example, it could be along... Figure 2AThe cut is made along the cross-sectional direction 23 shown in the figure, resulting in the cross-sectional profile. Figure 2B The diagram illustrates the two-dimensional outline of the eaves. This two-dimensional outline can be a quadrilateral with its four vertices labeled "ABCD". Figure 2C The diagram illustrates the two-dimensional outline of a floor. This outline can also be a quadrilateral with its four vertices labeled "1-2-3-4". That is, to... Figure 2C The edges of the floors shown in the diagram form an eave, the cross-sectional profile of which is as follows: Figure 2B The outline is shown. After obtaining the width of the eaves, you can continue with the subsequent steps of eaves modeling.

[0050] In step 102, based on the normal direction of the vertices, the two-dimensional contour lines of the floors and eaves are split into vertices to obtain the vertex set on the two-dimensional contour lines, and the normal line corresponding to each vertex in the set is generated.

[0051] In this step, the two-dimensional outlines of the floors and the two-dimensional outlines of the eaves are treated in the same way.

[0052] First, describe how the two-dimensional outline of the floor is processed:

[0053] First, remove collinear points from the two-dimensional contour line; collinear points are points that lie on the same line. The remaining points on the two-dimensional contour line can be called "first vertices." For example, Figure 2C The schematic two-dimensional outline of the floor, after removing collinear points, leaves four vertices "1", "2", "3" and "4", which can be called the first vertex.

[0054] Secondly, in the eaves modeling of the embodiments in this specification, "normals" are required. After removing collinear points, for each first vertex, the vertex is split according to the normal generation rules. The resulting vertices can be called second vertices, and each second vertex corresponds to a normal. That is, vertex splitting is based on the normal direction of the vertex, and the aforementioned normal generation rules mean that each vertex corresponds to a normal in one direction. Figure 3 As shown, taking the first vertex "1" as an example, this vertex can be split into two second vertices, namely "1'" and "1"". The normal 31 of vertex "1'" is perpendicular to line "1-2" in the two-dimensional outline of the floor. The normal 32 of vertex "1"" is perpendicular to line "1-3" in the two-dimensional outline of the floor. That is, the split vertices correspond to different normal directions. Similarly, the remaining first vertices "2", "3", and "4" can also be split into two second vertices, which are not illustrated further.

[0055] Then, all the second vertices obtained after splitting can form the vertex set of the two-dimensional outline of the floor.

[0056] Furthermore, it should be noted that the two second vertices obtained by splitting the same first vertex coincide in position coordinates. For example, the two second vertices "1'" and "1" obtained by splitting the first vertex "1" also coincide. This is only for clarity and ease of observation. Figure 3 The middle vertex is displayed as two vertices. The other vertices are split in the same way.

[0057] The treatment of the two-dimensional outline of the eaves is the same as that of the floors mentioned above, and will not be described in detail again. See [link to relevant documentation]. Figure 4 As shown, for example, the first vertex "C" on the two-dimensional outline of the eaves can be divided into two second vertices, "c1" and "c2". The normal 41 of the second vertex "c1" is perpendicular to line "AC" on the two-dimensional outline of the eaves. The normal 42 of the second vertex "c2" is perpendicular to line "CD" on the two-dimensional outline of the eaves. Furthermore, the first vertex "A" on the two-dimensional outline of the eaves can have only one normal, namely normal 43, which is perpendicular to line "AC" on the two-dimensional outline of the eaves. Similarly, the first vertex "B" has normal 44.

[0058] Furthermore, after removing collinear points on the two-dimensional contour line, before splitting each first vertex, rounded corner interpolation can be performed on the first vertices to obtain multiple interpolated first vertices. For example, taking the first vertex "3" of the two-dimensional contour line of a floor as an example: Please refer to... Figure 5 As shown, after rounded corner interpolation, multiple first vertices "51, 52, 53, 54" are obtained, and then each of these first vertices is further subdivided. After rounded corner interpolation, compared to the initial 2D outline of the floor, the first vertex "3" will be smoother and the transition more stable. Whether to perform rounded corner interpolation can be flexibly determined according to actual needs.

[0059] At this point, the two-dimensional outlines of the floors and eaves have been split into vertexes, and the normals of each vertex have been generated.

[0060] In step 104, based on the vertex set corresponding to the floor and the eaves and the normal, the two-dimensional outline of the eaves is transformed into a three-dimensional coordinate system to obtain the rendering data of the three-dimensional shape of the eaves.

[0061] Since the final goal is to construct the three-dimensional shape of the eaves, it is necessary to transform the two-dimensional outline of the eaves into a three-dimensional coordinate system. Furthermore, the three-dimensional shape of the eaves must be constructed at the edge of the floor, that is, along the two-dimensional outline of the floor.

[0062] Specifically, the transformation from a two-dimensional coordinate system to a three-dimensional coordinate system includes both the rotation of vertices and the rotation of normals.

[0063] First, describe the rotation of the vertices:

[0064] 1) Please see Figure 6 As shown, taking the example of not performing rounded corner interpolation, Figure 6 This illustrates a three-dimensional coordinate system of XYZ. For vertex "1" in the two-dimensional outline of the floor (as mentioned before, it has actually been split into two second vertices, but since these two second vertices coincide in position and are both at the location of vertex "1", we will use vertex "1" as an example here. It can be understood that each second vertex is actually processed as described in the following embodiment), obtain the angle bisector vector of the vertex. For example... Figure 6 As shown, the angle bisector corresponding to vertex "1" is the angle bisector formed by the two lines "1-2" (i.e., the straight line connecting vertex 1 and vertex 2) and "1-4".

[0065] 2) Based on the eaves width, determine the projection length of the eaves width onto the angle bisector vector. Here, the eaves width is pre-acquired eaves style data. Figure 6 In the diagram, the width of the eaves is equivalent to the distance from line "1-2", and this distance is inward. This is because the two-dimensional outline of the floor is equivalent to the outermost outline of the floor, which is also the outer side of the eaves. Therefore, the inner side of the eaves can be obtained based on the aforementioned eaves width.

[0066] Combined Figure 6 As shown, the two-dimensional outline of the eaves is rotated according to the angle bisector vector, so that the four vertices "ABCD" of the two-dimensional outline of the eaves originally correspond to... Figure 6 In the figure “1-9”-5-5”, 1-9” lies on the angle bisector corresponding to vertex “1”, and line 5-5” is parallel to the angle bisector. 1-5 represents the height of the eaves. However, if the two-dimensional outline of the eaves corresponds to “1-9”-5-5”, the resulting projection length “_9”-9”” will not match the desired eaves width, being shorter than the intended width. Therefore, the two-dimensional outline of the eaves can be scaled by vertex translation, such as… Figure 6 As shown, 9” is translated to “9” along the angle bisector and 5” is translated to “5”. In this way, the two-dimensional outline of the eaves is expanded along the direction of the angle bisector, corresponding to “1-9-5-5”. This way, the desired eaves width “9-_9” can be obtained.

[0067] The aforementioned “1-9-5-5’” can be called a roof cross-section, which is along the direction of the angle bisector corresponding to vertex “1”. It can be understood that in the preceding steps, the vertices on the two-dimensional outline of the floor have been split. For example, vertex “1” has actually been split into two second vertices, “1’” and “1””. Therefore, when the two-dimensional outline of the eaves is transformed from a two-dimensional coordinate system to a three-dimensional coordinate system, vertex “A” in the two-dimensional outline of the eaves must correspond to the two vertices “1’” and “1”” respectively. That is, the “1-9-5-5’” cross-section actually includes two overlapping roof cross-sections, which correspond to the two vertices “1’” and “1”” respectively.

[0068] Secondly, describe the rotation of the normal:

[0069] The construction of the eaves requires the use of the normals of each vertex.

[0070] In this embodiment, the normals of the vertices of the two-dimensional outline of the eaves can be rotated according to the normals of the vertices of the two-dimensional outline of the floor to obtain the normals of the vertices of the eaves tangent point set.

[0071] Specifically, for example, in Figure 3 In the middle, the normal of the second vertex "1'" obtained after splitting is the line "1-2" perpendicular to the two-dimensional outline of the floor. Combined with... Figure 6 Imagine aligning vertex "A" of the two-dimensional outline of the eaves with the second vertex "1'", and obtaining the eaves section "1-9-5-5'" along the angle bisector. Then, observe the normal; the normal to vertex "A" is originally located at... Figure 6 Rotate the "ABCD" face along the negative X-axis and then along the Z-axis. This will rotate the normal vector as well (for example, by rotating counterclockwise along the Z-axis), so that the normal vector of vertex "A" rotates to the same position as the X-axis. Figure 3 It should be in the same direction as the normal 31 in the middle.

[0072] For example, in Figure 3 In the middle, the normal of the second vertex "1" obtained after splitting is the line "1-3" perpendicular to the two-dimensional outline of the floor. Combined with... Figure 6 Imagine aligning vertex "A" of the two-dimensional outline of the eaves with the second vertex "1", and obtaining the eaves section "1-9-5-5" along the angle bisector. Then, observe the normal; the normal to vertex "A" is originally located at... Figure 6 Rotate the "ABCD" face along the negative X-axis and then along the Z-axis. This will rotate the normal vector as well, causing the normal vector at vertex "A" to rotate to the same position as the X-axis. Figure 3 It should be in the same direction as the normal 32.

[0073] To make it easier to understand, let's go through it again. Figure 7 To illustrate: Taking vertex "1" in the two-dimensional outline of a floor as an example, vertex "1" is split into two second vertices "1'" and "1". These two second vertices have different normals: one is normal 31, and the other is normal 32. When transforming the two-dimensional outline of the eaves "ABCD" from a two-dimensional to a three-dimensional coordinate system, vertex A corresponds to the second vertex "1'". Following the aforementioned method, a cross-section of the eaves along the aforementioned angle bisector is obtained, namely "eaves cross-section-1". The normals of each vertex in "eaves cross-section-1" are consistent with the normals of each vertex in the two-dimensional outline of the eaves "ABCD", except that the normals of each vertex in "ABCD" are rotated so that the normal of vertex "A" is aligned with the direction of normal 31. Similarly, vertex A corresponds to the second vertex "1", resulting in a cross-section of the eaves along the aforementioned angle bisector, namely "eaves cross-section-2", and the normal of vertex "A" is rotated to be consistent with normal 32. It is understandable that the above "eaves section-1" and "eaves section-2" overlap, that is... Figure 6 The eaves section is "1-9-5-5".

[0074] Please combine Figure 6 and Figure 7 As you can see, vertex "1" on the two-dimensional outline of the floor is split into two second vertices "1'" and "1". Each second vertex also corresponds to a roof eaves section, that is... Figure 7 The two "eaves cut surfaces -1" and "eaves cut surfaces -2" shown in the figure also have their respective normals at each vertex. For example, the second vertex "1'" in "eaves cut surface -1" corresponds to normal 31, and the second vertex "1"" in "eaves cut surface -2" corresponds to normal 32. Similarly, each of the other vertices of the eaves cut surface also has its own corresponding normal.

[0075] The above example uses vertex "1" on the two-dimensional outline of a floor. Similarly, it can be understood that vertices "2", "3", and "4" on the two-dimensional outline of the floor can each be processed in a similar way to vertex "1", including the aforementioned vertex splitting, and rotating the two-dimensional outline of the eaves based on the angle bisectors and normals of the split vertices to obtain the respective eaves cross-sections. For example, please refer to... Figure 6 As shown, the eaves cross section “3-3'-8-8’ obtained based on vertex “3” can be understood as two overlapping cross sections. Similarly, the eaves cross section “4-4'-7-7’” based on vertex “4” and the eaves cross section “2-2'-6-6’” based on vertex “2” were also constructed.

[0076] Figure 6 The set of all vertices of the above-mentioned eaves cross-sections constitutes the eaves cross-section point set. The coordinates of each vertex in the eaves cross-section point set, as well as the normal of each vertex, are part of the rendering data of the subsequent three-dimensional shape of the eaves.

[0077] In addition, the rendering data also includes: a set of indexes for triangular faces generated after obtaining the set of eaves sectional points at each vertex of the two-dimensional outline of the floor, wherein each triangular face is composed of the vertices in the set of eaves sectional points. This set of indexes for triangular faces may include vertex identifiers for each vertex included in each triangular face.

[0078] For example, please combine Figure 8 As shown, with Figure 6 Taking a portion of the three-dimensional shape of the eaves as an example, the face "1-2-5-6" can be divided into two triangular faces, "1-5-6" and "1-2-6". The indices for this face are as follows: Assuming vertex 1 is assigned index s1, vertex 5 is assigned index s2, vertex 6 is assigned index s3, and vertex 2 is assigned index s4, then (s1, s2, s3) is the index of the triangular face "1-5-6". Here, s1, s2, and s3 are equivalent to the vertex identifiers of each vertex in the triangular face "1-5-6". Based on this index, the vertices included in the triangular face "1-5-6" can be obtained. Similarly, based on the index (s1, s4, s3), the vertices of the other triangular face "1-2-6" can be obtained. These two triangular faces together constitute the face "1-2-5-6" in the eaves. Then, based on the actual coordinates of each vertex 1, 5, 2, and 6 and their corresponding normals, the face "1-2-5-6" in the eaves can be constructed. Similarly, the indexes of the other faces of the eaves are constructed using the same method.

[0079] In addition, as mentioned earlier, some eaves cross sections overlap, for example, Figure 7 The "Eaves Section-1" and "Eaves Section-2" shown both coincide on the angle bisector of vertex "1". Please refer to... Figure 9 As shown, in the process of generating the index of the triangles formed by the vertices of the roof slab point set, it is necessary to skip overlapping points and not generate triangles there. For example, if triangles are generated for the vertices of "roof slab-1" and "roof slab-2", then the triangle index "1'-1"-5-5" will be generated, but this face "1'-1"-5-5" does not actually exist. Therefore, for some overlapping points, they can be skipped when generating the triangle index, and triangles are not generated for overlapping points.

[0080] In step 106, rendering is performed based on the rendering data to display the three-dimensional shape of the eaves on the floor. The floor is rendered based on the two-dimensional outline of the floor.

[0081] As mentioned above, the rendering data may include: a set of triangular face indices, the coordinates of each vertex in the roof slab point set, and the normals corresponding to these vertices.

[0082] In this step, rendering will be performed based on the aforementioned rendering data. For example, the vertex identifiers of each vertex of a triangle can be obtained from the triangular facet index set, and the corresponding vertex can be found based on these vertex identifiers. Then, based on the coordinates of each vertex and the normals corresponding to each vertex included in the rendering data, each triangle is rendered. These triangles can then be combined to form the three-dimensional shape of the eaves. Specifically, the three-dimensional shape of the eaves can be constructed by rendering based on the coordinates of each vertex and the corresponding normals. The final generated three-dimensional shape of the eaves can be, for example, Figure 2A The eaves shown are 22.

[0083] In addition, the client can render the floor based on the two-dimensional outline of the floor sent by the server, and display the rendered three-dimensional shape of the eaves on the floor according to the aforementioned steps. For example, the floor can be the roof.

[0084] In one example scenario, the construction of eaves can be applied in a map application. Buildings can be rendered and displayed in the map application, and the 3D shape of eaves can be rendered and displayed on the floors of the buildings based on the rendering data. For example, when a user searches for a map area using a map application, the app can display buildings within that area, such as office buildings and parks. For these buildings, eaves can be added to make the display more realistic. Figure 2A The building shown has eaves 22 on its roof.

[0085] The modeling method for building eaves in this specification involves sending two-dimensional outlines of floors and eaves from the server to the client, and then converting these two-dimensional outlines to a three-dimensional coordinate system on the client to construct the three-dimensional shape of the eaves. This reduces the downlink traffic sent from the server to the client, and the modeling method is simple to implement, thereby enabling the rapid construction of the three-dimensional shape of the eaves on the client side and accelerating the rendering and display efficiency on the client side.

[0086] Furthermore, in the modeling method of this embodiment, the eaves width, as a separate eaves style data, can be flexibly configured and easily controlled. For example, if the eaves width needs to be changed, an updated eaves width configuration can be sent from the server, and the 3D shape of the eaves can be constructed locally on the client based on this configured eaves width. Similarly, the client can cache some data required for rendering and displaying buildings and eaves. If no updates are involved, this data can be retrieved from the client for 3D construction each time it is displayed. If updates are required, the updated configuration data is sent from the server, thus keeping the downlink traffic from the server to the client relatively low.

[0087] This specification also provides a modeling device for building eaves, which can be applied to implement the method of any embodiment of this specification. Figure 10 This is an exemplary embodiment of a modeling device for the eaves of a building, such as... Figure 10 As shown, the device may include: a data acquisition module 1001, a vertex acquisition module 1002, a coordinate system transformation module 1003, and a rendering and display module 1004.

[0088] The data acquisition module 1001 is used to receive the two-dimensional outline of the floor and the two-dimensional outline of the eaves sent by the server; the eaves are to be set on the edge of the floor, and the two-dimensional outline of the eaves is used to represent the cross-sectional outline of the eaves.

[0089] The vertex acquisition module 1002 is used to split the two-dimensional contour lines of the floors and eaves into vertices according to the normal direction of the vertices, to obtain the vertex set on the two-dimensional contour lines, and to generate the normal line corresponding to each vertex in the vertex set.

[0090] The coordinate system transformation module 1003 is used to transform the two-dimensional outline of the eaves to a three-dimensional coordinate system based on the vertex set corresponding to the floor and the eaves and the normal, so as to obtain the rendering data of the three-dimensional shape of the eaves.

[0091] The rendering and display module 1004 is used to render according to the rendering data and display the three-dimensional shape of the eaves on the floor; the floor is rendered according to the two-dimensional outline of the floor.

[0092] In some examples, the vertex acquisition module 1002, when performing vertex splitting of the two-dimensional contour lines of the floors and eaves according to the normal direction of the vertices to obtain a vertex set on the two-dimensional contour lines and generating a normal corresponding to each vertex in the vertex set, includes: removing collinear points on the two-dimensional contour lines to obtain multiple first vertices on the two-dimensional contour lines; splitting each first vertex so that each second vertex obtained after splitting corresponds to a normal; and forming a vertex set on the two-dimensional contour lines by combining all the second vertices obtained after splitting.

[0093] In some examples, the vertex acquisition module 1002 is also used to: after removing collinear points on the two-dimensional contour line, and before performing vertex splitting for each first vertex, perform rounded corner interpolation on the first vertex to obtain multiple interpolated first vertices.

[0094] In some examples, the data acquisition module 1001 is also used to receive the eaves width of the eaves sent by the server.

[0095] The coordinate system transformation module 1003, when used to transform the two-dimensional outline of the eaves to a three-dimensional coordinate system based on the vertex set corresponding to the floor and the eaves and the normal, to obtain rendering data of the three-dimensional shape of the eaves, includes: obtaining the angle bisector vector of each vertex in the vertex set of the two-dimensional outline of the floor; determining the projection length of the eaves width on the angle bisector vector based on the eaves width; rotating the two-dimensional outline of the eaves according to the angle bisector vector, and scaling the two-dimensional outline of the eaves by vertex translation according to the projection length, to obtain the set of eaves tangent points on each vertex of the two-dimensional outline of the floor; the rendering data includes the coordinates of each vertex in the set of eaves tangent points.

[0096] In some examples, the coordinate system transformation module 1003, when used to transform the two-dimensional outline of the eaves to a three-dimensional coordinate system based on the vertex set corresponding to the floor and the eaves and the normal, to obtain rendering data of the three-dimensional shape of the eaves, further includes: rotating the normals of each vertex of the two-dimensional outline of the eaves according to the normals of each vertex of the two-dimensional outline of the floor, to obtain the normals of each vertex in the eaves tangent point set; the rendering data also includes: the normals of each vertex in the eaves tangent point set.

[0097] In some examples, the coordinate system transformation module 1003, when transforming the two-dimensional outline of the eaves to a three-dimensional coordinate system based on the vertex set corresponding to the floor and the eaves and the normal, to obtain rendering data of the three-dimensional shape of the eaves, further includes: after obtaining the set of eaves tangent points on each vertex of the two-dimensional outline of the floor, generating an index set of triangular faces formed by each vertex in the eaves tangent point set, wherein the triangular face index set includes: vertex identifiers of each vertex included in each triangular face; the rendering data includes the index set.

[0098] In some examples, the rendering display module 1004, when rendering based on the rendering data and displaying the three-dimensional shape of the eaves on the floor, includes: rendering and displaying the building in a map application; and rendering and displaying the three-dimensional shape of the eaves on the floor of the building based on the rendering data.

[0099] The specific implementation process of the functions and roles of each module in the above device can be found in the implementation process of the corresponding steps in the above method, and will not be repeated here.

[0100] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to in the description of the method embodiments. The device embodiments described above are merely illustrative. The modules described as separate components may or may not be physically separate, and the components shown as modules may or may not be physical modules, that is, they may be located in one place or distributed across multiple network modules. Some or all of the modules can be selected to achieve the purpose of the solution in this specification according to actual needs. Those skilled in the art can understand and implement this without creative effort.

[0101] like Figure 11 As shown, Figure 11 This specification illustrates a hardware structure diagram of an electronic device housing a modeling apparatus for building eaves according to an embodiment of the present specification. The device may include: a processor 1110, a memory 1120, an input / output interface 1130, a communication interface 1140, and a bus 1150. The processor 1110, memory 1120, input / output interface 1130, and communication interface 1140 are internally connected to each other via the bus 1150.

[0102] The processor 1110 can be implemented using a general-purpose CPU (Central Processing Unit), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this specification. The processor implements the above-described methods by running executable instructions.

[0103] The memory 1120 for storing processor-executable instructions can be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 1120 can store the operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 1120.

[0104] Input / output interface 1130 is used to connect input / output modules to realize information input and output. Input / output modules can be configured as components in the device (not shown in the figure) or externally connected to the device to provide corresponding functions. Input devices may include keyboards, mice, touch screens, microphones, various sensors, etc., and output devices may include displays, speakers, vibrators, indicator lights, etc.

[0105] The communication interface 1140 is used to connect a communication module (not shown in the figure) to enable communication between this device and other devices. The communication module can communicate via wired means (such as USB, Ethernet cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.).

[0106] Bus 1150 includes a pathway for transmitting information between various components of the device, such as processor 1110, memory 1120, input / output interface 1130, and communication interface 1140.

[0107] It should be noted that although the above-described device only shows the processor 1110, memory 1120, input / output interface 1130, communication interface 1140, and bus 1150, in specific implementations, the device may also include other components necessary for normal operation. Furthermore, those skilled in the art will understand that the above-described device may only include the components necessary for implementing the embodiments of this specification, and not necessarily all the components shown in the figures.

[0108] For example, the aforementioned electronic devices may be mobile phones, computers, or other similar devices. In one example, a map software client may be installed on these devices. When a user uses the map software client to view an electronic map, the rendering of buildings on the map can be generated by modeling the eaves of the buildings using the methods described in the embodiments of this specification.

[0109] This specification also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described method for modeling building eaves.

[0110] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0111] This specification also provides a computer program that, when run, is used to implement the above-described method for modeling building eaves.

[0112] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0113] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.

[0114] The user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of the relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation entry points are provided for users to choose to authorize or refuse.

[0115] The above description is merely a preferred embodiment of one or more embodiments of this specification and is not intended to limit the scope of one or more embodiments of this specification. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of one or more embodiments of this specification should be included within the protection scope of one or more embodiments of this specification.

Claims

1. A method of modeling a building roof, characterized by, The method includes: The system receives two-dimensional outlines of the floor and eaves from the server. The eaves are to be set on the edge of the floor, and the two-dimensional outlines of the eaves are used to represent the cross-sectional outline of the eaves. Based on the normal direction of the vertices, the two-dimensional outline of the floor and the two-dimensional outline of the eaves are split into vertices to obtain the vertex set on the two-dimensional outline, and the normal corresponding to each vertex in the vertex set is generated. Based on the vertex set corresponding to the floor and the eaves and the normal, the two-dimensional outline of the eaves is transformed into a three-dimensional coordinate system to obtain the rendering data of the three-dimensional shape of the eaves; The rendering is performed based on the rendering data, and the three-dimensional shape of the eaves is displayed on the floor; the floor is rendered based on the two-dimensional outline of the floor.

2. The method of claim 1, wherein, The process involves splitting the two-dimensional contour lines of the floor and the eaves into vertex sets based on the normal direction of the vertices, and generating the normal for each vertex in the vertex set, including: Remove collinear points on the two-dimensional contour line to obtain multiple first vertices on the two-dimensional contour line; For each first vertex, perform vertex splitting, such that each second vertex obtained after the split corresponds to a normal. All the second vertices obtained after splitting are used to form the vertex set on the two-dimensional contour line.

3. The method of claim 2, wherein, The method further includes: After removing collinear points on the two-dimensional contour line, before splitting each first vertex, rounded corner interpolation is performed on the first vertex to obtain multiple interpolated first vertices.

4. The method according to claim 1, characterized in that, The method further includes: receiving the eaves width of the eaves sent by the server; The process of transforming the two-dimensional outline of the eaves into a three-dimensional coordinate system based on the vertex set corresponding to the floor and the eaves and the normal, to obtain the rendering data of the three-dimensional shape of the eaves, includes: For each vertex in the vertex set of the two-dimensional outline of the floor, obtain the angle bisector vector of the vertex; Based on the width of the eaves, determine the projection length of the eaves width onto the angle bisector vector; Rotate the two-dimensional outline of the eaves according to the angle bisector vector, and scale the two-dimensional outline of the eaves by vertex translation according to the projection length to obtain the set of eaves tangent points at each vertex of the two-dimensional outline of the floor. The rendering data includes the coordinates of each vertex in the set of points on the roof's cross section.

5. The method of claim 4, wherein, The process of converting the two-dimensional outline of the eaves to a three-dimensional coordinate system based on the vertex set and normals corresponding to the floors and eaves to obtain rendering data of the three-dimensional shape of the eaves also includes: By rotating the normals of the vertices of the two-dimensional outline of the floor, we obtain the normals of the vertices of the two-dimensional outline of the eaves. The rendering data also includes the normals of each vertex in the set of points on the eaves section.

6. The method according to claim 5, characterized in that, The process of converting the two-dimensional outline of the eaves to a three-dimensional coordinate system based on the vertex set and normals corresponding to the floors and eaves to obtain rendering data of the three-dimensional shape of the eaves also includes: After obtaining the set of eaves tangent points at each vertex of the two-dimensional outline of the floor, an index set of triangular faces formed by each vertex in the set of eaves tangent points is generated. The triangular face index set includes: vertex identifiers of each vertex included in each triangular face. The rendering data includes the index set.

7. The method of claim 1, wherein, The step of rendering based on the rendering data and displaying the three-dimensional shape of the eaves on the floor includes: Render and display buildings in map applications; On the floors of the building, the three-dimensional shape of the eaves is rendered and displayed based on the rendering data.

8. A device for modeling a building roof, characterized in that The device includes: The data acquisition module is used to receive the two-dimensional outline of the floor and the two-dimensional outline of the eaves sent by the server; the eaves are to be set on the edge of the floor, and the two-dimensional outline of the eaves is used to represent the cross-sectional outline of the eaves. The vertex acquisition module is used to split the two-dimensional contour lines of the floor and the eaves into vertices according to the normal direction of the vertices, to obtain the vertex set on the two-dimensional contour lines, and to generate the normal corresponding to each vertex in the vertex set. The coordinate system transformation module is used to transform the two-dimensional outline of the eaves to a three-dimensional coordinate system based on the vertex set corresponding to the floor and the eaves and the normal, so as to obtain the rendering data of the three-dimensional shape of the eaves; The rendering and display module is used to render according to the rendering data and display the three-dimensional shape of the eaves on the floor; the floor is rendered based on the two-dimensional outline of the floor.

9. An electronic device, comprising: include: processor; Memory used to store processor-executable instructions; The processor implements the method as described in any one of claims 1-7 by executing the executable instructions.

10. A computer-readable storage medium storing computer instructions thereon, characterized in that, When executed by the processor, this instruction implements the steps of the method as described in any one of claims 1-7.