Viewpoint generation method and device for linear workpiece 3D file analysis and electronic equipment

By performing planar detection and occlusion analysis on the point cloud of a straight workpiece, an effective list of viewpoints is generated, which solves the problems of redundancy and repetitive calculation in the prior art and achieves efficient parsing of weld information of straight workpieces.

CN122453907APending Publication Date: 2026-07-24FAIR INNOVATION (SUZHOU) ROBOTIC SYSTEM CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
FAIR INNOVATION (SUZHOU) ROBOTIC SYSTEM CO LTD
Filing Date
2026-04-29
Publication Date
2026-07-24

AI Technical Summary

Technical Problem

Existing technologies suffer from redundancy, repetitive calculations, and missed detections when generating viewing points, especially in complex assemblies such as box girder workpieces where internal welds cannot be analyzed.

Method used

By performing planar detection on the point cloud of a straight workpiece, an initial viewpoint is generated in the direction of the angle bisector of the planar structure. The viewpoint is then checked for occlusion or if it is located inside the workpiece. Invalid viewpoints are deleted, and new viewpoints are searched for on the occlusion path. Finally, a list of viewpoints that can be used to parse weld information from 3D files is generated.

Benefits of technology

This avoids the generation of redundant and invalid viewpoints, ensuring that the generated viewpoints can effectively resolve the weld information of straight workpieces, reducing the computational burden and improving resolution efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122453907A_ABST
    Figure CN122453907A_ABST
Patent Text Reader

Abstract

The application provides a view point generation method, device and electronic equipment for linear workpiece 3D file analysis, plane structure is obtained by plane detection on the point cloud of the linear workpiece, and an initial view point is generated. Whether each initial view point is blocked by the corresponding plane structure or other structure is detected, and whether the initial view point is located inside the linear workpiece is detected. In the case that there is no effective view point after detection and deletion, a new view point is searched along the surface of the blocking obstacle on the path of the blocked line of sight, and secondary detection is performed again on the new view point whether it is blocked and whether it is located inside the linear workpiece. The final view point list is generated based on the view points reserved after the secondary detection. In the scheme, through the blocking detection and the workpiece internal detection, the generation of redundant and invalid view points can be avoided, and combined with the re-searching of the surface of the blocking obstacle, the available view points can be generated for the structure, so that the effectiveness and the calculation burden are balanced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of point cloud processing technology, and more specifically, to a viewpoint generation method, apparatus, and electronic device for parsing 3D files of linear workpieces. Background Technology

[0002] When a model file of a workpiece is provided, it is often necessary to extract the weld information present in the workpiece from the model file. Existing methods for extracting weld information from model files involve randomly generating several viewpoints, performing operations such as detection and merging of the structure in the point cloud at each viewpoint, and then obtaining the weld information from the model file.

[0003] The existing methods for parsing welds from model files have the following drawbacks: (1) The generated viewpoints often have some redundancy, and the point cloud observed from some viewpoints cannot detect effective surface structures. This is because when generating viewpoints, only the bounding box information of the workpiece is used, without considering the plane distribution in the workpiece. When some viewpoints are located in the same space on certain planes, the structures detected from the observed point cloud are the same.

[0004] exist Figure 1 The diagram illustrates redundant viewpoints, showing a workpiece model and two viewpoints. The distribution of these two viewpoints causes them to detect the same structure in their observed point clouds, thus constituting redundant viewpoints. When some viewpoints are located behind the workpiece, no structure may be detected in the observed point cloud.

[0005] exist Figure 2 The diagram shows an invalid viewpoint. As can be seen from the diagram, the viewpoint is located above the bottom surface of the workpiece, and no valid structure can be detected from the point cloud of this viewpoint.

[0006] (2) For each viewpoint's point cloud, planar detection and structure lookup are required, which involves a large amount of repetitive computation. Because different viewpoints only show different parts of the same workpiece, the planar planes themselves do not change; that is, the planes in the point clouds from different viewpoints are actually the same. Repeatedly detecting these planes leads to a large computational load. Figure 3 and Figure 4 The corresponding diagram is provided in the figure. Figure 3 and Figure 4 These are point clouds observed from two different viewpoints. As can be seen from the images, the planes are basically the same, but plane detection is required in both point clouds.

[0007] (3) For complex assemblies, some welds cannot be resolved. A typical example is a box girder, which has a complex internal structure. Since the generated viewpoint surrounds the workpiece's enclosure, there is a lack of viewpoints inside the workpiece, resulting in the welds corresponding to the internal structure not being resolved. Figure 5 The diagram shows a box girder workpiece. It can be seen from the diagram that there are many structures inside the box girder. The welds corresponding to these structures cannot be well observed from the viewpoints around the frame.

[0008] It is evident that existing technologies suffer from problems such as redundant generated viewpoints, repetitive workload, and potential missed detections. Summary of the Invention

[0009] The purpose of this invention is to provide a viewpoint generation method, apparatus, and electronic device for parsing 3D files of linear workpieces, so as to avoid redundant and invalid viewpoint generation and ensure that usable viewpoints are generated for the structure.

[0010] In a first aspect, the present invention provides a viewpoint generation method for parsing 3D files of linear workpieces, the method comprising: Obtain the point cloud of the straight workpiece, and perform planar detection on the point cloud to obtain a planar structure; An initial viewpoint is generated based on the geometric parameters of each of the planar structures, located in the direction of the angle bisector of the planar structure. Detect whether each initial viewpoint is occluded by the corresponding planar structure or other structures in the point cloud. If it is occluded, delete the initial viewpoint. Detect whether each of the initial viewpoints is located inside the straight workpiece; if it is located inside the straight workpiece, delete the initial viewpoint. If no valid viewpoint is found after deletion, a new viewpoint is searched along the surface of the obstructing obstacle on the path where the view is blocked, and a secondary detection is performed on the new viewpoint to check whether it is obstructed and whether it is located inside the straight workpiece. The viewpoints retained after the secondary inspection are obtained to generate a final viewpoint list, wherein the viewpoints in the viewpoint list are used to parse the 3D file of the straight workpiece to obtain the weld information of the 3D file.

[0011] In an optional implementation, the step of generating an initial viewpoint located in the angle bisector direction of the planar structure based on the geometric parameters of each of the planar structures includes: In the case that the planar structure is a three-plane structure, determine the intersection point of the three planes in the three-plane structure; Calculate the angle bisectors between any two planes, and calculate the line of intersection between any two angle bisectors; On each intersection line, starting from the intersection point, a point is determined in both the positive and negative directions according to a set distance threshold, serving as the initial viewpoint.

[0012] In an optional implementation, the step of generating an initial viewpoint located in the angle bisector direction of the planar structure based on the geometric parameters of each of the planar structures includes: In the case where the planar structure is a two-plane structure, calculate the midpoint of the intersection line of the two planes in the two-plane structure, and calculate the angle bisector of the two planes; On the angle bisector plane, in the direction parallel to the line of intersection, a point is determined in the positive and negative directions of the midpoint according to a set distance threshold, and used as the initial viewpoint.

