CN106844921B - Method for realizing butt joint of pipeline connection middleware model and pipelines at two ends in three-dimensional scene - Google Patents

Method for realizing butt joint of pipeline connection middleware model and pipelines at two ends in three-dimensional scene Download PDF

Info

Publication number
CN106844921B
CN106844921B CN201710019303.1A CN201710019303A CN106844921B CN 106844921 B CN106844921 B CN 106844921B CN 201710019303 A CN201710019303 A CN 201710019303A CN 106844921 B CN106844921 B CN 106844921B
Authority
CN
China
Prior art keywords
pipeline
point
middleware model
pipeline connection
points
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.)
Active
Application number
CN201710019303.1A
Other languages
Chinese (zh)
Other versions
CN106844921A (en
Inventor
谢文锐
余延远
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fuzhou Fuguang Water Science & Technology Co ltd
Original Assignee
Fuzhou Fuguang Water Science & Technology Co ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Fuzhou Fuguang Water Science & Technology Co ltd filed Critical Fuzhou Fuguang Water Science & Technology Co ltd
Priority to CN201710019303.1A priority Critical patent/CN106844921B/en
Publication of CN106844921A publication Critical patent/CN106844921A/en
Application granted granted Critical
Publication of CN106844921B publication Critical patent/CN106844921B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F30/00Computer-aided design [CAD]
    • G06F30/20Design optimisation, verification or simulation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2113/00Details relating to the application field
    • G06F2113/14Pipes

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Evolutionary Computation (AREA)
  • Geometry (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Image Processing (AREA)
  • Complex Calculations (AREA)

Abstract

The invention provides a method for realizing the butt joint of a pipeline connection middleware model and pipelines at two ends in a three-dimensional scene, which comprises the following steps: 1. acquiring a point data set to be processed of a pipeline on a pipeline plane of a three-dimensional scene; 2. performing situation-based judgment on the point data set and obtaining a pipeline connection middleware model of which angle type is selected; 3. judging the point data set to be processed according to the situation and obtaining the rotation angle of the pipeline connecting middleware model; 4. and (4) storing the results obtained in the step (2) and the step (3) into corresponding layer data sets, and butting the pipeline connection middleware model with pipelines at two ends. The invention can accurately realize the butt joint of the pipeline connection middleware model and the pipelines at two ends in the pipeline plane of the three-dimensional scene.

Description

Method for realizing butt joint of pipeline connection middleware model and pipelines at two ends in three-dimensional scene
Technical Field
The invention relates to a method for realizing butt joint of a pipeline connection middleware model and pipelines at two ends in a three-dimensional scene, in particular to a method for selecting the angle type of the pipeline connection middleware model on a pipeline plane of the three-dimensional scene and rotating the model to a corresponding angle to butt joint the pipelines at two ends.
Background
In a three-dimensional scene, when pipe network data is imported into an application system, characteristic points such as a two-way joint and a three-way joint exist at a connection point between pipelines, and in the three-dimensional scene, problems of a direction, a rotation angle and a connection angle of the two pipelines also exist. If one of the above three conditions is wrong in the three-dimensional scene, what is displayed in the system is also wrong. As shown in fig. 1, the error results after the system is introduced due to errors in direction, angle and rotation angle.
In fig. 1, the projected two-way pipe should be turned right originally, but since the direction of the pipe network data is not considered when the pipe network data is introduced into the system, an error occurs. Causing the head of the two-way to the left.
When an operator adds the pipeline connection middleware model to the three-dimensional scene, the pipeline connection middleware model is not accurately connected with the pipeline but deviates because the initial alignment direction of the pipeline connection middleware model is basically horizontal and transverse, so that the display error on the three-dimensional scene is caused, and the three-dimensional scene is not attractive.
Disclosure of Invention
The technical problem to be solved by the invention is to provide a method for realizing the butt joint of a pipeline connection middleware model and pipelines at two ends in a three-dimensional scene, and the butt joint of the pipeline connection middleware model and the pipelines at two ends can be accurately realized in a pipeline plane of the three-dimensional scene.
The invention is realized by the following steps: a method for realizing the butt joint of a pipeline connection middleware model and pipelines at two ends in a three-dimensional scene comprises the following steps:
step 1, acquiring a point data set to be processed of a pipeline on a pipeline plane of a three-dimensional scene;
step 2, performing situation-based judgment on the point data set and obtaining a pipeline connection middleware model of which angle type is to be selected;
step 3, performing situation-based judgment on the point data set to be processed and obtaining a rotation angle of the pipeline connecting middleware model;
and 4, storing the results obtained in the step 2 and the step 3 into corresponding layer data sets, and butting the pipeline connection middleware model with pipelines at two ends.
Further, the step 1 specifically comprises:
step 1.1, defining a point data set points to be processed, acquiring SmX coordinates and SmY coordinates in a pipeline connection middleware model point element to be processed, generating a new two-dimensional point points A from SmX coordinates and SmY coordinates, and adding the point A into the points;
step 1.2, acquiring all pipeline elements connected with the pipeline connection middleware model, judging the element types of the Point elements of the pipeline connection middleware model, if the element types are variable diameter, adding the end points which are not equal to the two-dimensional Point A generated in the step 1.1 in the two end points of one pipeline element with the large value of the variable diameter in the pipeline elements connected with the element into points, and adding a new two-dimensional Point2D into the points; if the element type of the pipeline connection middleware model Point element is 'pipe blockage', adding an end Point which is not equal to the two-dimensional Point A generated in the step 1.1 in two end points of the only pipeline element connected with the pipeline connection middleware model into points, and adding a new two-dimensional Point2D into the points; if the element type of the pipeline connection middleware model point element is other types, adding the end points which are not equal to the two-dimensional point pointA generated in the step 1.1 in the two end points of each pipeline element connected with the pipeline connection middleware model into points;
and step 1.3, taking points added completely as a point data set to be processed.
Further, the step 2 specifically includes:
step 2.1, specifically judging the point data set points to be processed generated in the step 1, wherein if the type of the element of the point element of the pipeline connection middleware model in the points is variable diameter, the type of the angle of the pipeline connection middleware model is 180 degrees; otherwise, entering step 2.2;
step 2.2, specifically calculating the angle type of the pipeline connection middleware model: extracting three point elements in points in sequence, wherein the three point elements are respectively pipeline connection middleware model point elements: point2D
aPoint2D ═ pointList [0], the pipe connection middleware model connects the endpoints of pipe 1: point2DbPoint2D ═ pointList [1], the pipeline connection middleware model connects the endpoints of pipeline 2: point2D cPoint2D ═ pointList [2], a cosine value pipLineCosine of an included angle between two pipelines is obtained through vectors for X and Y coordinates of three points, and then through a mathematical formula: and (ArcCos (pipLineCosine) 180)/pi, calculating the included angle of the two pipelines, and finally obtaining the angle result of the pipeline connection middleware model to be selected according to the angle interval to which the included angle belongs.
Further, the step 3 specifically includes:
step 3.1, specifically judging the point data sets points to be processed generated in the step 1, if the element type of the pipeline connecting middleware model point element is 'tee', obtaining the rotation angle by quadrant judgment but by angle judgment of the connected pipelines; if the element type of the pipeline connecting middleware model point element is not 'tee', obtaining a rotation angle after quadrant judgment, and if the element type of the pipeline connecting middleware model point element is 'valve', obtaining a final result by further adding 90 degrees or subtracting 90 degrees after the rotation angle is obtained; otherwise, the final result is obtained;
step 3.2, respectively carrying out different operations according to different conditions of the step 3.1: if the type of the element of the pipeline connection middleware model point element is 'tee', judging the included angle between the three connected pipelines, if the included angle between one pipeline and the other two pipelines is 90 degrees, selecting the pipeline as a rotation reference edge, and obtaining the rotation angle by using the end point of one end of the pipeline, which is not connected with the pipeline connection middleware model, and the pipeline connection middleware model point element; if the type of the element of the pipeline connecting middleware model point element is not tee, judging whether the element is pipe blockage, and if the element is pipe blockage, directly taking the only one connected pipeline as a rotary reference edge; otherwise, judging the quadrants of the two connected pipelines, determining a rotary reference edge according to the quadrants and the horizontal and longitudinal included angles with the horizontal direction, and acquiring the rotation angle of an end point of the pipeline of the rotary reference edge, which is not connected with the pipeline connection middleware model, and the pipeline connection middleware model point element;
step 3.3, calculating the endpoint point2D at one end of the rotating reference side pipeline and the pipeline connecting middleware model point element aPoint2D obtained in the step 3.2: if the Y coordinate of point2D is greater than the Y coordinate of aPoint2D, the rotation reference side pipeline is in a quadrant of two, and the rotation angle calculation formula is as follows: 180+ ArcTan (point2d.y-apoint2d.y, point2d.x-apoint2d.x) 180/pi; otherwise, rotating the reference edge pipeline in three-four quadrants, wherein the calculation formula of the rotation angle is as follows: ArcTan (aPoint2D.Y-point2D.Y, aPoint2D.X-point2D.X) × 180/π; if the element type of the pipeline connecting middleware model point element is 'valve' and the calculated rotation angle is less than or equal to 90 degrees, the final rotation angle result is the calculated result plus 90 degrees, and if the element type of the pipeline connecting middleware model point element is 'valve' and the calculated rotation angle is greater than 90 degrees, the final rotation angle result is the calculated result minus 90 degrees; and if the type of the element of the pipeline connecting middleware model point element is not a valve, obtaining a final rotation angle result through calculation.
Further, step 4 specifically includes: and (3) writing the angle type result of the pipeline connection middleware model obtained in the step (2) and the rotation angle result of the pipeline connection middleware model obtained in the step (3) into a corresponding layer element set, and enabling an operator to carry out butt joint operation on the pipeline connection middleware model and pipelines at two ends according to the two results.
The invention has the following advantages: the method comprises the steps of judging the situation of a point data set according to the situation and obtaining a pipeline connection middleware model of which angle type is to be selected; judging the point data set to be processed according to the situation and obtaining the rotation angle of the pipeline connecting middleware model; storing the obtained result into a corresponding layer data set, and butting a pipeline connection middleware model with pipelines at two ends; therefore, the pipeline connection middleware model can be accurately butted with the pipelines at two ends in the pipeline plane of the three-dimensional scene.
Drawings
The invention will be further described with reference to the following examples with reference to the accompanying drawings.
FIG. 1 is a schematic diagram of a conventional two-way pipe with an error after being introduced into a system.
FIG. 2 is a schematic flow chart of the method of the present invention.
FIG. 3 is a detailed flow chart of step 1 of the present invention.
FIG. 4 is a detailed flow chart of step 2 of the present invention.
FIG. 5 is a detailed flow chart of step 3 and step 4 of the present invention.
Fig. 6 is a schematic flow chart illustrating detailed analysis and design of the rotation angle calculation method according to the first embodiment.
Fig. 7 is a schematic flow chart illustrating detailed analysis and design of the rotation angle calculation method according to the second embodiment.
Fig. 8 is a schematic flow chart illustrating detailed analysis and design of the rotation angle calculation method according to the third embodiment.
Fig. 9 is a schematic flow chart illustrating detailed analysis and design of the rotation angle calculation method according to the fourth embodiment.
Detailed Description
Referring to fig. 2, a method for realizing the butt joint of a pipeline connection middleware model and two end pipelines in a three-dimensional scene includes the following steps:
step 1, acquiring a point data set to be processed of a pipeline on a pipeline plane of a three-dimensional scene;
step 2, performing situation-based judgment on the point data set and obtaining a pipeline connection middleware model of which angle type is to be selected;
step 3, performing situation-based judgment on the point data set to be processed and obtaining a rotation angle of the pipeline connecting middleware model;
and 4, storing the results obtained in the step 2 and the step 3 into corresponding layer data sets, and butting the pipeline connection middleware model with pipelines at two ends.
The specific steps of step 1 are as follows:
1.1 defining a Point data set List < Point2D > points to be processed, acquiring SmX coordinates and SmY coordinates in a Point element of a pipeline connection middleware model to be processed, generating a new two-dimensional Point2D Point A from the SmX coordinates and the SmY coordinates, and adding the Point into the points;
1.2 acquiring all pipeline elements connected with the pipeline connection middleware model, judging the element type of the Point element of the pipeline connection middleware model, if the element type is variable diameter, adding an end Point which is not equal to the two-dimensional Point A generated in the step 1.1 in two end points of one pipeline element with a larger value of the variable diameter in the pipeline element connected with the element into points, and adding a two-dimensional Point new Point2D (0,0) into the points; if the element type of the pipeline connecting middleware model Point element is 'pipe blockage', adding an end Point which is not equal to the two-dimensional Point A generated in the step 1.1 in two end points of a unique pipeline element connected with the model into points, and adding a two-dimensional Point new Point2D (0,0) into the points; and if the element type of the pipeline connecting middleware model point element is other types, adding the end points which are not equal to the point A of the two-dimensional points generated in the step 1.1 in the two end points of each pipeline element connected with the model into points.
1.3 the generated points are used as the point data set to be processed.
The specific steps of step 2 are as follows:
2.1, specifically judging the point data set points to be processed generated in the step 1, wherein if the element type of the point element of the pipeline connection middleware model in the points is variable diameter, the angle type of the pipeline connection middleware model is 180 degrees; otherwise, the angle type needs to be calculated;
2.2 according to the step 2.1, if the element type of the pipeline connecting middleware model point element is not variable diameter, performing specific calculation: extracting three Point elements in points in sequence, namely a pipeline connecting middleware model Point element (an included angle between two pipelines) Point2D aPoint2D ═ Point List [0] (representing the first data in a Point data set), an endpoint Point2D bPoint2D of a pipeline 1 connected by the middleware is ═ Point List [1], an endpoint Point2DcPoint2D of a pipeline 2 connected by the middleware is ═ Point List [2], calculating an included angle cosine value pipLineCosine of the two pipelines for X and Y coordinates of the three points through a vector algorithm, and then calculating an included angle cosine value pipLineCosine of the two pipelines through a mathematical formula: and (ArcCos (pipLineCosine) 180)/pi, calculating the included angle of the two pipelines, and finally obtaining the angle result of the pipeline connection middleware model to be selected according to the angle interval to which the included angle belongs.
The specific steps of step 3 are as follows:
3.1, specifically judging the point data set points to be processed generated in the step 1, if the element type of the pipeline connecting middleware model point element is 'tee', the rotation angle cannot be calculated by quadrant judgment, and the rotation angle is calculated by the included angle judgment of the connected pipelines; if the element type of the pipeline connecting middleware model point element is not 'tee', calculating a rotation angle after quadrant judgment, and if the element type of the pipeline connecting middleware model point element is 'valve', further calculating to obtain a final result after calculating the rotation angle; otherwise, the final result is obtained
3.2 according to the different conditions of the step 3.1, respectively carrying out different operations: if the type of the element of the pipeline connection middleware model point element is 'tee', judging the included angle between the three connected pipelines, if the included angle between one pipeline and the other two pipelines is 90 degrees, selecting the pipeline as a rotating reference edge, and calculating the rotating angle of the end point of the pipeline which is not connected with the pipeline connection middleware model and the pipeline connection middleware model point element; if the type of the element of the pipeline connecting middleware model point element is not tee, judging whether the element is pipe blockage, and if the element is pipe blockage, directly taking the only one connected pipeline as a rotary reference edge; otherwise, judging the quadrants of the two connected pipelines, determining a rotary reference edge according to the quadrants and the horizontal and longitudinal included angles with the horizontal direction, and calculating the rotation angle of the end point of the pipeline of the rotary reference edge, which is not connected with the pipeline connection middleware model, and the pipeline connection middleware model point element;
3.3, calculating the end Point (Point2D Point2D) of one end of the rotating reference side pipeline obtained in the step 3.2 and the pipeline connecting middleware model Point element (Point2D aPoint 2D): if the Y coordinate of point2D is greater than the Y coordinate of aPoint2D, the rotation reference side pipeline is in a quadrant of two, and the rotation angle calculation formula is as follows: 180+ ArcTan (point2d.y-apoint2d.y, point2d.x-apoint2d.x) 180/pi; otherwise, rotating the reference edge pipeline in three-four quadrants, wherein the calculation formula of the rotation angle is as follows: ArcTan (aPoint2D.Y-point2D.Y, aPoint2D.X-point2D.X) × 180/π. If the element type of the pipeline connecting middleware model point element is 'valve' and the calculated rotation angle is less than or equal to 90 degrees, the final rotation angle result is the calculated result plus 90 degrees, and if the element type of the pipeline connecting middleware model point element is 'valve' and the calculated rotation angle is greater than 90 degrees, the final rotation angle result is the calculated result minus 90 degrees; if the type of the pipeline connecting middleware model point element is not a valve, the result obtained through calculation is the final rotation angle result;
the specific steps of step 4 are as follows: and (3) writing the angle type result of the pipeline connection middleware model obtained in the step (2) and the rotation angle result of the pipeline connection middleware model obtained in the step (3) into a corresponding layer element set, and enabling an operator to carry out butt joint operation on the pipeline connection middleware model and pipelines at two ends according to the two results.
The invention is further illustrated below with reference to a specific embodiment:
referring to fig. 3, the specific steps of step 1:
1.1, defining a Point data set List < Point2D > points to be processed, acquiring SmX-118.959573262301 coordinates and SmY-25.8726265962318 coordinates in a pipeline connection middleware model Point element to be processed, generating a new two-dimensional Point2D Point A-new Point2D (SmX, SmY) and adding the new two-dimensional Point2D Point A-new Point2D (SmX, SmY) into the points;
1.2, acquiring all pipeline elements connected with the pipeline connection middleware model, and judging the element type of the pipeline connection middleware model Point element, wherein the element type of the pipeline connection middleware model Point element is 'elbow', and adding an end Point2D Point b which is not equal to the two-dimensional Point a generated in the step 1.1 in two end points of each pipeline element connected with the model to new Point2D (118.959600614754,25.8731157757925), and a Point2D Point c which is not equal to new Point2D (118.959516638785,25.8721508590648) into points.
1.3 the generated points are used as the point data set to be processed
Referring to fig. 4, the specific steps of step 2 are:
2.1, specifically judging the point data set points to be processed generated in the step 1, and if the element type of the pipeline connecting middleware model point element in the points is 'elbow', calculating the angle type;
2.2 according to the step 2.1, if the element type of the pipeline connecting middleware model point element is 'elbow', the concrete calculation is carried out: extracting three Point elements in points in sequence, namely a pipeline connecting middleware model Point element (the included angle of two pipelines) Point2D aPoint2D ═ Point List [0], an endpoint Point2D bPoint2D ═ Point List [1] of a pipeline 1 connected by the middleware, an endpoint Point2D cPoint2D ═ Point List [2] of a pipeline 2 connected by the middleware, calculating the cosine value pipLineCosine of the included angle of the two pipelines to-0.99804072265220156 by a vector algorithm for X and Y coordinates of the three points, and then calculating the cosine value pipLineCosine of the included angle of the two pipelines by a mathematical formula: (ArcCos (pipLineCosine) 180)/pi, calculating the included angle of the two pipelines to be 176.41279230077595 degrees, and finally obtaining a model with the 180-degree model of the pipeline connection middleware which should be selected according to the angle interval to which the included angle belongs;
referring to fig. 5, the specific steps of step 3 are:
3.1 specifically judging the point data set points to be processed generated in the step 1, if the element type of the pipeline connecting middleware model point element is 'elbow', calculating the rotation angle after the quadrant judgment, and the angle is the final result
3.2 according to the different conditions of the step 3.1, respectively carrying out different operations: determining the quadrants of two connected pipelines to be the first quadrant and the third quadrant respectively according to the quadrants and the horizontal and longitudinal included angles, determining a rotation reference edge, and calculating the rotation angle of an end point pointC (118.959516638785,25.8721508590648) of the rotation reference edge pipeline which is not connected with the pipeline connection middleware model and a pipeline connection middleware model point element pointA (118.959573262301,25.8726265962318)
3.3 calculating the rotating reference side pipeline end point (pointC (118.959516638785,25.8721508590648)) and the pipeline connecting middleware model point element (pointA (118.959573262301,25.8726265962318)) obtained in the step 3.2: and if the Y coordinate of the pointC is smaller than that of the pointA, rotating the reference side pipeline in three or four quadrants, wherein the calculation formula of the rotation angle is as follows: ArcTan (apoint2d.y-point2d.y, apoint2d.x-point2d.x) × 180/pi ═ ArcTan (25.8726265962318-25.8721508590648,118.959573262301-118.959516638785) × 180/pi ═ 83 °. If the type of the element of the pipeline connecting middleware model point element is 'elbow', the result obtained by calculation is 83 degrees, namely the final rotation angle result.
Quadrant judgment detailed analysis:
suppose that: a pipeline plane of a three-dimensional scene is divided into four quadrants by taking the horizontal direction as an X axis and the horizontal longitudinal direction as a Y axis, and a middleware model point element is in a two-axis intersection point, namely a digital axis origin by default.
The method comprises the following specific steps:
1. obtaining Point data set List < Point2D > pointList to be processed
2. Point data were extracted in order:
point2D aPoint2D ═ poitlist [0] (model angle end Point)
Point2D bPoint2D ═ pointList [1] (pipeline 1 endpoint)
Point2D cPoint2D ═ pointList [2] (pipeline 2 end Point)
3. Extracting the X, Y coordinates of the point data in order:
double X1=aPoint2D.X;
double Y1=aPoint2D.Y;
double X2=bPoint2D.X;
double Y2=bPoint2D.Y;
double X3=cPoint2D.X;
double Y3=cPoint2D.Y;
4. according to the judgment of the size relationship among X1, Y1, X2, Y2, X3 and Y3, the method is specifically divided into the following concentrated cases:
1)((X2>X1&&Y2>Y1)&&(X3>X1&&Y3>Y1))||((X2<X1&&Y2<Y1)&&(X3<X1&&Y3<Y1))
then the two connected pipelines are in the first quadrant or the third quadrant, and the tangent values (tan) of the included angles of the two pipelines and the X axis are compared:
selecting line 1 as the rotating reference side line if Math.abs ((Y2-Y1)/(X2-X1)) > Math.abs ((Y3-Y1)/(X3-X1), otherwise selecting line 2 as the rotating reference side line
2)((X2<X1&&Y2>Y1)&&(X3<X1&&Y3>Y1))||((X2>X1&&Y2<Y1)&&(X3>X1&&Y3<Y1))
Then the two connected pipelines are in the second quadrant or the fourth quadrant, and the tangent values (tan) of the included angles of the two pipelines and the X axis are compared:
selecting line 1 as the rotating reference side line if Math.abs ((Y2-Y1)/(X2-X1)) < Math.abs ((Y3-Y1)/(X3-X1)), otherwise selecting line 2 as the rotating reference side line
3)((X2>X1&&X3>X1)&&((Y2<Y1&&Y3>Y1)||(Y2>Y1&&Y3<Y1)))
Then one of the two connected pipelines is in the first quadrant, the other is in the fourth quadrant, and the Y-axis values of the two pipelines are compared:
if Y2> Y3
Then pipeline 1 is selected as the rotating reference side pipeline, otherwise pipeline 2 is selected as the rotating reference side pipeline
4)((X2<X1&&X3<X1)&&((Y2<Y1&&Y3>Y1)||(Y2>Y1&&Y3<Y1)))
Then one of the two connected pipelines is in the second quadrant, the other is in the third quadrant, and then the Y-axis values of the two pipelines are compared:
if Y2< Y3
Then pipeline 1 is selected as the rotating reference side pipeline, otherwise pipeline 2 is selected as the rotating reference side pipeline
5)((Y2>Y1&&Y3>Y1)&&((X2<X1&&X3>X1)||(X2>X1&&X3<X1)))
Then one of the two connected pipelines is in the first quadrant, the other is in the second quadrant, and then the X-axis values of the two pipelines are compared:
if X2< X3
Then pipeline 1 is selected as the rotating reference side pipeline, otherwise pipeline 2 is selected as the rotating reference side pipeline
6)((Y2<Y1&&Y3<Y1)&&((X2<X1&&X3>X1)||(X2>X1&&X3<X1)))
Then one of the two connected pipelines is in the third quadrant, and the other is in the fourth quadrant, and then the X-axis values of the two pipelines are compared:
if X2> X3
Then pipeline 1 is selected as the rotating reference side pipeline, otherwise pipeline 2 is selected as the rotating reference side pipeline
7)((X2>X1&&Y2>Y1)&&(X3<X1&&Y3<Y1))||((X2<X1&&Y2<Y1)&&(X3>X1&&Y3>Y1))
Then the two connected pipelines are in the first quadrant and the third quadrant, and the sizes of the tangents (tan) of the two pipelines to the X axis are compared:
selecting line 1 as the rotating reference side line if Math.abs ((Y2-Y1)/(X2-X1)) < Math.abs ((Y3-Y1)/(X3-X1)), otherwise selecting line 2 as the rotating reference side line
8)((X2<X1&&Y2>Y1)&&(X3>X1&&Y3<Y1))||((X2>X1&&Y2<Y1)&&(X3<X1&&Y3>Y1))
Then the two connected pipelines are in the second quadrant and the fourth quadrant, and the sizes of the tangents (tan) of the two pipelines to the X axis are compared:
line 1 was selected as the rotating reference side line if Math.abs ((Y2-Y1)/(X2-X1)) > Math.abs ((Y3-Y1)/(X3-X1), otherwise line 2 was selected as the rotating reference side line.
Detailed analysis of the angle type calculation algorithm:
suppose that: a pipeline plane of a three-dimensional scene is divided into four quadrants by taking the horizontal direction as an X axis and the horizontal longitudinal direction as a Y axis, and a middleware model point element is in a two-axis intersection point, namely a digital axis origin by default.
The method comprises the following specific steps:
1. obtaining Point data set List < Point2D > pointList to be processed
2. Point data were extracted in order:
point2D aPoint2D ═ poitlist [0] (model angle end Point)
Point2D bPoint2D ═ pointList [1] (pipeline 1 endpoint)
Point2D cPoint2D ═ pointList [2] (pipeline 2 end Point)
double piplinesugar; // pipeline cosine value
double angle is 0; // middleware model Angle types
3. Extracting the X, Y coordinates of the point data in order:
double E1=aPoint2D.X;double N1=aPoint2D.Y;
double E2=bPoint2D.X;double N2=bPoint2D.Y;
double E3=cPoint2D.X;double N3=cPoint2D.Y;
4. and (3) calculating the cosine value of the included angle of the two pipelines by using a vector algorithm:
pipLineCosine=((E2-E1)*(E3-E1)+(N2-N1)*(N3-N1))/(Math.Sqrt((E2-E1)*(E2-E1)+(N2-N1)*(N2-N1))*Math.Sqrt((E3-E1)*(E3-E1)+(N3-N1)*(N3-N1)));
5. calculating the included angle of the two pipelines:
aCos=(ArcCos(pipLineCosine)*180)/π
6. selecting the type of the model according to the included angle of the pipeline:
when 0< aCos and aCos < ═ 40
The angle type of the intermediate piece model is angle which is 30 degrees;
when 40< aCos and aCos < ═ 50
The angle type of the intermediate piece model is 45 degrees;
when 50< aCos and aCos < ═ 70
The angle type of the intermediate piece model is angle which is 60 degrees;
when 70< aCos and aCos < ═ 100
The angle type of the intermediate piece model is angle which is 90 degrees;
when 100< aCos and aCos < ═ 120
The angle type of the middleware model is angle which is 120 degrees;
when 120< aCos and aCos < 140
The angle type of the middleware model is 135 degrees;
when 140< aCos and aCos < 160
The angle type of the intermediate piece model is equal to 150 degrees;
when 160< aCos and aCos < 180
The angle type of the intermediate piece model is angle which is 180 degrees;
referring to FIG. 6, when the rotation reference edge line is equal to the first quadrant, the rotation angle is θ
θ=180°+∠CAD
=180°+arctan∠CAD*180/π
=180°+arctan(|N1–Y1|/|E1–X1|)*180/π
Because: n1> Y1 and E1> X1
Therefore: | N1-Y1 |/| E1-X1 | (N1-Y1)/(E1-X1)
Therefore, the rotation angle θ is 180 ° + arctan ((N1-Y1)/(E1-X1)) + 180/pi
Referring to FIG. 7, when the rotation reference edge line is equal to the second threshold, the rotation angle is θ
θ=180°+∠CAE
=180°+arctan∠CAE*180/π
because the angle CAE + ∠ CAD is 180 DEG
therefore, arc & ltCAE & gt + arc & ltCAD & gt is 0
arctan∠CAE=-arctan∠CAD
therefore, the rotation angle theta is 180-arctan 180/pi CAD
=180°-arctan(|N1–Y1|/|E1–X1|)*180/π
Because: n1> Y1 and E1< X1
Therefore: | N1-Y1 |/| E1-X1 | (N1-Y1)/((E1-X1))
Therefore, the rotation angle θ is 180 ° -arctan ((N1-Y1)/((E1-X1)))) 180/pi
=180°-arctan(-(N1–Y1)/(E1–X1))*180/π
=180°+arctan((N1–Y1)/(E1–X1))*180/π
Referring to FIG. 8, when the rotation reference edge line is equal to the third quadrant, the rotation angle is θ
θ=∠CAD
=arctan∠CAD*180/π
=arctan(|N1–Y1|/|E1–X1|)*180/π
Because: n1< Y1 and E1< X1
Therefore: | N1-Y1 |/| E1-X1 | (- (N1-Y1))/((E1-X1))
Therefore, the rotation angle θ ═ arctan (((N1-Y1))/((E1-X1)))/180/pi
=-arctan((-(N1–Y1))/(E1–X1))*180/π
=arctan((N1–Y1)/(E1–X1))*180/π
Referring to FIG. 9, when the rotation reference edge line is equal to the fourth quadrant, the rotation angle is θ
θ=∠CAW
=arctan∠CAW*180/π
because CAW + ∠ CAD is 180 °
therefore, arctan ∠ CAW + arctan & ltCAD & gt is 0
arctan∠CAW=-arctan∠CAD
so the rotation angle theta is-arctan ∠ CAD 180/pi
=-arctan(|N1–Y1|/|E1–X1|)*180/π
Because: n1< Y1 and E1> X1
Therefore: | N1-Y1 |/| E1-X1 | ═ - (N1-Y1))/(E1-X1)
Therefore, the rotation angle θ ═ arctan (((N1-Y1))/(E1-X1)) × 180/pi
=arctan((N1–Y1)/(E1–X1))*180/π
The analysis of the above four cases leads to the following conclusions:
assume the middleware model point data is A (X1, Y1), the rotating reference side pipeline end point is B (X2, Y2)
Then when Y1> Y2
The formula of the rotation angle is theta-180 DEG + arctan ((N1-Y1)/(E1-X1)). 180/pi
Otherwise
The formula of the rotation angle is θ ═ arctan ((N1-Y1)/(E1-X1)) × 180/pi.
Although specific embodiments of the invention have been described above, it will be understood by those skilled in the art that the specific embodiments described are illustrative only and are not limiting upon the scope of the invention, and that equivalent modifications and variations can be made by those skilled in the art without departing from the spirit of the invention, which is to be limited only by the appended claims.

