Feature analysis method and device based on STL grid model, equipment and storage medium

CN122550864APending Publication Date: 2026-08-11ELEPHANT ROBOTICS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-05-09
Publication Date
2026-08-11

AI Technical Summary

Technical Problem

[0003]以立体光刻(Stereolithography,STL)三角网格格式的三维模型为例,现有CAM在处理STL网格模型时,难以有效区分“由三角面片逼近的曲面”与“真正具有加工意义的平面区域”,导致加工策略错误、表面质量不达标或加工效率降低等问题

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122550864A_ABST
    Figure CN122550864A_ABST
Patent Text Reader

Abstract

This disclosure provides a feature analysis method, apparatus, device, and storage medium based on an STL mesh model. The method includes: obtaining the normal vector of each triangular facet in the STL mesh model; classifying the triangular facets into at least one of a first type of facet and a second type based on the Z-axis component of the normal vector, wherein the first type of facets are those whose Z-axis component satisfies a first preset condition, and the second type of facets are those whose Z-axis component satisfies a second preset condition; performing high-level clustering and boundary contour extraction based on the first type of facets to generate planar machining contour features; and performing connected component grouping based on the second type of facets to generate curved surface machining region features. This disclosure can automatically extract and classify planar and curved surface features from the STL mesh model, significantly reducing the reliance on engineer experience in CAM programming; and effectively solving the problem of misclassification of machining surfaces in the triangular mesh model through the Z-axis component interval determination of the normal vector, ensuring the correctness of subsequent machining strategy allocation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of computer numerical control (CNC) machining technology, and more specifically, to a feature analysis method, apparatus, device, and storage medium based on an STL mesh model. Background Technology

[0002] In the process of programming computer numerical control (CNC) machining, computer-aided manufacturing (CAM) software typically requires operators to manually identify and select the planar areas, curved areas, cavity features, and contour boundaries to be machined based on the geometry of the 3D model. Operators then further manually specify the machining tools, set cutting parameters, and plan the toolpath based on their experience.

[0003] Taking a 3D model in the triangular mesh format of stereolithography (STL) as an example, existing CAM systems have difficulty effectively distinguishing between "surfaces approximated by triangular facets" and "planar areas that are truly meaningful for processing" when processing STL mesh models, leading to problems such as incorrect processing strategies, substandard surface quality, or reduced processing efficiency. Summary of the Invention

[0004] This disclosure provides at least one feature analysis method, apparatus, device, and storage medium based on an STL mesh model to solve the aforementioned technical problems.

[0005] In a first aspect, embodiments of this disclosure provide a feature analysis method based on an STL mesh model, including:

[0006] Obtain the normal vector of each triangle in the STL mesh model; Based on the Z-axis component of the normal vector, the triangular facets are divided into at least one of a first type of facet and a second type of facet, wherein the first type of facet is a facet whose Z-axis component satisfies a first preset condition, and the second type of facet is a facet whose Z-axis component satisfies a second preset condition. Based on the first type of surface patches, high-level clustering and boundary contour extraction are performed to generate planar processing contour features; Based on the second type of surface patches, connected component grouping is performed to generate surface processing region features.

[0007] In one possible implementation, the first preset condition is: the Z-axis component of the normal vector is greater than a first threshold. The second preset condition is: the Z-axis component of the normal vector is greater than the second threshold and less than the third threshold.

[0008] In one possible implementation, after patch segmentation and before feature extraction, the method further includes: The first type of surface and / or the second type of surface are subjected to occlusion filtering to remove unseen surfaces that are occluded by other surfaces in a preset direction.

[0009] In one possible implementation, the occluded face filter includes: For the surface to be filtered, generate multiple test points located on the surface; Rays are emitted from each test point along the preset direction to detect whether the rays intersect with other faces in the STL mesh model; If all the rays corresponding to the test points intersect with other surfaces, then the surface is determined to be an obscured surface and is filtered out.

[0010] In one possible implementation, after patch segmentation and before feature extraction, the method further includes: The spiked faces in the triangular facet set formed by the first type of facets and / or the second type of facets are detected and removed, wherein the spiked faces are triangular facets that simultaneously satisfy the following conditions: This triangular face has only one edge shared by other triangular faces, and the other two edges are boundary edges; The unique shared edge is the shortest of the three edges of the triangular facet.

[0011] In one possible implementation, the detection and removal of the spiked surface includes: After each round of detection and removal of the spiked faces that currently meet the conditions, the number of shared edges and the relationship of edge lengths of each triangle in the updated set of triangles are recalculated. The spike detection is performed again based on the updated statistical results until no spikes are detected.

[0012] In one possible implementation, generating the planar machining contour feature includes: For the first type of facets belonging to the same height layer, extract all boundary edges that are referenced by only one triangle facet; A closed loop is formed by tracing the topological connections along the boundary edges; During the tracking process, if the closed loop intersects itself at the target vertex, the closed loop is split into two independent closed loops at the target vertex, wherein the independent closed loops constitute the planar processing contour feature.

[0013] In one possible implementation, it also includes: Perform inclusion relationship analysis on multiple closed loops within the same height layer, and construct an inclusion relationship tree; The processing type corresponding to each closed loop is determined based on the parity of the nesting level, where odd-numbered nesting levels correspond to internal cavity processing, and even-numbered nesting levels correspond to external island processing.

[0014] In one possible implementation, the generated surface processing region features include: The second type of patch is grouped into connected components, and the height difference of each connected component group in the Z-axis direction is calculated; If the height difference is less than a preset thickness threshold, the facets in the corresponding connected component group will be excluded from the second type of facets. Based on the excluded connected component grouping, surface processing region features are generated.

[0015] In one possible implementation, after generating the surface machining region features, the method further includes: Based on the normal vector direction of each patch within the generated surface machining area and the preset tool radius, the bounding box range that the tool center trajectory needs to cover on the XY plane is calculated. The bounding box range is used to constrain the generation of the surface machining toolpath.

[0016] Secondly, this disclosure also provides a feature analysis device based on an STL mesh model, comprising: The acquisition module is used to obtain the normal vector of each triangle in the STL mesh model; The partitioning module is used to divide the triangular facet into at least one of a first type of facet and a second type of facet based on the Z-axis component of the normal vector, wherein the first type of facet is a facet whose Z-axis component satisfies a first preset condition, and the second type of facet is a facet whose Z-axis component satisfies a second preset condition. The generation module is used to perform high-level clustering and boundary contour extraction based on the first type of surface patches to generate planar processing contour features; and to perform connected component grouping based on the second type of surface patches to generate curved surface processing region features.

[0017] Thirdly, this disclosure also provides an electronic device, including: a processor, a memory, and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the memory via the bus, and when the machine-readable instructions are executed by the processor, the feature analysis method based on the STL mesh model as described in any one of the first aspects and various embodiments thereof is performed.

[0018] Fourthly, this disclosure also provides a computer-readable storage medium storing a computer program that, when executed by a processor, performs the feature analysis method based on the STL mesh model as described in any one of the first aspects and various embodiments thereof.

[0019] The aforementioned feature analysis method, apparatus, device, and storage medium based on the STL mesh model obtains the normal vector of each triangular facet in the STL mesh model. Based on the Z-axis component of the normal vector, the triangular facet is divided into at least one of a first type of facet and a second type of facet. Then, based on the first type of facet, high-level clustering and boundary contour extraction are performed to generate planar machining contour features; based on the second type of facet, connected component grouping is performed to generate curved surface machining region features. This disclosure replaces the manual selection of planes and curved surfaces, automatically extracting and classifying planar and curved surface features from the STL mesh model. This significantly reduces the reliance on engineer experience in CAM programming, improving programming efficiency and consistency. Furthermore, by determining the Z-axis component interval of the normal vector, it effectively solves the problem of "approximately planar curved surfaces" being misclassified as "planes" in the triangular mesh model, ensuring the correctness of subsequent machining strategy allocation.

[0020] Other advantages of this disclosure will be explained in more detail in conjunction with the following description and accompanying drawings.

[0021] It should be understood that the above description is merely an overview of the technical solution of this disclosure, so as to enable a general understanding of the technical means of this disclosure and to implement it in accordance with the contents of the specification. In order to make the above and other objects, features and advantages of this disclosure more apparent and understandable, preferred embodiments are described in detail below with reference to the accompanying drawings. Attached Figure Description

[0022] To more clearly illustrate the technical solutions of the embodiments of this disclosure, the accompanying drawings used in the embodiments will be briefly described below. The accompanying drawings are incorporated in and constitute a part of this specification. These drawings illustrate embodiments conforming to this disclosure and, together with the specification, serve to illustrate the technical solutions of this disclosure. It should be understood that the drawings only illustrate certain embodiments of this disclosure and should not be considered as a limitation on the scope of protection. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort. Furthermore, the same reference numerals denote the same components throughout the drawings. In the drawings: Figure 1 A flowchart of a feature analysis method based on an STL mesh model provided in an embodiment of this disclosure is shown; Figure 2 A schematic diagram of a feature analysis device based on an STL mesh model provided in an embodiment of this disclosure is shown. Figure 3 A schematic diagram of an electronic device provided in an embodiment of the present disclosure is shown. Detailed Implementation

[0023] Exemplary embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.

[0024] In the description of embodiments disclosed herein, it should be understood that terms such as “comprising” or “having” are intended to indicate the presence of the disclosed features, figures, steps, behaviors, components, portions or combinations thereof in this specification, and do not exclude the possibility of the presence of one or more other features, figures, steps, behaviors, components, portions or combinations thereof.

[0025] Unless otherwise stated, " / " means "or". For example, A / B can mean A or B. In this article, "and / or" is merely a way of describing the relationship between related objects, indicating that there can be three relationships. For example, A and / or B can mean: A alone, A and B at the same time, and B alone.

[0026] The terms "first," "second," etc., are used only for ease of description to distinguish identical or similar technical features and should not be construed as indicating or implying the relative importance or number of these technical features. Therefore, a feature defined by "first," "second," etc., may explicitly or implicitly include one or more of that feature. In the description of embodiments of this disclosure, unless otherwise stated, the term "multiple" means two or more.

[0027] Research has revealed that in related technologies, curved surfaces in triangular mesh models are approximated by a large number of small triangular facets. When the model contains approximately planar regions with very small thicknesses (such as thin-walled ribs or shallow stepped surfaces), the normal vector directions of these triangular facets often closely resemble the normal vector characteristics of the curved surface facets. Existing methods struggle to effectively distinguish between "curved surfaces approximated by triangular facets" and "truly machined planar regions," easily misidentifying thin-walled planes as curved surfaces and generating surface machining toolpaths, leading to incorrect machining strategies, substandard surface quality, or reduced machining efficiency.

