Method for generating GLTF based on three-dimensional building component coordinate information

Directly generate GLTF files through automated processing processes, solving the problems of low manual modeling efficiency and complex data conversion in the generation of coordinate information of three-dimensional building components, and achieving efficient and accurate modeling processes, meeting customized needs and improving rendering performance , solves the problem of difficulty in model integration and optimization in the prior art.

CN119006710AInactive Publication Date: 2024-11-22BEIJING YINTAIJIAN PRESTRESSING ENG
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411075414.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-07
Publication Date
2024-11-22
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing technology has problems such as low manual modeling efficiency, complex data conversion, lack of automated generation tools, difficult to meet customized requirements and model optimization difficulties in generating GLTF models directly through three-dimensional building component coordinate information, which affects the accuracy and integrity of the model. and rendering performance.

Method used

Through automated processing processes, from obtaining three-dimensional coordinate data to generating GLTF files, an efficient, accurate and consistent modeling process is achieved, directly generating GLTF files, reducing data conversion steps, providing flexible customization capabilities, and integrating and optimizing models is carried out. .

Benefits of technology

It significantly improves modeling efficiency and speed, reduces labor and time costs, ensures the integrity and rendering performance of model data, meets the personalized needs of different projects, and improves architectural design and evaluation capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119006710A_ABST
    Figure CN119006710A_ABST
Patent Text Reader

Abstract

The invention discloses a method for generating a GLTF based on coordinate information of three-dimensional building components, and the method comprises the following steps: S1, obtaining three-dimensional coordinate data of a building, including coordinate information of walls, columns, column caps, beams and floors; s2, generating a 3D building model according to the coordinate information of the wall component; s3, generating a 3D building model according to the coordinate information of the column component; s4, generating a 3D building model according to the coordinate information of the column cap component; s5, generating a 3D building model according to the coordinate information of the beam component; s6, generating a 3D building model according to the information coordinates of the floor components; s7, summarizing component node information generated in the steps S2-S6 to form a complete three-dimensional model of the building, generating a GLTF file containing all components, and integrating and optimizing the model; and S8, the generated GLTF file is verified, and the final GLTF file is generated and stored. According to the method, through an automatic processing flow, an efficient and accurate modeling process is realized from acquisition of the three-dimensional coordinate data to generation of the 3D building model to generation of the GLTF file.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of three-dimensional modeling, and in particular to a method for generating GLTF based on coordinate information of three-dimensional building components. Background Art

[0002] With the rapid development of information technology, 3D modeling technology has been widely used in the fields of architecture, engineering and construction (AEC). 3D building models can not only realistically and intuitively display the structure and appearance of buildings, but also provide effective data support for design, construction and operation. At present, the mainstream 3D modeling formats include BIM (Building Information Model), IFC (Industrial Foundation Classes) and GLTF (Graphics Language Transmission Format). Among them, the GLTF format has gradually become a popular choice for 3D model display due to its lightweight, efficient transmission and good visualization effect on the Web.

[0003] GLTF (GL Transmission Format) is an open standard format managed by the Khronos Group for efficient transmission and loading of 3D models. Compared with traditional 3D modeling formats, GLTF has the advantages of small file size, fast loading speed, and good compatibility. It describes the geometry, material, animation and other information of the 3D scene in JSON format, and stores the actual data in a binary buffer, making it easier and more efficient to render 3D models on the Web.

[0004] Although the GLTF format has significant advantages in displaying 3D models, the existing technology still has many shortcomings and challenges in directly generating GLTF models from the coordinate information of 3D building components:

[0005] 1. Inefficient manual modeling: Traditional 3D modeling usually relies on manual drawing by professional modelers, which is not only time-consuming and labor-intensive, but also prone to human errors, affecting the accuracy and consistency of the model. Especially when dealing with complex building structures, the workload and difficulty of manual modeling increase exponentially.

[0006] 2. Complex data conversion: In the existing technology, the generation of 3D building models usually requires multiple data format conversions. For example, from CAD format to BIM format, and then from BIM format to GLTF format. Each conversion will cause data loss, format incompatibility and other problems, affecting the integrity and visualization of the model.

[0007] 3. Lack of automated generation tools: Although there are some 3D modeling software on the market that support GLTF format output, most of these tools are single-function and lack automated processing capabilities, making it difficult to meet the needs of large-scale building model generation. In addition, existing tools often show performance bottlenecks and functional limitations when processing complex building models with multiple levels and components, and cannot effectively support real-time updates and dynamic displays.

[0008] 4. Difficulty in meeting customized needs: The design and construction of construction projects often need to be customized according to specific needs, but existing 3D modeling tools usually lack flexibility and scalability and are difficult to adapt to the personalized needs of different projects. For example, different projects have different requirements for the size, material, and location of components such as walls, columns, beams, and floor slabs, and existing tools are difficult to provide refined customization services.

[0009] 5. Difficulty in model optimization and integration: When generating a 3D model of a building, the models of each component need to be integrated and optimized to ensure the integrity and rendering efficiency of the model. Existing technologies lack effective solutions for model integration and optimization, resulting in poor rendering performance of the generated 3D model on the Web, affecting user experience.

[0010] Therefore, how to provide a method for generating GLTF based on three-dimensional building component coordinate information is a problem that technicians in this field need to solve urgently. Summary of the invention

[0011] One purpose of the present invention is to propose a method for generating GLTF based on three-dimensional building component coordinate information. The present invention realizes an efficient, accurate and consistent modeling process through an automated processing flow, from obtaining three-dimensional coordinate data to generating a 3D building model, and then to generating a GLTF file, which greatly reduces manpower and time costs, improves the efficient rendering and user experience of the Web side, and enhances the architectural design and evaluation capabilities.

[0012] A method for generating a GLTF based on three-dimensional building component coordinate information according to an embodiment of the present invention includes the following steps:

[0013] S1. Obtain the three-dimensional coordinate data of the building, including the coordinate information of walls, columns, column caps, beams and floor slabs;

[0014] S2, generating a 3D building model according to the coordinate information of the wall components;

[0015] S3, generating a 3D building model according to the column component coordinate information;

[0016] S4, generating a 3D building model according to the column cap component coordinate information;

[0017] S5. Generate a 3D building model according to the coordinate information of the beam component;

[0018] S6. Generate a 3D building model according to the coordinates of the floor component information;

[0019] S7, aggregate the component node information generated by S2-S6 to form a complete three-dimensional model of the building, generate a GLTF file containing all components, and integrate and optimize the model;

[0020] S8. Verify the generated GLTF file to ensure the correct file structure, data integrity, and visualization effect of the 3D model on the Web, and complete the generation and saving of the final GLTF file.

[0021] Optionally, the S2 specifically includes:

[0022] S21. Obtain basic information of the wall component, including wall thickness T, wall ID, wall name, floor ID where the wall is located, wall type ID, start coordinates (X1, Y1, Z1) and end coordinates (X2, Y2, Z2) of the wall;

[0023] S22. Calculate the length L of the wall according to the starting coordinates and the ending coordinates of the wall. The calculation formula is:

[0024]

[0025] Where L is the length of the wall, (X1, Y1) is the starting coordinate, and (X2, Y2) is the ending coordinate;

[0026] S23, determining the two-dimensional coordinates of the two end points of the wall, expanding the width direction of the wall according to the wall thickness T, and generating the two-dimensional coordinates of the four vertices of the wall;

[0027] S24. Obtain the coordinate information of the floor where the wall is located in the Z direction, and determine the height range H of the wall in the Z direction according to the floor ID where the wall is located. The height range H of the wall is calculated by the following formula:

[0028] H = Z2-Z1;

[0029] Where H is the height of the wall, Z1 is the Z value of the starting coordinate of the wall, and Z2 is the Z value of the ending coordinate of the wall;

[0030] S25, expanding the four vertex coordinates of the wall into eight vertex coordinates in the Z direction, determining the vertex coordinates and normal vector information of the six faces of the wall, and generating a three-dimensional model of the wall;

[0031] S26, splitting the six faces into multiple triangular face patches, and defining vertex coordinates and normal vectors for each triangular face patch;

[0032] S27, specifying a material reference of the wall, the material reference including color, texture and lighting properties, and being associated with material data in the material library through a material ID;

[0033] S28. Generate node information of the wall, the node information includes position, rotation and scaling transformation matrix; the position coordinate is defined as:

[0034] P = (X1, Y1, Z1);

[0035] The rotation matrix is ​​used to describe the rotation of the wall in three-dimensional space. Assuming that the rotation angle around the Z axis is θ, the rotation matrix is:

[0036]

[0037] Where θ is the rotation angle;

[0038] The rotation matrix is ​​used to describe the scaling of the wall in three-dimensional space. Assume that the scaling factors in the X, Y, and Z directions are s respectively. x 、s y and z , then the scaling matrix is:

[0039]

[0040] Among them, s x Indicates the scaling factor in the X direction, s y Indicates the scaling factor in the Y direction, s z Indicates the scaling factor in the Z direction.

[0041] Optionally, the S3 specifically includes:

[0042] S31. Obtain basic information of the column component, including column cross-sectional dimensions (B×H), column ID, column name, column floor ID, and column location coordinates;

[0043] S32, determining the center position of the column according to the positioning coordinates of the column, the positioning coordinates are composed of (X, Y, Z) three-dimensional coordinates, where X and Y are the plane coordinates of the column, and Z is the height information of the column;

[0044] S33, determining the plane position coordinates of the column according to the column cross-sectional dimensions (B×H), where B is the width of the column and H is the height of the column;

[0045] S34, obtaining the floor information of the column, and determining the Z-direction coordinate of the column, where the Z-direction coordinate is the height of the floor where the column is located;

[0046] S35, calculating the three-dimensional coordinate information of the six faces of the column, including the vertex coordinates and normal vectors of the top face, bottom face, front face, back face, left face and right face;

[0047] S36, defining mesh data of the cylinder, including vertex index, normal vector index and material index, wherein the vertex index is used to define the order of vertices on each face, the normal vector index is used to define the normal vector direction of the vertex, and the material index is used to specify the material information of each face;

[0048] S37, specifying a material reference of the column, the material reference including the color, texture and reflectivity information of the column, the color and texture are used to define the appearance of the column, and the reflectivity is used to define the lighting effect;