Claims (4)

1. A method for realizing the butt joint of a pipeline connection middleware model and pipelines at two ends in a three-dimensional scene is characterized in that: the method comprises the following steps:
step 1, acquiring a point data set to be processed of a pipeline on a pipeline plane of a three-dimensional scene;
step 2, performing situation-based judgment on the point data set and obtaining a pipeline connection middleware model of which angle type is to be selected;
step 3, performing situation-based judgment on the point data set to be processed and obtaining a rotation angle of the pipeline connecting middleware model;
step 4, storing the results obtained in the step 2 and the step 3 into corresponding layer data sets, and butting the pipeline connection middleware model with pipelines at two ends;
the step 1 specifically comprises the following steps:
step 1.1, defining a point data set points to be processed, acquiring SmX coordinates and SmY coordinates in a pipeline connection middleware model point element to be processed, generating a new two-dimensional point points A from SmX coordinates and SmY coordinates, and adding the point A into the points;
step 1.2, acquiring all pipeline elements connected with the pipeline connection middleware model, judging the element types of the Point elements of the pipeline connection middleware model, if the element types are variable diameter, adding the end points which are not equal to the two-dimensional Point A generated in the step 1.1 in the two end points of one pipeline element with the large value of the variable diameter in the pipeline elements connected with the element into points, and adding a new two-dimensional Point2D into the points; if the element type of the pipeline connection middleware model Point element is 'pipe blockage', adding an end Point which is not equal to the two-dimensional Point A generated in the step 1.1 in two end points of the only pipeline element connected with the pipeline connection middleware model into points, and adding a new two-dimensional Point2D into the points; if the element type of the pipeline connection middleware model point element is other types, adding the end points which are not equal to the two-dimensional point pointA generated in the step 1.1 in the two end points of each pipeline element connected with the pipeline connection middleware model into points;
and step 1.3, taking points added completely as a point data set to be processed.
2. The method for realizing the butt joint of the pipeline connection middleware model and the pipelines at two ends according to the three-dimensional scene in claim 1, which is characterized in that: the step 2 specifically comprises the following steps:
step 2.1, specifically judging the point data set points to be processed generated in the step 1, wherein if the type of the element of the point element of the pipeline connection middleware model in the points is variable diameter, the type of the angle of the pipeline connection middleware model is 180 degrees; otherwise, entering step 2.2;
step 2.2, specifically calculating the angle type of the pipeline connection middleware model: extracting three point elements in points in sequence, wherein the three point elements are respectively pipeline connection middleware model point elements: point2D aptint 2D ═ pointList [0], and the pipeline connection middleware model connects the endpoints of pipeline 1: point2D bPoint2D ═ pointList [1], the pipe connection middleware model connects the end points of pipe 2: point2D cPoint2D ═ pointList [2], a cosine value pipLineCosine of an included angle between two pipelines is obtained through vectors for X and Y coordinates of three points, and then through a mathematical formula: and (ArcCos (pipLineCosine) 180)/pi, calculating the included angle of the two pipelines, and finally obtaining the angle result of the pipeline connection middleware model to be selected according to the angle interval to which the included angle belongs.
3. The method for realizing the butt joint of the pipeline connection middleware model and the pipelines at two ends according to the three-dimensional scene in claim 2, is characterized in that: the step 3 specifically comprises the following steps:
step 3.1, specifically judging the point data sets points to be processed generated in the step 1, if the element type of the pipeline connecting middleware model point element is 'tee', obtaining the rotation angle by quadrant judgment but by angle judgment of the connected pipelines; if the element type of the pipeline connecting middleware model point element is not 'tee', obtaining a rotation angle after quadrant judgment, and if the element type of the pipeline connecting middleware model point element is 'valve', obtaining a final result by further adding 90 degrees or subtracting 90 degrees after the rotation angle is obtained; otherwise, the final result is obtained;
step 3.2, respectively carrying out different operations according to different conditions of the step 3.1: if the type of the element of the pipeline connection middleware model point element is 'tee', judging the included angle between the three connected pipelines, if the included angle between one pipeline and the other two pipelines is 90 degrees, selecting the pipeline as a rotation reference edge, and obtaining the rotation angle by using the end point of one end of the pipeline, which is not connected with the pipeline connection middleware model, and the pipeline connection middleware model point element; if the type of the element of the pipeline connecting middleware model point element is not tee, judging whether the element is pipe blockage, and if the element is pipe blockage, directly taking the only one connected pipeline as a rotary reference edge; otherwise, judging the quadrants of the two connected pipelines, determining a rotary reference edge according to the quadrants and the horizontal and longitudinal included angles with the horizontal direction, and acquiring the rotation angle of an end point of the pipeline of the rotary reference edge, which is not connected with the pipeline connection middleware model, and the pipeline connection middleware model point element;
step 3.3, calculating the endpoint point2D at one end of the rotating reference side pipeline and the pipeline connecting middleware model point element aPoint2D obtained in the step 3.2: if the Y coordinate of point2D is greater than the Y coordinate of aPoint2D, the rotation reference side pipeline is in a quadrant of two, and the rotation angle calculation formula is as follows: 180+ ArcTan (point2d.y-apoint2d.y, point2d.x-apoint2d.x) 180/pi; otherwise, rotating the reference edge pipeline in three-four quadrants, wherein the calculation formula of the rotation angle is as follows: ArcTan (aPoint2D.Y-point2D.Y, aPoint2D.X-point2D.X) × 180/π; if the element type of the pipeline connecting middleware model point element is 'valve' and the calculated rotation angle is less than or equal to 90 degrees, the final rotation angle result is the calculated result plus 90 degrees, and if the element type of the pipeline connecting middleware model point element is 'valve' and the calculated rotation angle is greater than 90 degrees, the final rotation angle result is the calculated result minus 90 degrees; and if the type of the element of the pipeline connecting middleware model point element is not a valve, obtaining a final rotation angle result through calculation.
4. The method for realizing the butt joint of the pipeline connection middleware model and the pipelines at two ends according to the three-dimensional scene in claim 1, which is characterized in that: the step 4 specifically comprises the following steps: and (3) writing the angle type result of the pipeline connection middleware model obtained in the step (2) and the rotation angle result of the pipeline connection middleware model obtained in the step (3) into a corresponding layer element set, and enabling an operator to carry out butt joint operation on the pipeline connection middleware model and pipelines at two ends according to the two results.
CN201710019303.1A 2017-01-11 2017-01-11 Method for realizing butt joint of pipeline connection middleware model and pipelines at two ends in three-dimensional scene Active CN106844921B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710019303.1A CN106844921B (en) 2017-01-11 2017-01-11 Method for realizing butt joint of pipeline connection middleware model and pipelines at two ends in three-dimensional scene

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710019303.1A CN106844921B (en) 2017-01-11 2017-01-11 Method for realizing butt joint of pipeline connection middleware model and pipelines at two ends in three-dimensional scene

Publications (2)

Publication Number Publication Date
CN106844921A CN106844921A (en) 2017-06-13
CN106844921B true CN106844921B (en) 2020-05-19

Family

ID=59118525

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710019303.1A Active CN106844921B (en) 2017-01-11 2017-01-11 Method for realizing butt joint of pipeline connection middleware model and pipelines at two ends in three-dimensional scene

Country Status (1)

Country Link
CN (1) CN106844921B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111079306B (en) * 2019-12-27 2023-08-01 广州燃气集团有限公司 Calculation method, system, device and storage medium for pipe fitting for pipeline connection

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7149668B2 (en) * 2001-09-12 2006-12-12 Siemens Aktiengesellschaft Visualization of workpieces during simulation of milling processes
CN102867077A (en) * 2012-07-05 2013-01-09 西安理工大学 BIM (Building Information Modeling)-based metro comprehensive pipeline adjustment method
CN102945294A (en) * 2012-10-12 2013-02-27 西安理工大学 Underground integrated pipeline non-standard rectangular connector determination method based on BIM (Building Information Modeling)
CN104574505A (en) * 2014-12-30 2015-04-29 华东师范大学 Automatic three-dimensional pipeline communication modeling method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7149668B2 (en) * 2001-09-12 2006-12-12 Siemens Aktiengesellschaft Visualization of workpieces during simulation of milling processes
CN102867077A (en) * 2012-07-05 2013-01-09 西安理工大学 BIM (Building Information Modeling)-based metro comprehensive pipeline adjustment method
CN102945294A (en) * 2012-10-12 2013-02-27 西安理工大学 Underground integrated pipeline non-standard rectangular connector determination method based on BIM (Building Information Modeling)
CN104574505A (en) * 2014-12-30 2015-04-29 华东师范大学 Automatic three-dimensional pipeline communication modeling method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
三维建模技术及其在城市地下管网系统建设中的应用;赖承芳;《中国优秀硕士学位论文全文数据库 基础科学辑》;20131015;A008-10 *

Also Published As

Publication number Publication date
CN106844921A (en) 2017-06-13

Similar Documents

Publication Publication Date Title
CN104898947B (en) A kind of method that GDI electronics map vector scaling and translation are realized based on mouse position
WO2008010488A1 (en) Image processing device and image processing method
CN106934842B (en) Method and device for identifying closed area
CN106844921B (en) Method for realizing butt joint of pipeline connection middleware model and pipelines at two ends in three-dimensional scene
CN103902343A (en) Tile map downloading and splicing method based on Delaunay triangulation network accuracy control
EP2286387B1 (en) Method and apparatus for 3d path
CN109794943A (en) A kind of turning migration path and determining method
CN106777604B (en) Circular tube tee joint construction method
CN106012721A (en) &#39;&#39;Two points&#39;&#39; line element method for road route plane alignment design
JP4959518B2 (en) 3D CG object interference check program
CN113870403B (en) Information processing method and device for image rendering
CN114741764B (en) Method for analyzing railway tunnel lining section drawing
CN107145652B (en) Method for converting construction coordinate system of BIM (building information modeling) arbitrary coordinate conversion system
CN102537382A (en) Simple and easy determining method of three-eccentric center butterfly valve seal surface dimension interference
CN113205086B (en) Method for identifying characteristic parameters of circular-section bent pipe type part based on ellipse fitting
王国勋 et al. Tool interference checking for five axis NC machining of sculptured surfaces
CN113836674A (en) Pipeline segment three-dimensional space interference detection and shortest distance point acquisition algorithm
WO2020094023A1 (en) Road thinning algorithm
CN114329666A (en) Method, device, processor and computer readable storage medium for analyzing and importing three-dimensional pipe tool path
CN108073775B (en) Method for drawing elbow and pipe network communication equipment and drawing device
CN109887013B (en) PCA-based point cloud registration final determination method and system
CN111008484A (en) Processing method for converting two-dimensional house type graph into three-dimensional scene graph
CN105138642A (en) Dynamic plotting method and device based on HTML5
JP2007328550A (en) Pipe laying-design method
CN110031073B (en) Method and device for determining weight of multi-way pipe fitting, computer equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant