Two-dimensional block cutting and searching method based on matrix expression
Technical Field
The invention relates to a two-dimensional block cutting and searching method, in particular to a two-dimensional block cutting and searching method based on a matrix expression. The invention belongs to the technical field of rock mass cutting, searching, calculating and graph geometry in geotechnical engineering.
Background
Jointed rock mass is a medium frequently encountered in geotechnical engineering, and the rock mass comprises a large number of structural surfaces (such as faults, joint cracks, layer surfaces and the like), and the structural surfaces are mutually overlapped to form a characteristic rock mass structure, so that the characteristics of deformation, strength, stability and the like of the jointed rock mass are determined. Therefore, how to describe the characteristics efficiently and quickly and realize efficient cutting and searching of the jointed rock mass is a premise and a foundation for developing related researches on the jointed rock mass.
Disclosure of Invention
In view of the above, the present invention provides a two-dimensional block cutting and searching method based on matrix expression.
In order to achieve the purpose, the invention adopts the following technical scheme: a two-dimensional block cutting and searching method based on a matrix expression comprises the following steps:
s1: establishing an initial information relation matrix in a vector description mode, performing intersection operation on all line segments, dispersing two-dimensional line segments, and establishing a matrix for describing all topological relations between nodes and the line segments;
s2: removing all line segments and nodes which cannot form the block boundary according to the topological relation matrix established in the step S1, and establishing a new topological relation matrix which only contains the block boundary;
s3: and searching the node numbers in the new topological relation matrix established in the step S2 to realize block searching.
In a preferred embodiment of the present invention, the specific method for establishing the matrix describing all topological relationships between the nodes and the line segments in step S1 is as follows:
s1.1: inputting initial basic information, wherein the initial basic information is a group of node information and a group of line segment information, each line segment consists of two nodes, and the node array does not contain nodes which are not used by the line segment;
s1.2: mutually intersecting each line segment, recording all intersection points, dispersing the line segments according to the intersection points to form line segments for searching blocks, and intersecting the dispersed line segments only at nodes;
s1.3: and establishing a matrix describing the topological relation between the nodes and the line segments on the basis of the nodes.
The specific method for establishing the new topological relation matrix only including the block boundary in the step S2 is as follows:
s2.1: based on the topological relation matrix between the points and the line segments established in the step S1, deleting the nodes which are used only once, and simultaneously deleting the line segments using the nodes;
s2.2: after deleting nodes and line segments which can not form a block, establishing a new topological relation matrix between the points and the line segments;
when a node is used by more than two line segments, the line segments in the matrix are sorted counterclockwise according to their corresponding space vectors.
The specific method for realizing the two-dimensional block search in the step S3 is as follows:
s3.1: traversing the judgment index of the directed line segment in the new topological relation matrix established in the step S2, namely recording the index of whether the line segment is used or not, when the judgment index is not 0, taking the node number as the block initial number i, taking another node of the line segment as the next node number j, and modifying the judgment index of the directed line segment to be 0 after use; taking j as i, repeating the previous operation until the searching obtains a node with the same initial number, closing the block body, and finishing the searching of 1 block body;
s3.2: repeating the step S3.1 until the judgment indexes of all directed line segments in the matrix are all changed into 0, and finishing the block body searching;
in the searching process, the block body and the boundary are distinguished according to the serial number sequence of the nodes in the block body, the nodes are the block body when being sorted according to the clockwise, and the nodes are the boundary when being sorted according to the counterclockwise.
The invention can realize the searching of the block body with any shape, the block body and the boundary range have a uniform expression, the searching of two-dimensional full space is realized, the searching speed is high, and a foundation is provided for developing the related research of jointed rock mass.
Drawings
FIG. 1 is a flow chart of the present invention;
FIG. 2A is the initial node information input by the present invention;
FIG. 2B is the initial line segment number entered by the present invention;
FIG. 3A illustrates node, line segment information and numbering prior to line segment intersection according to the present invention;
FIG. 3B is the node, segment information and numbering after the segment intersection of the present invention;
FIG. 4A is the relationship matrix after the invention removes nodes that are used only 1 time;
FIG. 4B is the node, line segment information and number after the invention removes the node that is used only 1 time;
FIG. 5 is a schematic diagram of the ordering of common node line segments according to spatial location relationships in accordance with the present invention;
fig. 6 is the overall process of the block search of the present invention.
Detailed Description
The structure and features of the present invention will be described in detail below with reference to the accompanying drawings and examples. It should be noted that various modifications can be made to the embodiments disclosed herein, and therefore, the embodiments disclosed in the specification should not be construed as limiting the present invention, but merely as exemplifications of embodiments, which are intended to make the features of the present invention apparent.
As shown in fig. 1, the two-dimensional block cutting and searching method based on the matrix expression provided by the present invention comprises:
s1: establishing an initial information relation matrix in a vector description mode, performing intersection operation on all line segments, dispersing two-dimensional line segments, and establishing a matrix for describing all topological relations between nodes and the line segments, wherein the method specifically comprises the following steps:
s1.1: initial basic information is input, the initial basic information is a group of node information and a group of line segment information, each line segment consists of two nodes, and in order to guarantee the data tightness, the node array does not contain nodes which are not used by the line segments.
As shown in fig. 2A and 2B, in the preferred embodiment of the present invention, the number of the input initial nodes is 16, i.e., node 1 to node 16. The number of initial segments is 10, i.e., segments 1-10, each segment consisting of two nodes.
S1.2: and mutually intersecting each line segment, recording all intersection points, dispersing the line segments according to the intersection points to form line segments for searching the block body, and intersecting the dispersed line segments only at nodes.
As shown in fig. 3A and 3B, each line segment is intersected with each other to generate an intersection point 17 — an intersection point 25; and then, dispersing the line segments according to the intersection points to form new line segments for searching the block. For example, if the line segment 7 intersects the line segment 1, the line segment 10, and the line segment 9, and the line segment 7 has 3 intersections, the line segment 7 is discretized into 4 line segments, and the discretized line segments intersect only at the nodes.
S1.3: and establishing a matrix describing the topological relation between the nodes and the line segments on the basis of the nodes.
S2: clearing all line segments and nodes which can not form the block boundary according to the topological relation matrix established in the step S1, and establishing a new topological relation matrix which only contains the line segments and the nodes which can form the block boundary, wherein the specific method comprises the following steps:
s2.1: based on the topological relation matrix between the points and the line segments established in the step S1, deleting the nodes which are used only once, and simultaneously deleting the line segments using the nodes;
nodes 5-16 in fig. 3A are all used only once, so it is necessary to delete these nodes and the line segments containing these solutions. It should be noted that after the node and the line segment are deleted, a new node used only once may appear, and at this time, the above steps need to be repeated until there is no node used only once, as shown in fig. 4B, and fig. 4B renumbers the remaining nodes.
S2.2: and after deleting the nodes and line segments which can not form the block, establishing a new topological relation matrix between the points and the line segments.
When a node is used with more than 2 line segments, the line segments in the matrix are sorted counterclockwise by their corresponding space vectors, as shown in FIG. 5.
S3: two-dimensional loop search, namely search of a two-dimensional block, is realized through the node number in the new topological relation matrix established in the searching step S2, and the specific method comprises the following steps: the search process is as shown in figure 6,
s3.1: traversing the judgment index of the directed line segment in the new topological relation matrix established in the step S2, namely recording the index of whether the line segment is used or not, when the judgment index is not 0, taking the node number as the block initial number i, taking another node of the line segment as the next node number j, and modifying the judgment index of the directed line segment to be 0 after use; taking j as i, repeating the previous operation until the searching obtains a node with the same initial number, closing the block body, and finishing the searching of 1 block body;
s3.2: repeating the step S3.1 until the judgment indexes of all the directed line segments in the matrix become 0, and ending the block searching;
during searching, the block and the boundary are distinguished according to the numbering sequence of the nodes in the block, the nodes are the block when sorted according to the clockwise, and the nodes are the boundary when sorted according to the counterclockwise.
The invention can realize the search of the block body with any shape, the block body and the boundary range have a uniform expression, the search of two-dimensional full space is realized, the search speed is high, and a foundation is provided for the development of the related research of jointed rock mass.
Finally, it should be noted that: the above-mentioned embodiments are only used for illustrating the technical solution of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.