Vector elbow center line acquisition method and device, computer device, and storage medium
By using OpenCascade technology to obtain the centerline of complex pipe bend models, the problem of low accuracy in existing technologies is solved, and efficient acquisition of pipe bend centerlines is achieved.
Patent Information
- Application Number
- CN202311324464.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-12
- Publication Date
- 2025-11-21
- Estimated Expiration
- 2043-10-12
AI Technical Summary
Existing technologies are not very accurate and efficient in obtaining the centerline of the bend in a complex bending component model.
The OpenCascade technology is used to import the 3D model, obtain the outer surface of the pipe, and fill the intersecting surface with isoparametric curves to obtain the center line of the bend. This includes importing the 3D model, obtaining the outer surface, creating isoparametric curves, creating intersecting surfaces, and obtaining the intersection line.
It improves the accuracy of obtaining the center line of the bend, is applicable to various complex bending component models, and is highly efficient.
Smart Images

Figure CN117315005B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of three-dimensional modeling technology, and in particular to a method, apparatus, computer equipment, and storage medium for obtaining the center line of a vector bend pipe. Background Technology
[0002] Complex hollow tube bends are widely used in piping systems in aerospace, automotive, and other fields. Unlike common tube forming technologies that involve simple geometries such as bending, tension bending, push bending, and pressure bending, vector bending forming technology is suitable for complex bending components with more intricate geometries and continuously varying bending radii. The working principle of vector tube bending equipment is more complex. Before operation, a three-dimensional model of the tube needs to be analyzed to obtain control point data and convert it into processing data. Since the geometry of the tube's centerline determines the tube's overall geometry, accurately obtaining the tube's centerline is crucial.
[0003] The existing centerline of bent pipes is usually obtained manually from 3D graphics. However, the accuracy of obtaining the centerline is often low for some complex bent component models.
[0004] Therefore, it is necessary to design a new method to improve the accuracy of obtaining the centerline of the bend, and to be applicable to various complex bending component models with high efficiency. Summary of the Invention
[0005] The purpose of this invention is to overcome the shortcomings of the prior art and provide a method, apparatus, computer equipment and storage medium for obtaining the center line of a vector bend.
[0006] To achieve the above objectives, the present invention adopts the following technical solution: a method for obtaining the centerline of a vector bend pipe, comprising:
[0007] Import the 3D model;
[0008] The outer surface of the pipe in the three-dimensional model was obtained using OpenCascade technology;
[0009] The OpenCascade technique was used to plot isoparametric curves along the generatrix direction on the outer surface.
[0010] Using the OpenCascade technique, intersecting surfaces are created with the parametric curve that is centrally symmetric within the isoparametric curve as the boundary.
[0011] Obtain the intersection line of the intersecting surfaces to obtain the center line of the bend.
[0012] The further technical solution is as follows: the outer surface of the pipe obtained by using OpenCascade technology to acquire a three-dimensional model includes:
[0013] convert the three-dimensional model into a TopoDS_Shape topology to obtain a conversion result;
[0014] traverse the conversion result to convert a TopAbs_Face sub-topology in the conversion result into a Geom_Surface geometric entity;
[0015] when the type of the Geom_Surface geometric entity is a curved surface, the Geom_Surface geometric entity is retained to obtain a curved surface;
[0016] according to the principle that the number of intersection surfaces of the first and last two curved surfaces in the pipe material model is the least, four curved surfaces of the first and last are obtained;
[0017] select the curved surface with the largest area in the four curved surfaces of the first and last as a reference surface, and traverse the intersection surface related to the reference surface again to obtain the outer curved surface of each section to constitute the outer surface of the pipe material.
[0018] Further technical solutions thereof are as follows: the traversing the conversion result to convert a TopAbs_Face sub-topology in the conversion result into a Geom_Surface geometric entity comprises:
[0019] the TopAbs_Face sub-topology in the conversion result is traversed through a TopExp_Explorer function, and the TopAbs_Face sub-topology is converted into a TopoDS_Face structure to obtain a first conversion result;
[0020] the first conversion result is converted into a Geom_Surface geometric entity through a BRep_Tool function combined with a handle operation.
[0021] Further technical solutions thereof are as follows: the according to the principle that the number of intersection surfaces of the first and last two curved surfaces in the pipe material model is the least, four curved surfaces of the first and last are obtained, comprising:
[0022] the number of intersection surfaces of each curved surface is calculated through a BRepExtrema_DistShapeShape, and the principle that the number of intersection surfaces of the first and last two curved surfaces in the pipe material model is the least is used to obtain the four curved surfaces of the first and last.
[0023] Further technical solutions thereof are as follows: the using OpenCascade technology to make an equal parameter curve on the outer surface along the generatrix direction comprises:
[0024] the UV boundary of the curved surface of the Geom_Surface geometric entity is obtained;
[0025] the distance of the UV boundary with respect to the cylindrical surface is divided into four equal parts, and a u curve is respectively created.
[0026] The distance in the UV boundary about the torus is divided into four equal parts, and v curves are respectively created.
[0027] Further technical solutions are as follows: the OpenCascade technology is used to create an intersection surface with the parameter curve in the center symmetry of the equal parameter curve as a boundary, and the method comprises the following steps:
[0028] Two equal parameter curves in the center symmetry are used as edges for filling to obtain the intersection surface.
[0029] Further technical solutions are as follows: the intersection line of the intersection surface is obtained to obtain the elbow center line, and the method comprises the following steps:
[0030] The intersection line of the intersection surface in each section is obtained through BRepAlgoAPI_Section;
[0031] The corresponding topological edge group is extracted by using TopExp_Explorer on the obtained intersection line, and all topological edge groups are sewn through BRepBuilderAPI_Sewing to obtain the elbow center.
[0032] The application further provides a vector elbow center line obtaining device, which comprises:
[0033] An import unit is configured to import a three-dimensional model.
[0034] An outer surface obtaining unit is configured to obtain an outer surface of a pipe material of the three-dimensional model by using the OpenCascade technology.
[0035] A curve making unit is configured to make an equal parameter curve along a generatrix direction of the outer surface by using the OpenCascade technology.
[0036] An intersection surface creating unit is configured to create an intersection surface with a parameter curve in the center symmetry of the equal parameter curve as a boundary by using the OpenCascade technology.
[0037] An intersection line obtaining unit is configured to obtain an intersection line of the intersection surface to obtain an elbow center line.
[0038] The application further provides a computer device, which comprises a memory and a processor, the memory stores a computer program, and the processor implements the above method when executing the computer program.
[0039] The application further provides a storage medium, which stores a computer program, and the computer program is executed by a processor to implement the above method.
[0040] Compared with the prior art, the application has the beneficial effects that: the application introduces a three-dimensional model, and uses the OpenCascade technology to obtain the outer surface of the pipe material of the three-dimensional model, make parametric curves, fill the intersection surface with the parametric curves as the boundary, and determine the intersection line of the intersection surface to form the elbow center line, so that the accuracy of the elbow center line is improved, and the method is suitable for various complex bending component models and has high efficiency.
[0041] The application will be further described below in combination with the drawings and specific embodiments. BRIEF DESCRIPTION OF DRAWINGS
[0042] In order to more clearly illustrate the technical solutions of the embodiments of the application, the drawings needed in the embodiment description will be briefly introduced. Obviously, the drawings in the following description are some embodiments of the application, and other drawings can be obtained by those skilled in the art without creative labor.
[0043] Figure 1 The flowchart of the vector elbow center line acquisition method provided by the embodiment of the application is shown in the figure.
[0044] Figure 2 The schematic diagram of the geometric type provided by the embodiment of the application is shown in the figure.
[0045] Figure 3 The sub-flowchart of the vector elbow center line acquisition method provided by the embodiment of the application is shown in the figure.
[0046] Figure 4 The sub-flowchart of the vector elbow center line acquisition method provided by the embodiment of the application is shown in the figure.
[0047] Figure 5 The sub-flowchart of the vector elbow center line acquisition method provided by the embodiment of the application is shown in the figure.
[0048] Figure 6 The sub-flowchart of the vector elbow center line acquisition method provided by the embodiment of the application is shown in the figure.
[0049] Figure 7 The schematic diagram of the three-dimensional model provided by the embodiment of the application is shown in the figure.
[0050] Figure 8 The schematic diagram of the outer surface of the pipe material provided by the embodiment of the application is shown in the figure.
[0051] Figure 9 The schematic diagram of the creation of the parametric line provided by the embodiment of the application is shown in the figure.
[0052] Figure 10 The schematic diagram of the creation of the intersection surface provided by the embodiment of the application is shown in the figure.
[0053] Figure 11 a schematic diagram of a bend centerline provided for an embodiment of the present application;
[0054] Figure 12 a schematic block diagram of a vector bend centerline acquisition device provided for an embodiment of the present application;
[0055] Figure 13 a schematic block diagram of an outer surface acquisition unit of a vector bend centerline acquisition device provided for an embodiment of the present application;
[0056] Figure 14 a schematic block diagram of a first conversion subunit of a vector bend centerline acquisition device provided for an embodiment of the present application;
[0057] Figure 15 a schematic block diagram of a curve making unit of a vector bend centerline acquisition device provided for an embodiment of the present application;
[0058] Figure 16 a schematic block diagram of an intersection line acquisition unit of a vector bend centerline acquisition device provided for an embodiment of the present application;
[0059] Figure 17 a schematic block diagram of a computer device provided for an embodiment of the present application. DETAILED DESCRIPTION
[0060] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are some but not all of the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of the present application.
[0061] It should be understood that the terms "comprise" and "include" as used in the specification and the appended claims indicate the presence of the described features, integers, steps, operations, elements, and / or components but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.
[0062] It should also be understood that the terms used in the present application specification are only for the purpose of describing particular embodiments and are not intended to limit the present application. As used in the present application specification and the appended claims, the singular forms "a", "an" and "the" are intended to include the plural forms unless the context clearly indicates otherwise.
[0063] It should be further understood that the term "and / or" used in the description and claims of the application herein is used to mean any one and / or any combination of the associated listed items and includes all possible combinations.
[0064] Referring to Figure 1 . Figure 1 A schematic flowchart of a vector elbow centerline acquisition method provided by an embodiment of the present application. The vector elbow centerline acquisition method is applied to a terminal such as a computer, etc., and based on an OpenCascade open-source geometry kernel, a method for extracting an elbow centerline is designed, and in combination with Qt, a visual operation of a three-dimensional pipe model is realized. The method can accurately extract a centerline of a complex elbow model. OpenCascade (OCC, Open Computer Aided Software for Computer Aided Design and Engineering) is a geometry kernel developed based on C++, including a solid modeling component, a visualization component, a data exchange component, etc., and provides functions of two-dimensional and three-dimensional geometry generation, display and analysis. OCC provides a model import technology of a STEP file format, and can convert a model into a B-Rep (Boundary Representation) representation model used by OCC modeling, i.e., a boundary representation model. In OCC, topology is realized by a total class TopoDS_Shape, in which a geometry type of the boundary representation is described as shown in Figure 2 According to a structure relationship of the geometry, several topological types can be combined into a set, such as two vertices can constitute an edge, a plurality of edges can constitute a wire, and a wire can constitute a face, etc. In this way, it is determined which simple types constitute a complex Shape.
[0065] Figure 1 A flowchart of the vector elbow centerline acquisition method provided by the embodiment of the present application. As shown in Figure 1 The method includes the following steps S110 to S150.
[0066] S110, importing a three-dimensional model.
[0067] In the embodiment, for an elbow model, a STEP format type is generally obtained by related modeling software or CAM, and is imported into a corresponding software program of the terminal.
[0068] S120, acquiring an outer surface of a pipe material of the three-dimensional model by using an OpenCascade technology.
[0069] In the embodiment, the outer surface refers to an outer curved surface of the pipe material of the three-dimensional model.
[0070] Specifically, the pipe material has solid pipe and hollow pipe, and the type of the pipe material model surface generally includes the plane of each section of the model and all other curved surfaces. For solid pipe, only all the curved surfaces of the pipe material need to be obtained, and no more consideration is needed here. For the outer surface of the hollow pipe material, first, in the imported three-dimensional model Shape, all TopAbs_Face are traversed by TopExp_Explorer function and converted into TopoDS_Face. Then, TopoDS_Face is converted into Geom_Surface by BRep_Tool function combined with handle operation, so as to judge the type of Geom_Surface by using its DynamicType function. If it is Geom_Plane type, it is deleted, and all curved surfaces are reserved.
[0071] In an embodiment, referring to Figure 3 The step S120 can include steps S121-S125.
[0072] S121, converting the three-dimensional model into TopoDS_Shape topology to obtain a conversion result.
[0073] In this embodiment, the conversion result refers to the content formed after the three-dimensional model is converted into TopoDS_Shape topology.
[0074] S122, traversing the conversion result to convert the TopAbs_Face sub-topology structure in the conversion result into Geom_Surface geometric entity.
[0075] In an embodiment, referring to Figure 4 The step S122 can include steps S1221-S1222.
[0076] S1221, traversing the TopAbs_Face sub-topology structure in the conversion result by TopExp_Explorer function, and converting the TopAbs_Face sub-topology structure into TopoDS_Face structure to obtain a first conversion result.
[0077] In this embodiment, the first conversion result refers to the content formed by converting the TopAbs_Face sub-topology structure in the conversion result into TopoDS_Face structure.
[0078] S1222, converting the first conversion result into Geom_Surface geometric entity by BRep_Tool function combined with handle operation.
[0079] In the embodiment, each TopAbs_Face sub-topology contained in the conversion result is mainly accessed and converted into a Geom_Surface geometric entity.
[0080] S123, when the type of the Geom_Surface geometric entity is a curved surface, the Geom_Surface geometric entity is reserved to obtain a curved surface.
[0081] In the embodiment, the curved surface refers to the Geom_Surface geometric entity when the type of the Geom_Surface geometric entity is a curved surface.
[0082] Specifically, it is judged whether the Geom_Surface geometric entity is a curved surface, if yes, the Geom_Surface geometric entity is reserved, if not, other Geom_Surface geometric entities are judged again.
[0083] S124, four curved surfaces at the beginning and the end are obtained according to the principle that the number of intersection surfaces of the curved surfaces at the beginning and the end is the least.
[0084] In the embodiment, the number of intersection surfaces of the curved surfaces is calculated, when the number is the least, the area of the curved surface can be calculated, when the number is not the least, the step S122 is returned.
[0085] Specifically, the number of intersection surfaces of each curved surface is calculated by BRepExtrema_DistShapeShape, four curved surfaces at the beginning and the end are obtained according to the principle that the number of intersection surfaces of the curved surfaces at the beginning and the end is the least.
[0086] S125, the curved surface with the largest area among the four curved surfaces at the beginning and the end is selected as a reference surface, the intersection surfaces related to the reference surface are traversed again to obtain the outer curved surface of each section to constitute the outer surface of the pipe.
[0087] In the embodiment, it is judged whether the area of the curved surface is the largest, when the area of the curved surface is not the largest, the step S122 is returned, when the area of the curved surface is the largest, the curved surface is taken as the reference surface, the intersection surfaces related to the reference surface are traversed to obtain the outer curved surface of each section to constitute the outer surface of the pipe.
[0088] Please refer to Figure 7 and Figure 8All the obtained curved surfaces include the inner and outer surfaces. Generally, the outer surface of the straight section of the bent pipe is a cylindrical surface, i.e., Geom_CylindricalSurface, and the outer surface of the curved section is a toroidal surface, i.e., Geom_ToroidalSurface. The radius of each standard surface type can be obtained by using the respective Radius function, and the outer or inner surface can be determined by comparing the radius. However, considering that the pipe model can be created in different ways, the curved surface may not be a standard toroidal surface, but may be a Geom_BsplineSurface according to the DynamicType, which makes it difficult to calculate the radius.
[0089] In this embodiment, after all the curved surfaces are obtained, the number of intersection surfaces of each curved surface is calculated by using BRepExtrema_DistShapeShape. The first and last sections of the pipe model have the least number of intersection surfaces (generally one less than the middle section, and the difference is caused by different ways of creating the model), so the four curved surfaces of the first and last sections are obtained. The curved surface with the largest area is selected as the reference surface, and the intersection surface is obtained again, so that the outer curved surface of each section of the model is obtained.
[0090] S130, using OpenCascade technology to make an isoparametric curve along the generatrix direction of the outer surface.
[0091] In this embodiment, the isoparametric curve refers to a curve on the curved surface determined by using the parametric representation method.
[0092] Specifically, the parametric representation method (Parametric functions) is one of the most commonly used methods for representing curved surfaces and curves due to its simple structure and easy calculation. A curved surface represented by a vector function p(u, v) composed of two variables u and v is called a parameter surface. If one of the parameters v=v0 is given, then p(u, v0) represents a curve on the curved surface, which is called an isoparametric curve or isoparametric line.
[0093] In an embodiment, referring to Figure 5 The above step S130 can include steps S131-S133.
[0094] S131, obtaining the UV boundary of the curved surface of the Geom_Surface geometric entity;
[0095] S132, dividing the distance related to the cylindrical surface in the UV boundary into four equal parts, and creating u curves respectively;
[0096] S133, dividing the distance related to the toroidal surface in the UV boundary into four equal parts, and creating v curves respectively.
[0097] In the embodiment, instructions for creating isoparametric lines are provided in OCC, and only the values of fixed parameters need to be provided. The values are obtained as follows: through the obtained Geom_Surface, the UV bounds of the surface are obtained using BRepTools, denoted as uFirst, uLast, vFirst, and vLast. The distance from uFirst to uLast is equally divided into four parts, and u curves are created respectively. The v curves are created in the same way.
[0098] Generally, when creating isoparametric lines along the bending tube generatrix direction, the straight section, i.e., the cylindrical surface, creates u curves, and the curved section, i.e., the torus, creates v curves. In the operation interface, the isoparametric curve is as shown in the following figure. Figure 9
[0099] S140, using OpenCascade technology, an isoparametric curve inside the center-symmetric parameter curve is created as a boundary, and an intersection surface is created.
[0100] In the embodiment, the intersection surface refers to a surface obtained after filling with the center-symmetric parameter curve inside the isoparametric curve as a boundary.
[0101] Specifically, the two center-symmetric isoparametric curves are filled as edges to obtain the intersection surface.
[0102] As shown in the following figure, Figure 10 OCC is given a variety of ways to create surfaces, and the most commonly used are BRepBuilderAPI_MakeFace and BRepFill. The former needs a closed wire, and the latter needs a pair of edges to create. Generally, only a plane can be created through MakeFace, and for a wire frame, the internal form may not be recognized, resulting in a failure to fill the surface, so when creating a surface through MakeFace, the surface parameters need to be provided to create.
[0103] S150, the intersection line of the intersection surface is obtained to obtain the bending tube center line.
[0104] In the embodiment, the bending tube center line refers to the intersection line of the intersection surface.
[0105] In an embodiment, referring to the above figure, Figure 6 The above step S150 can include steps S151-S152.
[0106] S151, the intersection line of the intersection surface in each section is obtained through BRepAlgoAPI_Section;
[0107] S152, the TopExp_Explorer is used to extract the corresponding topological edge group of the obtained intersection line, and then all the topological edge groups are sewn through BRepBuilderAPI_Sewing to obtain the elbow center.
[0108] Specifically, the intersection line of the intersection surface in each section is obtained through BRepAlgoAPI_Section, and then all the intersection lines are integrated, so that the center line of the pipe model is obtained. The effect diagram is as follows Figure 11 .
[0109] The method of the embodiment is based on OpenCascade, and a simple software is designed in combination with Qt, so that the model import and export, model surface acquisition and center line acquisition can be realized, and a foundation for subsequent design and development of vector elbow CAM is laid. In the current CAM\CAD system, data analysis of model files in various file formats is very important, and the open source geometric kernel OCC undoubtedly provides a more convenient research and development method for designers, which reduces the cost and also obtains better stability, which has a broad market prospect and brings benefits to industrial development.
[0110] The above-mentioned vector elbow center line acquisition method imports a three-dimensional model, and uses OpenCascade technology to acquire the outer surface of the pipe material of the three-dimensional model, make an isoparametric curve, fill the isoparametric curve to form an intersection surface, determine the intersection line of the intersection surface, and form an elbow center line, so that the accuracy of the elbow center line acquisition is improved, and the method is suitable for various complex bending component models and has high efficiency.
[0111] Figure 12 is a schematic block diagram of a vector elbow center line acquisition device 300 provided by an embodiment of the present application. As Figure 12 shown, corresponding to the above-mentioned vector elbow center line acquisition method, the present application further provides a vector elbow center line acquisition device 300. The vector elbow center line acquisition device 300 includes a unit for executing the above-mentioned vector elbow center line acquisition method, and the device can be configured in a desktop computer, a tablet computer, a laptop computer, or the like. Specifically, please refer to Figure 12 , the vector elbow center line acquisition device 300 includes an import unit 301, an outer surface acquisition unit 302, a curve making unit 303, an intersection surface creating unit 304, and an intersection line acquisition unit 305.
[0112] The import unit 301 is configured to import a three-dimensional model; the outer surface acquisition unit 302 is configured to acquire an outer surface of a pipe material of the three-dimensional model by using an OpenCascade technology; the curve making unit 303 is configured to make an isoparametric curve of the outer surface along a generatrix direction by using the OpenCascade technology; the intersecting surface creating unit 304 is configured to create an intersecting surface by using the OpenCascade technology and taking a parameter curve symmetrically inside the isoparametric curve as a boundary; and the intersection line acquisition unit 305 is configured to acquire an intersection line of the intersecting surface to obtain a bend pipe center line.
[0113] In an embodiment, as shown in Figure 13 The outer surface acquisition unit 302 includes a first conversion subunit 3021, a second conversion subunit 3022, a reservation subunit 3023, a surface acquisition subunit 3024, and an outer surface acquisition subunit 3025.
[0114] The first conversion subunit 3021 is configured to convert the three-dimensional model into a TopoDS_Shape topology to obtain a conversion result; the second conversion subunit 3022 is configured to traverse the conversion result to convert a TopAbs_Face sub-topology in the conversion result into a Geom_Surface geometric entity; the reservation subunit 3023 is configured to reserve the Geom_Surface geometric entity when the type of the Geom_Surface geometric entity is a surface to obtain a surface; the surface acquisition subunit 3024 is configured to obtain four surfaces at the beginning and the end according to a principle that the number of intersecting surfaces of the four surfaces is the least; and the outer surface acquisition subunit 3025 is configured to select a surface with the largest area in the four surfaces as a reference surface, traverse the intersecting surfaces related to the reference surface again to obtain an outer surface of each segment, and constitute an outer surface of the pipe material.
[0115] In an embodiment, as shown in Figure 14 The first conversion subunit 3021 includes a structure conversion module 30211 and a result conversion module 30212.
[0116] The structure conversion module 30211 is configured to traverse a TopAbs_Face sub-topology in the conversion result by using a TopExp_Explorer function, and convert the TopAbs_Face sub-topology into a TopoDS_Face structure to obtain a first conversion result; and the result conversion module 30212 is configured to convert the first conversion result into a Geom_Surface geometric entity by using a BRep_Tool function in combination with a handle operation.
[0117] In an embodiment, the number of intersection surfaces of each surface is calculated by BRepExtrema_DistShapeShape, and the principle of the least number of intersection surfaces of the first and last surfaces in the pipe model is used to obtain the four surfaces of the first and last.
[0118] In an embodiment, as shown in Figure 15 , the curve making unit 303 includes a boundary obtaining subunit 3031, a first creating subunit 3032, and a second creating subunit 3033.
[0119] The boundary obtaining subunit 3031 is configured to obtain the UV boundary of the surface of the Geom_Surface geometric entity; the first creating subunit 3032 is configured to divide the distance of the UV boundary with respect to the cylindrical surface into four equal parts and create u curves respectively; and the second creating subunit 3033 is configured to divide the distance of the UV boundary with respect to the torus surface into four equal parts and create v curves respectively.
[0120] In an embodiment, the intersection surface creating unit 304 is configured to fill two center-symmetric equal-parameter curves as edges to obtain an intersection surface.
[0121] In an embodiment, as shown in Figure 16 , the intersection line obtaining unit 305 includes an intersection line obtaining subunit 3051 and an integrating subunit 3052.
[0122] The intersection line obtaining subunit 3051 is configured to obtain the intersection line of the intersection surface in each section by BRepAlgoAPI_Section; and the integrating subunit 3052 is configured to extract the corresponding topological edge group by using TopExp_Explorer on the obtained intersection line, and then sew all the topological edge groups by BRepBuilderAPI_Sewing to obtain the bend center.
[0123] It should be noted that the specific implementation process of the above-mentioned vector bend center line obtaining device 300 and each unit can be clearly understood by those skilled in the art, which can be referred to the corresponding description in the foregoing method embodiments. For the convenience and brevity of description, it will not be described here.
[0124] The above-mentioned vector bend center line obtaining device 300 can be realized in the form of a computer program, which can run on a computer device as shown in Figure 17 .
[0125] Please refer to Figure 17 , Figure 17is a schematic block diagram of a computer device provided by an embodiment of the present application. The computer device 500 can be a terminal, where the terminal can be a smartphone, a tablet computer, a notebook computer, a desktop computer, a personal digital assistant, a wearable device, and the like electronic device having a communication function.
[0126] Referring to Figure 17 The computer device 500 includes a processor 502, a memory, and a network interface 505 connected through a system bus 501, where the memory can include a non-volatile storage medium 503 and an internal memory 504.
[0127] The non-volatile storage medium 503 can store an operating system 5031 and a computer program 5032. The computer program 5032 includes program instructions that, when executed, can cause the processor 502 to perform a vector elbow centerline acquisition method.
[0128] The processor 502 is configured to provide computing and control capabilities to support the operation of the entire computer device 500.
[0129] The internal memory 504 provides an environment for the operation of the computer program 5032 in the non-volatile storage medium 503, which, when executed by the processor 502, can cause the processor 502 to perform a vector elbow centerline acquisition method.
[0130] The network interface 505 is configured to perform network communication with other devices. Those skilled in the art can understand that Figure 17 The structure shown in the figure is only a block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the computer device 500 to which the scheme of the present application is applied. The specific computer device 500 can include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0131] The processor 502 is configured to run the computer program 5032 stored in the memory to implement the following steps:
[0132] Importing a three-dimensional model; using OpenCascade technology to acquire an outer surface of a pipe material of the three-dimensional model; using OpenCascade technology to make an isoparametric curve of the outer surface along a generatrix direction; using OpenCascade technology to create an intersection surface with a center-symmetric parameter curve inside the isoparametric curve as a boundary; acquiring an intersection line of the intersection surface to obtain an elbow centerline.
[0133] In an embodiment, the processor 502, when implementing the step of acquiring the outer surface of the pipe material of the three-dimensional model using OpenCascade technology, specifically implements the following steps:
[0134] convert the three-dimensional model into a TopoDS_Shape topology to obtain a conversion result; traverse the conversion result to convert a TopAbs_Face sub-topology in the conversion result into a Geom_Surface geometric entity; when a type of the Geom_Surface geometric entity is a curved surface, retain the Geom_Surface geometric entity to obtain a curved surface; according to a principle that a number of intersection surfaces of the curved surfaces of the first and last two sections in the pipe model is the least, obtain four curved surfaces of the first and last; select a curved surface with a largest area in the four curved surfaces of the first and last as a reference surface, and traverse an intersection surface related to the reference surface again to obtain an outer curved surface of each section to constitute an outer surface of the pipe.
[0135] In an embodiment, the processor 502, when implementing the step of traversing the conversion result to convert the TopAbs_Face sub-topology in the conversion result into the Geom_Surface geometric entity, specifically implements the following steps:
[0136] traverse the TopAbs_Face sub-topology in the conversion result through a TopExp_Explorer function, and convert the TopAbs_Face sub-topology into a TopoDS_Face structure to obtain a first conversion result; and convert the first conversion result into the Geom_Surface geometric entity through a BRep_Tool function in combination with a handle operation.
[0137] In an embodiment, the processor 502, when implementing the step of obtaining the four curved surfaces of the first and last according to the principle that the number of intersection surfaces of the curved surfaces of the first and last two sections in the pipe model is the least, specifically implements the following steps:
[0138] obtain the four curved surfaces of the first and last through a BRepExtrema_DistShapeShape calculation of a number of intersection surfaces of each curved surface and the principle that the number of intersection surfaces of the curved surfaces of the first and last two sections in the pipe model is the least.
[0139] In an embodiment, the processor 502, when implementing the step of making an equal-parameter curve on the outer surface along a generatrix direction by using the OpenCascade technology, specifically implements the following steps:
[0140] obtain a UV boundary of the curved surface of the Geom_Surface geometric entity; divide a distance related to a cylindrical surface in the UV boundary into four equal parts, and create u curves respectively; and divide a distance related to a toroidal surface in the UV boundary into four equal parts, and create v curves respectively.
[0141] In an embodiment, the processor 502, when implementing the step of creating the intersecting surface by using the OpenCascade technology to take the two center-symmetrical parameter curves in the same parameter curve as the boundary, specifically implements the following steps:
[0142] Filling with the two center-symmetrical parameter curves as the boundary to obtain the intersecting surface.
[0143] In an embodiment, the processor 502, when implementing the step of obtaining the intersection line of the intersecting surface to obtain the elbow center line, specifically implements the following steps:
[0144] Obtaining the intersection line of the intersecting surface in each section by BRepAlgoAPI_Section; using TopExp_Explorer to extract the corresponding topological edge group for the obtained intersection line, and then sewing all the topological edge groups by BRepBuilderAPI_Sewing to obtain the elbow center.
[0145] It should be understood that, in the embodiments of the present application, the processor 502 can be a central processing unit (CPU), and the processor 502 can also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor.
[0146] It can be understood by those skilled in the art that all or part of the processes in the method of the above-mentioned embodiments can be completed by a computer program instructing related hardware. The computer program includes program instructions, and the computer program can be stored in a storage medium, which is a computer-readable storage medium. The program instructions are executed by at least one processor in the computer system to implement the process steps of the above-mentioned embodiments of the method.
[0147] Therefore, the present application also provides a storage medium. The storage medium can be a computer-readable storage medium. The storage medium stores a computer program, wherein the computer program is executed by a processor to make the processor execute the following steps:
[0148] Importing a three-dimensional model; using OpenCascade technology to obtain an outer surface of a pipe material of the three-dimensional model; using OpenCascade technology to make an isoparametric curve of the outer surface along a generatrix direction; using OpenCascade technology to create an intersection surface with a parameter curve symmetrically inside the isoparametric curve as a boundary; and obtaining an intersection line of the intersection surface to obtain a bend pipe center line.
[0149] In an embodiment, the processor, when executing the computer program to implement the step of using OpenCascade technology to obtain an outer surface of a pipe material of a three-dimensional model, implements the following steps:
[0150] converting the three-dimensional model into a TopoDS_Shape topology to obtain a conversion result; traversing the conversion result to convert a TopAbs_Face sub-topology in the conversion result into a Geom_Surface geometric entity; when a type of the Geom_Surface geometric entity is a surface, retaining the Geom_Surface geometric entity to obtain a surface; and obtaining four surfaces at the beginning and end according to a principle that a number of intersection surfaces of the surfaces at the beginning and end is the least, selecting a surface with the largest area among the four surfaces at the beginning and end as a reference surface, traversing an intersection surface related to the reference surface again to obtain an outer side surface of each section to constitute an outer surface of the pipe material.
[0151] In an embodiment, the processor, when executing the computer program to implement the step of traversing the conversion result to convert a TopAbs_Face sub-topology in the conversion result into a Geom_Surface geometric entity, implements the following steps:
[0152] traversing the TopAbs_Face sub-topology in the conversion result through a TopExp_Explorer function and converting the TopAbs_Face sub-topology into a TopoDS_Face structure to obtain a first conversion result; and converting the first conversion result into a Geom_Surface geometric entity through a BRep_Tool function in combination with a handle operation.
[0153] In an embodiment, the processor, when executing the computer program to implement the step of obtaining four surfaces at the beginning and end according to a principle that a number of intersection surfaces of the surfaces at the beginning and end is the least, implements the following steps:
[0154] calculating a number of intersection surfaces of each surface through a BRepExtrema_DistShapeShape, and obtaining the four surfaces at the beginning and end according to the principle that the number of the intersection surfaces of the surfaces at the beginning and end is the least.
[0155] In an embodiment, the processor, when implementing the step of using the OpenCascade technology to create the isoparametric curves of the outer surface along the generatrix direction, implements the following steps:
[0156] Obtaining the UV boundary of the surface of the Geom_Surface geometric entity; dividing the distance in the UV boundary with respect to the cylindrical surface into four equal parts, and creating u curves respectively; dividing the distance in the UV boundary with respect to the torus surface into four equal parts, and creating v curves respectively.
[0157] In an embodiment, the processor, when implementing the step of using the OpenCascade technology to create the intersection surface with the isoparametric curves symmetrically centered, implements the following steps:
[0158] Filling with the two isoparametric curves symmetrically centered as edges to obtain the intersection surface.
[0159] In an embodiment, the processor, when implementing the step of obtaining the intersection line of the intersection surface to obtain the elbow center line, implements the following steps:
[0160] Obtaining the intersection line of the intersection surface in each section by BRepAlgoAPI_Section; extracting the corresponding topological edge group by using TopExp_Explorer on the obtained intersection line, and sewing all the topological edge groups by BRepBuilderAPI_Sewing to obtain the elbow center line.
[0161] The storage medium can be a U disk, a mobile hard disk, a read-only memory (ROM), a magnetic disk or an optical disk, and various computer readable storage media that can store program codes.
[0162] Those skilled in the art can realize that the units and algorithm steps of the examples described in combination with the embodiments disclosed herein can be realized by electronic hardware, computer software or a combination of both. In order to clearly illustrate the interchangeability of hardware and software, the components and steps of the examples have been described in the above description in general terms. Whether the functions are realized in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to realize the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.
[0163] In several embodiments provided by the present application, it should be understood that the disclosed apparatus and method can be implemented in other manners. For example, the embodiments of the apparatus described above are merely schematic. For example, the division of the units is merely a logical function division. For example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In this way, the inventive idea can be implemented.
[0164] The steps in the method embodiments of the present application can be adjusted, combined and deleted in sequence according to actual needs. The units in the apparatus embodiments of the present application can be combined, divided and deleted according to actual needs. In addition, each functional unit in each embodiment of the present application can be integrated in one processing unit, or each unit can exist physically, or two or more units can be integrated in one unit.
[0165] The integrated unit, if realized in the form of a software functional unit and sold or used as an independent product, can be stored in a storage medium. Based on such understanding, the technical solutions of the present application, essentially or in the contribution to the prior art, or all or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, and includes several instructions for causing a computer device (which can be a personal computer, a terminal, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application.
[0166] The above describes only specific embodiments of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art can easily think of various equivalent modifications or replacements within the technical range disclosed by the present application, and these modifications or replacements should be covered in the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A method for obtaining the centerline of a vector bend pipe, characterized in that, include: Import the 3D model; The outer surface of the pipe in the three-dimensional model was obtained using OpenCascade technology; The OpenCascade technique was used to plot isoparametric curves along the generatrix direction on the outer surface. Using the OpenCascade technique, intersecting surfaces are created with the parametric curve that is centrally symmetric within the isoparametric curve as the boundary. Obtain the intersection line of the intersecting surfaces to obtain the center line of the bend; The step of obtaining the intersection line of the intersecting surfaces to obtain the centerline of the bend includes: Obtain the intersection line of intersecting surfaces in each segment using BRepAlgoAPI_Section; The obtained intersection line is extracted using TopExp_Explorer to extract the corresponding topological edge group, and then all the topological edge groups are stitched together using BRepBuilderAPI_Sewing to obtain the center line of the bend. The method of obtaining the outer surface of the pipe using OpenCascade technology for a 3D model includes: The 3D model is converted into a TopoDS_Shape topology to obtain the conversion result; Traverse the transformation results to convert the TopAbs_Face sub-topology in the transformation results into Geom_Surface geometric entities; When the Geom_Surface geometric entity is of type curved surface, retain the Geom_Surface geometric entity to obtain the curved surface; Based on the principle of minimizing the number of intersecting surfaces between the first and last sections of the pipe model, four surfaces are obtained at the beginning and end. Select the surface with the largest area among the four curved surfaces at the beginning and end as the reference surface, and then traverse the intersecting surfaces related to the reference surface again to obtain the outer curved surface of each segment, which constitutes the outer surface of the pipe.
2. The method for obtaining the centerline of a vector bend pipe according to claim 1, characterized in that, The step of traversing the transformation results to convert the TopAbs_Face sub-topology structure in the transformation results into Geom_Surface geometric entities includes: The TopExp_Explorer function is used to traverse the TopAbs_Face sub-topology in the transformation result and convert the TopAbs_Face sub-topology into a TopoDS_Face structure to obtain the first transformation result. By combining the BRep_Tool function with handle operations, the first transformation result is converted into a Geom_Surface geometric entity.
3. The method for obtaining the centerline of a vector bend pipe according to claim 1, characterized in that, Based on the principle of minimizing the number of intersecting surfaces between the first and last segments of the pipe model, four surfaces are obtained at the beginning and end, including: The number of intersecting surfaces of each surface is calculated using BRepExtrema_DistShapeShape. The principle of minimizing the number of intersecting surfaces between the first and last sections of the pipe model is used to obtain the four surfaces at the beginning and end.
4. The method for obtaining the centerline of a vector bend pipe according to claim 1, characterized in that, The step of using OpenCascade technology to generate isoparametric curves along the generatrix direction on the outer surface includes: Obtain the UV boundary of the surface of the Geom_Surface geometric entity; Divide the distance of the UV boundary about the cylindrical surface into four equal parts, and create u-curves for each part; Divide the distance of the UV boundary about the torus into four equal parts, and create v curves for each part.
5. The method for obtaining the centerline of a vector bend pipe according to claim 1, characterized in that, The method of using OpenCascade technology to create intersecting surfaces with a parametric curve that is centrally symmetric within the isoparametric curve as the boundary includes: The intersecting surfaces are filled with two centrally symmetric isoparametric curves as edges.
6. A vector bend centerline acquisition device, characterized in that, The device uses the vector bend centerline acquisition method as described in any one of claims 1 to 5, including: Import unit, used to import 3D models; The outer surface acquisition unit is used to acquire the outer surface of the pipe in the three-dimensional model using OpenCascade technology; The curve creation unit is used to create an isoparametric curve on the outer surface along the generatrix direction using OpenCascade technology. The intersecting surface creation unit is used to create intersecting surfaces using OpenCascade technology with the parametric curve that is centrally symmetric within the isoparametric curve as the boundary; The intersection line acquisition unit is used to acquire the intersection line of the intersecting curved surfaces to obtain the center line of the bend.
7. A computer device, characterized in that, The computer device includes a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the method as described in any one of claims 1 to 5.
8. A storage medium, characterized in that, The storage medium stores a computer program that, when executed by a processor, implements the method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
BIM model pipeline center line extraction method and device
CN112509139A