[0049] S38. Generate the node information of the column, including the node name, position, rotation, scale and sub-node information. The node name is the ID of the column, the position is the center position coordinate of the column, the rotation is the rotation angle of the column, the scale is the scale ratio of the column, and the sub-node information is the information of each face of the column.

[0050] Optionally, the S4 specifically includes:

[0051] S41, obtaining basic information of the column cap component, including column cap size definition, column cap ID, column cap name, column cap corresponding column ID, and column cap positioning coordinates;

[0052] S42, locate the center coordinates of the column according to the column ID corresponding to the column cap, and determine the center point coordinates P of the column cap c (x c ,y c ,z c );

[0053] S43, determining the three-dimensional coordinate information of the column cap according to the column cap size definition, where the column cap size definition includes the horizontal coordinates of C1, C2, C3, C4, C5, C6, C7, and C8 and the first-order column cap height H1 and the second-order column cap height H2;

[0054] S44, calculate the three-dimensional coordinate information of the ten faces of the column cap, including the vertex coordinates and normal vector of each face, the vertex coordinates V i (x i ,y i ,z i ) is determined by the following formula:

[0055]

[0056] Among them, C ix and C iy Respectively represent the offset of the i-th vertex on the horizontal plane;

[0057] S45, defining mesh data of each face of the column cap, wherein the mesh data includes vertex indexes and vertex coordinates;

[0058] S46, defining a material reference for each face of the column cap, wherein the material reference includes a material name and material attributes;

[0059] S47, generating node information of the column cap, the node information includes node name, node index, node transformation matrix, mesh index and material index, the node transformation matrix is ​​represented by a 4x4 matrix, which is used to describe the position and posture of the column cap in three-dimensional space, and the matrix form is:

[0060]

[0061] Among them, m ij Represents the element in the i-th row and j-th column of the matrix, which is specifically defined as:

[0062]

[0063] Optionally, the S5 specifically includes:

[0064] S51, obtaining basic information of the beam component, including the cross-sectional width b of the beam, the longitudinal height h of the beam, the beam ID, the beam name, the beam end 1 positioning coordinates (x1, y1, z1) and the beam end 2 positioning coordinates (x2, y2, z2);

[0065] S52, determine the length of the beam according to the beam end 1 positioning coordinates and the beam end 2 positioning coordinates. The beam length calculation formula is:

[0066]

[0067] S53, determine the plane position coordinate information of the beam according to the cross-sectional transverse width b and the longitudinal height h of the beam. The cross-sectional width b and the longitudinal height h of the beam are used to calculate the coordinates of the four corner points of the beam, which are:

[0068]

[0069] S54, calculating the three-dimensional coordinate information of the six faces of the beam according to the plane position coordinates and the Z direction coordinates of the beam, including the vertex coordinates and the normal vector of each face; the six faces are: top face, bottom face, left face, right face, front side face and rear side face;

[0070] S55. Define the mesh data of each face of the beam. The mesh data includes information about vertices, edges, and faces, and determines the material reference of each face. The mesh data is represented by triangular face patches, each face patch is defined by three vertices, and the connection between vertices represents an edge, and multiple edges form a face. The mesh data is calculated as follows:

[0071] Mesh vertex coordinates = {(x i ,y i ,z i )};

[0072] edge_connection = {(i,j)};

[0073] FaceConnect = {(i,j,k)};

[0074] Among them, i, j, k are vertex indices;

[0075] S56. Generate node information of the beam, including: node ID, node name, node location information, node geometry information and node material information.

[0076] Optionally, the S6 specifically includes:

[0077] S61, obtaining basic information of the floor component, including the floor ID, the natural layer ID where the floor is located, the XY coordinates of the floor corner point 1, the XY coordinates of the floor corner point 2, and the floor thickness H;

[0078] S62. Determine the length L and width W of the floor slab according to the XY coordinates (X1, Y1) of the floor slab corner point 1 and the XY coordinates (X2, Y2) of the floor slab corner point 2. The calculation formula of the floor slab length L is:

[0079]

[0080] The floor width W is the lateral distance between floor corner point 1 and floor corner point 2;

[0081] S63. Determine the Z-direction coordinate information of the floor according to the ID of the natural layer where the floor is located. The Z-direction coordinate is the height Z0 of the natural layer where the floor is located plus the floor thickness H. The Z-direction coordinate Z1 of the top surface of the floor is:

[0082] Z1=Z0+H;

[0083] The Z-direction coordinate Z2 of the bottom surface of the floor is:

[0084] Z2=Z0;

[0085] S64, calculating the three-dimensional coordinate information of the six faces of the floor slab, including the vertex coordinates and normal vector of each face;

[0086] S65, defining mesh data of the floor slab, including vertex data, face data and material reference; the vertex data includes the three-dimensional coordinates of each vertex of the top and bottom surfaces of the floor slab, the face data includes six faces of the floor slab, each face is defined by four vertices, and the material reference is used to specify the material properties of the floor slab;

[0087] S66. Generate node information of the floor, wherein the node information includes the position, rotation and scaling information of the floor, and write the information into a GLTF file.

[0088] The beneficial effects of the present invention are:

[0089] (1) Automation and efficiency: The present invention achieves high automation in the entire process from acquiring three-dimensional coordinate data to generating a 3D building model and then generating a GLTF file through an automated processing flow. Compared with the traditional manual modeling method, the modeling efficiency and speed are significantly improved, and the complexity and time cost of manual participation are reduced.