[0013] In an optional implementation, the step of detecting whether each of the initial viewpoints is occluded by the corresponding planar structure or other structures in the point cloud includes: For each of the initial viewpoints, the concavity and convexity of the planar structure at the initial viewpoint are obtained; Based on the concavity and convexity, a three-dimensional Boolean code is generated, and a geometric information rearrangement operation is performed based on the three-dimensional Boolean code to uniformly map the concavity and convexity to a standard concavity and convex configuration; Based on the standard concave-convex configuration, it is detected whether the initial viewpoint is occluded by the corresponding planar structure or other structures in the point cloud.

[0014] In an optional implementation, the step of detecting whether the initial viewpoint is occluded by the corresponding planar structure or other structures in the point cloud based on the standard concave-convex configuration includes: Detect whether the initial viewpoint is obscured by the corresponding planar structure; If the initial viewpoint is not occluded by the corresponding planar structure, then the corresponding occlusion detection strategy is determined based on the standard concave-convex configuration, and the occlusion detection strategy is used to detect whether the initial viewpoint is occluded by other structures in the point cloud.

[0015] In an optional implementation, the step of detecting whether the initial viewpoint is occluded by other structures in the point cloud based on the occlusion detection strategy includes: Iterate through each plane in the obtained list of planes and check whether the line connecting the initial viewpoint and the intersection of the plane structure penetrates the plane. If the connecting line penetrates the plane, then it is detected whether there is a point on the plane that meets the set conditions. If there is a point that meets the set conditions, then it is determined that the initial viewpoint is occluded by the plane. Specifically, when the standard concave-convex configuration is a three-concave configuration, the setting condition is that the point is within the positive spatial range of the three planes of the planar structure and the distance to each of the three planes is less than a preset distance; when the standard concave-convex configuration is a two-concave-one-convex configuration, the setting condition is that the point is within the positive spatial range of the two planes constituting any concave structure and the distance to each of the three planes is less than a preset distance; when the standard concave-convex configuration is a two-convex-one-concave configuration, the setting condition is that the point is within the positive spatial range of the two planes constituting the unique concave structure and the distance to each of the three planes is less than a preset distance.

[0016] In an optional implementation, the step of detecting whether each of the initial viewpoints is located inside the linear workpiece includes: Detect whether there is a thin plate structure in the point cloud. The thin plate structure is defined as the angle between the normal vectors of two planes being less than a preset angle and the distance between them being less than a preset distance. If a thin plate structure exists, it is detected whether each initial viewpoint is located within the gap space defined by any thin plate structure. If it is located within the gap space, it is determined that the initial viewpoint is located inside the straight workpiece.

[0017] In an optional implementation, after the step of generating the final list of viewpoints, the method further includes: Detect whether there is an associated planar structure in the point cloud that is related to the planar structure; If it exists, verify whether the viewpoints in the viewpoint list corresponding to the plane structure can observe the effective area of ​​the associated plane structure. If the verification passes, directly map the viewpoints to the associated plane structure to obtain the viewpoint list of the associated plane structure.

[0018] Secondly, the present invention provides a viewpoint generation apparatus for parsing 3D files of linear workpieces, the apparatus comprising: The acquisition module is used to acquire the point cloud of the linear workpiece and perform planar detection on the point cloud to obtain a planar structure. A generation module is used to generate an initial viewpoint located in the direction of the angle bisector of the plane structure based on the geometric parameters of each plane structure. The first detection module is used to detect whether each initial viewpoint is occluded by the corresponding planar structure or other structures in the point cloud. If it is occluded, the initial viewpoint is deleted. The second detection module is used to detect whether each of the initial viewpoints is located inside the straight workpiece. If it is located inside the straight workpiece, the initial viewpoint is deleted. The search module is used to search for a new viewpoint along the surface of the obstructing obstacle on the path where the viewpoint is blocked if no valid viewpoint is found after deletion. The new viewpoint is then re-detected to determine whether it is obstructed and whether it is located inside a straight workpiece. The parsing module is used to obtain the viewpoints retained after the secondary inspection to generate a final viewpoint list. The viewpoints in the viewpoint list are used to parse the 3D file of the straight workpiece to obtain the weld information of the 3D file.

[0019] Thirdly, the present invention provides an electronic device including a processor and a memory, the memory storing computer-executable instructions executable by the processor, the processor executing the computer-executable instructions to implement the method described in any of the foregoing embodiments.

[0020] This invention provides a viewpoint generation method, apparatus, and electronic device for parsing 3D files of straight workpieces. The method involves obtaining a planar structure by performing planar detection on the point cloud of the straight workpiece, and generating initial viewpoints located along the angle bisectors of the planar structure based on its geometric parameters. The method detects whether each initial viewpoint is occluded by its corresponding planar structure or other structures, and whether the initial viewpoint is located inside the straight workpiece. If no valid viewpoint exists after deletion, a new viewpoint is searched along the surface of the occluding obstacle on the path of the occluded viewpoint, and a secondary detection process is performed on the new viewpoint to check for occlusion and whether it is located inside the straight workpiece. A final viewpoint list is generated based on the viewpoints retained after the secondary detection. The viewpoints in the viewpoint list are used to parse the 3D file of the straight workpiece to obtain weld information.

[0021] In this scheme, redundant and invalid viewpoint generation can be avoided by using occlusion detection and workpiece interior detection. Furthermore, by combining the re-search of occlusion obstacle surfaces, usable viewpoints can be generated for the structure, thus balancing effectiveness and computational burden. Attached Figure Description

[0022] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments of the present invention will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0023] Figure 1 A schematic diagram of redundant viewpoints; Figure 2 A diagram illustrating an invalid viewpoint; Figure 3 This is one of the schematic diagrams showing the existence of the same plane; Figure 4 This is the second schematic diagram showing the existence of the same plane; Figure 5 This is a schematic diagram of a box girder workpiece; Figure 6 A flowchart of a viewpoint generation method for parsing 3D files of linear workpieces provided in an embodiment of the present invention; Figure 7 This is a schematic diagram of the overall logic for viewpoint generation of the three-plane structure in an embodiment of the present invention; Figure 8 This is a schematic diagram of the overall logic for viewpoint generation of the two planar structures in an embodiment of the present invention; Figure 9 This is a schematic diagram illustrating the logic for generating the bounding box of the planar structure in an embodiment of the present invention; Figure 10 This is a logical schematic diagram illustrating the generation of the initial viewpoint of the three-plane structure in an embodiment of the present invention; Figure 11 This is a schematic diagram of each plane of the three-plane structure; Figure 12 This is a logical schematic diagram illustrating the generation of the initial viewpoint of the two-plane structure in an embodiment of the present invention; Figure 13 This is a functional block diagram of a viewpoint generation device for parsing 3D files of linear workpieces provided in an embodiment of the present invention. Detailed Implementation