[0028] In addition, traditional CAM software requires operators to manually select the machining surface. For complex models with multiple nested planar and curved surface areas, it is difficult to quickly and accurately complete feature division, and the recognition results vary from person to person, resulting in poor consistency.

[0029] To at least partially address one or more of the aforementioned problems and other potential issues, this disclosure provides at least one feature analysis scheme based on an STL mesh model. By automatically acquiring the normal vectors of each triangular facet in the STL mesh model and dividing the facets based on the Z-axis component of the normal vector, it can automatically distinguish the geometric features in the model into at least one of two types: a first type of facet with planar machining characteristics and a second type of facet with curved surface machining characteristics. This eliminates the need for manual selection of machining areas, solving the problems of low efficiency and poor consistency caused by manual operation in existing technologies. Simultaneously, using the Z-axis component of the normal vector as a unified quantitative classification basis, it can objectively and accurately define the boundary between planar and curved facets, effectively avoiding confusion between "curved surfaces approximated by triangular facets" and "truly meaningful planar regions" caused by mesh discretization. This lays a reliable foundation for subsequently generating machining contour features for planar regions and machining region features for curved regions, respectively. Furthermore, it can adaptively handle cases where only planar features or only curved surface features exist in the model, demonstrating broad applicability.

[0030] To facilitate understanding of this embodiment, a feature analysis method based on an STL mesh model disclosed in this disclosure will first be described in detail. The execution subject of the feature analysis method provided in this disclosure is generally an electronic device with a certain computing capability. This electronic device may include, for example, a terminal device, a server, or other processing devices. The terminal device may be a user equipment (UE), a mobile device, a user terminal, a computing device, etc. In some possible implementations, this feature analysis method can be implemented by a processor calling computer-readable instructions stored in memory.

[0031] See Figure 1 The flowchart illustrates a feature analysis method provided in an embodiment of this disclosure, the method comprising the following steps S101-S104: S101: Obtain the normal vector of each triangular facet in the STL mesh model; S102: Based on the Z-axis component of the normal vector, the triangular facet is divided into at least one of the first type of facet and the second type of facet, wherein the first type of facet is the facet whose Z-axis component satisfies the first preset condition, and the second type of facet is the facet whose Z-axis component satisfies the second preset condition. S103: Based on the first type of surface patches, perform high-level clustering and boundary contour extraction to generate planar processing contour features; S104: Based on the second type of surface patches, connective domains are grouped to generate surface processing region features.

[0032] Here, the STL format 3D model file to be processed can be read from external storage or memory, and the vertex coordinates and triangular facet index information in the file can be parsed. For each triangular facet, the unit normal vector of the facet is calculated based on the spatial coordinates of its three vertices.

[0033] For each triangular facet, extract the Z-axis component of its normal vector. Based on the numerical range of the Z-axis component, classify the triangular facet into at least one of the first type and the second type of facet.

[0034] The first type of patch is a patch whose Z-axis component satisfies a first preset condition. The first preset condition is used to identify patches in the model whose normal vector is nearly vertically upward. These patches typically correspond to horizontal plane regions in the model that have planar machining significance. For example, the first preset condition is that the Z-axis component of the normal vector is greater than a first threshold (e.g., the Z-axis component is greater than...). The second type of patch is a patch whose Z-axis component satisfies a second preset condition. The second preset condition is used to identify patches in the model whose normal vector deviates from the vertical direction by a certain angle. These patches typically correspond to inclined surface regions in the model that have surface machining significance. Here, the second preset condition is, for example, that the Z-axis component of the normal vector is greater than a second threshold and less than a third threshold (e.g., the Z-axis component is between 0.05 and...). between).

[0035] It should be noted that the actual input STL model may contain only planar regions (such as a simple rectangular block), or only curved regions (such as a purely irregular curved surface model), or both types of regions. When only one type of feature exists in the model, it is sufficient to classify the corresponding patch type. The embodiments of this disclosure adaptively process models with different composition types.

[0036] In a specific application scenario, the specific values ​​of the first, second, and third thresholds mentioned above can be adjusted appropriately according to the processing accuracy requirements. The principle for selecting the thresholds is to match the classification results with the actual geometric features and processing scenario requirements. For example, for precision machining scenarios with high accuracy requirements, the first threshold can be adjusted to a value closer to 1; for models containing a large number of gently sloping surfaces, the lower limit of the second threshold can be appropriately relaxed.

