CN117934751A - Method, device, equipment and medium for constructing three-dimensional tunnel model - Google Patents
Method, device, equipment and medium for constructing three-dimensional tunnel model Download PDFInfo
- Publication number
- CN117934751A CN117934751A CN202410164703.1A CN202410164703A CN117934751A CN 117934751 A CN117934751 A CN 117934751A CN 202410164703 A CN202410164703 A CN 202410164703A CN 117934751 A CN117934751 A CN 117934751A
- Authority
- CN
- China
- Prior art keywords
- dimensional
- tunnel
- vector
- point
- point set
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 46
- 239000013598 vector Substances 0.000 claims abstract description 102
- 230000009466 transformation Effects 0.000 claims abstract description 46
- 239000011159 matrix material Substances 0.000 claims abstract description 41
- 238000010276 construction Methods 0.000 claims abstract description 15
- 238000010586 diagram Methods 0.000 claims description 17
- 230000006870 function Effects 0.000 claims description 17
- 238000004590 computer program Methods 0.000 claims description 9
- 238000012952 Resampling Methods 0.000 claims description 6
- 238000003491 array Methods 0.000 claims description 3
- 230000008859 change Effects 0.000 claims description 2
- 238000011960 computer-aided design Methods 0.000 description 23
- 238000004422 calculation algorithm Methods 0.000 description 15
- 238000005516 engineering process Methods 0.000 description 8
- 230000008569 process Effects 0.000 description 8
- 238000012545 processing Methods 0.000 description 8
- 238000000605 extraction Methods 0.000 description 4
- 238000004364 calculation method Methods 0.000 description 3
- 230000007246 mechanism Effects 0.000 description 3
- 230000001131 transforming effect Effects 0.000 description 3
- 238000012937 correction Methods 0.000 description 2
- 230000008676 import Effects 0.000 description 2
- 238000005457 optimization Methods 0.000 description 2
- 238000013519 translation Methods 0.000 description 2
- 238000013473 artificial intelligence Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000006243 chemical reaction Methods 0.000 description 1
- 238000013075 data extraction Methods 0.000 description 1
- 238000009795 derivation Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000010801 machine learning Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000003909 pattern recognition Methods 0.000 description 1
- 238000002360 preparation method Methods 0.000 description 1
- 238000005070 sampling Methods 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
- 238000000844 transformation Methods 0.000 description 1
- 238000012800 visualization Methods 0.000 description 1
Abstract
The invention discloses a method, a device, equipment and a medium for constructing a three-dimensional tunnel model, which relate to the technical field of three-dimensional model construction and comprise the steps of obtaining two-dimensional coordinates of a tunnel engineering drawing and converting the two-dimensional coordinates into three-dimensional coordinates; determining a three-dimensional path point set and a two-dimensional contour point set of a tunnel; obtaining tangential lines, normal lines and auxiliary normal line vectors of each point in a three-dimensional path of a tunnel, setting the tangential lines, the normal lines and the auxiliary normal line vectors as a column vector, and converting the column vector into a transformation matrix; adding three-dimensional 0 to each two-dimensional contour point to form a three-dimensional vector, and multiplying the three-dimensional vector by a corresponding transformation matrix to obtain a three-dimensional contour point set of the tunnel; and connecting the vertexes of the contour points to obtain the three-dimensional tunnel model. The invention constructs the tangent vector, the normal vector and the auxiliary normal vector of each point in the three-dimensional path point set of the tunnel into a transformation matrix, transforms the two-dimensional contour point set into the three-dimensional vector and multiplies the three-dimensional vector by the transformation matrix of the corresponding position to accurately determine the position, the path and the direction of the contour point, connects the vertexes of the contour point to determine the three-dimensional model of the tunnel, and greatly improves the accuracy of constructing the three-dimensional model of the tunnel.
Description
Technical Field
The present invention relates to the field of three-dimensional model construction technology, and in particular, to a method, an apparatus, a device, and a medium for constructing a three-dimensional tunnel model.
Background
With the development of engineering and construction fields, CAD (computer aided design) technology has become an indispensable tool for designers; when a tunnel project is built, the CAD drawing is used normally, so that the information such as the plane arrangement and the section view of the tunnel can be very conveniently drawn; however, converting CAD drawings into solid tunnel models remains a very complex process, requiring the assistance of specialized software and algorithms.
Currently, some technical schemes can be used for converting CAD drawings into three-dimensional tunnel models; one is a three-dimensional modeling function built in CAD software, some CAD software is built in with the function of three-dimensional modeling, CAD drawings can be directly converted into a three-dimensional model through some operations, but the method is generally limited for complex tunnel structures or detail processing; one is professional tunnel design software, which has a few professional tunnel design software, can import CAD drawings and perform three-dimensional modeling, and has higher-level functions generally, and can better process complex tunnel structures and details; a modeling method based on point cloud obtains point cloud data of an actual structure of a tunnel through technologies such as laser scanning and the like, and then models the actual structure by utilizing the point cloud data.
Therefore, when extracting the coordinate points in the CAD drawing, the existing technologies have difficulty in using the obtained effective coordinate points for modeling the tunnel, so that the accuracy in modeling the tunnel is low, and the technology is difficult to apply to practice.
Disclosure of Invention
The embodiment of the invention provides a method, a device, equipment and a medium for constructing a three-dimensional tunnel model, which can solve the problem of lower accuracy in modeling a tunnel in the prior art.
The embodiment of the invention provides a method for constructing a three-dimensional tunnel model, which comprises the following steps:
different engineering drawings of tunnels in the CAD file are obtained, two-dimensional position information points in the engineering drawings are extracted, and the two-dimensional position information points are converted into three-dimensional position information points of the tunnels in a three-dimensional space;
determining a three-dimensional path point set of the tunnel and a two-dimensional contour point set of the tunnel by using the three-dimensional position information points of the tunnel;
Obtaining tangent, normal and auxiliary normal vectors of each point in the three-dimensional path point set of the tunnel by using a python function, setting the tangent, the normal and the auxiliary normal vectors as a column vector, and converting the column vector into a transformation matrix; translating the tunnel two-dimensional contour point sets at different positions to corresponding positions along the tunnel three-dimensional path point set, loading a third dimension 0 to each two-dimensional contour point to form a three-dimensional vector, and multiplying the three-dimensional vector by a corresponding transformation matrix to obtain the tunnel three-dimensional contour point set;
and connecting the vertexes of each point in the obtained three-dimensional contour point set of the tunnel to obtain a three-dimensional tunnel model.
Preferably, the extracting the two-dimensional position information point in the engineering drawing includes the following steps:
obtaining engineering drawings, namely a tunnel plane path drawing, a longitudinal section drawing and a lining contour drawing in a CAD file;
extracting a plurality of two-dimensional position information points in the horizontal direction and the vertical direction of a tunnel plane path diagram, a longitudinal section diagram and a lining outline diagram;
the two-dimensional position information point includes an x-coordinate value and a y-coordinate value.
Preferably, the converting the two-dimensional position information point into the tunnel three-dimensional position information point in the three-dimensional space includes the steps of:
Calculating the difference between the x coordinate and the y coordinate in the two-dimensional information points, and resampling the x coordinate and the y coordinate based on the obtained difference to obtain a tunnel three-dimensional position information point in a three-dimensional space;
the tunnel three-dimensional position information point includes an x-coordinate value, a y-coordinate value, and a z-coordinate value.
Preferably, the determining the three-dimensional path point set of the tunnel and the two-dimensional contour point set of the tunnel includes the following steps:
Determining the points along the trend of the tunnel in the three-dimensional position information points of the tunnel as a three-dimensional path point set of the tunnel;
And determining points on cross sections at different positions along the tunnel in the three-dimensional position information points of the tunnel as a two-dimensional contour point set of the tunnel.
Preferably, the obtaining the transformation matrix includes the following steps:
calculating 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;
Calculating the derivative of the tangent vector of each point and unitizing the derivative to obtain the normal vector of each point;
calculating the vector product of the tangent vector and the normal vector of each point to obtain the auxiliary normal vector of each point;
the tangential vector, normal vector and sub-normal vector of each point are set in order as one column vector, and this column vector is converted into a transformation matrix.
Preferably, the obtaining the three-dimensional contour point set of the tunnel includes the following steps:
Translating the two-dimensional contour point sets of the tunnels at different positions to corresponding positions along the positions of corresponding points in the three-dimensional path point sets of the tunnels;
And loading a third dimension 0 to each two-dimensional contour point so as to change the three-dimensional contour point into an x coordinate value, a y coordinate value and 0, setting the x coordinate value, the y coordinate value and 0 as three-dimensional vectors, and multiplying the three-dimensional vectors by the corresponding transformation matrix to obtain a three-dimensional contour point set of the tunnel.
Preferably, the obtaining a three-dimensional tunnel model includes the following steps:
Connecting each point in the obtained three-dimensional contour point set of the tunnel to obtain a continuous tunnel grid in a three-dimensional space;
and converting the contour points into vertex arrays, and connecting adjacent vertices on a continuous tunnel grid through a surface to obtain the three-dimensional tunnel model.
The embodiment of the invention also provides a device for constructing the three-dimensional tunnel model, which comprises the following steps:
The tunnel position module is used for acquiring different engineering drawings of the tunnel in the CAD file, extracting two-dimensional position information points in the engineering drawings, and converting the two-dimensional position information points into three-dimensional position information points of the tunnel in a three-dimensional space;
The tunnel path and contour construction module is used for determining a three-dimensional path point set of the tunnel and a two-dimensional contour point set of the tunnel by utilizing the three-dimensional position information points of the tunnel;
The transformation matrix application module is used for acquiring tangential lines, normal lines and auxiliary normal line vectors of each point in the three-dimensional path point set of the tunnel by using the python function, setting the tangential lines, the normal lines and the auxiliary normal line vectors as a column vector, and converting the column vector into a transformation matrix; translating the tunnel two-dimensional contour point sets at different positions to corresponding positions along the tunnel three-dimensional path point set, loading a third dimension 0 to each two-dimensional contour point to form a three-dimensional vector, and multiplying the three-dimensional vector by a corresponding transformation matrix to obtain the tunnel three-dimensional contour point set;
And the model building model is used for connecting the vertexes of each point in the obtained three-dimensional contour point set of the tunnel to obtain a three-dimensional tunnel model.
The embodiment of the invention also provides electronic equipment, which comprises a memory and a processor;
the memory is used for storing a computer program;
The processor is configured to implement the steps of a method for constructing a three-dimensional tunnel model as described above when executing the computer program stored in the memory.
The embodiment of the invention also provides a computer readable storage medium for storing a computer program which, when executed by a processor, implements the steps of a method for constructing a three-dimensional tunnel model as described above.
The embodiment of the invention provides a method, a device, equipment and a medium for constructing a three-dimensional tunnel model, which have the following beneficial effects compared with the prior art:
The invention determines a three-dimensional path point set of a tunnel and two-dimensional contour point sets at different positions from three-dimensional position points of the tunnel obtained in CAD, constructs tangent vectors, normal vectors and auxiliary normal vectors 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, multiplies the three-dimensional vector with the transformation matrix at corresponding positions to accurately determine the position, path and direction of the contour point, connects vertexes of the contour point to determine a three-dimensional model of the tunnel, greatly improves the accuracy of constructing the three-dimensional model of the tunnel, and accurately constructs a entity model distorted and deformed in a three-dimensional space.
In addition, the calculation of the tangent vector, the normal vector and the auxiliary normal vector of each point, the operation multiplication of the transformation matrix and the connection of the contour points are automatically calculated by a computer, so that the method has high overall speed and high efficiency, and can be widely applied to tunnel modeling of various types.
Drawings
FIG. 1 is a schematic overall flow diagram of a method, apparatus, device and medium for constructing a three-dimensional tunnel model according to an embodiment of the present invention;
FIG. 2 is a tunnel route diagram in CAD of a three-dimensional tunnel model, which is provided by the embodiment of the invention, and a method, a device, equipment and a medium for constructing the three-dimensional tunnel model;
FIG. 3 is a schematic diagram of a tunnel in CAD of a three-dimensional tunnel model, which is provided by the embodiment of the invention;
FIG. 4 is a tunnel lining contour diagram in CAD of a three-dimensional tunnel model, which is provided by the embodiment of the invention;
FIG. 5 is a three-dimensional roadmap of a tunnel for a method, apparatus, device and medium for constructing a three-dimensional tunnel model according to an embodiment of the invention;
FIG. 6 is a tunnel lining outline diagram of a method, a device, equipment and a medium for constructing a three-dimensional tunnel model according to an embodiment of the present invention;
FIG. 7 is a scatter diagram of a method, apparatus, device and medium for constructing a three-dimensional tunnel model according to an embodiment of the present invention;
fig. 8 is a tunnel three-dimensional model diagram of a method, a device, equipment and a medium for constructing a three-dimensional tunnel model according to an embodiment of the present invention.
Detailed Description
In order that the above objects, features and advantages of the invention will be readily understood, a more particular description of the invention will be rendered by reference to the appended drawings. In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present invention. The present invention may be embodied in many other forms than described herein and similarly modified by those skilled in the art without departing from the spirit of the invention, whereby the invention is not limited to the specific embodiments disclosed below.
Referring to fig. 1 to 8, an embodiment of the present invention provides a method for constructing a three-dimensional tunnel model, including the following steps:
step one: and (5) extracting coordinates.
Automatically identifying a tunnel plane path, a longitudinal section diagram and a tunnel lining contour in a CAD file through a python writing function, and extracting coordinates of the tunnel plane path, the longitudinal section diagram and the tunnel lining contour; the function is used for extracting point coordinates from a DXF file generated by CAD software; firstly, loading a DXF file of a specified path by an ezdxf.readfile method, and then accessing a model space of the file, wherein the model space is an area containing drawing elements; next, the function initializes an empty list for storing coordinate points, then traverses all the point entities in the model space, and for each traversed point entity, the function obtains its position coordinates, which include 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 respectively, one for storing the x coordinates of all points and the other for storing the y coordinates; finally, the function returns to the two coordinate lists, so that a user calling the function can obtain the horizontal and vertical position information of all the extracted points, and through the process, the point information in the two-dimensional space can be extracted from the CAD drawing efficiently and accurately.
Step two: and (5) coordinate processing.
Calculating a difference between the x-coordinate and the z-coordinate and performing resampling based on the difference; ensuring that each point on the three-dimensional path has consistent x, y and z coordinates; firstly, calculating the difference value of the two groups of data lengths, if the z coordinate geometry is longer than the x coordinate set, calculating an index set which is uniformly distributed, and using the indexes to select corresponding points from the original z coordinate set so as 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, the mode of the z-coordinate set is calculated and this value is repeated to fill the data points until the length of the z-coordinate set is the same as the x-coordinate set; after filling, it may be selected whether to randomly shuffle the new data points to eliminate any possible ordering bias; if the two sets of data are equal in length, no adjustment is required; thus, both the redundant data points and the missing data points can be deleted and the missing data points can be added, so that the two groups of data can be ensured to have the same length, and a basis is provided for further data processing.
Step three: three-dimensional path and contour construction.
Defining coordinates of a three-dimensional path and a two-dimensional contour, and performing space transformation on the two-dimensional contour along the three-dimensional path so as to create a continuous tunnel structure; firstly, defining path coordinates in three-dimensional space and contour coordinates in two-dimensional space, wherein the coordinates are used for determining the shape and position of a tunnel, the contour coordinates represent the shape of a cross section of the tunnel, the path coordinates define the central line of the tunnel, a Matplotlib library of Python is used for displaying a two-dimensional scatter diagram of an inner ring of a lining, which can be regarded as a certain cross section of the tunnel, and then expanding the contour coordinates, adding a z dimension and initializing the z dimension to 0 to prepare for subsequent three-dimensional transformation.
Step four: and (5) transforming matrix application.
Calculating tangential lines, normal lines and auxiliary normal line vectors of each point on the path, and constructing a transformation matrix; the transformation matrix is used for carrying out proper translation and rotation on the two-dimensional contour points along the three-dimensional path; by means of the defined python function, the tangential (T), normal (N) and sub-normal (B) vectors of each point in the tunnel path are calculated, which vectors vary with the path, which together constitute a local coordinate system at each path point in which the two-dimensional contour is to be transformed into three-dimensional space, by means of a transformation matrix obtained by calculation, which maps the contour points into three-dimensional space, correctly positioned and oriented in the tangential direction of the path.
Step five: and (5) constructing a three-dimensional model.
Creating a face of the model by connecting transformed contour point vertices, thereby forming a closed three-dimensional mesh model; once the transformation matrix of the local coordinate system is obtained, the code transforms the contour along each point of the path, creating a series of three-dimensional point sets, which are then connected to form a continuous tunnel grid in three-dimensional space, which are converted into vertex arrays, and adjacent vertices are connected by faces (triangle primitives) to form the grid structure of the three-dimensional model, which is finally exported as an obj file that can be used in various three-dimensional modeling software or graphics engines for further editing or visualization.
In step four, it calculates a tangent (T) vector comprising: the tangent vector for each point on the three-dimensional path can be determined by calculating the derivative of the path at the store (i.e., the difference between adjacent points, if parameterized, can be derived from the derivative), which indicates the tangent direction of the path in the direction of the store.
Calculating a normal (N) vector: the normal vector is a vector perpendicular to the tangent vector, pointing 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 unitizing (normalizing) it, this vector indicating to which side the route curve is curved.
Calculating a secondary normal (B) vector: the secondary normal vector is the cross product (vector product) of the tangent and the normal vector, which is perpendicular to the tangent and the normal vector, and constitutes a local coordinate system orthogonal to the direction of the road surface, and the secondary normal vector indicates the "lateral direction" of the road surface.
Constructing a transformation matrix: once these three vectors are present, they can be put into a matrix as column vectors, constructing a rotation matrix of local to global coordinate systems; typically the columns of this matrix are in turn tangential vectors, sub-normal vectors and normal vectors.
Translating and rotating a two-dimensional profile, comprising:
Translation: each two-dimensional contour point translates according to the position of the corresponding point in the three-dimensional path.
And (3) rotation: for each contour point, it is considered a two-dimensional coordinate, a three-dimensional vector is formed by adding 0 to the third bit, and then the point is transformed from the local coordinate system to the global coordinate system by multiplying by a transformation matrix, so that the original two-dimensional contour is properly placed in three-dimensional space, correctly positioned and oriented along the path.
The operation relation and the function relation of the invention: in the operation process, the extracted coordinate points are firstly subjected to space transformation through a transformation matrix, then the transformed points are used as vertexes, the vertexes are connected through an algorithm to construct a three-dimensional grid of the tunnel, in the process, the position relation and the connection relation among the components are automatically calculated and defined by the algorithm, the accuracy of the three-dimensional model is ensured, and meanwhile, the modeling efficiency is remarkably improved.
The working principle and the technological process of the invention are as follows: the working principle of the technical scheme of the invention is that the geometrical data in the CAD file is automatically read and processed by using the computer graphics principle and then the geometrical construction in the three-dimensional space is carried out by using the data; the technological process comprises the steps of CAD file reading, coordinate recognition, coordinate processing, path and contour construction, transformation matrix calculation, vertex generation, surface construction, three-dimensional model derivation and the like.
The key points of the invention include:
Automated coordinate extraction algorithm: an algorithm for automatically extracting key geometric coordinates from CAD files is developed, which can identify tunnel plane paths, vertical sections and lining contours, and extract corresponding coordinates.
Coordinate resampling mechanism: a resampling mechanism is designed for balancing and unifying x, y and z coordinate points on a three-dimensional path, and consistency and accuracy of point coordinates in a three-dimensional modeling process are ensured.
Spatial transformation algorithm: a set of algorithm for calculating tangential lines, normal lines and auxiliary normal line vectors of all points on a three-dimensional path and constructing a transformation matrix according to the tangential lines, the normal lines and the auxiliary normal line vectors is realized and is used for correctly transforming two-dimensional contour coordinate points in a three-dimensional space.
Three-dimensional network construction technology: a technique has been developed to create a three-dimensional mesh model of a tunnel by connecting the vertices of the changed contour points to form a closed three-dimensional structure.
Multi-format output capability: the method supports the export of the generated three-dimensional model into a plurality of three-dimensional model file formats, and provides higher universality and compatibility.
The relation between the key points and the technical problems comprises:
Automated coordinate extraction algorithm: the method solves the problems of complexity and time consumption in manually extracting tunnel coordinate data from complex CAD drawings, so that the coordinate extraction process is automated, and the efficiency and accuracy of the data preparation stage are improved.
Coordinate sampling mechanism: the modeling accuracy problem caused by inconsistent data is solved, and the coordinate data of each point of the model is unified through resampling, so that an accurate geometric basis is provided when the three-dimensional model is constructed.
Spatial transformation algorithm: the method solves the difficult problem of the transformation positioning and direction of the two-dimensional contour in the three-dimensional space, realizes complex space construction through an accurate transformation matrix, and provides key technical support for creating an accurate three-dimensional tunnel structure.
Three-dimensional grid construction technology: the method solves the problem of how to create a closed three-dimensional model from the transformed contour points, and connects the vertex building faces through an intelligent algorithm, so that a complete tunnel grid model is formed, and seamless conversion from two dimensions to three dimensions is provided.
The following scheme can be adopted for data extraction:
Image processing technology: in addition to extracting coordinates directly from CAD files, image processing and pattern recognition techniques may also be used to identify and extract geometric information from scanned drawings or image files.
Manual input and correction: to address the difficulty of automatic recognition, a user interface may be provided that allows the user to manually enter key coordinate points or to make corrections after automatic extraction.
The following scheme can be adopted for coordinate processing and optimization:
the interpolation method comprises the following steps: in processing the coordinate data, different interpolation algorithms (e.g., bezier curves, spline curves, etc.) may be employed to smooth or optimize the path.
Artificial intelligence optimization: machine learning or AI algorithms are used to predict and optimize three-dimensional paths, especially when the data is truly or incomplete.
The following scheme can also be adopted for three-dimensional modeling:
Rule-based modeling: in addition to transforming a two-dimensional contour along a three-dimensional path, predefined rules or algorithms may also be used to generate complex shapes.
Parameterized modeling: the shape and size of the tunnel are defined by parameterized methods, allowing the characteristics of the model to be adjusted by changing a set of parameters.
The following scheme can also be adopted for transformation matrix and space construction:
Quaternion transformation: quaternion provides a way to avoid "gimbal locks" in three-dimensional rotation, possibly being used to replace traditional transformation matrices.
Non-uniform rational B-spline (NURBS) transform: the use of NURBS for more complex geometric transformations is particularly useful for complex shaped tunnel profiles.
The following scheme can also be adopted for connecting and creating the three-dimensional model:
grid generation algorithm: different algorithms (e.g., delaunay triangulation, voronoi diagram, etc.) are used to generate the mesh of connected vertices.
Tessellation: and carrying out surface subdivision on the preliminarily generated model to increase the detail and smoothness of the model.
The following scheme may also be adopted for the output format:
different 3D file formats: although OBJ is a widely supported format, other formats such as STL, VRML, FBX, etc. may be used as alternative output formats to cope with different requirements.
Directly output to modeling software: an interface or plug-in may be provided to directly import the three-dimensional model into specific modeling software, such as AutoCAD, revit, etc.
The embodiment of the invention also provides a device for constructing the three-dimensional tunnel model, which comprises the following steps:
the tunnel position module is used for acquiring different engineering drawings of the tunnel in the CAD file, extracting two-dimensional position information points in the engineering drawings, and converting the two-dimensional position information points into three-dimensional position information points of the tunnel in the three-dimensional space.
And the tunnel path and contour construction module is used for determining a three-dimensional path point set of the tunnel and a two-dimensional contour point set of the tunnel by utilizing the three-dimensional position information points of the tunnel.
The transformation matrix application module is used for acquiring tangential lines, normal lines and auxiliary normal line vectors of each point in the three-dimensional path point set of the tunnel by using the python function, setting the tangential lines, the normal lines and the auxiliary normal line vectors as a column vector, and converting the column vector into a transformation matrix; translating the tunnel two-dimensional contour point sets at different positions to corresponding positions along the tunnel three-dimensional path point set, loading a third dimension 0 to each two-dimensional contour point to form a three-dimensional vector, and multiplying the three-dimensional vector by a corresponding transformation matrix to obtain the tunnel three-dimensional contour point set.
And the model building model is used for connecting the vertexes of each point in the obtained three-dimensional contour point set of the tunnel to obtain a three-dimensional tunnel model.
The embodiment of the invention also provides electronic equipment which comprises a memory and a processor.
The memory is used for storing a computer program.
The processor is configured 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.
The embodiment of the invention also provides a computer readable storage medium for storing a computer program which, when executed by a processor, implements the steps of a method for constructing a three-dimensional tunnel model as described above.
The above examples illustrate only a few embodiments of the invention, which are described in detail and are not to be construed as limiting the scope of the invention. It should be noted that it will be apparent to those skilled in the art that several variations and modifications can be made without departing from the spirit of the invention, which are all within the scope of the invention. Accordingly, the scope of protection of the present invention is to be determined by the appended claims.
Claims (10)
1. The construction method of the three-dimensional tunnel model is characterized by comprising the following steps of:
different engineering drawings of tunnels in the CAD file are obtained, two-dimensional position information points in the engineering drawings are extracted, and the two-dimensional position information points are converted into three-dimensional position information points of the tunnels in a three-dimensional space;
determining a three-dimensional path point set of the tunnel and a two-dimensional contour point set of the tunnel by using the three-dimensional position information points of the tunnel;
Obtaining tangent, normal and auxiliary normal vectors of each point in the three-dimensional path point set of the tunnel by using a python function, setting the tangent, the normal and the auxiliary normal vectors as a column vector, and converting the column vector into a transformation matrix; translating the tunnel two-dimensional contour point sets at different positions to corresponding positions along the tunnel three-dimensional path point set, loading a third dimension 0 to each two-dimensional contour point to form a three-dimensional vector, and multiplying the three-dimensional vector by a corresponding transformation matrix to obtain the tunnel three-dimensional contour point set;
and connecting the vertexes of each point in the obtained three-dimensional contour point set of the tunnel to obtain a three-dimensional tunnel model.
2. The method for constructing a three-dimensional tunnel model according to claim 1, wherein the step of extracting two-dimensional position information points in the engineering drawing comprises the steps of:
obtaining engineering drawings, namely a tunnel plane path drawing, a longitudinal section drawing and a lining contour drawing in a CAD file;
extracting a plurality of two-dimensional position information points in the horizontal direction and the vertical direction of a tunnel plane path diagram, a longitudinal section diagram and a lining outline 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, wherein the converting the two-dimensional position information points into the three-dimensional position information points of the tunnel in the three-dimensional space comprises the steps of:
Calculating the difference between the x coordinate and the y coordinate in the two-dimensional information points, and resampling the x coordinate and the y coordinate based on the obtained difference to obtain a tunnel three-dimensional position information point in a three-dimensional space;
the tunnel three-dimensional position information point 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, wherein the determining the three-dimensional path point set of the tunnel and the two-dimensional contour point set of the tunnel comprises the steps of:
Determining the points along the trend of the tunnel in the three-dimensional position information points of the tunnel as a three-dimensional path point set of the tunnel;
And determining points on cross sections at different positions along the tunnel in the three-dimensional position information points of the tunnel as a two-dimensional contour point set of the tunnel.
5. The method for constructing a three-dimensional tunnel model according to claim 1, wherein the obtaining the transformation matrix comprises the steps of:
calculating 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;
Calculating the derivative of the tangent vector of each point and unitizing the derivative to obtain the normal vector of each point;
calculating the vector product of the tangent vector and the normal vector of each point to obtain the auxiliary normal vector of each point;
the tangential vector, normal vector and sub-normal vector of each point are set in order as one column vector, and this column vector is converted into a transformation matrix.
6. The method for constructing a three-dimensional tunnel model according to claim 1, wherein the obtaining the three-dimensional contour point set of the tunnel comprises the following steps:
Translating the two-dimensional contour point sets of the tunnels at different positions to corresponding positions along the positions of corresponding points in the three-dimensional path point sets of the tunnels;
And loading a third dimension 0 to each two-dimensional contour point so as to change the three-dimensional contour point into an x coordinate value, a y coordinate value and 0, setting the x coordinate value, the y coordinate value and 0 as three-dimensional vectors, and multiplying the three-dimensional vectors by the corresponding transformation matrix to obtain a three-dimensional contour point set of the tunnel.
7. The method for constructing a three-dimensional tunnel model according to claim 1, wherein the step of obtaining the three-dimensional tunnel model comprises the steps of:
Connecting each point in the obtained three-dimensional contour point set of the tunnel to obtain a continuous tunnel grid in a three-dimensional space;
and converting the contour points into vertex arrays, and connecting adjacent vertices on a continuous tunnel grid through a surface to obtain the three-dimensional tunnel model.
8. The device for constructing the three-dimensional tunnel model is characterized by comprising the following components:
The tunnel position module is used for acquiring different engineering drawings of the tunnel in the CAD file, extracting two-dimensional position information points in the engineering drawings, and converting the two-dimensional position information points into three-dimensional position information points of the tunnel in a three-dimensional space;
The tunnel path and contour construction module is used for determining a three-dimensional path point set of the tunnel and a two-dimensional contour point set of the tunnel by utilizing the three-dimensional position information points of the tunnel;
The transformation matrix application module is used for acquiring tangential lines, normal lines and auxiliary normal line vectors of each point in the three-dimensional path point set of the tunnel by using the python function, setting the tangential lines, the normal lines and the auxiliary normal line vectors as a column vector, and converting the column vector into a transformation matrix; translating the tunnel two-dimensional contour point sets at different positions to corresponding positions along the tunnel three-dimensional path point set, loading a third dimension 0 to each two-dimensional contour point to form a three-dimensional vector, and multiplying the three-dimensional vector by a corresponding transformation matrix to obtain the tunnel three-dimensional contour point set;
And the model building model is used for connecting the vertexes of each point in the obtained three-dimensional contour point set of the tunnel to obtain a three-dimensional tunnel model.
9. An electronic device, comprising: a memory and a processor;
the memory is used for storing a computer program;
The processor is configured to implement the steps of a method for constructing a three-dimensional tunnel model according to any one of claims 1 to 7 when executing the computer program stored in the memory.
10. A computer-readable storage medium, for storing a computer program which, when executed by a processor, implements the steps of a method of constructing a three-dimensional tunnel model according to any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410164703.1A CN117934751A (en) | 2024-02-05 | 2024-02-05 | Method, device, equipment and medium for constructing three-dimensional tunnel model |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410164703.1A CN117934751A (en) | 2024-02-05 | 2024-02-05 | Method, device, equipment and medium for constructing three-dimensional tunnel model |
Publications (1)
Publication Number | Publication Date |
---|---|
CN117934751A true CN117934751A (en) | 2024-04-26 |
Family
ID=90766397
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202410164703.1A Pending CN117934751A (en) | 2024-02-05 | 2024-02-05 | Method, device, equipment and medium for constructing three-dimensional tunnel model |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117934751A (en) |
-
2024
- 2024-02-05 CN CN202410164703.1A patent/CN117934751A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP5361785B2 (en) | A method for simulating numerically controlled milling using an adaptively sampled distance field | |
JP5361793B2 (en) | A method for reconstructing the swept volume distance field at the sample point. | |
EP1710720B1 (en) | Method of computer-aided design of a modeled object having several faces | |
US4858150A (en) | Shape modeling system | |
CN100371937C (en) | CAD system and CAD program | |
JP2002352273A (en) | System and method for interactively editing graphics object | |
KR20050086463A (en) | System and method for performing domain decomposition for multiresolution surface analysis | |
KR20140139984A (en) | Compression and decompression of a 3d modeled object | |
CN111581776B (en) | Iso-geometric analysis method based on geometric reconstruction model | |
JP2002329215A (en) | Method for generating adaptively sampled distance field of object | |
JP2002324250A (en) | Method for editing graphics object by using computer implemented tool | |
CN113077553A (en) | Three-dimensional model segmentation method based on surface attributes | |
JP2002334346A (en) | Method for converting range data of object to model of the object | |
JP2002334347A (en) | Method for converting adaptive sample distance field of graphic model to triangle model | |
CN111462328B (en) | Interpolation method for multiple three-dimensional grid models based on progressive interpolation subdivision surface | |
JP2002329218A (en) | Method for editing surface of graphics object with computer implemented tool | |
JP2002324251A (en) | Method for editing graphics object | |
Zhang et al. | A surface based approach to recognition of geometric features for quality freeform surface machining | |
JPWO2003048980A1 (en) | Method and program for converting 3D shape data into cell internal data | |
JP2002324252A (en) | Method for modeling graphics object | |
JP2017162448A (en) | Designing outer surface of composite part | |
CN117934751A (en) | Method, device, equipment and medium for constructing three-dimensional tunnel model | |
JP2002352270A (en) | Method for correcting adaptively sampled distance | |
CN108876922A (en) | A kind of mesh amending method based on the regularization of interior dihedral angle supplementary angle | |
Patel et al. | Automatic CAD model topology generation |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination |