A method, device, equipment and medium for constructing a three-dimensional tunnel model
By extracting and converting two-dimensional position information points from CAD files, and using tangent, normal and paranormal vectors to construct transformation matrices, the problem of low accuracy in the construction of three-dimensional tunnel models is solved, and an efficient and accurate three-dimensional tunnel model is achieved. Build.
Patent Information
- Application Number
- CN202410164703.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-05
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2044-02-05
AI Technical Summary
When converting CAD drawings into three-dimensional tunnel models, the existing technology has low accuracy and is difficult to apply in actual projects.
By obtaining the two-dimensional position information points in the CAD file and converting them into position information points in the three-dimensional space, the tangent, normal and paranormal vectors are used to construct a transformation matrix, and the two-dimensional contour point set is translated and rotated to form a three-dimensional path point set. and a set of contour points, connecting the vertices to form a three-dimensional tunnel model.
The accuracy and modeling efficiency of the three-dimensional tunnel model have been significantly improved, complex tunnel structures and details can be accurately constructed, and it is suitable for various types of tunnel modeling.
Smart Images

Figure CN117934751B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of three-dimensional model construction, and in particular to a method, device, equipment and medium for constructing a three-dimensional tunnel model. Background Art
[0002] With the development of engineering technology and construction, CAD (computer-aided design) technology has become an indispensable tool for designers. When constructing tunnel projects, the use of CAD drawings has become the norm, which can easily draw information such as the tunnel's plan layout and cross-section. However, converting CAD drawings into physical tunnel models is still a very complicated process that requires the use of professional software and algorithms.
[0003] At present, there are some technical solutions that can be used to convert CAD drawings into 3D tunnel models; one is the built-in 3D modeling function of CAD software. Some CAD software has built-in 3D modeling function, which can directly convert CAD drawings into 3D models through some operations, but this method is usually limited for complex tunnel structures or details; one is professional tunnel design software. There are some professional tunnel design software that can import CAD drawings and perform 3D modeling. These software usually have more advanced functions and can better handle complex tunnel structures and details; one is a point cloud-based modeling method, which uses laser scanning and other technologies to obtain point cloud data of the actual structure of the tunnel, and then uses the point cloud data for modeling. This method can restore the actual shape of the tunnel more accurately, but it requires professional equipment and technical support.
[0004] Therefore, when these existing technologies extract coordinate points from CAD drawings, it is difficult to use the acquired valid coordinate points for tunnel modeling, resulting in low accuracy in tunnel modeling and difficulty in application in practice. Summary of the invention
[0005] The embodiments of the present invention provide a method, device, equipment and medium for constructing a three-dimensional tunnel model, which can solve the problem of low accuracy in modeling tunnels in the prior art.
[0006] An embodiment of the present invention provides a method for constructing a three-dimensional tunnel model, comprising the following steps:
[0007] Obtain different engineering drawings of the tunnel in the CAD file, extract the two-dimensional position information points in the engineering drawings, and convert the two-dimensional position information points into three-dimensional position information points of the tunnel in three-dimensional space;
[0008] Determine the three-dimensional path point set of the tunnel and the two-dimensional contour point set of the tunnel by using the three-dimensional position information points of the tunnel;
[0009] Use Python function to obtain the tangent, normal and binormal vectors of each point in the tunnel 3D path point set, set the tangent, normal and binormal vectors to a column vector, and convert the column vector into a transformation matrix;
[0010] The steps of converting the column vector into a transformation matrix include:
[0011] Calculate the derivative of the path at each point in the three-dimensional path point set of the tunnel to obtain the tangent vector of each point;
[0012] Calculate the derivative of the tangent vector at each point and normalize it to get the normal vector at each point;
[0013] Calculate the vector product of the tangent vector and the normal vector of each point to obtain the binormal vector of each point;
[0014] Set the tangent vector, normal vector and binormal vector of each point to a column vector in turn, and convert this column vector into a transformation matrix;
[0015] The two-dimensional contour point sets of the tunnel at different positions are translated to the corresponding positions along the three-dimensional path point set of the tunnel, a third dimension 0 is added to each two-dimensional contour point to form a three-dimensional vector, and the three-dimensional vector is multiplied with the corresponding transformation matrix to obtain the three-dimensional contour point set of the tunnel;
[0016] Each point in the obtained three-dimensional contour point set of the tunnel is connected to obtain a continuous tunnel mesh in three-dimensional space; and the contour points are converted into vertex arrays, and adjacent vertices are connected through faces on the continuous tunnel mesh to obtain a three-dimensional tunnel model.
[0017] Preferably, the step of extracting two-dimensional position information points in an engineering drawing comprises the following steps:
[0018] Obtain tunnel plan, longitudinal section and lining profile from CAD files;
[0019] Extract multiple two-dimensional position information points in the horizontal and vertical directions of the tunnel plan path diagram, longitudinal section diagram and lining profile diagram;
[0020] The two-dimensional position information point includes an x-coordinate value and a y-coordinate value.
[0021] Preferably, the step of converting the two-dimensional position information point into a three-dimensional position information point of the tunnel in three-dimensional space comprises the following steps:
[0022] Calculating the difference between the x-coordinate and the y-coordinate in the two-dimensional information point, resampling the x-coordinate and the y-coordinate based on the obtained difference, and obtaining the three-dimensional position information point of the tunnel in the three-dimensional space;
[0023] The three-dimensional position information point of the tunnel includes an x-coordinate value, a y-coordinate value and a z-coordinate value.
[0024] Preferably, the determining of the three-dimensional path point set of the tunnel and the two-dimensional contour point set of the tunnel comprises the following steps:
[0025] Determine the points along the direction of the tunnel among the three-dimensional position information points of the tunnel as the three-dimensional path point set of the tunnel;
[0026] The points on the cross section at different positions along the tunnel among the three-dimensional position information points of the tunnel are determined as the two-dimensional contour point set of the tunnel.
[0027] Preferably, obtaining the three-dimensional contour point set of the tunnel comprises the following steps:
[0028] The two-dimensional tunnel contour point sets at different positions are translated to corresponding positions along the positions of corresponding points in the three-dimensional tunnel path point set;
[0029] A third dimension of 0 is added to each two-dimensional contour point to convert it into an x-coordinate value, a y-coordinate value and 0, the x-coordinate value, the y-coordinate value and 0 are set as a three-dimensional vector, and the three-dimensional vector is multiplied by the corresponding transformation matrix to obtain a three-dimensional contour point set of the tunnel.
[0030] The embodiment of the present invention further provides a device for constructing a three-dimensional tunnel model, comprising:
[0031] The tunnel location module is used to obtain different engineering drawings of the tunnel in the CAD file, extract the two-dimensional location information points in the engineering drawings, and convert the two-dimensional location information points into three-dimensional location information points of the tunnel in three-dimensional space;
[0032] A tunnel path and contour construction module, used to determine a three-dimensional path point set of the tunnel and a two-dimensional contour point set of the tunnel using the three-dimensional position information points of the tunnel;
[0033] A transformation matrix application module is used to obtain the tangent, normal and binormal vectors of each point in the tunnel three-dimensional path point set using a Python function, and set the tangent, normal and binormal vectors to a column vector, and convert the column vector into a transformation matrix;
[0034] The steps of converting the column vector into a transformation matrix include:
[0035] Calculate the derivative of the path at each point in the three-dimensional path point set of the tunnel to obtain the tangent vector of each point;
[0036] Calculate the derivative of the tangent vector at each point and normalize it to get the normal vector at each point;
[0037] Calculate the vector product of the tangent vector and the normal vector of each point to obtain the binormal vector of each point;
[0038] Set the tangent vector, normal vector and binormal vector of each point to a column vector in turn, and convert this column vector into a transformation matrix;
[0039] The two-dimensional contour point sets of the tunnel at different positions are translated to the corresponding positions along the three-dimensional path point set of the tunnel, a third dimension 0 is added to each two-dimensional contour point to form a three-dimensional vector, and the three-dimensional vector is multiplied with the corresponding transformation matrix to obtain the three-dimensional contour point set of the tunnel;
[0040] The model building model is used to connect each point in the obtained three-dimensional contour point set of the tunnel to obtain a continuous tunnel mesh in three-dimensional space; and convert the contour points into vertex arrays, connect adjacent vertices through faces on the continuous tunnel mesh to obtain a three-dimensional tunnel model.
[0041] An embodiment of the present invention further provides an electronic device, including a memory and a processor;
[0042] The memory is used to store computer programs;
[0043] The processor is used to implement the steps of the method for constructing a three-dimensional tunnel model as described above when executing the computer program stored in the memory.
[0044] An embodiment of the present invention further provides a computer-readable storage medium for storing a computer program, wherein when the computer program is executed by a processor, the steps of the method for constructing a three-dimensional tunnel model as described above are implemented.
[0045] The embodiments of the present invention provide a method, device, equipment and medium for constructing a three-dimensional tunnel model. Compared with the prior art, the beneficial effects thereof are as follows:
[0046] The present invention determines the three-dimensional path point set of the tunnel and the two-dimensional contour point sets at different positions from the three-dimensional position points of the tunnel obtained in CAD, and constructs the tangent vector, normal vector and binormal vector of each point in the three-dimensional path point set of the tunnel into a transformation matrix, transforms the two-dimensional contour point sets at different positions into three-dimensional vectors and then multiplies them by the transformation matrix at the corresponding position to accurately determine the position, path and direction of the contour points, connects the vertices of the contour points to determine the three-dimensional model of the tunnel, greatly improves the accuracy of constructing the three-dimensional model of the tunnel, and accurately constructs a solid model that is distorted and deformed in three-dimensional space.
[0047] Moreover, in the present invention, the calculation of the tangent vector, normal vector and binormal vector of each point, as well as the operation and multiplication of the transformation matrix and the connection of the contour points are all automatically calculated by a computer, with an overall fast speed and high efficiency, and can be widely used in various types of tunnel modeling. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] Figure 1 A schematic diagram of the overall process of a method, device, equipment and medium for constructing a three-dimensional tunnel model provided by an embodiment of the present invention;
[0049] Figure 2 A tunnel route map in CAD of a three-dimensional tunnel model construction method, device, equipment and medium provided by an embodiment of the present invention;
[0050] Figure 3 A tunnel longitudinal section diagram in CAD of a three-dimensional tunnel model construction method, device, equipment and medium provided by an embodiment of the present invention;
[0051] Figure 4 A tunnel lining contour diagram in CAD of a three-dimensional tunnel model construction method, device, equipment and medium provided by an embodiment of the present invention;
[0052] Figure 5 A method, device, equipment and medium for constructing a three-dimensional tunnel model provided in an embodiment of the present invention;
[0053] Figure 6 A method, device, equipment and medium tunnel lining outline diagram of a three-dimensional tunnel model provided by an embodiment of the present invention;
[0054] Figure 7 A scatter diagram of a method, device, equipment and medium for constructing a three-dimensional tunnel model provided by an embodiment of the present invention;
[0055] Figure 8 A three-dimensional tunnel model diagram of a method, device, equipment and medium for constructing a three-dimensional tunnel model provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0056] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the specific embodiments of the present invention are described in detail below in conjunction with the accompanying drawings. In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention can be implemented in many other ways different from those described herein, and those skilled in the art can make similar improvements without violating the connotation of the present invention, so the present invention is not limited by the specific embodiments disclosed below.
[0057] See also Figures 1 to 8 The embodiment of the present invention provides a method for constructing a three-dimensional tunnel model, comprising the following steps:
[0058] Step 1: Coordinate extraction.
[0059] A function is written in Python to automatically identify the tunnel plane path, longitudinal section and tunnel lining profile in the CAD file and extract their coordinates. The function is to extract point coordinates from the DXF file generated by the CAD software. It first loads the DXF file of the specified path through the ezdxf.readfile method, and then accesses the model space of the file, which is an area containing drawing elements. Next, the function initializes an empty list to store the coordinate points, and then traverses all the point entities in the model space. For each traversed point entity, the function obtains its position coordinates, which includes the x and y coordinate values, and adds these coordinates to the previously initialized list. After extracting the coordinates of all points, the function creates and fills two lists, one for storing the x coordinates of all points and the other for storing the y coordinates. Finally, the function returns the two coordinate lists, so that the user who calls the function can obtain the horizontal and vertical position information of all extracted points. Through this process, the point information in the two-dimensional space can be efficiently and accurately extracted from the CAD drawing.
[0060] Step 2: Coordinate processing.
[0061] Calculate the difference between the x-coordinate and the z-coordinate, and perform resampling based on this difference; ensure that each point on the three-dimensional path has consistent x, y, and z coordinates; first, calculate the difference in the length of the two sets of data. If the z-coordinate geometry is longer than the x-coordinate set, calculate a uniformly distributed index set and use these indices to select corresponding points from the original z-coordinate set to reduce the number of data points, thereby creating a new adjusted z-coordinate set; conversely, if the length of the z-coordinate set is shorter than the x-coordinate set, calculate the mode of the z-coordinate set and repeat this value to fill the data points until the length of the z-coordinate set is the same as the x-coordinate set; after filling, you can choose whether to randomly shuffle the new data points to eliminate any possible sorting bias; if the two sets of data are of equal length, then no adjustment is required; in this way, whether by deleting excess data points or adding missing data points, it is possible to ensure that the two sets of data have consistent lengths, providing a basis for further data processing.
[0062] Step 3: 3D path and contour construction.
[0063] Define the coordinates of the three-dimensional path and the two-dimensional contour, and transform the two-dimensional contour along the three-dimensional path to create a continuous tunnel structure. First, define the path coordinates in the three-dimensional space and the contour coordinates in the two-dimensional space. These coordinates are used to determine the shape and position of the tunnel. The contour coordinates represent the shape of the tunnel cross-section, while the path coordinates define the centerline of the tunnel. Use Python's Matplotlib library to display a two-dimensional scatter plot of the inner circle of the lining, which can be regarded as a cross-section of the tunnel. Then, expand the contour coordinates, add a z dimension, and initialize it to 0 in preparation for subsequent three-dimensional transformation.
[0064] Step 4: Apply the transformation matrix.
[0065] The tangent, normal and binormal vectors of each point on the path are calculated and a transformation matrix is constructed; the transformation matrix is used to appropriately translate and rotate the two-dimensional contour points along the three-dimensional path; through the defined python function, the tangent (T), normal (N) and binormal (B) vectors of each point in the tunnel path are calculated. These vectors change as the path changes, and together they constitute a local coordinate system at each path point. In the local coordinate system, the two-dimensional contour will be transformed into three-dimensional space. This is achieved by calculating the transformation matrix obtained, which maps the contour points into three-dimensional space, correctly positioning and oriented along the tangent direction of the path.
[0066] Step 5: 3D model construction.
[0067] The model's faces are created by connecting the transformed contour point vertices to form a closed three-dimensional mesh model; once the transformation matrix of the local coordinate system is obtained, the code transforms the contour at each point along the path to create a series of three-dimensional point sets, and then, by connecting these point sets, a continuous tunnel mesh in three-dimensional space is formed. These point sets are converted into vertex arrays, and adjacent vertices are connected by faces (triangle fragments) to form a mesh structure of the three-dimensional model. Finally, this mesh model is exported as an .obj file, which can be used in various 3D modeling software or graphics engines for further editing or visualization.
[0068] In step four, the calculation of the tangent (T) vector includes: the tangent vector of each point on the three-dimensional path can be determined by calculating the derivative of the path at that point (that is, the difference between adjacent points, if it is a parameterized curve, it can be obtained by the derivative), and the vector indicates the tangent direction of the path in the direction of that point.
[0069] Calculate the normal (N) vector: The normal vector is the vector perpendicular to the tangent vector and points to the center of curvature of the curve; for a space curve, this can be obtained by calculating the derivative of the tangent vector and normalizing it. This vector indicates which side the route curve bends to.
[0070] Calculate the binormal (B) vector: The binormal vector is the cross product (vector product) of the tangent and normal vectors. It is perpendicular to the tangent and normal vectors, forming a local coordinate system that is orthogonal to the road surface. The binormal vector indicates the "side" of the road surface.
[0071] Construct the transformation matrix: Once you have these three vectors, you can put them into a matrix as column vectors to construct a rotation matrix from the local coordinate system to the global coordinate system; usually the columns of this matrix are the tangent vector, the binormal vector, and the normal vector, respectively.
[0072] Translate and rotate 2D profiles, including:
[0073] Translation: Each 2D contour point is translated according to the position of the corresponding point in the 3D path.
[0074] Rotation: For each contour point, treat it as a two-dimensional coordinate, add 0 to the third position to form a three-dimensional vector, and then transform the point from the local coordinate system to the global coordinate system by multiplying it by the transformation matrix. In this way, the original two-dimensional contour is properly placed in the three-dimensional space, correctly positioned and oriented along the path.
[0075] The operational relationship and functional relationship of the present invention: During the operation process, the extracted coordinate points are first spatially transformed through a transformation matrix, and then these transformed points are used as vertices, and the vertices are connected through an algorithm to construct a three-dimensional grid of the tunnel. In this process, the positional relationship and connection relationship between components are automatically calculated and defined by the algorithm, ensuring the accuracy of the three-dimensional model while significantly improving the modeling efficiency.
[0076] Working principle and process flow of the present invention: The working principle of the technical solution of the present invention is to utilize the principles of computer graphics, automatically read and process the geometric data in the CAD file from the program, and then use these data to perform geometric construction in three-dimensional space; the process flow includes the steps of CAD file reading, coordinate recognition, coordinate processing, path and contour construction, transformation matrix calculation, vertex generation, face construction, three-dimensional model export, etc.
[0077] The key points of the present invention include:
[0078] Automated Coordinate Extraction Algorithm: An algorithm was developed to automatically extract key geometric coordinates from CAD files. The algorithm is able to identify the tunnel plane path, longitudinal section and lining profile and extract the corresponding coordinates.
[0079] Coordinate resampling mechanism: A resampling mechanism is designed to balance and unify the x, y, and z coordinate points on the 3D path to ensure the consistency and accuracy of the point coordinates during the 3D modeling process.
[0080] Spatial transformation algorithm: implements a set of algorithms that calculate the tangent, normal and binormal vectors of each point on a three-dimensional path and construct a transformation matrix based on them. It is used to correctly transform the coordinate points of a two-dimensional contour in three-dimensional space.
[0081] 3D mesh construction technology: A technology has been developed to create a 3D mesh model of the tunnel by connecting the vertices of the changed contour points to form a closed 3D structure.
[0082] Multi-format output capability: This method supports exporting the generated 3D model into a variety of 3D model file formats, providing higher versatility and compatibility.
[0083] The relationship between the above key points and the technical problems to be solved includes:
[0084] Automated coordinate extraction algorithm: It solves the tedious and time-consuming problem of manually extracting tunnel coordinate data from complex CAD drawings, automates the coordinate extraction process, and improves the efficiency and accuracy of the data preparation stage.
[0085] Coordinate sampling mechanism: It solves the problem of modeling accuracy caused by inconsistent data. Through resampling, the coordinate data of each point in the model is unified, thus providing an accurate geometric basis when building a 3D model.
[0086] Spatial transformation algorithm: It solves the problem of transforming the positioning and direction of two-dimensional contours in three-dimensional space, realizes complex spatial construction through precise transformation matrix, and provides key technical support for creating accurate three-dimensional tunnel structures.
[0087] 3D mesh construction technology: It solves the problem of how to create a closed 3D model from the transformed contour points. Surfaces are established by connecting vertices through an intelligent algorithm to form a complete tunnel mesh model, providing a seamless transition from 2D to 3D.
[0088] The following solutions can also be used to extract data:
[0089] Image processing technology: In addition to extracting coordinates directly from CAD files, image processing and pattern recognition technology can also be used to identify and extract geometric information from scanned drawings or image files.
[0090] Manual input and correction: In order to cope with situations where automatic recognition is difficult, a user interface can be provided to allow users to manually input key coordinate points or perform corrections after automatic extraction.
[0091] The following solutions can also be used for coordinate processing and optimization:
[0092] Interpolation method: When processing coordinate data, different interpolation algorithms (such as Bezier curves, spline curves, etc.) may be used to smooth or optimize the path.
[0093] AI Optimization: Use machine learning or AI algorithms to predict and optimize 3D paths, especially when data is scarce or incomplete.
[0094] The following solutions can also be used for 3D modeling:
[0095] Rule-based modeling: In addition to transforming 2D contours along 3D paths, you can also use predefined rules or algorithms to generate complex shapes.
[0096] Parametric Modeling: The shape and dimensions of the tunnel are defined parametrically, allowing the characteristics of the model to be adjusted by varying a set of parameters.
[0097] The following solutions can also be used for transformation matrix and space construction:
[0098] Quaternion transformations: Quaternions provide a way to avoid "gimbal lock" in three-dimensional rotations and may be used instead of traditional transformation matrices.
[0099] Non-Uniform Rational B-Spline (NURBS) Transformations: Use NURBS to perform more complex geometric transformations, which is particularly useful for complex-shaped tunnel profiles.
[0100] The following solutions can also be used to connect and create 3D models:
[0101] Mesh Generation Algorithms: Different algorithms like Delaunay triangulation, Voronoi diagram, etc. are used to generate a mesh of connected vertices.
[0102] Tessellation: Tessellate the initially generated model to increase the details and smoothness of the model.
[0103] The following options are also available for output formats:
[0104] Different 3D file formats: Although OBJ is a widely supported format, other formats such as STL, VRML, FBX, etc. can also be used as alternative output formats to meet different needs.
[0105] Direct output to modeling software: An interface or plug-in can be provided to directly import the 3D model into specific modeling software, such as AutoCAD, Revit, etc.
[0106] The embodiment of the present invention further provides a device for constructing a three-dimensional tunnel model, comprising:
[0107] The tunnel location module is used to obtain different engineering drawings of the tunnel in the CAD file, extract the two-dimensional location information points in the engineering drawings, and convert the two-dimensional location information points into three-dimensional location information points of the tunnel in three-dimensional space.
[0108] The tunnel path and contour construction module is used to determine the three-dimensional path point set of the tunnel and the two-dimensional contour point set of the tunnel using the three-dimensional position information points of the tunnel.
[0109] A transformation matrix application module is used to obtain the tangent, normal and binormal vectors of each point in the tunnel three-dimensional path point set using a Python function, and set the tangent, normal and binormal vectors to a column vector, and convert the column vector into a transformation matrix;
[0110] The steps of converting the column vector into a transformation matrix include:
[0111] The derivative of the path at each point in the three-dimensional path point set of the tunnel is calculated to obtain the tangent vector of each point.
[0112] Calculate the derivative of the tangent vector at each point and normalize it to get the normal vector at each point.
[0113] Calculate the vector product of the tangent vector and the normal vector of each point to get the binormal vector of each point.
[0114] Set the tangent vector, normal vector and binormal vector of each point to a column vector in turn, and convert this column vector into a transformation matrix.
[0115] The two-dimensional contour point sets of the tunnel at different positions are translated to the corresponding positions along the three-dimensional path point set of the tunnel, a third dimension 0 is added to each two-dimensional contour point to form a three-dimensional vector, and the three-dimensional vector is multiplied with the corresponding transformation matrix to obtain the three-dimensional contour point set of the tunnel.
[0116] The model building model is used to connect each point in the obtained three-dimensional contour point set of the tunnel to obtain a continuous tunnel mesh in three-dimensional space; and convert the contour points into vertex arrays, connect adjacent vertices through faces on the continuous tunnel mesh to obtain a three-dimensional tunnel model.
[0117] An embodiment of the present invention also provides an electronic device, including a memory and a processor.
[0118] The memory is used to store computer programs.
[0119] When the processor is used to execute the computer program stored in the memory, the steps of the above-mentioned method for constructing a three-dimensional tunnel model are implemented.
[0120] An embodiment of the present invention further provides a computer-readable storage medium for storing a computer program, which implements the steps of the above-mentioned method for constructing a three-dimensional tunnel model when executed by a processor.
[0121] The above-mentioned embodiments only express several implementation methods of the present invention, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present invention, and these all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be subject to the attached claims.
Claims
1. A method for constructing a three-dimensional tunnel model, characterized in that: The following steps are involved: Obtain different engineering drawings of the tunnel in the CAD file, extract the two-dimensional position information points in the engineering drawings, and convert the two-dimensional position information points into three-dimensional position information points of the tunnel in three-dimensional space; Determine the three-dimensional path point set of the tunnel and the two-dimensional contour point set of the tunnel by using the three-dimensional position information points of the tunnel; Use Python function to obtain the tangent, normal and binormal vectors of each point in the tunnel 3D path point set, set the tangent, normal and binormal vectors to a column vector, and convert the column vector into a transformation matrix; The steps of converting the column vector into a transformation matrix include: Calculate the derivative of the path at each point in the three-dimensional path point set of the tunnel to obtain the tangent vector of each point; Calculate the derivative of the tangent vector at each point and normalize it to get the normal vector at each point; Calculate the vector product of the tangent vector and the normal vector of each point to obtain the binormal vector of each point; Set the tangent vector, normal vector and binormal vector of each point to a column vector in turn, and convert this column vector into a transformation matrix; The two-dimensional contour point sets of the tunnel at different positions are translated to the corresponding positions along the three-dimensional path point set of the tunnel, a third dimension 0 is added to each two-dimensional contour point to form a three-dimensional vector, and the three-dimensional vector is multiplied with the corresponding transformation matrix to obtain the three-dimensional contour point set of the tunnel; Connect each point in the obtained three-dimensional contour point set of the tunnel to obtain a continuous tunnel grid in three-dimensional space; The contour points are converted into vertex arrays, and adjacent vertices are connected through faces on the continuous tunnel grid to obtain a three-dimensional tunnel model.
2. The method for constructing a three-dimensional tunnel model according to claim 1, characterized in that: The method of extracting two-dimensional position information points in an engineering drawing comprises the following steps: Obtain tunnel plan, longitudinal section and lining profile from CAD files; Extract multiple two-dimensional position information points in the horizontal and vertical directions of the tunnel plan path diagram, longitudinal section diagram and lining profile diagram; The two-dimensional position information point includes an x-coordinate value and a y-coordinate value.
3. The method for constructing a three-dimensional tunnel model according to claim 1, characterized in that: The method of converting the two-dimensional position information point into a three-dimensional position information point of the tunnel in three-dimensional space comprises the following steps: Calculating the difference between the x-coordinate and the y-coordinate in the two-dimensional information point, resampling the x-coordinate and the y-coordinate based on the obtained difference, and obtaining the three-dimensional position information point of the tunnel in the three-dimensional space; The three-dimensional position information point of the tunnel includes an x-coordinate value, a y-coordinate value and a z-coordinate value.
4. The method for constructing a three-dimensional tunnel model according to claim 1, characterized in that: Determining the three-dimensional path point set of the tunnel and the two-dimensional contour point set of the tunnel comprises the following steps: Determine the points along the direction of the tunnel among the three-dimensional position information points of the tunnel as the three-dimensional path point set of the tunnel; The points on the cross section at different positions along the tunnel among the three-dimensional position information points of the tunnel are determined as the two-dimensional contour point set of the tunnel.
5. The method for constructing a three-dimensional tunnel model according to claim 1, characterized in that: The step of obtaining a three-dimensional contour point set of a tunnel comprises the following steps: The two-dimensional tunnel contour point sets at different positions are translated to corresponding positions along the positions of corresponding points in the three-dimensional tunnel path point set; A third dimension of 0 is added to each two-dimensional contour point to convert it into an x-coordinate value, a y-coordinate value and 0, the x-coordinate value, the y-coordinate value and 0 are set as a three-dimensional vector, and the three-dimensional vector is multiplied by the corresponding transformation matrix to obtain a three-dimensional contour point set of the tunnel.
6. A device for constructing a three-dimensional tunnel model, characterized in that: include: The tunnel location module is used to obtain different engineering drawings of the tunnel in the CAD file, extract the two-dimensional location information points in the engineering drawings, and convert the two-dimensional location information points into three-dimensional location information points of the tunnel in three-dimensional space; A tunnel path and contour construction module, used to determine a three-dimensional path point set of the tunnel and a two-dimensional contour point set of the tunnel using the three-dimensional position information points of the tunnel; A transformation matrix application module is used to obtain the tangent, normal and binormal vectors of each point in the tunnel three-dimensional path point set using a Python function, and set the tangent, normal and binormal vectors to a column vector, and convert the column vector into a transformation matrix; The steps of converting the column vector into a transformation matrix include: Calculate the derivative of the path at each point in the three-dimensional path point set of the tunnel to obtain the tangent vector of each point; Calculate the derivative of the tangent vector at each point and normalize it to get the normal vector at each point; Calculate the vector product of the tangent vector and the normal vector of each point to obtain the binormal vector of each point; Set the tangent vector, normal vector and binormal vector of each point to a column vector in turn, and convert this column vector into a transformation matrix; The two-dimensional contour point sets of the tunnel at different positions are translated to the corresponding positions along the three-dimensional path point set of the tunnel, a third dimension 0 is added to each two-dimensional contour point to form a three-dimensional vector, and the three-dimensional vector is multiplied with the corresponding transformation matrix to obtain the three-dimensional contour point set of the tunnel; A model building model is used to connect each point in the obtained three-dimensional contour point set of the tunnel to obtain a continuous tunnel mesh in three-dimensional space; The contour points are converted into vertex arrays, and adjacent vertices are connected through faces on the continuous tunnel grid to obtain a three-dimensional tunnel model.
7. An electronic device, characterized in that: include: Memory and processor; The memory is used to store computer programs; The processor is used to implement the steps of the method for constructing a three-dimensional tunnel model as described in any one of claims 1 to 5 when executing the computer program stored in the memory.
8. A computer-readable storage medium, characterized in that: Used to store a computer program, which, when executed by a processor, implements the steps of a method for constructing a three-dimensional tunnel model as claimed in any one of claims 1 to 5.