[0037] If a first category of facets is identified, then height clustering and boundary contour extraction are performed on these facets. Height clustering refers to grouping facets of the first category into different height layers based on their Z-axis coordinates (e.g., the Z-coordinate of the facet's center point). Facets within the same height layer are considered to belong to the same planar machining region. Subsequently, the boundary contours of the facet set within each height layer are extracted, generating one or more planar machining contour features. These planar machining contour features can be directly used for subsequent planar milling toolpath planning.

[0038] If a second type of surface is identified, then these surfaces are grouped into connected component groups. Connected component grouping refers to grouping interconnected second-type surfaces into the same group based on the shared edge topology between them. Each group constitutes an independent surface machining region feature. This surface machining region feature can be directly used for subsequent surface milling toolpath planning.

[0039] As can be seen, the embodiments of this disclosure achieve fully automatic identification and classification of planar and curved surface features in the STL model by automatically calculating normal vectors and dividing the surface based on the Z-axis component. This eliminates the need for manual selection of processing areas, solving the problems of low efficiency and poor consistency caused by manual operation in existing technologies. Using the Z-axis component of the normal vector as a unified quantitative classification basis can objectively and accurately define the boundary between planar and curved surface patches, effectively avoiding confusion between "curved surfaces approximated by triangular patches" and "truly meaningful planar regions" caused by mesh discretization. Furthermore, it can adaptively handle cases where only a single feature type exists in the model, demonstrating broad applicability.

[0040] Here, considering the crucial role of recognizing planar features and curved surface features in the feature analysis method provided in the embodiments of this disclosure, they will be described in detail below.

[0041] On the one hand, the embodiments of this disclosure can generate planar machining contour features according to the following steps: Step 1: For the first type of facets belonging to the same height layer, extract all boundary edges that are referenced by only one triangle facet; Step 2: Tracing the topological connections along the boundary edges to form a closed loop; Step 3: During the tracking process, if the closed loop intersects itself at the target vertex, the closed loop is split into two independent closed loops at the target vertex, and the independent closed loops constitute the planar processing contour feature.

[0042] Here, for the first type of patches belonging to the same height layer (i.e., the set of patches with similar Z coordinates after height clustering), we first extract all boundary edges that are referenced by only one triangular patch. The extraction of boundary edges can be achieved by counting the total number of times each edge is referenced in the patch set: edges with a reference count of 1 are boundary edges, and edges with a reference count greater than 1 are internal edges.

[0043] Then, starting from any boundary edge, trace along the topological connections of the boundary edges. During the tracing process, continuously search for the next edge that shares a vertex with the current edge and is also a boundary edge, until the process returns to the starting point and forms a closed loop.

[0044] During the tracking process, closed loops may intersect at a target vertex, meaning the tracking path passes the same vertex twice, forming a complex self-intersecting loop resembling a figure-eight. Such self-intersecting loops cannot be directly used as effective machining profiles for tool radius compensation and toolpath generation.

[0045] Therefore, in this embodiment, when self-intersection behavior is detected, the current closed loop is split into two independent closed loops at the target vertex. Each independent closed loop after splitting is a simple polygon (non-self-intersecting) and can be directly used as a planar processing contour feature.

[0046] As can be seen, this embodiment solves the technical problem that complex self-intersecting polygons cannot be directly used to generate tool compensation paths by automatically detecting the self-intersecting vertices of boundary loops and splitting them at those locations.

[0047] After generating one or more planar machining contour features (i.e., independent closed loops), an inclusion relationship analysis is performed on all closed loops within the same height layer. Specifically, the inclusion relationship between each closed loop and other closed loops can be determined: if loop A is completely inside loop B, then loop A is included by loop B.

[0048] Based on the inclusion relationship, an inclusion relationship tree can be constructed. The root node in the tree is the outermost contour, and its direct child nodes are the next level contours that are directly included by the outer contour, and so on to form a multi-level nested structure.

[0049] The machining type corresponding to each closed loop is determined by the parity of the nesting level: closed loops located in odd-numbered nesting levels (such as the 1st and 3rd levels) are inner contours, and their internal areas need to be removed, corresponding to internal cavity machining; closed loops located in even-numbered nesting levels (such as the 2nd and 4th levels) are outer contours, and their internal areas are retained island material, and the tool should cut outside the contour, corresponding to external island machining.

[0050] In addition, area thresholds and vertex count thresholds can be set to filter out meaningless small contours with too small an area (e.g., less than 1 mm²) or too few vertices (e.g., less than 4), thus avoiding the generation of unnecessary machining toolpaths.

[0051] Here, this implementation can automatically identify the internal and external attributes of the planar machining contour without requiring manual specification of the machining direction. By constructing a containment relationship tree and utilizing nested hierarchical parity rules, it can accurately distinguish whether the area enclosed by the contour boundary is a cavity that needs to be removed or an island that needs to be preserved.

[0052] On the other hand, the surface machining region features can be generated according to the following steps in the embodiments of this disclosure: Step 1: Group the second type of patches into connected component groups and calculate the height difference of each connected component group in the Z-axis direction; Step 2: If the height difference is less than the preset thickness threshold, then the patches in the corresponding connected component group will be excluded from the second type of patches. Step 3: Based on the excluded connected components, generate surface processing region features.

[0053] First, the resulting second-type patches are grouped into connected component groups. This grouping is based on the shared edge topology between patches: if two second-type patches share an edge, they are grouped into the same connected component. By traversing all second-type patches, interconnected curved patches can be aggregated into several independent connected component groups, each group corresponding to a continuous curved surface region on the model.

[0054] However, in triangular mesh models, some regions that are geometrically planar thin-walled areas (such as the top surface of thin-walled ribs and shallow stepped surfaces) may have their triangular facet normals fall into the second preset condition range due to mesh generation or the geometric characteristics of the model itself, thus being incorrectly classified as second-type facets. If the surface machining region is directly generated based on these facets, it will lead to the incorrect generation of surface machining toolpaths for that region, affecting machining efficiency and surface quality.

[0055] To address the aforementioned issues, this embodiment calculates the height difference along the Z-axis for each connected component group, which is the difference between the maximum and minimum Z-coordinates of all facet vertices within that group. If the height difference is less than a preset thickness threshold (e.g., 0.1 mm), the region represented by that connected component group is considered to have almost no change along the Z-axis, essentially representing a thin, approximately planar structure rather than a true curved surface. In this case, the faces within that connected component group are excluded from the second type of faces and no longer participate in the generation of curved surface processing region features.

[0056] Finally, based on the connected component groups retained after excluding the thin slice groups, the surface processing region features are generated.

[0057] As can be seen, this embodiment, by introducing a thickness threshold determination based on the Z-axis height difference, can effectively identify and filter out planar thin-film regions that are misclassified as curved surfaces. This avoids the erroneous generation of curved surface machining toolpaths for such regions that should be processed using planar machining strategies, further improving the accuracy of feature recognition and ensuring the rationality of subsequent machining strategy allocation and machining efficiency.

[0058] Furthermore, after generating the surface machining area features, a step is added to calculate the bounding box range of the tool center trajectory.

[0059] To fully cover the surface machining area, the actual spatial position that the tool center needs to reach should be offset outward by a tool radius relative to the surface boundary.

[0060] This implementation calculates the bounding box range that the tool center trajectory needs to cover on the XY plane based on the normal vector direction of each patch within the generated surface machining area and a preset tool radius. Specifically, the boundary is offset outward by a preset tool radius along the projection direction of the normal vector of the surface boundary surface on the XY plane to obtain the outer boundary of the tool center trajectory. The minimum and maximum values ​​of all the outer boundaries in the X and Y axis directions are taken to form a rectangular bounding box. This bounding box defines the minimum XY plane range that the tool center must reach to achieve complete machining of the surface area, thus accurately defining the minimum rectangular area that the tool center must cover to achieve complete surface machining.

[0061] Subsequent surface machining toolpath generation algorithms can use this bounding box as a spatial search constraint, calculating and optimizing the toolpath only within the bounding box, without needing to perform a global search in the entire model space. It can be seen that using this bounding box can significantly reduce the path search space and reduce invalid calculations, thereby improving the efficiency of surface machining toolpath generation.

[0062] It should be noted that, in classifying face patches based on the Z-axis component of the normal vector, this embodiment of the present disclosure can not only distinguish the first type of face patches corresponding to planar features and the second type of face patches corresponding to curved surface features, but can also further identify a third type of face patch.

[0063] Specifically, triangular facets whose absolute value of the Z-axis component of the normal vector is less than a preset threshold (e.g., 0.05) can be identified as third-type facets. The normal vectors of this type of facet are approximately horizontal, corresponding to the vertical wall regions in the model.

[0064] When generating surface processing region features, for a surface connected domain group composed of second-type patches, third-type patches that share the boundary with the connected domain group in the original mesh can be further searched and incorporated into the group, thereby forming an extended surface processing region.

[0065] By associating and merging the vertical wall with the adjacent curved surface region, the generated curved surface machining area can remain intact at the junction of the curved surface and the vertical sidewall. This avoids the problem of root residue caused by incomplete coverage of the subsequent curved surface machining toolpath at the boundary, thereby ensuring the continuity of the subsequent machining path at the junction and improving the integrity and surface quality of the curved surface machining.

[0066] In actual 3D models, there are some surfaces with upward-facing normals (i.e., the Z-axis component satisfies the first or second preset condition) that cannot be machined by the tool because they are located inside the model or are occluded by other structures above them. If such surfaces are included in subsequent feature extraction without distinction, it will result in the generation of invalid machining contours or machining areas, and thus the planning of toolpaths that cannot be actually executed.

[0067] To solve the above-mentioned technical problems, this embodiment performs occluded surface filtering on the first type of surface and / or the second type of surface before performing feature extraction.

[0068] For the triangular facet to be filtered, first generate multiple test points on the facet. The distribution of each test point should reasonably represent the overall visibility state of the facet.

[0069] Then, rays are emitted from each test point along a preset direction (usually the +Z direction), and it is detected whether each ray intersects with other triangular faces in the STL mesh model before reaching the test point.

[0070] If all rays corresponding to test points intersect with other faces before reaching the test point, it indicates that the entire test area of ​​that face is occluded by the structure above, and the face is determined to be an occluded face, thus being filtered out from the corresponding face set. If at least one ray corresponding to a test point does not intersect with other faces, it indicates that at least a portion of that face is exposed, and the tool can reach it directly from above, therefore the face is retained.

[0071] As can be seen, by combining the detection results of multiple locations within the patch, the embodiments of this disclosure can more reliably identify the true occlusion state, thereby improving the accuracy and robustness of filtering occluded patches.

[0072] Furthermore, considering that STL models often introduce degenerate triangular facets during the export and conversion process, the presence of spiked faces can severely interfere with subsequent boundary tracing and connected component grouping processes based on edge topology, leading to interrupted boundary extraction or the generation of abnormal contours. Therefore, this implementation performs spiked facet detection and removal on the triangular facet set composed of the first type of facets and / or the second type of facets. A spiked facet is defined as a triangular facet that simultaneously satisfies the following two conditions: Condition 1: In the entire set of triangles to be processed, only one edge of the triangle is shared by other triangles, and the other two edges are boundary edges (i.e., only referenced by the triangle itself).

[0073] Condition 2: The unique shared edge mentioned above is the shortest edge among the three edges of the triangular facet.

[0074] Considering that the presence of spikes may be multi-layered, if only a single round of detection and removal is performed, these newly exposed spikes will remain in the patch set, continuing to interfere with subsequent processing.

[0075] To address the above problems, this implementation method employs an iterative loop mechanism. Specifically: Round 1: Perform spike face detection on the set of triangular facets to be processed, mark and remove all spike faces that meet the conditions.

[0076] Second round: Based on the remaining face set after the first round of processing, the number of shared edges and edge length relationships of each triangular face are recalculated. Since the adjacency relationships of some faces have changed, faces that were not originally spiked may now meet the spiked face condition. Based on the updated statistical results, spiked face detection and removal are performed again.

[0077] This process is repeated iteratively, with each round re-statistically analyzing the topological information and performing detection based on the updated set of faces from the previous round, until no spiked faces are detected in a certain round, at which point the iteration terminates.

[0078] The aforementioned iterative loop mechanism ensures that the final set of facets participating in feature extraction has a continuous and clean boundary topology, providing a reliable foundation for subsequent contour tracking.

[0079] The feature analysis method provided in this disclosure achieves fully automatic feature recognition without manual intervention. It automatically extracts and classifies planar and curved surface features from the STL model, significantly reducing the manual cost and technical threshold of CAM programming. Furthermore, through iterative spike removal and thin-film filtering, it ensures that feature analysis can still be completed correctly even when the input mesh quality is poor, making it more practical.

[0080] In the description of this specification, references to terms such as "some possible implementations," "some implementations," "example," "specific example," or "some examples" indicate that a specific feature, structure, material, or characteristic described in connection with that implementation or example is included in at least one implementation or example of this disclosure, and the aforementioned terms do not necessarily refer to the same implementation or example. Furthermore, the described specific features, structures, materials, or characteristics can be combined in a suitable manner in any one or more implementations or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different implementations or examples described in this specification, as well as the features of different implementations or examples.

[0081] Regarding the method flowcharts of embodiments of this disclosure, certain operations are described as different steps performed in a certain order. Such flowcharts are illustrative and not restrictive. Some steps described herein may be grouped together and performed in a single operation, or some steps may be divided into multiple sub-steps, and some steps may be performed in an order different from that shown herein. The various steps shown in the flowcharts may be implemented in any way by any circuit structure and / or tangible mechanism (e.g., software running on a computer device, hardware (e.g., logic functions implemented by a processor or chip), and / or any combination thereof).

[0082] Those skilled in the art will understand that in the methods described in the above specific embodiments, the order in which the steps are written does not imply a strict execution order, and the specific execution order of each step should be determined by its function and possible internal logic.

[0083] Based on the same inventive concept, this disclosure also provides a feature analysis device corresponding to the feature analysis method based on the STL mesh model. Since the principle of the device in this disclosure for solving the problem is similar to the feature analysis method described above in this disclosure, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be described again.

[0084] Reference Figure 2 The diagram shown is a schematic representation of a feature analysis device provided in an embodiment of this disclosure. The device includes: an acquisition module 201, a segmentation module 202, and a generation module 203; wherein, Module 201 is used to obtain the normal vector of each triangular facet in the STL mesh model; The partitioning module 202 is used to partition the triangular facet into at least one of a first type of facet and a second type of facet based on the Z-axis component of the normal vector, wherein the first type of facet is a facet whose Z-axis component satisfies a first preset condition, and the second type of facet is a facet whose Z-axis component satisfies a second preset condition. The generation module 203 is used to perform high-level clustering and boundary contour extraction based on the first type of surface patches to generate planar processing contour features; and to perform connected component grouping based on the second type of surface patches to generate curved surface processing region features.

[0085] The aforementioned feature analysis device based on the STL mesh model acquires the normal vector of each triangular facet in the STL mesh model. Based on the Z-axis component of the normal vector, the triangular facet is divided into at least one of a first type of facet and a second type of facet. Then, based on the first type of facet, high-level clustering and boundary contour extraction are performed to generate planar machining contour features; based on the second type of facet, connected component grouping is performed to generate curved surface machining region features. This disclosure replaces the manual selection of planes and curved surfaces, automatically extracting and classifying planar and curved surface features from the STL mesh model. This significantly reduces the reliance on engineer experience in CAM programming, improving programming efficiency and consistency. Furthermore, by determining the Z-axis component interval of the normal vector, it effectively solves the problem of "approximately planar curved surfaces" being misclassified as "planes" in the triangular mesh model, ensuring the correctness of subsequent machining strategy allocation.

[0086] In one possible implementation, the first preset condition is: the Z-axis component of the normal vector is greater than a first threshold. The second preset condition is: the Z-axis component of the normal vector is greater than the second threshold and less than the third threshold.

[0087] In one possible implementation, it also includes: The filtering module 204 is used to filter the occluded faces of the first type of face and / or the second type of face after face segmentation and before feature extraction, and to filter out the unseen face that is occluded by other face in a preset direction.

[0088] In one possible implementation, the filtering module 204 is used to filter the obscured face sheet according to the following steps: For the surface to be filtered, generate multiple test points located on the surface; Rays are emitted from each test point along a preset direction to detect whether the rays intersect with other faces in the STL mesh model; If all the rays corresponding to the test points intersect with other surfaces, then the surface is determined to be an obscured surface and is filtered out.

[0089] In one possible implementation, it also includes: Detection module 205 is used to detect and remove spiked faces in the triangular face set composed of the first type of facets and / or the second type of facets after facet segmentation and before feature extraction, wherein the spiked facet is a triangular facet that simultaneously satisfies the following conditions: This triangular face has only one edge shared by other triangular faces, and the other two edges are boundary edges; The unique shared edge is the shortest of the three edges of the triangular facet.

[0090] In one possible implementation, the detection module 205 is used to detect and remove the spiked surface according to the following steps: After each round of detection and removal of the spiked faces that currently meet the conditions, the number of shared edges and the relationship of edge lengths of each triangle in the updated set of triangles are recalculated. The spike detection is performed again based on the updated statistical results until no spikes are detected.

[0091] In one possible implementation, the generation module 203 is used to generate planar machining contour features according to the following steps: For the first type of facets belonging to the same height layer, extract all boundary edges that are referenced by only one triangle facet; Tracing the topological connections along the boundary edges forms a closed loop; During the tracking process, if the closed loop intersects itself at the target vertex, the closed loop is split into two independent closed loops at the target vertex, and the independent closed loops constitute the planar processing contour feature.

[0092] In one possible implementation, the generation module 203 is further configured to: Perform inclusion relationship analysis on multiple closed loops within the same height layer, and construct an inclusion relationship tree; The processing type corresponding to each closed loop is determined based on the parity of the nesting level, where odd-numbered nesting levels correspond to internal cavity processing, and even-numbered nesting levels correspond to external island processing.

[0093] In one possible implementation, the generation module 203 is configured to generate surface machining region features according to the following steps: The second type of patch is grouped into connected components, and the height difference of each connected component group in the Z-axis direction is calculated. If the height difference is less than the preset thickness threshold, the patches in the corresponding connected component group will be excluded from the second type of patches; Based on the excluded connected component grouping, surface processing region features are generated.

[0094] In one possible implementation, the generation module 203 is further configured to, after generating the features of the surface machining area, calculate the bounding box range that the tool center trajectory needs to cover on the XY plane based on the normal vector direction of each facet in the generated surface machining area and the preset tool radius. The bounding box range is used to constrain the generation of the surface machining toolpath.

[0095] It should be noted that the apparatus in this embodiment can implement the various processes of the aforementioned method and achieve the same effects and functions, which will not be elaborated here.

[0096] This disclosure also provides an electronic device, such as... Figure 3 The diagram shown is a schematic representation of an electronic device structure provided in this embodiment of the present disclosure, including: a processor 301, a memory 302, and a bus 303. The memory 302 stores machine-readable instructions executable by the processor 301 (e.g., ...). Figure 2 The device includes modules 201 for acquisition, 202 for partitioning, and 203 for generating execution instructions. When the electronic device is running, the processor 301 and memory 302 communicate via bus 303. When machine-readable instructions are executed by the processor 301, the following processing is performed: Obtain the normal vector of each triangle in the STL mesh model; Based on the Z-axis component of the normal vector, the triangular facets are divided into at least one of the first type of facets and the second type of facets, wherein the first type of facets are facets whose Z-axis components satisfy a first preset condition, and the second type of facets are facets whose Z-axis components satisfy a second preset condition. Based on the first type of surface patches, high-level clustering and boundary contour extraction are performed to generate planar processing contour features; Based on the second type of surface patches, connected component grouping is performed to generate surface processing region features.

[0097] This disclosure also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the steps of the feature analysis method described in the above-described method embodiments. The storage medium may be a volatile or non-volatile computer-readable storage medium.

[0098] This disclosure also provides a computer program product carrying program code. The program code includes instructions that can be used to execute the steps of the feature analysis method described in the above method embodiments. For details, please refer to the above method embodiments, which will not be repeated here.

[0099] The aforementioned computer program product can be implemented through hardware, software, or a combination thereof. In one optional embodiment, the computer program product is specifically embodied in a computer storage medium; in another optional embodiment, the computer program product is specifically embodied in a software product, such as a software development kit (SDK), etc.

[0100] The various embodiments in this disclosure are described in a progressive manner, and the same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on describing the differences from other embodiments. In particular, the description of the apparatus, device, and computer-readable storage medium embodiments is simplified because they are basically similar to the method embodiments, and the relevant parts can be referred to the description of the method embodiments.

[0101] The apparatus, device, and computer-readable storage medium provided in this disclosure correspond one-to-one with the method. Therefore, the apparatus, device, and computer-readable storage medium also have similar beneficial technical effects as their corresponding methods. Since the beneficial technical effects of the method have been described in detail above, the beneficial technical effects of the apparatus, device, and computer-readable storage medium will not be repeated here.

[0102] Those skilled in the art will understand that embodiments of this disclosure can be implemented as methods and apparatus (devices or systems), or as computer-readable storage media. Therefore, this disclosure can be implemented entirely in hardware, entirely in software, or in a combination of software and hardware. Furthermore, this disclosure can be implemented as a computer-readable storage medium on one or more computer-readable storage media containing computer-usable program code (including, but not limited to, disk storage, read-only optical disc storage (CD-ROM), optical storage, etc.).

[0103] This disclosure is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (devices or systems), and computer-readable storage media according to embodiments of this disclosure. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to create a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in one or more blocks of the flowchart illustrations and / or block diagrams.

[0104] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article including instruction means, wherein the instruction means implement the functions specified in one or more flowcharts and / or one or more blocks in a block diagram.

[0105] These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process, such that the instructions, which execute on the computer or other programmable apparatus, provide steps for implementing the functions specified in one or more processes in the flowchart and / or one or more blocks in the block diagram.

[0106] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0107] Memory can include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0108] Computer-readable media include permanent and non-permanent, removable and non-removable media, which can store information by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer-readable storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory, read-only memory, electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transfer medium that can be used to store information accessible by a computing device. Furthermore, although the operations of the methods of this disclosure are described in a specific order in the accompanying drawings, this does not require or imply that these operations must be performed in that specific order, or that all of the operations shown must be performed to achieve the desired result. Additionally, certain steps may be omitted, multiple steps may be combined into one step, and / or a step may be broken down into multiple sub-steps.