[0024] The technical solutions of the present invention will now be described with reference to the accompanying drawings in the embodiments of the present invention.

[0025] Please see Figure 6 The above is a flowchart of a viewpoint generation method for parsing 3D files of a straight workpiece, provided by an embodiment of the present invention. This viewpoint generation method for parsing 3D files of a straight workpiece can be executed by a viewpoint generation device for parsing 3D files of a straight workpiece. This viewpoint generation device can be implemented by software and / or hardware and can be configured in an electronic device, such as a computer device or a server. The detailed steps of the viewpoint generation method for parsing 3D files of a straight workpiece are described below.

[0026] S11, Obtain the point cloud of the straight workpiece, and perform planar detection on the point cloud to obtain the planar structure; S12, Generate an initial viewpoint located in the direction of the angle bisector of the plane structure based on the geometric parameters of each plane structure; S13, detect whether each initial viewpoint is occluded by the corresponding planar structure or other structures in the point cloud. If it is occluded, delete the initial viewpoint. S14, Detect whether each initial viewpoint is located inside the straight workpiece. If it is located inside the straight workpiece, delete the initial viewpoint. S15. If no valid viewpoint exists after deletion, a new viewpoint is searched along the surface of the obstructing obstacle on the path where the viewpoint is blocked, and a secondary detection is performed on the new viewpoint to check whether it is blocked and whether it is located inside the straight workpiece. S16, obtain the viewpoints retained after the secondary inspection to generate the final viewpoint list, wherein the viewpoints in the viewpoint list are used to parse the 3D file of the straight workpiece to obtain the weld information of the 3D file.

[0027] Based on the engineering requirements of point cloud processing in 3D scenes, this embodiment aims to automatically generate and optimize sensor observation points (viewpoints) for detected planes (such as industrial features like weld corners and box edges, or linear features formed by the intersection of two planes, such as V-grooves and plate folds). Its core objective is to select poses from a set of initially generated viewpoints that can clearly and unobstructedly observe the effective area of ​​the target structure through multiple rounds of geometric constraint and occlusion analysis.

[0028] In this embodiment, planar detection is first performed on the point cloud of the straight workpiece. Based on the planar detection results, planar structures are then identified. Planar structures are mainly divided into three-plane structures and two-plane structures, and the processing methods for these two types of planar structures differ somewhat. Figure 7 and Figure 8 The overall logic diagrams for viewpoint generation in three-plane and two-plane structures are shown respectively.

[0029] Based on the planar structure, an initial viewpoint is generated in the direction of the angle bisector of the planar structure according to the geometric parameters of the planar structure.

[0030] For a three-plane structure, the step of generating the initial viewpoint can be achieved in the following way: In the case of a three-plane structure, determine the intersection point of the three planes in the three-plane structure; calculate the angle bisector between each pair of planes, and calculate the line of intersection between each pair of angle bisectors; on each line of intersection, starting from the intersection point, determine a point in the positive and negative directions according to the set distance threshold, as the initial viewpoint.

[0031] The distance threshold set in the above steps is obtained based on the diagonal of the bounding box formed by the three planes, and has a certain degree of adaptability.

[0032] Among them, combined Figure 9 As shown, the bounding box of the planar structure can be determined in the following way: Figure 9The workflow described here is a complete process for calculating the diagonal length of a scaled cuboid (bounding box) from point cloud data with a three-plane structure. The entire process begins with inputting the three-plane structure data and the scaling factor, and through a series of geometric calculations and projection operations, ultimately outputs key dimension information.

[0033] First, the program calculates the theoretical intersection of the three planes as the reference point, and then constructs a three-dimensional coordinate system using the normal vectors of each plane as the axial reference of the cuboid. This method of naturally determining the direction using the plane normal vectors ensures the geometric consistency of subsequent calculations.

[0034] Next, the point cloud data for each plane is projected onto the corresponding coordinate axes, and the original dimensions in the three directions are determined by analyzing the projection range. These dimensions are then multiplied by the scaling factor to obtain the adjusted final dimensions. This step allows the system to flexibly adapt to different measurement units or design requirements.

[0035] Finally, the length of the cuboid's spatial diagonal is calculated using the scaled 3D dimensions, and this length value, along with the previously calculated coordinates of the three intersection points, is output simultaneously. This entire process transforms discrete point cloud data into precise geometric parameters, providing crucial dimensional information for 3D modeling, industrial inspection, and reverse engineering applications.

[0036] Based on this, combined Figure 10 , Figure 11 As shown in the diagram, in the three-plane structure, plane ① and plane ② intersect, and their plane normal vectors are N1 and N2, respectively. Plane ③ is the angle bisector of plane ① and plane ②, and points on plane ③ are equidistant from plane ① and plane ②.

[0037] The initial viewpoint can be generated based on the angle bisector information of a three-plane structure, which can be achieved in the following ways: For each of the three planes of a three-plane structure: 1. Calculate the intersection point O of the three planes.

[0038] 2. Calculate two angle bisectors for every two planes.

[0039] 3. Then, calculate the line of intersection for every two angle bisectors (from different plane pairs) from these angle bisectors.

[0040] 4. On each angle bisector intersection line, starting from O, select one point in each of the positive and negative directions according to a set distance threshold (the set distance threshold is based on the diagonal of the bounding box formed by the three planes, and a scaling ratio threshold is taken, which has a certain degree of adaptability) as candidate viewpoints, and finally obtain the initial list of candidate viewpoints.

[0041] Furthermore, for a two-plane structure, the step of generating the initial viewpoint can be achieved in the following way: In the case of a two-plane structure, calculate the midpoint of the intersection line of the two planes and calculate the angle bisector of the two planes; on the angle bisector, in the direction parallel to the intersection line, determine a point in the positive and negative directions of the midpoint according to a set distance threshold, and use it as the initial viewpoint.

[0042] Specifically, in combination Figure 12 As shown, the initial viewpoint of a two-plane structure can be achieved in the following way: 1. Calculate the midpoint M of the intersection line.

[0043] 2. Calculate the two angle bisectors of two planes.

[0044] 3. Parallel to the intersection of the two planes, on the angle bisector plane, at a distance of M from the midpoint, take one point in each of the positive and negative directions as the initial viewpoints according to a set distance threshold (the set distance threshold is based on the diagonal of the bounding box formed by the three planes, and a scaling ratio threshold is taken, which has a certain degree of adaptability), and finally obtain a list of candidate initial viewpoints.

[0045] Based on this, it is determined whether each initial viewpoint is occluded by the corresponding planar structure or other structures in the point cloud. Specifically, this step can be achieved in the following way: For each initial viewpoint, the concavity and convexity of the planar structure under the initial viewpoint are obtained; a three-dimensional Boolean code is generated based on the concavity and convexity; a geometric information rearrangement operation is performed based on the three-dimensional Boolean code to uniformly map the concavity and convexity to a standard concavity and convex configuration; based on the standard concavity and convex configuration, it is detected whether the initial viewpoint is occluded by the corresponding planar structure or other structures in the point cloud.

[0046] Based on the standard concave-convex configuration, detecting whether the initial viewpoint is occluded by the corresponding planar structure or other structures in the point cloud can be achieved in the following ways: Detect whether the initial viewpoint is occluded by the corresponding planar structure; if the initial viewpoint is not occluded by the corresponding planar structure, determine the corresponding occlusion detection strategy based on the standard concave-convex configuration, and detect whether the initial viewpoint is occluded by other structures in the point cloud based on the occlusion detection strategy.

[0047] Specifically, detecting whether the initial viewpoint is occluded by other structures in the point cloud based on the occlusion detection strategy can be achieved in the following ways: Iterate through each plane in the obtained list of planes and check whether the line connecting the initial viewpoint and the intersection of the plane structure penetrates the plane. If the line penetrates the plane, then check if there is a point on the plane that meets the set conditions. If there is a point that meets the set conditions, then it is determined that the initial viewpoint is occluded by the plane.

[0048] Specifically, in the case of a standard concave-convex configuration with three concave surfaces, the setting condition is that the point is within the positive spatial range of the three planes of the planar structure and the distance to each of the three planes is less than a preset distance; in the case of a standard concave-convex configuration with two concave surfaces and one convex surface, the setting condition is that the point is within the positive spatial range of the two planes constituting any concave structure and the distance to each of the three planes is less than a preset distance; in the case of a standard concave-convex configuration with two convex surfaces and one concave surface, the setting condition is that the point is within the positive spatial range of the two planes constituting the unique concave structure and the distance to each of the three planes is less than a preset distance.

[0049] In this embodiment, for a three-plane structure, the core objective of the algorithm is: given a "three-plane structure" consisting of three planes and a set of candidate viewpoints, determine whether each viewpoint can "see" a valid region of the structure (usually a specific spatial range near the theoretical intersection of the three planes) through a series of strict geometric rules. The algorithm filters out all invalid viewpoints and finally outputs a reliable list of viewpoints.

[0050] For inputting a three-plane structure, the input includes the three-plane structure, a list of viewpoints, and a list of planes. The process determines the concavity / convexity of two-plane combinations (plane 1 and plane 2, plane 1 and plane 3, plane 2 and plane 3) within the current viewpoint. If it's a convex-convex-convex structure, the viewpoint is deleted, and the process moves to the next viewpoint. Otherwise, it checks for occlusion within its own three-plane structure. Each three-plane structure consists of three planes that intersect each other.

[0051] The attribute values ​​of `three_struct` are adjusted based on the concavity / convexity relationships between the three planes. The order of concavity / convexity is bound to plane-related information. The topological representation of the three-plane structure is normalized to ensure the consistency of the algorithm logic and simplify the subsequent decision-making process. Specifically, the system first generates a three-dimensional Boolean code (concavity / convexity flag) based on the pairwise concavity / convexity relationships between the three planes observed from the current viewpoint. Subsequently, based on this code, a series of predefined geometric information rearrangement operations are performed. The eight possible initial concavity / convexity configurations of the three-dimensional concavity / convexity are uniformly mapped to a few standard concavity / convexity configurations, such as 100, 110, and 111, which are dominated by the "concave" relationship. This significantly reduces the number of branch cases that need to be processed in the subsequent viewpoint validity determination.

[0052] For example, when the concavity / convexity flag is 001 (i.e., plane 1-2 is convex, plane 1-3 is convex, and plane 2-3 is concave), the structure is determined to be essentially of the "two convex and one concave" type. To unify the processing logic, the algorithm swaps all geometric attributes of plane 1 and plane 3 (such as point cloud information, intersection information, and planar information). This operation is equivalent to performing a geometric rotation transformation on the structure around its theoretical intersection point, updating the flag to 100 (i.e., plane 1-2 is concave, plane 1-3 is convex, and plane 2-3 is convex), thus conforming to the algorithm's expected input for the standard "two convex and one concave" type.

[0053] Similarly, when the concavity / convexity flag is 011 (i.e., plane 1-2 is convex, plane 1-3 is concave, and plane 2-3 is concave), the structure is determined to be of the "one convex and two concave" type. By exchanging the geometric information of plane 1 and plane 3, it is converted into the standard "two concave and one convex" type with a flag of 110 (i.e., plane 1-2 is concave, plane 1-3 is concave, and plane 2-3 is convex).

[0054] This allows subsequent core steps such as line-of-sight penetration determination and effective region search to be designed and optimized only for standard concave-convex configurations, thus ensuring the robustness, maintainability and execution efficiency of the algorithm.

[0055] The property value plane equation of the three-plane structure is ax + by + cz = d. Based on whether the line connecting the centroid of the plane and the viewpoint is in the same direction as the plane normal vector, it is adjusted so that the direction of the normal vector points to the direction of the viewpoint.

[0056] The theoretical intersection of the three planes in a three-plane structure is not necessarily on one side of two planes; it may appear in the middle of the intersection of two planes, depending on the position of the third plane.

[0057] First, determine the position of the intersection point on the line of intersection between plane 1 and plane 2 in the current three-plane structure. If the start and end points of the line of intersection between plane 1 and plane 2 are on one side of the theoretical intersection point, then move a fixed distance away from the endpoint of the theoretical intersection point along the direction of the line of intersection between plane 1 and plane 2 to obtain a new keypoint. Otherwise, start from the theoretical intersection point and randomly move a fixed distance along the direction of the line of intersection between plane 1 and plane 2 (either forward or backward) to obtain a new keypoint. Determine whether the line connecting the new keypoint to the current viewpoint penetrates the unbounded plane containing plane 3. If it penetrates, it means that plane 3 may occlude it. Then, determine whether there is a point on plane 3 within the positive spatial range of planes 1 and 2, and whose distance threshold to all three planes is less than a set threshold. If such a point exists, determine that the current viewpoint is unusable, delete it, and proceed to the next viewpoint. If no such point exists, perform a similar judgment process to determine whether plane 1 occludes planes 2 and 3, and whether plane 2 occludes planes 1 and 3. If neither is occluded, proceed to the occlusion judgment of other plane lists.

[0058] First, based on the previous concavity / convexity, different judgment procedures are followed.

[0059] If it is a three-concave structure, iterate through the list of planes and determine if there exists a plane whose boundary-free plane is penetrated by the line connecting the theoretical intersection of the three planes and the current viewpoint, and if there exists a point on this plane that is both within the positive spatial range of the three planes and whose distance to each of the three planes is less than a preset threshold. If such a plane exists, the current viewpoint is deemed unusable, deleted, and the process moves to the next viewpoint; if no such plane exists, the current viewpoint can be retained as an alternative.

