Method for extracting welding seam from three-dimensional welding workpiece based on OpenCasCide
The welds of three-dimensional welded workpieces are extracted through the OpenCasCade platform, which solves the problem of insufficient accuracy of complex curved surfaces and non-standardized welds, and achieves efficient and accurate extraction of weld parameters, improving welding quality and efficiency.
Patent Information
- Application Number
- CN202510516743.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-23
- Publication Date
- 2025-07-18
AI Technical Summary
The prior art has insufficient extraction accuracy when dealing with complex curved surfaces or non-standardized welds, and weld extraction based on CAD model cannot effectively handle weld cutoff and associated surface information binding. The topological analysis method can easily lead to deviations in the extraction result.
Using the OpenCasCade platform, by reading the three-dimensional welded workpiece model, calculating the faces of the joint and opposite normals, binding the initial weld, detecting the cutoff state, generating a new weld and binding the cutoff surface, removing overlapping welds, and outputting the final weld parameters.
It improves the accuracy and efficiency of weld extraction, reduces the cost of manual teaching, and improves the quality and efficiency of welding.
Smart Images

Figure CN120339259A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of industrial automation welding, and particularly to a method for extracting weld seams from three-dimensional welding workpieces based on OpenCasCade. Background Art
[0002] In the industrial field, extracting weld seams from three-dimensional welding workpieces is a process of automatically identifying, positioning, and extracting the geometric information and associated features of welding joints (weld seams) from three-dimensional digital models (such as CAD models) through computer-aided technology. The goal of this process is to provide accurate structured data support for subsequent welding process planning, robot path programming, quality inspection, etc. The existing technologies mainly include: (1) Weld seam extraction methods based on geometric features, mainly through surface segmentation and boundary detection, using the differences between weld seams and matrix geometric features to segment the area where the weld seams are located. Usually, segmentation is performed through geometric features such as surface normal vectors, curvatures, and corners, and the boundaries of the weld seams are detected. (2) Weld seam extraction based on CAD models. In CAD models, different types of weld seams (such as fillet welds, butt joints, etc.) are extracted and classified by identifying specific weld seam features (such as the cross-sectional shape and position parameters of the weld seams). (3) Weld seam extraction through topological analysis, using the topological structure of three-dimensional models to extract the connection relationships between weld seams and the matrix, and based on these relationships, the weld seams are extracted and classified.
[0003] In practice, in models with complex surfaces or similar geometric features, it is difficult to distinguish between weld seam regions and non-weld seam regions using weld seam extraction methods based on geometric features. And weld seam extraction based on CAD models is mainly applicable to regularized and standardized weld seam extraction, and has poor effects on complex or non-standardized weld seams. For weld seam extraction through topological analysis, if the topological structure of the three-dimensional model is not clear or there are errors, it is easy to cause deviations in the extraction results.
[0004] Therefore, there is an urgent need for a new technical solution to solve the above technical problems. Summary of the Invention
[0005] The purpose of the present invention is to overcome the problems of the above-mentioned existing technologies, and provide a method for extracting weld seams from three-dimensional welding workpieces based on OpenCasCade, so as to solve the technical problems of insufficient extraction accuracy for complex surfaces or non-standardized weld seams based on geometric features in the existing technology, inability to effectively process weld seam truncation and associated surface information binding based on CAD models, and easy deviation of extraction results based on topological analysis.
[0006] The above purpose is achieved through the following technical solutions:
[0007] A method for extracting weld seams from three-dimensional welding workpieces based on OpenCasCade, comprising:
[0008] Step (1) Read the 3D model: Convert the model file of the 3D welding workpiece into an OpenCascade data structure, save the sub-model, face, and edge information in the model, and establish the mapping relationship between the sub-model and the face and edge.
[0009] Step (2) Extract the initial weld seam: Traverse all sub-models, filter out two adjacent sub-models, calculate the two adjacent faces with opposite normal vectors, determine the initial weld seam according to the inclusion or intersection relationship of the faces, and bind the forming face of the weld seam.
[0010] Step (3) Weld seam truncation detection: Traverse the initial weld seam, detect the sub-models intersecting with it, judge the weld seam truncation state according to the number of cross-sections, generate a new weld seam after truncation, and bind the cross-section.
[0011] Step (4) Internal cross-section detection of the solid: Conduct internal cross-section detection on the new weld seam, determine the sub-model to which the weld seam endpoints belong, and bind the cross-section information.
[0012] Step (5) Output the final weld seam: Remove the overlapping weld seams and save the weld seam parameters including the forming face and cross-section information.
[0013] Further, the model file of the 3D welding workpiece in step (1) is in IFC, STEP, or IGES format, and the model is converted into an OpenCascade data structure through the IFC++ library.
[0014] Further, the calculation of the two adjacent faces with opposite normal vectors in step (2) is specifically: Detect the intersection of the bounding boxes and screen the normal directions to calculate the adjacent faces with opposite normal vectors.
[0015] Further, the extraction of the initial weld seam in step (2) is specifically:
[0016] If the two faces are in an inclusion relationship, take the smaller face as the intersection face and its edges as the initial weld seam;
[0017] If the two faces are in an intersection relationship, project the smaller face onto the larger face and generate a contour as the initial weld seam.
[0018] Further, the determination of the inclusion relationship is specifically: Extract the outer contour of the face through the OuterWire() interface inside BReTools, construct a projection face and calculate the parameter range;
[0019] Set the four parameter ranges of face 1 as uMin1, uMax1, vMin1, vMax1, and the four parameter ranges of face 2 as uMin2, uMax2, vMin2, vMax2. If it satisfies:
[0020] uMin2 - 1 ≤ uMin1
[0021] uMax2 + 1 ≥ uMax1
[0022] vMin2 - 1 ≤ vMin1
[0023] vMax2 + 1 ≥ vMax1
[0024] Then it is determined as an inclusion relationship, otherwise it is an intersection relationship.
[0025] Furthermore, the truncation detection described in step (3) is specifically as follows:
[0026] If the number of cross - sectional planes is 1, it is determined that the weld is not truncated;
[0027] If the number of cross - sectional planes is 2, the weld is cut into two segments and respectively bound to the cross - sectional plane closest to it.
[0028] Furthermore, the internal cross - section detection described in step (4) determines the attribution of the cross - sectional plane by calculating the consistency of the normal direction between the weld endpoints and the adjacent faces.
[0029] A method for extracting weld seams from a three - dimensional welded workpiece based on OpenCasCade provided by the present invention can read different types of three - dimensional files (such as: IFC, STEP, IGES, etc., and the three - dimensional model of the three - dimensional file needs to contain a combined model of at least two part entities), calculate the interface between intersecting entities, extract weld seam information and bind it to form a surface; extract the cross - section information of the weld seam by judging the truncation situation of the weld seam, and at the same time judge the cross - section situation of the entity itself; remove overlapping weld seams, generate parameters such as the final weld seam position and related surface information; thus more efficiently and accurately extract the weld seam parameters of the workpiece model. This method can reduce the cost of manual teaching and improve the welding efficiency and quality by accurately extracting weld seam parameters (position, cross - section, formed surface). BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 is a flowchart of a method for extracting weld seams from a three - dimensional welded workpiece based on OpenCasCade according to the present invention;
[0031] Figure 2 is a flowchart of extracting the initial weld seam in a method for extracting weld seams from a three - dimensional welded workpiece based on OpenCasCade according to the present invention;
[0032] Figure 3 is a flowchart of the weld seam truncation process in a method for extracting weld seams from a three - dimensional welded workpiece based on OpenCasCade according to the present invention;
[0033] Figure 4It is an example model diagram in the method for extracting weld seams from three-dimensional welded workpieces based on OpenCasCade according to the present invention;
[0034] Figure 5 It is an example diagram of the initial weld seam in the method for extracting weld seams from three-dimensional welded workpieces based on OpenCasCade according to the present invention;
[0035] Figure 6 It is an example diagram of the truncated weld seam in the method for extracting weld seams from three-dimensional welded workpieces based on OpenCasCade according to the present invention;
[0036] Figure 7 It is an example diagram of the left cross-section of the weld seam in the method for extracting weld seams from three-dimensional welded workpieces based on OpenCasCade according to the present invention;
[0037] Figure 8 It is an example diagram of the right cross-section of the weld seam in the method for extracting weld seams from three-dimensional welded workpieces based on OpenCasCade according to the present invention;
[0038] Figure 9 It is an example diagram of the formation surface of the weld seam in the method for extracting weld seams from three-dimensional welded workpieces based on OpenCasCade according to the present invention;
[0039] Figure 10 It is an example diagram of the internal cross-section detection of the weld seam in the method for extracting weld seams from three-dimensional welded workpieces based on OpenCasCade according to the present invention;
[0040] Figure 11 It is an example diagram of the final weld seam extraction in the method for extracting weld seams from three-dimensional welded workpieces based on OpenCasCade according to the present invention. Detailed implementation manners
[0041] The present invention will be further described in detail below with reference to the drawings and embodiments. The described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. All other embodiments obtained by those of ordinary skill in the art without creative efforts based on the embodiments of the present invention belong to the scope of protection of the present invention.
[0042] As Figures 1 - 3 shown, this solution provides a method for extracting weld seams from three-dimensional welded workpieces based on OpenCasCade, including the following steps:
[0043] Step (1) Read the 3D model: Convert the model file of the 3D welding workpiece into an OpenCascade data structure, save the sub-model (Shape), face (Face), and edge (Edge) information in the model, and establish the mapping relationship between the sub-model and the face and edge;
[0044] Step (2) Extract the initial weld seam: Traverse all sub-models, filter out two connected sub-models, calculate the two faces that are connected and have opposite normal vectors, determine the initial weld seam according to the inclusion or intersection relationship of the faces, and bind the forming faces of the weld seam;
[0045] Step (3) Weld seam truncation detection: Traverse the initial weld seam, detect the sub-models that intersect with it, judge the weld seam truncation state according to the number of cross-sections, generate a new weld seam after truncation, and bind the cross-section;
[0046] Step (4) Internal cross-section detection of the solid: Perform internal cross-section detection on the new weld seam, determine the sub-model to which the weld seam endpoints belong, and bind the cross-section information;
[0047] Step (5) Output the final weld seam: Remove the overlapping weld seams and save the weld seam parameters including the forming faces and cross-section information. That is, save all the weld seam information, including the forming faces (the two faces where the weld seam is generated) and the cross-sections (the cut-off faces of the weld seam). Traverse all the saved weld seams, remove all the overlapping weld seams, and save the final weld seam result.
[0048] In step (1) of this embodiment, the model file of the 3D welding workpiece is in IFC, STEP, or IGES format. The model is converted into an OpenCascade data structure through the IFC++ library, and the sub-model (Shape), face (Face), and edge (Edge) information in the model is extracted using the TopExp_Explorer interface. The mapping relationship between the three is saved through the MapShapesAndAncestors interface, laying the foundation for binding relevant face information to the weld seam.
[0049] In step (2) of this embodiment, the calculation of the two faces that are connected and have opposite normal vectors is specifically as follows: Through bounding box intersection detection and normal direction screening, calculate the faces that are connected and have opposite normal vectors. Specifically:
[0050] First, extract all the face information of the two models respectively through the TopExp_Explorer() interface. Select any one face from the face information saved respectively, and calculate the bounding box information of the face through the AddOBB() interface in BRepBndLib. Then, judge the intersection situation of the bounding boxes of the two faces and call the internal isOUT() interface;
[0051] If the result is false, repeat the above operation of taking faces and calculating the bounding box;
[0052] When the result is true, calculate the normal vector of the face through the BRepGPrp_Face() interface;
[0053] If the normal vectors of the two faces are opposite, retain the information of the two faces to prepare for subsequent extraction of the weld seam, otherwise continue to return to the above operation of taking the faces and calculating the bounding box.
[0054] Separate the sides of the two faces retained in the above calculation, and use the face that is collinear with the weld seam as the forming face of the weld seam.
[0055] The two sub-models (Shape) calculated above are used as the related bodies of the weld seam.
[0056] The extraction of the initial weld seam described in step (2) of this embodiment is specifically as follows:
[0057] If the two faces are in an inclusion relationship, take the smaller face as the intersection face, use its edges as the initial weld seam, and bind the forming face;
[0058] If the two faces are in an intersecting relationship, project the smaller face onto the larger face, generate a contour as the initial weld seam, and bind the forming face.
[0059] Among them, the determination of the inclusion relationship is specifically: extract the outer contour of the face through the OuterWire() interface inside BReTools, construct a projection face and calculate the parameter range;
[0060] Set the four parameter ranges of face 1 as uMin1, uMax1, vMin1, vMax1, and the four parameter ranges of face 2 as uMin2, uMax2, vMin2, vMax2. If the following conditions are met:
[0061] uMin2 - 1 ≤ uMin1
[0062] uMax2 + 1 ≥ uMax1
[0063] vMin2 - 1 ≤ vMin1
[0064] vMax2 + 1 ≥ vMax1
[0065] Then it is determined as an inclusion relationship, otherwise it is an intersecting relationship.
[0066] Specifically, calculate the outer contours of the two faces that are both adjacent and have opposite directions saved above through the OuterWire() interface inside BReTools.
[0067] Then, the areas of the two surfaces are calculated by combining GProp_GPro with the SurfaceProperties() interface in BrepGPrp, and the projection surface is constructed through the BrepBuilderAPI_MakeFace interface based on the surface with the larger area.
[0068] The initial face contours are respectively projected onto the projection surface, and the parameter ranges of each on the projection surface are calculated. Assume the four parameter ranges of face 1 are uMin1, uMax1, vMin1, vMax1, and the parameter ranges of face 2 are uMin2, uMax2, vMin2, vMax2. If
[0069] uMin2 - 1 ≤ uMin1
[0070] uMax2 + 1 ≥ uMax1
[0071] vMin2 - 1 ≤ vMin1
[0072] vMax2 + 1 ≥ vMax1
[0073] it indicates that the two surfaces contain a light system; otherwise, it is an intersecting relationship.
[0074] The truncation detection described in step (3) of this embodiment is specifically as follows:
[0075] If the number of truncated surfaces is 1, it is determined that the weld is not truncated;
[0076] If the number of truncated surfaces is 2, the weld is cut into two sections, and each is respectively bound to the nearest truncated surface.
[0077] The truncation position is determined according to the number of truncated welds. If the number of truncated welds is 2, it indicates that the weld is truncated from the middle; otherwise, one end is truncated.
[0078] Bind the sections of all the truncated welds above and save all the new welds.
[0079] The confirmation of the above "section" is specifically as follows: First, find the sub-model intersecting with the weld through the AddOBB() interface, and then calculate the number of intersection points between the weld and this sub-model through the IntCurvesFace_ShapeIntersector interface;
[0080] If the number of intersection points is 1, it indicates that there is one section;
[0081] If the number of intersection points is 2, there are two sections, and the faces in the sub-model intersecting with the weld are obtained through the internal Face() interface.
[0082] In step (4) of this embodiment, the internal cross-section detection determines the attribution of the cross-section by calculating the consistency between the weld endpoints and the normal direction of the adjacent surface.
[0083] Perform internal cross-section detection on the truncated weld within its own solid to determine the clear sub-models to which the two sub-models associated with the weld belong. Traverse the sub-models to calculate the surfaces that are tangent to the forming surface of the weld. Take the endpoint closest to this surface at one end of the weld as the starting point and the other end as the ending point to calculate the normal.
[0084] Judge whether the normal of this surface is consistent with the normal directions calculated from the two endpoints:
[0085] If the directions are the same, bind it as the cross-section;
[0086] Otherwise, discard it.
[0087] Specifically, traverse all the saved weld data. If the number of cross-sections of the weld is already 2, there is no internal cross-section in the two related shapes where the weld is located.
[0088] First, extract the two vertices and the forming surface of the weld. Traverse all the surfaces of the two shapes related to the weld, retain the surfaces that can intersect with the forming surface of the weld, and at the same time calculate the distances from the starting and ending points of the weld to this surface. Compare the magnitudes of the two distances. If it is closer to the starting point, construct a vector from the ending point to the starting point of the weld; if this vector is opposite to the normal of the traversed surface, then take this surface as the cross-section of the weld and bind it to the starting position of this weld; similarly, if it is closer to the ending point, construct a vector from the starting point to the ending point of the weld; if this vector is opposite to the normal of the traversed surface, then take this surface as the cross-section of the weld and bind it to the starting position of this weld.
[0089] In this solution, the initial weld extraction technology mainly focuses on the welds with joined parts in the model, which is the key to subsequent weld truncation and extraction of relevant surface information. By adopting different processing methods according to different states of the joined surfaces, the initial welds can be correctly extracted;
[0090] The weld truncation technology can perform truncation processing on the welds generated by intersecting solids, and select specific processing methods based on the number of cross-sections and the number of welds after truncation;
[0091] Integrating the forming surface and cross-section technologies of the weld prepares for the subsequent teaching-free welding system.
[0092] The above technologies are crucial for accurately extracting welds and their relevant information, can provide more complete weld information, prepare for the later teaching-free system, and gain a competitive advantage in the teaching-free welding industry.
[0093] Such as Figure 2 、 4As shown in FIGS. 4 and 5, as an optimization of step (2) of this embodiment, the initial weld extraction process is implemented based on the OpenCascade platform. The initial weld extraction process accurately locates the weld position and binds the key surface information through geometric intersection analysis, surface classification, and projection technology. This step is the basis for subsequent truncation detection ( Figure 3 ), and cross-section binding ( Figures 6 - 9 ), ensuring the integrity and accuracy of the weld data and providing reliable input for the path planning of the teaching-free welding system. The specific steps are as follows:
[0094] Step (2.1): Read the 3D model and store the mapping relationship
[0095] Model conversion: Read the 3D model file (supporting IFC, STEP, and IGES formats) through the third-party IFC++ library and convert it into a geometric data structure (B-rep model) supported by OpenCascade.
[0096] Information extraction: Use the TopExp_Explorer interface of OpenCascade to traverse all sub-models (Shape), faces (Face), and edges (Edge) in the model, and extract geometric and topological information.
[0097] Mapping storage: Establish the mapping relationship between faces and edges through the MapShapesAndAncestors interface, providing a data basis for the subsequent binding of welds and forming surfaces.
[0098] Step (2.2): Traverse the sub-models and filter the connected entities
[0099] Traverse all sub-models: Traverse each sub-model in the model (such as two parts of a welded workpiece) and filter out the entities that are connected to each other in pairs.
[0100] Determine whether there is an intersection: Use a geometric intersection detection algorithm (such as BRepAlgoAPI_Common) to determine whether there is an intersection area between two sub-models. If there is no intersection, skip this pair of sub-models; if there is an intersection, proceed to the next step.
[0101] Step (2.3): Extract the intersecting faces and classify them
[0102] Extract the intersecting faces: Use TopExp_Explorer to traverse all the faces of the two intersecting sub-models and filter out the two faces that intersect and have opposite normal directions (as shown in Figure 5 ).
[0103] Surface classification: The intersecting surfaces are classified into "large surfaces" and "small surfaces" according to their area sizes. If there is an inclusion relationship between two surfaces (i.e., the small surface is completely within the large surface), directly go to step 4.1; if it is an ordinary intersection relationship (i.e., partial overlap), go to step (2.4).
[0104] Step (2.4): Generate the initial weld seam
[0105] Processing of inclusion relationship
[0106] Take all the edges of the small surface as the initial weld seam (such as Figure 5 the edge of the intermediate interface).
[0107] Bind to form surfaces: Associate the adjacent surfaces of the two sub-models to which the small surface belongs (i.e., the two surfaces where the weld seam is generated) with the weld seam and record them as the "forming surfaces" of the weld seam.
[0108] Processing of intersection relationship
[0109] - Generate the intersection line by projection: Geometrically project the small surface onto the large surface (such as using the BRepProj_Projection algorithm) to generate the projected intersection line as the initial weld seam (such as Figure 5 the projected contour).
[0110] Bind to form surfaces: Bind the intersecting surfaces of the two sub-models corresponding to the projected intersection line as the forming surfaces of the weld seam.
[0111] Step (2.5): Store the information of the initial weld seam
[0112] Store the generated initial weld seam (including parameters such as geometric coordinates, length, and direction) and the information of its bound forming surfaces into the data structure to provide input for subsequent truncation detection and section binding.
[0113] Such as Figure 3 、 6 ~11 shown, as an optimization of steps (3), (4), and (5) of this embodiment, the weld seam truncation process effectively solves the problem of the weld seam being truncated by other entities in complex welded workpieces by dynamically detecting intersecting sub-models, classifying and processing unilateral and bilateral truncations, and binding the cross-section information. This step not only improves the integrity of the weld seam data (such as the cross-section binding effect shown in Figures 7 - 8 ), but also provides high-precision input data for the path planning of the subsequent teaching-free welding system. The specific steps are as follows:
[0114] Step 1: Traverse the initial weld seam
[0115] Input the initial weld seam: Obtain the untruncated initial weld seam data from the initial weld seam extraction process ( Figure 2 ), including the geometric parameters (position, length, direction) of the weld seam and the information of its bound forming surfaces.
[0116] Traverse the weld seams: Process each initial weld seam one by one and enter the truncation detection logic.
[0117] Step 2: Detect intersecting sub-models (Shape)
[0118] Traverse all intersecting sub-models: For the current weld seam, traverse other sub-models in the model that intersect with the sub-models to which the two forming surfaces of the weld seam belong (i.e., the two parts that generate the weld seam).
[0119] Judge the intersection:
[0120] If no intersecting sub-model is found (the number of intersections is 0), skip this weld seam and keep the original state (such as Figure 5 the untruncated weld seam in
[0121] If there are intersecting sub-models (the number of intersections ≥ 1), enter the judgment of the number of cross-sections.
[0122] Step 3: Calculate the number of cross-sections
[0123] Extract the cross-section: Calculate the intersection points or intersection lines between the intersecting sub-model and the current weld seam through a geometric intersection detection algorithm (such as BRepAlgoAPI_Section), and count the number of cross-sections.
[0124] Judge the number of cross-sections:
[0125] If the number of cross-sections is 0: There is no actual truncation relationship between the sub-model and the weld seam (such as only the bounding box intersects but the geometry does not intersect), skip this sub-model;
[0126] If the number of cross-sections is 1: The sub-model only truncates one end of the weld seam (single-sided truncation), enter the single-sided processing logic;
[0127] If the number of cross-sections is 2: The sub-model truncates the weld seam in the middle (double-sided truncation), enter the double-sided processing logic.
[0128] Step 4: Truncation processing and weld seam segmentation
[0129] Single-sided truncation (the number of cross-sections is 1)
[0130] Retain the untruncated part: Cut off the part truncated by the sub-model through the `BRepAlgoAPI_Cut` algorithm, and retain the remaining untruncated weld seam segment (such as Figure 6 the single-sided truncation example in
[0131] Bind the cross-section: Bind the geometric information (position, normal direction) of the cross-section to the remaining weld seam.
[0132] Double-sided truncation (the number of cross-sections is 2)
[0133] Cut weld: Divide the original weld into two independent new welds through geometric operations (such as Figure 6 the bilateral truncation example in
[0134] Bind the truncation surface:
[0135] Calculate the distance between the endpoints of each new weld and the truncation surface, and bind the truncation surface with the closest distance to the corresponding weld;
[0136] If the truncation surfaces are symmetrically distributed, determine the binding relationship through the normal direction consistency verification.
[0137] Step 5: Temporarily store and save the new welds
[0138] Temporarily store the new welds: Temporarily store the truncated new welds (including the formation surface and truncation surface information) in the intermediate data structure.
[0139] Duplicate removal processing: Check whether the temporarily stored welds overlap with the existing welds. If they overlap, merge or remove the duplicates.
[0140] Output result: Save all legal new weld data as part of the final weld extraction result (as Figure 11 shown).
[0141] The above is only to illustrate the embodiments of the present invention and is not intended to limit the present invention. For those skilled in the art, any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.
Claims
1. A method for extracting weld seams from three-dimensional welded workpieces based on OpenCasCade, characterized in that, Including: Step (1) Read the 3D model: Convert the model file of the 3D welding workpiece into an OpenCascade data structure, save the sub-model (Shape), face (Face), and edge (Edge) information in the model, and establish the mapping relationship between the sub-model and the face and edge; Step (2) Extract the initial weld seam: Traverse all sub-models, filter out two connected sub-models, calculate two faces that are adjacent and have opposite normal directions, determine the initial weld seam according to the inclusion or intersection relationship of the faces, and bind the forming face of the weld seam; Step (3) Weld seam truncation detection: Traverse the initial weld seam, detect the sub-models that intersect with it, judge the weld seam truncation state according to the number of cross-sections, generate a new weld seam after truncation and bind the cross-section; Step (4) Internal cross-section detection of the solid: Perform internal cross-section detection on the new weld seam, determine the sub-model to which the weld seam end belongs, and bind the cross-section information; Step (5) Output the final weld seam: Remove the overlapping weld seams and save the weld seam parameters including the forming face and cross-section information.
2. The method for extracting a weld seam from a three-dimensional welded workpiece based on OpenCasCade according to claim 1, wherein The model file of the 3D welding workpiece in Step (1) is in IFC, STEP, or IGES format, and the model is converted into an OpenCascade data structure through the IFC++ library.
3. A method for extracting weld seams from three-dimensional welded workpieces based on OpenCasCade according to claim 1, characterized in that, In Step (2), the calculation of the two faces that are adjacent and have opposite normal directions is specifically: Detect the intersection of the bounding boxes and filter by the normal direction to calculate the adjacent faces with opposite normal directions.
4. A method for extracting weld seams from three-dimensional welded workpieces based on OpenCasCade according to claim 3, characterized in that, The extraction of the initial weld seam in Step (2) is specifically: If the two faces are in an inclusion relationship, take the smaller face as the intersection face and its edges as the initial weld seam; If the two faces are in an intersection relationship, project the smaller face onto the larger face to generate a contour as the initial weld seam.
5. A method for extracting weld seams from a three-dimensional welded workpiece based on OpenCasCade according to claim 4, characterized in that, The determination of the inclusion relationship is specifically: Extract the outer contour of the face through the OuterWire() interface inside BReTools, construct the projection face and calculate the parameter range; Set the four parameter ranges of face 1 as uMin1, uMax1, vMin1, vMax1, and the four parameter ranges of face 2 as uMin2, uMax2, vMin2, vMax2. If the following conditions are met: uMin2 - 1 ≤ uMin1 uMax2 + 1 ≥ uMax1 uMin2 - 1 ≤ vMin1 vMax2 + 1 ≥ vMax1 Then it is determined as an inclusion relationship, otherwise it is an intersection relationship.
6. A method for extracting weld seams from three-dimensional welded workpieces based on OpenCasCade according to claim 1, characterized in that, The truncation detection in Step (3) is specifically: If the number of cross-sections is 1, it is determined that the weld seam is not truncated; If the number of cross-sections is 2, cut the weld seam into two sections and respectively bind the cross-section closest to it.
7. A method for extracting weld seams from three-dimensional welded workpieces based on OpenCasCade according to claim 4, characterized in that, The internal cross-section detection in Step (4) determines the cross-section attribution by calculating the consistency of the normal direction between the weld seam end and the adjacent face.