[0109] While the spirit and principles of this disclosure have been described above with reference to several specific embodiments, it should be understood that this disclosure is not limited to the disclosed specific embodiments, and the division of aspects does not imply that features in these aspects cannot be combined. This disclosure is intended to cover various modifications and equivalent arrangements included within the spirit and scope of the appended claims.

Claims

1. A feature analysis method based on an STL mesh model, characterized in that, include: Obtain the normal vector of each triangle in the STL mesh model; Based on the Z-axis component of the normal vector, the triangular facets are divided into at least one of a first type of facet and a second type of facet, wherein the first type of facet is a facet whose Z-axis component satisfies a first preset condition, and the second type of facet is a facet whose Z-axis component satisfies a second preset condition. Based on the first type of surface patches, high-level clustering and boundary contour extraction are performed to generate planar processing contour features; Based on the second type of surface patches, connected component grouping is performed to generate surface processing region features.

2. The method according to claim 1, characterized in that, The first preset condition is: the Z-axis component of the normal vector is greater than the first threshold. The second preset condition is: the Z-axis component of the normal vector is greater than the second threshold and less than the third threshold.

3. The method according to claim 1, characterized in that, After face segmentation and before feature extraction, the process also includes: The first type of surface and / or the second type of surface are subjected to occlusion filtering to remove unseen surfaces that are occluded by other surfaces in a preset direction.