[0060] If the structure consists of two concave and one convex plane, iterate through the list of planes and determine if there exists a plane whose boundary-free plane is penetrated by the line connecting the theoretical intersection point of the three-plane structure and the current viewpoint, and if such a plane contains a point within the positive spatial range of plane 1 and plane 2, and whose distance to all three planes is less than a preset threshold, or within the positive spatial range of plane 1 and plane 3, and whose distance to all three planes is less than a preset threshold. If such a plane exists, the current viewpoint is deemed unusable, deleted, and the process proceeds to the next viewpoint. If no such plane exists, the current viewpoint can be retained as an alternative.

[0061] If the structure is two convex and one concave, iterate through the list of planes and determine if there exists a plane whose boundary-free plane is penetrated by the line connecting the theoretical intersection point of the three-plane structure and the current viewpoint, and if there exists a point on this plane within the positive spatial range of plane 1 and plane 2, and whose distance to all three planes is less than a preset threshold. If such a plane exists, the current viewpoint is deemed unusable, deleted, and the process moves to the next viewpoint; if no such plane exists, the current viewpoint can be retained as an alternative.

[0062] After iterating through all viewpoint lists, output the filtered viewpoint list.

[0063] Furthermore, for two-plane structures, the core objective of the algorithm is: given a "two-plane only structure" consisting of two planes intersecting each other, and these two planes not simultaneously intersecting a third plane, and a set of candidate viewpoints, the algorithm uses a series of strict geometric rules to determine whether each viewpoint can "see" a valid region of the structure (usually a specific spatial range near the theoretical intersection of the three planes). The algorithm filters out all invalid viewpoints and ultimately outputs a reliable list of viewpoints.

[0064] For inputs consisting of a two-plane structure, a list of viewpoints, and a list of planes, the algorithm first calculates three key points (start, mid, and end) on the intersection line of the two planes. Then, it iterates through each viewpoint: if the two planes appear convex from the viewpoint, they are directly discarded; if they are concave, the normal vectors of the two planes are adjusted to point towards the viewpoint, and the algorithm sequentially checks whether the line of sight from the viewpoint to the three key points is obstructed by other planes in the scene—that is, whether there exists a plane that is both penetrated by the line of sight and contains points on its surface located in the positive space of the two-plane structure, with distances to both planes less than a preset threshold. A viewpoint is retained only when the line of sight to all key points is effectively unobstructed. This algorithm, through keypoint sampling and rigorous geometric verification, efficiently filters out invalid viewpoints obstructed by their own structure or the environment, providing a reliable observational basis for subsequent visual measurements.

[0065] This algorithm performs penetration analysis on a given initial list of viewpoints for a three-plane structure or a two-plane structure to evaluate the penetration of each viewpoint to the key points of the target structure (the key point for a three-plane structure is the intersection of the three planes, and the key point for a two-plane structure is the midpoint of the intersection line of the two planes). The algorithm input includes the initial list of viewpoints and the list of planes. The process first iterates through each viewpoint in the initial list of viewpoints and performs planar penetration analysis on each viewpoint.

[0066] In this embodiment, during the plane penetration analysis phase, the algorithm traverses each plane in the plane list and determines whether the line segment connecting the current viewpoint to the target structure (such as the theoretical intersection of three cylinders or the key reference point of two cylinders) penetrates the plane. If penetration occurs, the coordinates of the penetration point and the corresponding plane information are recorded; otherwise, the algorithm continues to check the next plane. After completing all plane checks, the algorithm enters the penetration analysis phase for the next viewpoint.

[0067] After completing the planar penetration analysis for all viewpoints, the algorithm outputs a summary of penetration analysis information, including viewpoint information and the coordinates of all recorded penetration points and their corresponding planar information, thus providing data support for subsequent viewpoint optimization and selection.

[0068] Based on the above, it is determined whether each initial viewpoint is located inside the linear workpiece. Specifically, this can be achieved in the following way: The system detects whether a thin plate structure exists in the point cloud. A thin plate structure is defined as the angle between the normal vectors of two planes being less than a preset angle and the distance between them being less than a preset distance. If a thin plate structure exists, the system detects whether each initial viewpoint is located within the gap space defined by any thin plate structure. If it is located within the gap space, the initial viewpoint is determined to be located inside the straight workpiece.

[0069] Thin-plate filtering is a post-processing step for viewpoints in industrial vision scenarios involving workpieces made of sheet metal. Even after penetrating plane filtering, where the viewpoint meets the condition of no external obstruction, it may still be ineffective if it is located inside the sheet metal. Therefore, this step aims to identify and eliminate viewpoints located within the gaps in the thin-plate structure.

[0070] The specific process is as follows: First, determine whether a thin-plate structure exists in the scene, i.e., two planes are approximately parallel (the angle between their normal vectors is less than a preset angle), and the distance between the two planes is within a preset distance set according to the actual plate thickness. If the condition is met, mark it as a group of thin-plate structures. Then, iterate through all viewpoints to be screened, and determine whether their spatial position is within the gap space defined by any group of thin-plate structures (i.e., the viewpoint is simultaneously between two planes and the distance is within the threshold range). If the viewpoint falls into the thin-plate gap, it is determined to be invalid for subsequent measurements and is deleted; otherwise, the viewpoint is retained and output. This process further ensures that all viewpoints are in the observable external space of the workpiece, improving the robustness and practicality of the vision measurement system.

[0071] After the above screening, if a planar structure does not have a valid viewpoint, a new viewpoint can be found along the surface of the obstructing obstacle.

[0072] If the first round fails to generate a valid viewpoint due to parameter settings or model structure complexity, this algorithm is activated. Its purpose is not to generate a large number of viewpoints, but to generate at least one usable viewpoint for the current structure, in order to balance effectiveness and subsequent computational burden.

[0073] The specific process is as follows: 1. Pre-screening of ineffective structures: Pre-screening is performed based on the concavity / convexity judgment results of the first round of viewpoints: if all first round viewpoints generated for the current planar structure are judged to be "fully convex", then the planar structure is considered an invalid structure and deleted, and the process of processing the next planar structure is directly entered.

[0074] 2. Initiate the retry process: If a planar structure is not pre-screened and excluded, it is considered a potentially valid structure, and a second round of viewpoint retry generation is initiated.

[0075] 3. Penetration analysis and intersection sorting: Iterate through each initial viewpoint generated in the first round, perform viewpoint penetration analysis, and obtain the planes penetrated by the lines connecting the current viewpoint to keypoints, along with the coordinates of the corresponding intersections. Calculate the distances from the current viewpoint to all intersections and sort the intersections from closest to furthest. This sorting is based on a key assumption: generating a valid new viewpoint from a closer intersection has a higher probability of success, contributing to faster success.

[0076] 4. Viewpoint generation and verification based on intersection points: Traverse the list of intersection points in the order described above, and perform the following verification for each intersection point: (1) Generate candidate viewpoints: Starting from the current intersection point, move a fixed distance dis1 along the direction of "intersection point to key point" to obtain a new viewpoint. This operation aims to actively avoid potential occlusion boundaries or thin plate areas and increase the probability of the viewpoint passing subsequent filtering.

[0077] (2) Quick verification: Perform a complete concavity / convexity judgment, segmentation penetration filtering, and thin plate filtering on this new viewpoint. If it passes all verifications, immediately output the viewpoint as a valid solution for the current planar structure and end the retry process for this planar structure (i.e., "one-vote pass" system).

[0078] 5. Termination conditions: Success: Any valid viewpoint was generated in step 4.

[0079] Failure (current viewpoint): If none of the intersections corresponding to an initial viewpoint can generate a valid viewpoint, then try the next initial viewpoint.

[0080] Failure (Current Structure): If all initial viewpoints fail to generate a valid viewpoint, the current planar structure is ultimately determined to be invalid, the process ends, and the process proceeds to the next planar structure.

[0081] In the viewpoint generation process of a three-plane structure, the system introduces a key optimization mechanism: viewpoint reuse between related structures.

[0082] That is, in the step of obtaining the viewpoints retained after secondary detection to generate the final viewpoint list, it is achieved in the following way: The system detects whether there is an associated planar structure in the point cloud that is related to the planar structure. If it exists, it verifies whether the viewpoints in the viewpoint list corresponding to the planar structure can observe the effective area of ​​the associated planar structure. If the verification passes, the viewpoints are directly mapped to the associated planar structure to obtain the viewpoint list of the associated planar structure.

[0083] Among them, three planes that intersect each other in pairs form a three-plane structure. If two three-plane structures i and j share two planes, they are determined to be related, and the associated structure number is stored in the attribute of the three-plane structure with the relationship.

[0084] When the system detects a geometric or topological association between two three-plane structures, the algorithm does not generate viewpoints independently and repeatedly for each structure. Instead, it allows them to share the already generated viewpoints. Specifically, after a plane structure (source structure) completes its viewpoint filtering, the system determines whether these viewpoints can also "see" the other plane structure (target structure) associated with it. If the visibility verification passes, the viewpoint is directly mapped and inherited by the associated structure, without needing to restart the entire viewpoint generation and filtering process for that associated structure. This mechanism significantly reduces redundant computation, greatly improving the overall system processing efficiency while ensuring observation quality, reflecting the system-level optimization philosophy in the algorithm's design.

[0085] Building upon the above, a viewpoint simplification operation is performed for each viewpoint of a three-plane structure. This operation is the final optimization step in the viewpoint generation process, designed to address the issue of an excessive number of viewpoints that may result from complex workpieces containing numerous surface structures. The core logic of this step is spatial clustering and merging.

[0086] Since each effective planar structure independently generates at least one viewpoint, when the workpiece geometry is complex, these viewpoints may be densely distributed in three-dimensional space, with multiple viewpoints even being very close in position and having similar observation directions. The algorithm clusters these viewpoints with spatial distances less than a set threshold and compatible observation directions into a group, and replaces all the original viewpoints in the group with a representative new viewpoint (usually the average position and orientation of the cluster center). This operation significantly reduces the total number of viewpoints in the final output without losing effective observation coverage, thereby reducing the complexity of subsequent robot path planning and improving the overall execution efficiency of scanning or measurement tasks. This step, combined with the aforementioned "associative structure viewpoint reuse" mechanism, constitutes a full-link optimization system from the generation source to the result aggregation.

[0087] In summary, this embodiment provides a fully automated, highly reliable, and efficient viewpoint planning solution for complete model workpieces. By starting from the overall workpiece model and integrating geometric reasoning, global occlusion analysis, and optimization strategies, this solution offers at least the following advantages compared to existing technologies: 1. Achieve global viewpoint collaborative planning from "local features" to "complete workpiece" to improve overall work efficiency: For a complete workpiece model, the algorithm processes all detected two-plane and three-plane structures at once and generates initial viewpoints for each structure based on an adaptive angle bisector generation algorithm. An adaptive distance threshold mechanism ensures that the viewpoint layout matches the overall dimensions of the workpiece. This global collaborative planning avoids the suboptimal overall solution problem caused by designing viewpoints independently and in isolation for each feature, achieving the one-time generation of a viewpoint set from the overall workpiece perspective, greatly improving the systematic nature and efficiency of the planning.

[0088] 2. Through workpiece-level penetration analysis and scenario-based filtering, ensure the success rate and data integrity of full workpiece measurements on the first attempt: When performing penetration filtering, the algorithm not only considers the occlusion of the structure itself, but also includes all planes in the complete workpiece in a unified occlusion analysis list. This global perspective on occlusion judgment ensures that each generated viewpoint can not only clearly see the local structure of the target, but also that its line of sight is not obstructed by other parts of the workpiece. Combined with thin-plate filtering, it fundamentally eliminates local or overall scanning failures caused by the complex structure of the workpiece itself, ensuring the feasibility of performing a one-time, complete scan of the entire workpiece.

[0089] 3. Construct a "workpiece-level" viewpoint reuse and simplification optimization system to significantly reduce global path complexity and operation time: At the complete workpiece level, the algorithm implements dual optimizations: cross-structure viewpoint reuse and global viewpoint clustering simplification. By reusing effective viewpoints from associated structures, it reduces re-observations of the same area. By performing global spatial clustering and merging of viewpoints generated from all structures, it generates a final viewpoint set with minimized number and reasonable spatial layout. This system optimizes the number and spatial distribution of viewpoints at the macroscopic level of the complete workpiece, thereby minimizing the robot's total motion path and significantly shortening the overall scanning or operation cycle of the complete workpiece.

[0090] 4. Introduce an iterative regeneration mechanism based on global penetration analysis to ensure the observability of all features of complex workpieces: When certain complex or deep structures of a workpiece cannot find effective viewpoints in the initial screening, the algorithm performs penetration analysis based on a global plane list and intelligently "regenerates" candidate viewpoints in their vicinity for re-screening. This mechanism ensures that even severely occluded "dead-angle" features in a complete workpiece have a chance to find feasible observation poses, thereby guaranteeing the observability of every feature to be measured on the complete workpiece and greatly enhancing the algorithm's ability and robustness in handling complex overall workpieces.

[0091] 5. Establish standardized processing procedures for complete workpieces to improve the portability and engineering applicability of the solution: This invention standardizes and encapsulates the viewpoint generation, filtering, and optimization process for complete workpieces. This process takes the overall point cloud or model of the workpiece as input and automatically outputs a set of optimized viewpoints that cover all features without occlusion, forming a plug-and-play solution. This significantly lowers the engineering threshold for deploying this technology in various industrial scenarios such as welding, inspection, and reverse engineering, enhancing its portability and practical value.

[0092] In summary, this invention takes complete model workpieces as the processing object and achieves global optimality, 100% observability, high operational efficiency, and universal deployment of viewpoint planning at the workpiece level through a series of innovative global collaborative planning, occlusion analysis, and optimization techniques. This provides reliable and efficient core technical support for industrial robots to perform high-precision vision tasks on complex complete workpieces.

[0093] Based on the same inventive concept, please refer to Figure 13 This invention also provides a viewpoint generation device for parsing 3D files of linear workpieces, the device comprising: The acquisition module is used to acquire the point cloud of the linear workpiece and perform planar detection on the point cloud to obtain the planar structure. The generation module is used to generate initial viewpoints located in the direction of the angle bisector of the plane structure based on the geometric parameters of each plane structure. The first detection module is used to detect whether each initial viewpoint is occluded by the corresponding planar structure or other structures in the point cloud. If it is occluded, the initial viewpoint is deleted. The second detection module is used to detect whether each initial viewpoint is located inside the straight workpiece. If it is located inside the straight workpiece, the initial viewpoint is deleted. The search module is used to search for a new viewpoint along the surface of the obstructing obstacle on the path where the viewpoint is blocked if no valid viewpoint is found after deletion. The new viewpoint is then re-detected to determine whether it is obstructed and whether it is located inside a straight workpiece. The parsing module is used to obtain the viewpoints retained after secondary inspection in order to generate the final viewpoint list. The viewpoints in the viewpoint list are used to parse the 3D file of the straight workpiece to obtain the weld information of the 3D file.

[0094] The viewpoint generation device for parsing 3D files of linear workpieces provided in this embodiment can be used to execute the viewpoint generation method for parsing 3D files of linear workpieces under any of the above embodiments. For details not covered in this embodiment, please refer to the corresponding descriptions in the above embodiments. This embodiment will not elaborate further here.

[0095] Furthermore, embodiments of the present invention also provide an electronic device, which may be such as a computer device, a server, etc. The electronic device includes a processor and a memory. The memory stores computer-executable instructions that can be executed by the processor. The processor executes the computer-executable instructions to implement the viewpoint generation method for parsing 3D files of linear workpieces in any of the above embodiments.

[0096] In summary, the viewpoint generation method, apparatus, and electronic device for parsing 3D files of linear workpieces provided in the embodiments of the present invention have at least the following improvements: 1. An automatic initial viewpoint generation method based on geometric structure characteristics and adaptive distance: Angle Bisector Viewpoint Generation Algorithm: For identified two- or three-plane structures, the algorithm does not randomly generate viewpoints but strictly adheres to their geometric characteristics. For three-plane structures, the algorithm calculates the intersection points of the three planes, solves for the angle bisectors of every two planes, and calculates the intersection line between these angle bisectors. Viewpoints are then generated along the intersection line in both positive and negative directions at adaptive distances from the intersection point. For two-plane structures, the algorithm uses the midpoint of the intersection line as a reference and generates viewpoints along the angle bisectors in both positive and negative directions at adaptive distances from the intersection line. This method ensures that the initial viewpoint is located on the theoretically optimal geometric path that provides a balanced view of both sides of the structure.

[0097] Adaptive distance threshold mechanism: The key distance threshold in the above generation algorithm is not a fixed value, but is dynamically calculated according to a preset proportional coefficient based on the diagonal length of the target structure's own 3D bounding box. This allows the viewpoint distance to automatically scale with the workpiece size, combining universality for workpieces of different sizes with the rationality of viewpoint layout.

[0098] 2. A rapid prediction mechanism for viewpoint effectiveness based on structural concavity / convexity analysis and topology normalization: For the identified geometric structure, the algorithm first calculates the pairwise concavity-convexity relationships of all planes from the candidate viewpoint.

[0099] By using a set of predefined planar information rearrangement rules (such as converting the concavity / convexity code 001 to 100 by exchanging planar information), all possible initial concavity / convexity configurations are uniformly mapped to a few standard concavity / convexity configurations dominated by the "concave" relationship.

[0100] This normalization step acts as a pre-filter, quickly eliminating obviously invalid viewpoints (such as observing "tri-convex" structures) and simplifying complex branching logic into efficient processing of standard forms, laying the foundation for subsequent accurate analysis.

[0101] 3. A precise filtering method for penetrating planes that combines keypoint sampling and forward spatial verification: To avoid misjudgments caused by the uncertainty of the theoretical intersection point location, the algorithm dynamically generates multiple key test points (such as the start point, midpoint, and end point) along the structural intersection line.

[0102] For each candidate viewpoint, it is sequentially determined whether the line connecting it to each keypoint penetrates other planes. The penetration determination not only requires mathematical intersection, but more importantly, the subsequent step is to search for an actual point on the suspected occlusion plane that simultaneously satisfies the following conditions: a) Located within the intersection of the "positive" half-space of the planes related to the target structure; b) Its distance to all relevant planes is less than a predefined threshold with clear physical meaning.

[0103] An occlusion is only considered a true occlusion when both penetration and the existence of an actual point are simultaneously satisfied. This dual verification mechanism of "geometric penetration + physical existence" is the core of the algorithm's high robustness.

[0104] 4. Dedicated internal point filtering module for thin-plate structures in manufacturing scenarios: For workpieces made of sheet metal, a special detection logic for thin-plate structures is designed to identify plane pairs that are approximately parallel and whose spacing is within the thickness threshold range of the sheet metal.

[0105] Add an independent step to the viewpoint filtering chain to precisely eliminate viewpoints that are spatially located inside any thin-plate structure interlayer, ensuring that all output viewpoints are located in the external space observable by the workpiece.

[0106] 5. A dual optimization system based on relationship detection for viewpoint cross-structure reuse and global clustering simplification: Viewpoint reuse: When generating viewpoints, the correlation between geometric structures is checked (e.g., coplanarity, collinearity). If a viewpoint generated from one of the related structures is verified to be equally applicable to another related structure, it is directly shared to avoid duplicate generation and calculation.

[0107] Viewpoint simplification: After all structural viewpoints are generated, spatial clustering analysis is performed on the global viewpoint set to merge viewpoints that are too close to each other or have similar observation directions in three-dimensional space into a representative viewpoint.

[0108] This dual optimization system systematically reduces redundancy at both the generation process and the final result levels, which is the key to the high efficiency of this method.

[0109] 6. Penetration Analysis-Driven Iterative Viewpoint Regeneration and Optimization Strategy: When a structure has no valid viewpoints after the initial screening, it does not fail directly, but enters an optimization loop: analyzes the situation where the original viewpoint's line of sight penetrates other planes, and selects the nearest intersection of the penetrating planes as a new round of candidate viewpoints.

[0110] These "reborn" viewpoints are then subjected to rigorous penetration and thin-plate filtering. This mechanism simulates the intelligent behavior of "finding an observation window by getting close to obstacles," significantly improving the success rate of generating effective viewpoints even in extremely complex occlusion environments.

[0111] Integrated Explanation: The above six key technologies, starting with the first point (intelligent generation of initial viewpoint), proceed through the second and third points (rapid prediction and precise filtering) for core quality control, the fourth point (scenario-based filtering) for domain-adaptive correction, the fifth point (two-level optimization) to improve efficiency, and the sixth point (iterative regeneration) as the final guarantee for success. Together, they constitute a complete technical solution with progressive, closed-loop optimization, which is the core protected content of this invention.

[0112] The above are merely embodiments of the present invention and are not intended to limit the scope of protection of the present invention. For those skilled in the art, the present invention can have various modifications and variations. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A viewpoint generation method for parsing 3D files of linear workpieces, characterized in that, The method includes: Obtain the point cloud of the straight workpiece, and perform planar detection on the point cloud to obtain a planar structure; An initial viewpoint is generated based on the geometric parameters of each of the planar structures, located in the direction of the angle bisector of the planar structure. Detect whether each initial viewpoint is occluded by the corresponding planar structure or other structures in the point cloud. If it is occluded, delete the initial viewpoint. Detect whether each of the initial viewpoints is located inside the straight workpiece; if it is located inside the straight workpiece, delete the initial viewpoint. If no valid viewpoint is found after deletion, a new viewpoint is searched along the surface of the obstructing obstacle on the path where the view is blocked, and a secondary detection is performed on the new viewpoint to check whether it is obstructed and whether it is located inside the straight workpiece. The viewpoints retained after the secondary inspection are obtained to generate a final viewpoint list, wherein the viewpoints in the viewpoint list are used to parse the 3D file of the straight workpiece to obtain the weld information of the 3D file.

2. The viewpoint generation method for parsing 3D files of linear workpieces according to claim 1, characterized in that, The step of generating an initial viewpoint located in the angle bisector direction of the plane structure based on the geometric parameters of each of the plane structures includes: In the case that the planar structure is a three-plane structure, determine the intersection point of the three planes in the three-plane structure; Calculate the angle bisectors between any two planes, and calculate the line of intersection between any two angle bisectors; On each intersection line, starting from the intersection point, a point is determined in both the positive and negative directions according to a set distance threshold, serving as the initial viewpoint.

3. The viewpoint generation method for parsing 3D files of linear workpieces according to claim 1, characterized in that, The step of generating an initial viewpoint located in the angle bisector direction of the plane structure based on the geometric parameters of each of the plane structures includes: In the case where the planar structure is a two-plane structure, calculate the midpoint of the intersection line of the two planes in the two-plane structure, and calculate the angle bisector of the two planes; On the angle bisector plane, in the direction parallel to the line of intersection, a point is determined in the positive and negative directions of the midpoint according to a set distance threshold, and used as the initial viewpoint.

4. The viewpoint generation method for parsing 3D files of linear workpieces according to claim 1, characterized in that, The step of detecting whether each initial viewpoint is occluded by the corresponding planar structure or other structures in the point cloud includes: For each of the initial viewpoints, the concavity and convexity of the planar structure at the initial viewpoint are obtained; Based on the concavity and convexity, a three-dimensional Boolean code is generated, and a geometric information rearrangement operation is performed based on the three-dimensional Boolean code to uniformly map the concavity and convexity to a standard concavity and convex configuration; Based on the standard concave-convex configuration, it is detected whether the initial viewpoint is occluded by the corresponding planar structure or other structures in the point cloud.

5. The viewpoint generation method for parsing 3D files of linear workpieces according to claim 4, characterized in that, The step of detecting whether the initial viewpoint is occluded by the corresponding planar structure or other structures in the point cloud based on the standard concave-convex configuration includes: Detect whether the initial viewpoint is obscured by the corresponding planar structure; If the initial viewpoint is not occluded by the corresponding planar structure, then the corresponding occlusion detection strategy is determined based on the standard concave-convex configuration, and the occlusion detection strategy is used to detect whether the initial viewpoint is occluded by other structures in the point cloud.

6. The viewpoint generation method for parsing 3D files of linear workpieces according to claim 5, characterized in that, The step of detecting whether the initial viewpoint is occluded by other structures in the point cloud based on the occlusion detection strategy includes: Iterate through each plane in the obtained list of planes and check whether the line connecting the initial viewpoint and the intersection of the plane structure penetrates the plane. If the connecting line penetrates the plane, then it is detected whether there is a point on the plane that meets the set conditions. If there is a point that meets the set conditions, then it is determined that the initial viewpoint is occluded by the plane. Specifically, when the standard concave-convex configuration is a three-concave configuration, the setting condition is that the point is within the positive spatial range of the three planes of the planar structure and the distance to each of the three planes is less than a preset distance; when the standard concave-convex configuration is a two-concave-one-convex configuration, the setting condition is that the point is within the positive spatial range of the two planes constituting any concave structure and the distance to each of the three planes is less than a preset distance; when the standard concave-convex configuration is a two-convex-one-concave configuration, the setting condition is that the point is within the positive spatial range of the two planes constituting the unique concave structure and the distance to each of the three planes is less than a preset distance.

7. The viewpoint generation method for parsing 3D files of linear workpieces according to claim 1, characterized in that, The step of detecting whether each of the initial viewpoints is located inside the linear workpiece includes: Detect whether there is a thin plate structure in the point cloud. The thin plate structure is defined as the angle between the normal vectors of two planes being less than a preset angle and the distance between them being less than a preset distance. If a thin plate structure exists, it is detected whether each initial viewpoint is located within the gap space defined by any thin plate structure. If it is located within the gap space, it is determined that the initial viewpoint is located inside the straight workpiece.

8. The viewpoint generation method for parsing 3D files of linear workpieces according to claim 1, characterized in that, After the step of generating the final list of viewpoints, the method further includes: Detect whether there is an associated planar structure in the point cloud that is related to the planar structure; If it exists, verify whether the viewpoints in the viewpoint list corresponding to the plane structure can observe the effective area of ​​the associated plane structure. If the verification passes, directly map the viewpoints to the associated plane structure to obtain the viewpoint list of the associated plane structure.

9. A viewpoint generation device for parsing 3D files of linear workpieces, characterized in that, The device includes: The acquisition module is used to acquire the point cloud of the linear workpiece and perform planar detection on the point cloud to obtain a planar structure. A generation module is used to generate an initial viewpoint located in the direction of the angle bisector of the plane structure based on the geometric parameters of each plane structure. The first detection module is used to detect whether each initial viewpoint is occluded by the corresponding planar structure or other structures in the point cloud. If it is occluded, the initial viewpoint is deleted. The second detection module is used to detect whether each of the initial viewpoints is located inside the straight workpiece. If it is located inside the straight workpiece, the initial viewpoint is deleted. The search module is used to search for a new viewpoint along the surface of the obstructing obstacle on the path where the viewpoint is blocked if no valid viewpoint is found after deletion. The new viewpoint is then re-detected to determine whether it is obstructed and whether it is located inside a straight workpiece. The parsing module is used to obtain the viewpoints retained after the secondary inspection to generate a final viewpoint list. The viewpoints in the viewpoint list are used to parse the 3D file of the straight workpiece to obtain the weld information of the 3D file.

10. An electronic device, characterized in that, The method includes a processor and a memory, the memory storing computer-executable instructions executable by the processor, the processor executing the computer-executable instructions to implement the method of any one of claims 1 to 8.