[0090] (2) Reduce data conversion links: The present invention directly generates GLTF files based on 3D coordinate information, reducing the complexity and data loss caused by multiple data format conversions in traditional methods. By simplifying the data processing process, the integrity and consistency of the model data are ensured, and work efficiency is improved.

[0091] (3) Flexible customization capability: The method of the present invention can perform refined modeling of components such as walls, columns, column caps, beams, and floor slabs according to the needs of different construction projects. Through flexible parameter settings, the personalized needs of different projects are met, and the scalability and adaptability of model generation are enhanced.

[0092] (4) Model integration and optimization: After generating the 3D models of each component, the present invention aggregates the node information of these components to form a complete 3D model of the building, and integrates and optimizes the model. This process ensures that the generated GLTF file has a correct structure and complete data, improves the rendering efficiency and performance of the model, and makes its visualization effect on the Web side more outstanding.

[0093] (5) Reduce costs and resource consumption: Since the present invention greatly reduces manual operations and complex format conversion steps, it reduces the reliance on professional modelers, thereby reducing labor costs and time costs. At the same time, through the automatic generation of 3D model technology, the resource consumption required in the architectural design and display process is reduced, and the overall economic benefits are improved.

[0094] (6) Enhanced design and evaluation capabilities: The high-precision 3D building model generated by the present invention can provide valuable reference for engineers and designers in the early stages of building design. Through visual display, users can more intuitively evaluate design solutions and building effects, timely discover and solve potential problems, optimize the design process, and improve design quality. BRIEF DESCRIPTION OF THE DRAWINGS

[0095] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings:

[0096] Figure 1A flowchart of three-dimensional model generation of a method for generating GLTF based on three-dimensional building component coordinate information proposed by the present invention;

[0097] Figure 2 A flowchart of a three-dimensional model component composition of a method for generating GLTF based on three-dimensional building component coordinate information proposed by the present invention;

[0098] Figure 3 A schematic diagram of a three-dimensional wall model plane according to a method for generating GLTF based on three-dimensional building component coordinate information proposed by the present invention;

[0099] Figure 4 A schematic diagram of a three-dimensional column model plane according to a method for generating GLTF based on three-dimensional building component coordinate information proposed by the present invention;

[0100] Figure 5 A schematic diagram of a three-dimensional model of a column cap according to a method for generating GLTF based on three-dimensional building component coordinate information proposed by the present invention;

[0101] Figure 6 It is a partially enlarged plan view of a three-dimensional model of a column cap according to a method for generating GLTF based on three-dimensional building component coordinate information proposed by the present invention;

[0102] Figure 7 A schematic diagram of a beam three-dimensional model plane according to a method for generating GLTF based on three-dimensional building component coordinate information proposed by the present invention;

[0103] Figure 8 A schematic plan view of a three-dimensional model of a floor slab according to a method for generating GLTF based on three-dimensional building component coordinate information proposed in the present invention. DETAILED DESCRIPTION

[0104] The present invention will now be described in further detail with reference to the accompanying drawings. These drawings are simplified schematic diagrams, which only illustrate the basic structure of the present invention in a schematic manner, and therefore only show the components related to the present invention.

[0105] refer to Figure 1-8 , a method for generating GLTF based on three-dimensional building component coordinate information, comprising the following steps:

[0106] S1. Obtain the three-dimensional coordinate data of the building, including the coordinate information of walls, columns, column caps, beams and floor slabs;

[0107] S2, generating a 3D building model according to the coordinate information of the wall components;

[0108] S3, generating a 3D building model according to the column component coordinate information;

[0109] S4, generating a 3D building model according to the column cap component coordinate information;

[0110] S5. Generate a 3D building model according to the coordinate information of the beam component;

[0111] S6. Generate a 3D building model according to the coordinates of the floor component information;

[0112] S7, aggregate the component node information generated by S2-S6 to form a complete three-dimensional model of the building, generate a GLTF file containing all components, and integrate and optimize the model;

[0113] S8. Verify the generated GLTF file to ensure the correct file structure, data integrity, and visualization effect of the 3D model on the Web, and complete the generation and saving of the final GLTF file.

[0114] In this implementation, S2 specifically includes:

[0115] S21. Obtain basic information of the wall component, including wall thickness T, wall ID, wall name, floor ID where the wall is located, wall type ID, start coordinates (X1, Y1, Z1) and end coordinates (X2, Y2, Z2) of the wall;

[0116] S22. Calculate the length L of the wall according to the starting coordinates and the ending coordinates of the wall. The calculation formula is:

[0117]

[0118] Where L is the length of the wall, (X1, Y1) is the starting coordinate, and (X2, Y2) is the ending coordinate;

[0119] S23, determining the two-dimensional coordinates of the two end points of the wall, expanding the width direction of the wall according to the wall thickness T, and generating the two-dimensional coordinates of the four vertices of the wall;

[0120] S24. Obtain the coordinate information of the floor where the wall is located in the Z direction, and determine the height range H of the wall in the Z direction according to the floor ID where the wall is located. The height range H of the wall is calculated by the following formula:

[0121] H = Z2-Z1;

[0122] Where H is the height of the wall, Z1 is the Z value of the starting coordinate of the wall, and Z2 is the Z value of the ending coordinate of the wall;

[0123] S25, expanding the four vertex coordinates of the wall into eight vertex coordinates in the Z direction, determining the vertex coordinates and normal vector information of the six faces of the wall, and generating a three-dimensional model of the wall;

[0124] S26, splitting the six faces into multiple triangular face patches, and defining vertex coordinates and normal vectors for each triangular face patch;

[0125] S27, specifying a material reference of the wall, the material reference including color, texture and lighting properties, and being associated with material data in the material library through a material ID;

[0126] S28. Generate node information of the wall, the node information includes position, rotation and scaling transformation matrix; the position coordinate is defined as:

[0127] P = (X1, Y1, Z1);

[0128] The rotation matrix is ​​used to describe the rotation of the wall in three-dimensional space. Assuming that the rotation angle around the Z axis is θ, the rotation matrix is:

[0129]

[0130] Where θ is the rotation angle;

[0131] The rotation matrix is ​​used to describe the scaling of the wall in three-dimensional space. Assume that the scaling factors in the X, Y, and Z directions are s respectively. x 、s y and z , then the scaling matrix is:

[0132]

[0133] Among them, s x Indicates the scaling factor in the X direction, s y Indicates the scaling factor in the Y direction, s z Indicates the scaling factor in the Z direction.

[0134] In this implementation, S3 specifically includes:

[0135] S31. Obtain basic information of the column component, including column cross-sectional dimensions (B×H), column ID, column name, column floor ID, and column location coordinates;

[0136] S32, determining the center position of the column according to the positioning coordinates of the column, the positioning coordinates are composed of (X, Y, Z) three-dimensional coordinates, where X and Y are the plane coordinates of the column, and Z is the height information of the column;

[0137] S33, determining the plane position coordinates of the column according to the column cross-sectional dimensions (B×H), where B is the width of the column and H is the height of the column;

[0138] S34, obtaining the floor information of the column, and determining the Z-direction coordinate of the column, where the Z-direction coordinate is the height of the floor where the column is located;

[0139] S35, calculating the three-dimensional coordinate information of the six faces of the column, including the vertex coordinates and normal vectors of the top face, bottom face, front face, back face, left face and right face;

[0140] S36, defining mesh data of the cylinder, including vertex index, normal vector index and material index, wherein the vertex index is used to define the order of vertices on each face, the normal vector index is used to define the normal vector direction of the vertex, and the material index is used to specify the material information of each face;

[0141] S37, specifying a material reference of the column, the material reference including the color, texture and reflectivity information of the column, the color and texture are used to define the appearance of the column, and the reflectivity is used to define the lighting effect;

[0142] S38. Generate the node information of the column, including the node name, position, rotation, scale and sub-node information. The node name is the ID of the column, the position is the center position coordinate of the column, the rotation is the rotation angle of the column, the scale is the scale ratio of the column, and the sub-node information is the information of each face of the column.

[0143] In this implementation, S4 specifically includes:

[0144] S41, obtaining basic information of the column cap component, including column cap size definition, column cap ID, column cap name, column cap corresponding column ID, and column cap positioning coordinates;

[0145] S42, locate the center coordinates of the column according to the column ID corresponding to the column cap, and determine the center point coordinates P of the column cap c (x c ,y c ,z c );

[0146] S43, determining the three-dimensional coordinate information of the column cap according to the column cap size definition, where the column cap size definition includes the horizontal coordinates of C1, C2, C3, C4, C5, C6, C7, and C8 and the first-order column cap height H1 and the second-order column cap height H2;

[0147] S44, calculate the three-dimensional coordinate information of the ten faces of the column cap, including the vertex coordinates and normal vector of each face, the vertex coordinates V i (x i ,y i ,z i ) is determined by the following formula:

[0148]

[0149] Among them, C ix and C iy Respectively represent the offset of the i-th vertex on the horizontal plane;

[0150] S45, defining mesh data of each face of the column cap, wherein the mesh data includes vertex indexes and vertex coordinates;

[0151] S46, defining a material reference for each face of the column cap, wherein the material reference includes a material name and material attributes;

[0152] S47, generating node information of the column cap, the node information includes node name, node index, node transformation matrix, mesh index and material index, the node transformation matrix is ​​represented by a 4x4 matrix, which is used to describe the position and posture of the column cap in three-dimensional space, and the matrix form is:

[0153]

[0154] Among them, m ij Represents the element in the i-th row and j-th column of the matrix, which is specifically defined as:

[0155]

[0156] S48. Write the generated column cap node information into a GLTF file, wherein the GLTF file includes a scene description in a json format and geometric data in a binary format.

[0157] In this implementation manner, S5 specifically includes:

[0158] S51, obtaining basic information of the beam component, including the cross-sectional width b of the beam, the longitudinal height h of the beam, the beam ID, the beam name, the beam end 1 positioning coordinates (x1, y1, z1) and the beam end 2 positioning coordinates (x2, y2, z2);

[0159] S52, determine the length of the beam according to the beam end 1 positioning coordinates and the beam end 2 positioning coordinates. The beam length calculation formula is:

[0160]

[0161] S53, determine the plane position coordinate information of the beam according to the cross-sectional transverse width b and the longitudinal height h of the beam. The cross-sectional width b and the longitudinal height h of the beam are used to calculate the coordinates of the four corner points of the beam, which are:

[0162]

[0163] S54, calculating the three-dimensional coordinate information of the six faces of the beam according to the plane position coordinates and the Z direction coordinates of the beam, including the vertex coordinates and the normal vector of each face; the six faces are: top face, bottom face, left face, right face, front side face and rear side face;

[0164] S55. Define the mesh data of each face of the beam. The mesh data includes information about vertices, edges, and faces, and determines the material reference of each face. The mesh data is represented by triangular face patches, each face patch is defined by three vertices, and the connection between vertices represents an edge, and multiple edges form a face. The mesh data is calculated as follows:

[0165] Mesh vertex coordinates = {(x i ,y i ,z i )};

[0166] edge_connection = {(i,j)};

[0167] FaceConnect = {(i,j,k)};

[0168] Among them, i, j, k are vertex indices;

[0169] S56. Generate node information of the beam, including: node ID, node name, node location information, node geometry information and node material information.

[0170] In this implementation manner, S6 specifically includes:

[0171] S61, obtaining basic information of the floor component, including the floor ID, the natural layer ID where the floor is located, the XY coordinates of the floor corner point 1, the XY coordinates of the floor corner point 2, and the floor thickness H;

[0172] S62. Determine the length L and width W of the floor slab according to the XY coordinates (X1, Y1) of the floor slab corner point 1 and the XY coordinates (X2, Y2) of the floor slab corner point 2. The calculation formula of the floor slab length L is:

[0173]

[0174] The floor width W is the lateral distance between floor corner point 1 and floor corner point 2;

[0175] S63. Determine the Z-direction coordinate information of the floor according to the ID of the natural layer where the floor is located. The Z-direction coordinate is the height Z0 of the natural layer where the floor is located plus the floor thickness H. The Z-direction coordinate Z1 of the top surface of the floor is:

[0176] Z1=Z0+H;

[0177] The Z-direction coordinate Z2 of the bottom surface of the floor is:

[0178] Z2=Z0;

[0179] S64, calculating the three-dimensional coordinate information of the six faces of the floor slab, including the vertex coordinates and normal vector of each face;

[0180] S65, defining mesh data of the floor slab, including vertex data, face data and material reference; the vertex data includes the three-dimensional coordinates of each vertex of the top and bottom surfaces of the floor slab, the face data includes six faces of the floor slab, each face is defined by four vertices, and the material reference is used to specify the material properties of the floor slab;

[0181] S66. Generate node information of the floor, wherein the node information includes the position, rotation and scaling information of the floor, and write the information into a GLTF file.

[0182] Embodiment 1:

[0183] In order to verify the feasibility of the present invention in implementation, the present invention is applied to actual modeling. The present invention generates a 3D building model method based on the coordinate information of three-dimensional building components. The five components of wall, beam, column, column cap and floor are drawn separately. Each 3D building model is a gltf format file. The following are the basic steps for writing each component into the node information of the gltf file:

[0184] (1) Method for generating 3D building model based on wall component coordinate information

[0185] The basic information of the wall includes wall thickness, wall ID, wall name, natural layer where the wall is located, starting coordinates of the wall, ending coordinates of the wall, etc.

[0186] Table 1 Basic information of the wall

[0187]

[0188] According to the wall component data in Table 1, a 3D model of a wall can be generated. The specific steps are as follows:

[0189] (1) Determine the length of the wall based on the starting and ending coordinates of the wall;

[0190] (2) The plane position coordinates of a wall can be determined based on the length and thickness of the wall;

[0191] (3) The coordinate information of the wall in the Z direction can be obtained according to the layer where the wall is located;

[0192] (4) Calculate the three-dimensional coordinate information of the six faces of a wall;

[0193] (5) Define the mesh data and material references for each face;

[0194] (6) Generate node information and write it into gltfWriter.

[0195] (2) Method for generating 3D building model based on column component coordinate information

[0196] The basic information of the column includes column cross-sectional dimensions (B*H), column ID, column name, column floor ID, column location coordinates and other information.

[0197] Table 2 Basic information of columns

[0198]

[0199] According to the column component data in Table 2, a three-dimensional model information of a column can be generated. The specific steps are as follows:

[0200] (1) The center position of the column can be determined based on the column positioning coordinates;

[0201] (2) The plane coordinate information of the column can be obtained based on the column cross-sectional dimensions (B*H);

[0202] (3) Obtain the Z-direction coordinate information of the column according to the layer where the column is located;

[0203] (4) Calculate the three-dimensional coordinate information of the six faces of a column;

[0204] (5) Define the mesh data and material references for each face;

[0205] (6) Generate node information and write it into gltfWriter.

[0206] (3) Method for generating 3D building model based on column cap component coordinate information

[0207] The basic information of the column cap includes the column cap size definition, column cap ID, column cap name, column cap corresponding column ID, column positioning coordinates and other information.

[0208] Table 3 Basic information of column cap

[0209]

[0210] According to the column cap component data in Table 3, a three-dimensional model information of a column cap can be generated. The specific steps are as follows: (1) according to the column cap corresponding to the column ID, the center coordinates of the column are located to determine the center point coordinates of the column cap;

[0211] (2) Determine the Z-direction coordinate information of the column cap according to the column cap size definition coordinate information;

[0212] (3) Calculate the three-dimensional coordinate information of the ten faces of a column cap;

[0213] (4) Define the mesh data and material references for each face;

[0214] (5) Generate node information and write it into gltfWriter.

[0215] (4) Method for generating 3D building model based on beam component coordinate information

[0216] The basic information of the beam includes the transverse width b of the beam section, the longitudinal height h of the beam, the beam ID, the beam name, the positioning coordinates of beam end 1, the positioning coordinates of beam end 2 and other information.

[0217] Table 4 Basic information of beams

[0218]

[0219] According to the beam component data in Table 4, a three-dimensional model information of a beam can be generated. The specific steps are as follows:

[0220] (1) Determine the length of the beam based on the positioning coordinates at both ends of the beam;

[0221] (2) Determine the coordinate information of the beam plane position according to the transverse width of the beam section;

[0222] (3) Determine the coordinate information of the beam in the Z direction according to the longitudinal height of the beam;

[0223] (4) Calculate the three-dimensional coordinate information of the six surfaces of a beam;

[0224] (5) Define the mesh data and material references for each face;

[0225] (6) Generate node information and write it into gltfWriter.

[0226] (5) Method for generating 3D building model based on floor component coordinate information

[0227] The basic information of the floor includes the floor ID, the natural layer ID where the floor is located, the XY coordinates of the floor corner point 1, the XY coordinates of the floor corner point 2, the floor thickness and other information.

[0228] Table 5 Basic information of floor slab

[0229]

[0230] (1) Determine the length of the floor slab based on the positioning coordinates at both ends of the floor slab;

[0231] (2) Determine the floor plane position coordinate information according to the transverse width of the floor section;

[0232] (3) Determine the Z coordinate of the floor slab according to the floor on which the floor slab is located;

[0233] (4) Calculate the three-dimensional coordinate information of the six surfaces of a floor;

[0234] (5) Define the mesh data and material references for each face;

[0235] (6) Generate node information and write it into gltfWriter.

[0236] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can make equivalent replacements or changes according to the technical scheme and inventive concept of the present invention within the technical scope disclosed by the present invention, which should be covered by the protection scope of the present invention.

Claims

1. A method for generating GLTF based on three-dimensional building component coordinate information, characterized in that: The steps include: S1. Obtain the three-dimensional coordinate data of the building, including the coordinate information of walls, columns, column caps, beams and floor slabs; S2, generating a 3D building model according to the coordinate information of the wall components; S3, generating a 3D building model according to the column component coordinate information; S4, generating a 3D building model according to the column cap component coordinate information; S5. Generate a 3D building model according to the coordinate information of the beam component; S6. Generate a 3D building model according to the coordinates of the floor component information; S7, aggregate the component node information generated by S2-S6 to form a complete three-dimensional model of the building, generate a GLTF file containing all components, and integrate and optimize the model; S8. Verify the generated GLTF file, complete the generation of the final GLTF file and save it.

2. The method for generating GLTF based on three-dimensional building component coordinate information according to claim 1, characterized in that: The S2 specifically includes: S21. Obtain basic information of the wall component, including wall thickness T, wall ID, wall name, floor ID where the wall is located, wall type ID, start coordinates (X1, Y1, Z1) and end coordinates (X2, Y2, Z2) of the wall; S22. Calculate the length L of the wall according to the starting coordinates and the ending coordinates of the wall. The calculation formula is: Where L is the length of the wall, (X1, Y1) is the starting coordinate, and (X2, Y2) is the ending coordinate; S23, determining the two-dimensional coordinates of the two end points of the wall, expanding the width direction of the wall according to the wall thickness T, and generating the two-dimensional coordinates of the four vertices of the wall; S24. Obtain the coordinate information of the floor where the wall is located in the Z direction, and determine the height range H of the wall in the Z direction according to the floor ID where the wall is located. The height range H of the wall is calculated by the following formula: H = Z2-Z1; Where H is the height of the wall, Z1 is the Z value of the starting coordinate of the wall, and Z2 is the Z value of the ending coordinate of the wall; S25, expanding the four vertex coordinates of the wall into eight vertex coordinates in the Z direction, determining the vertex coordinates and normal vector information of the six faces of the wall, and generating a three-dimensional model of the wall; S26, splitting the six faces into multiple triangular face patches, and defining vertex coordinates and normal vectors for each triangular face patch; S27, specifying a material reference of the wall, the material reference including color, texture and lighting properties, and being associated with material data in the material library through a material ID; S28. Generate node information of the wall, the node information includes position, rotation and scaling transformation matrix; the position coordinate is defined as: P = (X1, Y1, Z1); The rotation matrix is: Where θ is the rotation angle; The scaling matrix is: Among them, s x Indicates the scaling factor in the X direction, s y Indicates the scaling factor in the Y direction, s z Indicates the scaling factor in the Z direction.

3. The method for generating GLTF based on three-dimensional building component coordinate information according to claim 2, characterized in that: The S3 specifically includes: S31. Obtain basic information of the column component, including column cross-sectional dimensions (B×H), column ID, column name, column floor ID, and column location coordinates; S32, determining the center position of the column according to the positioning coordinates of the column, the positioning coordinates are composed of (X, Y, Z) three-dimensional coordinates, where X and Y are the plane coordinates of the column, and Z is the height information of the column; S33, determining the plane position coordinates of the column according to the column cross-sectional dimensions (B×H), where B is the width of the column and H is the height of the column; S34, obtaining the floor information of the column, and determining the Z-direction coordinate of the column, where the Z-direction coordinate is the height of the floor where the column is located; S35, calculating the three-dimensional coordinate information of the six faces of the column, including the vertex coordinates and normal vectors of the top face, bottom face, front face, back face, left face and right face; S36, defining mesh data of the cylinder, including vertex index, normal vector index and material index; S37, specifying a material reference of the column, the material reference including color, texture and reflectivity information of the column; S38. Generate the node information of the column, including the node name, position, rotation, scale and sub-node information. The node name is the ID of the column, the position is the center position coordinate of the column, the rotation is the rotation angle of the column, the scale is the scale ratio of the column, and the sub-node information is the information of each face of the column.

4. The method for generating GLTF based on three-dimensional building component coordinate information according to claim 3, characterized in that: The S4 specifically includes: S41, obtaining basic information of the column cap component, including column cap size definition, column cap ID, column cap name, column cap corresponding column ID, and column cap positioning coordinates; S42, locate the center coordinates of the column according to the column ID corresponding to the column cap, and determine the center point coordinates P of the column cap c (x c ,y c ,z c ); S43, determining the three-dimensional coordinate information of the column cap according to the column cap size definition, where the column cap size definition includes the horizontal coordinates of C1, C2, C3, C4, C5, C6, C7, and C8 and the first-order column cap height H1 and the second-order column cap height H2; S44, calculate the three-dimensional coordinate information of the ten faces of the column cap, including the vertex coordinates and normal vector of each face, the vertex coordinates V i (x i ,y i ,z i ) is determined by the following formula: Among them, C ix and C iy Respectively represent the offset of the i-th vertex on the horizontal plane; S45, defining mesh data of each face of the column cap, wherein the mesh data includes vertex indexes and vertex coordinates; S46, defining a material reference for each face of the column cap, wherein the material reference includes a material name and material attributes; S47, generating node information of the column cap, wherein the node information includes a node name, a node index, a node transformation matrix, a mesh index, and a material index. The node transformation matrix is ​​represented by a 4x4 matrix, and the matrix form is: Among them, m ij Represents the element in the i-th row and j-th column of the matrix, which is specifically defined as:

5. The method for generating GLTF based on three-dimensional building component coordinate information according to claim 4, characterized in that: The S5 specifically includes: S51, obtaining basic information of the beam component, including the cross-sectional width b of the beam, the longitudinal height h of the beam, the beam ID, the beam name, the beam end 1 positioning coordinates (x1, y1, z1) and the beam end 2 positioning coordinates (x2, y2, z2); S52, determine the length of the beam according to the beam end 1 positioning coordinates and the beam end 2 positioning coordinates. The beam length calculation formula is: S53, determining the plane position coordinate information of the beam according to the cross-sectional transverse width b and the longitudinal height h of the beam; using the cross-sectional width b and the longitudinal height h of the beam to calculate the coordinates of the four corner points of the beam, which are: S54, calculating the three-dimensional coordinate information of the six faces of the beam according to the plane position coordinates and the Z direction coordinates of the beam, including the vertex coordinates and the normal vector of each face; the six faces are: top face, bottom face, left face, right face, front side face and rear side face; S55. Define the mesh data of each face of the beam. The mesh data includes information of vertices, edges and faces, and determine the material reference of each face. The mesh data is calculated as follows: Mesh vertex coordinates = {(x i ,y i ,z i )}; edge_connection = {(i,j)}; FaceConnect = {(i,j,k)}; Among them, i, j, k are vertex indices; S56. Generate node information of the beam, including: node ID, node name, node location information, node geometry information and node material information.

6. The method for generating GLTF based on three-dimensional building component coordinate information according to claim 4, characterized in that: The S6 specifically includes: S61, obtaining basic information of the floor component, including the floor ID, the natural layer ID where the floor is located, the XY coordinates of the floor corner point 1, the XY coordinates of the floor corner point 2, and the floor thickness H; S62. Determine the length L and width W of the floor slab according to the XY coordinates (X1, Y1) of the floor slab corner point 1 and the XY coordinates (X2, Y2) of the floor slab corner point 2. The calculation formula of the floor slab length L is: The floor width W is the lateral distance between floor corner point 1 and floor corner point 2; S63. Determine the Z-direction coordinate information of the floor according to the ID of the natural layer where the floor is located. The Z-direction coordinate is the height Z0 of the natural layer where the floor is located plus the floor thickness H. The Z-direction coordinate Z1 of the top surface of the floor is: Z1=Z0+H; The Z-direction coordinate Z2 of the bottom surface of the floor is: Z2=Z0; S64, calculating the three-dimensional coordinate information of the six faces of the floor slab, including the vertex coordinates and normal vector of each face; S65, defining mesh data of the floor slab, including vertex data, face data and material reference; the vertex data includes the three-dimensional coordinates of each vertex of the top and bottom surfaces of the floor slab, and the face data includes six faces of the floor slab, each face is defined by four vertices; S66. Generate node information of the floor, wherein the node information includes position, rotation and scaling information of the floor.