4. The method according to claim 3, characterized in that, The occluded surface filtering includes: For the surface to be filtered, generate multiple test points located on the surface; Rays are emitted from each test point along the preset direction to detect whether the rays intersect with other faces in the STL mesh model; If all the rays corresponding to the test points intersect with other surfaces, then the surface is determined to be an obscured surface and is filtered out.

5. The method according to claim 1, characterized in that, After face segmentation and before feature extraction, the process also includes: The spiked faces in the triangular facet set formed by the first type of facets and / or the second type of facets are detected and removed, wherein the spiked faces are triangular facets that simultaneously satisfy the following conditions: This triangular face has only one edge shared by other triangular faces, and the other two edges are boundary edges; The unique shared edge is the shortest of the three edges of the triangular facet.

6. The method according to claim 5, characterized in that, The detection and removal of the spiked surface includes: After each round of detection and removal of the spiked faces that currently meet the conditions, the number of shared edges and the relationship of edge lengths of each triangle in the updated set of triangles are recalculated. The spike detection is performed again based on the updated statistical results until no spikes are detected.

7. The method according to any one of claims 1 to 6, characterized in that, The generated planar machining contour features include: For the first type of facets belonging to the same height layer, extract all boundary edges that are referenced by only one triangle facet; A closed loop is formed by tracing the topological connections along the boundary edges; During the tracking process, if the closed loop intersects itself at the target vertex, the closed loop is split into two independent closed loops at the target vertex, wherein the independent closed loops constitute the planar processing contour feature.

8. The method according to claim 7, characterized in that, Also includes: Perform inclusion relationship analysis on multiple closed loops within the same height layer, and construct an inclusion relationship tree; The processing type corresponding to each closed loop is determined based on the parity of the nesting level, where odd-numbered nesting levels correspond to internal cavity processing, and even-numbered nesting levels correspond to external island processing.

9. The method according to any one of claims 1 to 6, characterized in that, The features of the generated surface processing area include: The second type of patch is grouped into connected components, and the height difference of each connected component group in the Z-axis direction is calculated; If the height difference is less than a preset thickness threshold, the facets in the corresponding connected component group will be excluded from the second type of facets. Based on the excluded connected component grouping, surface processing region features are generated.

10. The method according to any one of claims 1 to 6, characterized in that, After generating the surface machining region features, the following steps are also included: Based on the normal vector direction of each patch within the generated surface machining area and the preset tool radius, the bounding box range that the tool center trajectory needs to cover on the XY plane is calculated. The bounding box range is used to constrain the generation of the surface machining toolpath.

11. A feature analysis device based on an STL mesh model, characterized in that, include: The acquisition module is used to obtain the normal vector of each triangle in the STL mesh model; The partitioning module is used to divide the triangular facet into at least one of a first type of facet and a second type of facet based on the Z-axis component of the normal vector, wherein the first type of facet is a facet whose Z-axis component satisfies a first preset condition, and the second type of facet is a facet whose Z-axis component satisfies a second preset condition. The generation module is used to perform high-level clustering and boundary contour extraction based on the first type of facets to generate planar processing contour features; Based on the second type of surface patches, connected component grouping is performed to generate surface processing region features.

12. An electronic device, characterized in that, include: The device includes a processor, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. When the electronic device is running, the processor communicates with the memory via the bus. When the machine-readable instructions are executed by the processor, they perform the feature analysis method based on the STL mesh model as described in any one of claims 1 to 10.

13. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, performs the feature analysis method based on the STL mesh model as described in any one of claims 1 to 10.