Three-dimensional interference detection of pipeline segments and algorithm for obtaining the shortest distance point
The algorithm addresses the inefficiency in predicting spatial relationships by calculating perpendicular lines and intersection points between pipeline segments, enhancing pipeline construction efficiency and quality.
Patent Information
- Application Number
- CN202111084515.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-16
- Publication Date
- 2024-12-31
- Estimated Expiration
- 2041-09-16
AI Technical Summary
Existing three-dimensional pipeline network systems lack efficient and reliable algorithms for accurately predicting spatial relationships between pipeline segments, leading to increased labor and time costs in engineering design and construction.
A pipeline segment three-dimensional spatial interference detection and shortest distance point acquisition algorithm that calculates the common perpendicular line between two pipeline segments, determines the net distance, and checks for interference by comparing it with the sum of the pipe radii, and derives intersection points when necessary.
Accurately determines interference and intersection points, reducing time-consuming calculations and providing a reliable prediction for pipeline engineering, thereby improving construction efficiency and quality.
Smart Images

Figure CN113836674B_ABST
Abstract
Description
Technical field:
[0001] The invention relates to a pipeline segment three-dimensional space interference detection and shortest distance point acquisition algorithm. Background technology:
[0002] At present, pipeline network construction is the material basis for the survival and development of cities and industrial buildings. In order to adapt to the development of the times, a three-dimensional pipeline network management system with information data and scientific management has been established for the increasingly complex pipeline network system. For complex pipeline network systems, while ensuring real and reliable spatial data management, efficient and feasible three-dimensional spatial analysis algorithms are more needed to accurately predict the spatial relationship between pipelines, bring more scientific and efficient management measures to engineering design and construction, improve the quality and construction progress of pipeline network engineering construction, and reduce labor costs and time costs.
[0003] The purpose of the present invention is to rely on the three-dimensional pipe network information system. By detecting the three-dimensional spatial interference of pipeline segments and obtaining the shortest distance points, the spatial relationship between different pipe segments can be accurately calculated, and the shortest distance points and the shortest clear distance between pipe segments can be marked, so as to provide scientific and intuitive prediction effects for engineering design and construction personnel, handle the spatial relationship between complex pipe networks, improve the quality of pipe network construction, shorten labor costs and time costs, and improve the economic benefits in the process of pipe network construction. Summary of the invention:
[0004] The present invention aims to solve the problems existing in the above-mentioned prior art and provides a pipeline segment three-dimensional spatial interference detection and shortest distance point acquisition algorithm.
[0005] The technical solutions adopted in the present invention are:
[0006] The present invention is based on the unity3d pipeline segment three-dimensional space interference detection and shortest distance point acquisition algorithm, and takes any two pipeline segments L1 (starting point coordinates P LA1 , P LB1 , pipe diameter R1), L2 (starting point coordinates P LA2 , P LB2 , pipe diameter R2); calculate the common perpendicular line between L1 and L2
[0007] If L N ! = 0, connect any two points on L1 and L2 (P LA1 , P LA2 ) is L A12 , the net distance between the two line segments D = (L N ·L A12 ) / |L N |;
[0008] When D<R1+R2, there is a possibility of interference between the two pipelines in the space. It is necessary to infinitely enlarge the length space of the two pipelines and fit the two pipelines to intersect in the wireless space. By deriving the intersection formula, the shortest distance point between the two pipelines in the space is obtained, and it is judged whether the distance point is within the value range of each pipeline segment. Finally, it is determined whether the two pipeline segments interfere.
[0009] The clear distance of pipeline segments in three-dimensional space satisfies the following formula:
[0010] 1) If L N = 0, the two line segments are parallel or coincident,
[0011] but
[0012] Right now
[0013] L1, L A12 The angle between two vectors.
[0014]
[0015] Therefore L N = 0,
[0016] 2) If L N ! = 0, then L N ·L A12 =|L N ||L A12 |COS(θ),
[0017] D=|L A12 |COS(θ), where θ is the common perpendicular line between the two pipeline segments and the connection between any two points on L1 and L2, i.e., L A12 Angle,
[0018] Therefore L N ! = 0, D = (L N ·L A12 ) / |L N |.
[0019] 3) When D<R1+R2, the two pipe segments extend infinitely and there is interference. If L N = 0, the two line segments may overlap, L N !=0It is necessary to find out the coordinates of the interference point and determine whether the interference point is on the pipeline segment.
[0020] The spatial straight line coordinates of non-parallel pipeline segments satisfy the following formula:
[0021] 1) The coordinate formula of the pipeline segment space straight line L1 is:
[0022] L1(t1)=P LA1 +d1*t1 where d1=P LB1 -P LA1 Its direction vector
[0023] 2) The coordinate formula of the pipeline segment space straight line L2 is:
[0024] L2(t2)=P LA2 +d2*t2where d2=P LB2 -P LA2 where is its direction vector,
[0025] 3) When two spatial straight lines are extended infinitely, there must be an intersection between the two straight lines, satisfying the following
[0026] L1(t1)=L2(t2), that is, P LA1 +d1*t1=P LA2 +d2*t2
[0027] 4) Find the intersection point t1 on L1(t1):
[0028] Where d2*t2=0,
[0029]
[0030] 5) Find the intersection point t2 on L2(t2):
[0031] Where d2*t2=0,
[0032]
[0033] 6) Substitute the calculated value into the straight line formula in 1) and 2) to obtain the intersection point P L1t1 , P L2t2
[0034] Determine whether the intersection point is on the pipe segment:
[0035] (1) If the two pipe segments coincide, determine P LA2 or P LB2 Is it in P L1 P LA2 .x is in (P LA1 .x,P LB1 .x) interval, P LA2 .y is in (P LA1 .y,P LB1 .y) interval, P LA2 .z Is it in (P LA1 .z,P LB1 .z) interval or PLB2 .x is in (P LA1 .x,P LB1 .x) interval, P LB2 .y is in (P LA1 .y,P LB1 .y) interval, P LB2 .z Is it in (P LA1 .z,P LB1 .z) interval. If in the interval, the two pipe sections overlap, interfere, and have infinite intersection points
[0036] (2) If the straight lines of the two pipe segments do not overlap, determine the intersection point P L1t1 Is it in P L1 The intersection point P L2t2 Is it in P L2 The judgment method is similar to that in (1). If both conditions are met, the two pipe sections interfere with each other, and the interference point P0 = (P L1t1 +P L2t2 ) / 2.
[0037] The present invention obtains the common perpendicular line of any two pipelines in space by cross-product between the starting points of the spatial pipelines, and the distance projected on the common perpendicular line by the line connecting any point on the two pipelines is the net distance between the spatial pipelines. By comparing the net distance with the sum of the cross-sectional radius between the two pipelines, it is determined whether the two pipelines interfere with each other, and then the pipelines are infinitely extended in three-dimensional space. By assuming that the two straight lines intersect through the fitting method, the intersection calculation formula is derived, and the intersection is the interference point. The beneficial effect produced thereby is: through this algorithm, whether the two pipelines interfere and the interference point between the pipelines can be accurately calculated, avoiding the time-consuming algorithm of spatial judgment calculation of dense point cloud data on the model space surface, improving the efficiency of calculation, and providing a real and reliable prediction effect for three-dimensional pipeline engineering designers and construction. Description of the drawings:
[0038] Figure 1 Logic diagram of spatial pipeline segment interference check.
[0039] Figure 2 Any two parallel pipelines in three-dimensional space.
[0040] Figure 3 Any two non-parallel pipelines in three-dimensional space. Specific implementation method:
[0041] The present invention will be further described below in conjunction with the accompanying drawings.
[0042] The present invention is implemented based on the unity3d three-dimensional space pipe network.
[0043] Figure 1 Logic diagram of spatial pipeline segment interference check.
[0044] Step 1: In the Unity 3D space, establish two random pipeline space models as L1 and L2 and record the relevant comprehensive information of the pipeline segments, including the pipe diameters R1 and R2, the starting point coordinate information L1 (P LA1 , P LB1 )、L2(P LA2 , P LB2 ).
[0045] Step 2: Calculate the common vertical line of the pipelines at both ends.
[0046] Step 3: Use the common perpendicular line to determine whether the two pipelines overlap or are parallel, and calculate the net distance. Figure 2 .
[0047] Step 3.1 If the overlap and satisfy
[0048] Right now
[0049] L1, L A12 The angle between two vectors.
[0050] Step 3.2, use the inverse trigonometric function to find the angle formula and obtain L1 and L A12 Angle between two vectors
[0051]
[0052] Step 3.3, calculate the pipeline spacing under parallelism
[0053] Step 3.4, the two pipelines do not overlap, such as Figure 3 , that is, L N !=0 to obtain the clear distance between two pipelines:
[0054] 1) L N ·L A12 =|L N ||L A12 |COS(θ),
[0055] 2) Wherein the clearance 2) D = | L A12 |COS(θ)
[0056] θ is the common perpendicular line between the two pipe segments and the line connecting any two points on L1 and L2, i.e. L A12 Angle, from 1) and 2) the net distance D = (L N ·L A12 ) / |L N |.
[0057] D<R1+R2 LN =0
[0058] Step 3.5 When two line segments are extended infinitely in space and there is interference, if the two line segments may overlap, L N !=0It is necessary to find out the coordinates of the interference point and determine whether the interference point is on the pipeline segment.
[0059] Step 4, calculate the coordinates of the shortest distance point on the pipeline.
[0060] Step 4.1, the coordinate formula of the pipeline segment space straight line L1 is:
[0061] L1(t1)=P LA1 +d1*t1 where d1=P LB1 -P LA1 Its direction vector
[0062] Step 4.2 The coordinate formula of the pipeline segment space straight line L2 is:
[0063] L2(t2)=P LA2 +d2*t2 where d2=P LB2 -P LA2 is its direction vector,
[0064] Step 4.3 When two spatial straight lines are extended infinitely, there must be an intersection between the two straight lines, satisfying the following:
[0065] L1(t1)=L2(t2), that is, P LA1 +d1*t1=P LA2 +d2*t2
[0066] Step 4.4 Find the intersection point t1 on L1(t1):
[0067] Where d2*t2=0,
[0068]
[0069] Step 4.5 Find the intersection point t2 on L2(t2):
[0070] Where d2*t2=0,
[0071]
[0072] Step 4.6 Substitute the calculated value into the straight line formula in 1) and 2) to obtain the intersection point P L1t1 , P L2t2
[0073] Step 5: Determine whether the coordinates of the shortest distance point are on the pipeline segment and whether the pipelines interfere. Figure 3
[0074] (1) If the two pipe segments coincide, determine P LA2 or P LB2 Is it in P L1 P LA2 .x is in (P LA1 .x,P LB1 .x) interval, P LA2 .y is in (P LA1 .y,P LB1 .y) interval, P LA2 .z Is it in (P LA1 .z,P LB1 .z) interval or P LB2 .x is in (P LA1 .x,P LB1 .x) interval, P LB2 .y is in (P LA1 .y,P LB1 .y) interval, P LB2 .z Is it in (P LA1 .z,P LB1 .z) interval. If in the interval, the two pipe sections overlap, interfere, and have infinite intersection points
[0075] (2) If the straight lines of the two pipe segments do not overlap, determine the intersection point P L1t1 Is it in P L1 The intersection point P L2t2 Is it in P L2 The judgment method is similar to that in (1). If both conditions are met, the two pipe sections interfere with each other, and the interference point P0 = (P L1t1 +P L2t2 ) / 2.
[0076] The above description is only a preferred embodiment of the present invention. It should be pointed out that a person skilled in the art can make several improvements without departing from the principle of the present invention, and these improvements should also be regarded as within the protection scope of the present invention.
Claims
1. Pipeline segment three-dimensional spatial interference detection and shortest distance point acquisition algorithm, characterized by: Take any two pipeline segments L1 and L2 in three-dimensional space, and set the coordinates of the starting point of L1 to be P LA1 , P LB1 , the starting point coordinates of L2 are P LA2 , P LB2 ; The diameter of L1 is R1, and the diameter of L2 is R2; According to the formula Calculate the common perpendicular line between L1 and L2. If L N ! = 0, connect any two points P on L1 and L2 LA1 , P LA2 For L A12 , the net distance between the two points is D = (L N ·L A12 ) / |L N |; When D<R1+R2, there is interference in the infinite extension direction of the two pipeline segments in the three-dimensional space. It is necessary to infinitely enlarge the length space of the two pipelines, fit that the two pipelines intersect in the wireless space, and derive the intersection formula to obtain the shortest distance point between the two pipelines, judge whether the distance point is within the value range of each pipeline segment, and finally determine whether the two pipeline segments interfere; formula In, if L N = 0, pipeline segments L1 and L2 are parallel or overlapped, but Right now Where: L1, L A12 The angle between two vectors, Therefore L N = 0, formula In, if L N ! = 0, then L N ·L A12 =|L N ||L A12 |COS(θ),D=|L A12 |COS(θ), where: θ is the common perpendicular line L between the two pipe segments N With L A12 Angle; Therefore L N ! = 0, D = (L N ·L A12 ) / |L N |; When D<R1+R2, the two pipe segments extend infinitely and there is interference. N = 0, then the two pipe segments may overlap. If L N ! = 0, it is necessary to find the coordinates of the interference point and determine whether the interference point is on the pipeline segment; The process of solving the interference point coordinates is: 1) The coordinate formula of the pipeline segment space straight line L1 is: L1(t1)=P LA1 +d1*t1 where d1=P LB1 -P LA1 is its direction vector; 2) The coordinate formula of the pipeline segment space straight line L2 is: L2(t2)=P LA2 +d2*t2 where d2=P LB2 -P LA2 is its direction vector; 3) When two spatial straight lines are extended infinitely, there must be an intersection between the two straight lines, satisfying the following: L1(t1)=L2(t2), that is, P LA1 +d1*t1=P LA2 +d2*t2 4) Find the intersection point t1 on L1(t1) Where d2*t2=0, 5) Find the intersection point t2 on L2(t2) Where d2*t2=0, Substitute the calculated t1 and t2 into the straight line formula in 1) and 2) to obtain the intersection point P L1t1 , P L2t2 .
2. The pipeline segment three-dimensional space interference detection and shortest distance point acquisition algorithm as claimed in claim 1, characterized in that: If the two pipe segments coincide, determine P LA2 or P LB2 Is it in P L1 On, that is: P LA2 .x is in (P LA1 .x,P LB1 .x) interval, P LA2 .y is in (P LA1 .y,P LB1 .y) interval, P LA2 .z Is it in (P LA1 .z,P LB1 .z) interval or P LB2 .x is in (P LA1 .x,P LB1 .x) interval, P LB2 .y is in (P LA1 .y,P LB1 .y) interval, P LB2 .z Is it in (P LA1 .z,P LB1 .z) interval, if it is within the corresponding interval, the two pipe sections coincide and interfere, and there are infinitely many intersection points; If the two pipe segments do not overlap, determine the intersection point P L1t1 Is it in P L1 The intersection point P L2t2 Is it in P L2 The judgment method is the same as the method of coinciding the straight lines of two pipe segments; if P L1t1 It is in P L1 On, intersection point P L2t2 In P L2 On, the two pipe sections interfere, and the interference point P0 = (P L1t1 +P L2t2 ) / 2.
