Topological edge projection-based three-dimensional CAD model face-level labeling method and system
By using a topological edge projection method, the problems of low efficiency and poor accuracy of surface annotation in 3D CAD models are solved, achieving efficient and accurate surface annotation, supporting forward and reverse bounding box selection interaction, and improving the editability and fault tolerance of complex feature annotation.
Patent Information
- Application Number
- CN202611361040.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-03
- Publication Date
- 2026-11-27
AI Technical Summary
Existing methods for surface-level annotation in 3D CAD models suffer from low efficiency and poor accuracy. In particular, it is difficult to reliably and efficiently map the interactive areas of the 2D screen to the topological surfaces of the 3D CAD model in complex parts. Furthermore, methods based on triangular mesh patches or GPU picking are prone to causing the results to become disconnected from the CAD topological surface ID.
A topological edge projection-based method is adopted. By loading a 3D CAD model and parsing its B-Rep topology, topological surfaces, topological edges and their mapping relationships are obtained. Edge sampling and projection transformation are performed, and the intersection relationship of the selected area is determined by using the edge-surface mapping table to achieve surface-level annotation.
It improves the efficiency and accuracy of face-level annotation in 3D CAD models, reduces the process of selecting each face individually, ensures data consistency, facilitates review and model training, supports forward and reverse bounding box selection interaction, and enhances the editability and fault tolerance of complex feature annotations.
Smart Images

Figure CN123181794A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of computer-aided design technology, specifically relating to a method and system for surface-level annotation of 3D CAD models based on topological edge projection. Background Technology
[0002] In scenarios such as mechanical manufacturing, process planning, CNC machining, and manufacturing feature recognition model training, it is often necessary to annotate manufacturing features such as holes, slots, cavities, chamfers, and fillets in 3D CAD (Computer-Aided Design) models onto specific CAD topological surfaces. Existing 3D CAD model annotation methods mainly include face-by-face selection, selection based on triangular mesh faces, selection based on bounding boxes, and GPU picking.
[0003] The face-by-face selection method typically involves the user clicking on the face to be annotated one by one in the 3D view. This method is simple to implement, but in complex parts, the CAD model contains a large number of topological faces, especially when there are many small faces, chamfered faces, fillet faces, or hole walls. Face-by-face selection is inefficient and prone to omissions or misselections.
[0004] Selection methods based on triangular mesh faces or bounding boxes typically require triangulation of the model or the construction of geometrically bounded regions. However, there is usually not a one-to-one correspondence between CAD topological faces and triangular mesh faces. A CAD topological face may be discretized into multiple triangular faces, and multiple adjacent topological faces may form a continuous visual region in the display layer. Therefore, selection based on mesh faces or bounding boxes can easily lead to a disconnect between the annotation results and the CAD topological face IDs, and may be affected by factors such as triangulation accuracy, viewpoint occlusion, and surface discretization errors.
[0005] GPU-based picking is generally suitable for determining the user's click location or the corresponding display object for a screen pixel. However, when selecting multiple CAD topological faces, a stable mapping between the display object and the CAD topological face still needs to be addressed. When the model has complex surfaces, fine boundaries, occlusion relationships, or multiple faces sharing boundaries, relying solely on display layer picking may not be enough to accurately form a dataset suitable for face-level annotation.
[0006] In summary, the main shortcomings of existing technologies include: it is difficult to stably, efficiently, and accurately map the interactive area of a 2D screen to the topological surfaces of a 3D CAD model; the results based on triangular mesh selection, bounding box selection, or GPU picking lack a direct correlation with the edge-face topological relationships of the CAD model; and directly traversing all topological surfaces or triangular meshes for geometric judgment may increase computational load and affect the real-time performance of the interaction. Therefore, a more efficient and accurate 3D CAD model surface annotation scheme is urgently needed. Summary of the Invention
[0007] The purpose of this invention is to provide a method and system for surface-level annotation of 3D CAD models based on topological edge projection, so as to solve the above-mentioned problems existing in the prior art.
[0008] To achieve the above objectives, the present invention adopts the following technical solution: Firstly, a surface-level annotation method for 3D CAD models based on topological edge projection is provided, including: Load the 3D CAD model and parse the B-Rep topology of the 3D CAD model to obtain the topological face set, topological edge set, and edge-face mapping table of the 3D CAD model. The topological face set contains a number of topological faces, the topological edge set contains a number of topological edges, and the edge-face mapping table contains the mapping relationship between each topological face and each topological edge. During the edge sampling phase, each topological edge is sampled to obtain a set of sampling points for each topological edge, and the three-dimensional model coordinates of each sampling point in the set of sampling points are determined. When performing a selection operation on a 3D CAD model in response to user operation commands, the selection area formed by the user dragging within the 2D screen is recorded, and the 2D screen coordinates of the selection area in the current user coordinate system are determined. Project each sampling point in the set of sampling points corresponding to each topological edge onto the current user coordinate system to obtain the corresponding projection point, and obtain the two-dimensional screen coordinates of the corresponding projection point in the current user coordinate system based on the three-dimensional model coordinate transformation of each sampling point. Based on the two-dimensional screen coordinates of the projection points corresponding to each sampling point in the corresponding sampling point set and the two-dimensional screen coordinates of the selected area, determine whether there is a projection intersection relationship between the corresponding topological edge and the selected area; The topological edges that have a projection intersection relationship with the selected area are used as the hit edges, and the topological surfaces that have a mapping relationship with the hit edges in the edge-face mapping table are used to form a set of candidate surfaces. During the selection and update phase, the user's current selection mode and the set of selected faces are determined, and the candidate face set is added to the set of selected faces or removed from the set of selected faces according to the selection mode, thus obtaining the set of labeled faces; Obtain the feature information set of the labeled surface set, and combine the labeled surface set and its feature information set to generate surface-level annotation data.
[0009] In one possible design, each topological face in the set of topological faces is assigned a unique face identifier, each topological edge in the set of topological edges is assigned a unique edge identifier, and a mapping relationship is established between each topological face and each topological edge in the edge-face mapping table through the unique face identifier and the unique edge identifier.
[0010] In one possible design, the feature information set includes the manufacturing feature category, feature instance number, sub-feature category, and unique face identifier for each topological face in the labeled face set.
[0011] In one possible design, the transformation of the three-dimensional model coordinates based on each sampling point to obtain the two-dimensional screen coordinates of the corresponding projection point in the current user coordinate system includes: Obtain the model matrix, view matrix, and projection matrix corresponding to the 3D CAD model, and determine the viewport size of the screen; Based on the model matrix, view matrix, projection matrix, and viewport size, the 3D model coordinates of each sampling point are converted into the 2D screen coordinates of the corresponding projection point in the current user coordinate system.
[0012] In one possible design, determining whether there is a projection intersection relationship between the corresponding topological edge and the selected area based on the two-dimensional screen coordinates of the projection points corresponding to each sampling point in the corresponding sampling point set and the two-dimensional screen coordinates of the selected area includes: Based on the two-dimensional screen coordinates of the projection points corresponding to each sampling point in the corresponding sampling point set and the two-dimensional screen coordinates of the selected area, determine the number of sampling points in the sampling point set whose corresponding projection points fall within the selected area. If the number of sampling points whose corresponding projection points fall within the selected area in the corresponding sampling point set exceeds the set threshold, it is determined that the topological edge corresponding to the sampling point set has a projection intersection relationship with the selected area.
[0013] In one possible design, determining whether there is a projection intersection relationship between the corresponding topological edge and the selected area based on the two-dimensional screen coordinates of the projection points corresponding to each sampling point in the corresponding sampling point set and the two-dimensional screen coordinates of the selected area includes: Based on the two-dimensional screen coordinates of the projection points corresponding to each sampling point in the corresponding sampling point set and the two-dimensional screen coordinates of the selected area, determine the proportion of the number of sampling points in the sampling point set whose corresponding projection points fall within the selected area. If the proportion of the number of sampling points whose corresponding projection points fall within the selected area in the corresponding sampling point set exceeds a set threshold, it is determined that the topological edge corresponding to the sampling point set has a projection intersection relationship with the selected area.
[0014] In one possible design, based on the two-dimensional screen coordinates of the projection points corresponding to each sampling point in the corresponding sampling point set and the two-dimensional screen coordinates of the selected area, it is determined whether there is a projection intersection relationship between the corresponding topological edge and the selected area, including: Based on the two-dimensional screen coordinates of the projection points corresponding to each sampling point in the corresponding sampling point set, the projection lines of the corresponding topological edges are fitted, and the two-dimensional screen coordinates of the projection lines are determined. Based on the two-dimensional screen coordinates of the projection line and the two-dimensional screen coordinates of the selected area, determine whether the projection line intersects with the selected area. If the projection line intersects with the selected area, it is determined that the topological edge corresponding to the projection line has a projection intersection relationship with the selected area.
[0015] In one possible design, the step of adding the candidate face set to the selected face set or removing the candidate face set from the selected face set according to the selection mode to obtain the labeled face set includes: If the selection mode is positive selection mode, the candidate face set is added to the selected face set to obtain the labeled face set; if the selection mode is negative selection mode, the candidate face set is removed from the selected face set to obtain the labeled face set.
[0016] Secondly, a surface-level annotation system for 3D CAD models based on topological edge projection is provided, including model parsing units, topological sampling units, bounding box selection operation units, projection transformation units, association determination units, hit candidate units, selection update units, and data assembly units, wherein: The model parsing unit is used to load the 3D CAD model and parse the B-Rep topology of the 3D CAD model to obtain the topological face set, topological edge set, and edge-face mapping table of the 3D CAD model. The topological face set contains a number of topological faces, the topological edge set contains a number of topological edges, and the edge-face mapping table contains the mapping relationship between each topological face and each topological edge. The topology sampling unit is used to sample each topology edge during the edge sampling stage, obtain the set of sampling points for each topology edge, and determine the three-dimensional model coordinates of each sampling point in the set of sampling points. The bounding box operation unit is used to record the bounding box area formed by the user dragging within the two-dimensional screen when performing bounding box operation on the three-dimensional CAD model in response to the user's operation command, and to determine the two-dimensional screen coordinates of the bounding box area in the current user coordinate system. The projection transformation unit is used to project each sampling point in the set of sampling points corresponding to each topological edge onto the current user coordinate system to obtain the corresponding projection point, and to obtain the two-dimensional screen coordinates of the corresponding projection point in the current user coordinate system based on the three-dimensional model coordinate transformation of each sampling point. The association determination unit is used to determine whether there is a projection intersection relationship between the corresponding topological edge and the selected area based on the two-dimensional screen coordinates of the projection points corresponding to each sampling point in the corresponding sampling point set and the two-dimensional screen coordinates of the selected area. The candidate cell is selected by taking the topological edge that has a projection intersection relationship with the selected area as the hit edge, and using the topological surface that has a mapping relationship with the hit edge in the edge-surface mapping table to form a candidate surface set. The selection update unit is used to determine the user's current selection mode and the set of selected faces during the selection update phase, and to add the set of candidate faces to the set of selected faces or remove the set of candidate faces from the set of selected faces according to the selection mode, so as to obtain the set of labeled faces. The data assembly unit is used to obtain the feature information set of the labeled surface set and combine the labeled surface set and its feature information set to generate surface-level annotation data.
[0017] Thirdly, a surface-level annotation system for 3D CAD models based on topological edge projection is provided, including: Memory, used to store instructions; A processor is configured to read instructions stored in the memory and execute the surface-level annotation method for a 3D CAD model based on topological edge projection as described in the first aspect of the claims.
[0018] Beneficial effects: This invention allows multiple related topological faces to be selected in a single bounding box selection, reducing the process of selecting each face individually and improving the efficiency of face-level annotation in 3D CAD models; it utilizes the edge-face topological relationship of the real CAD model to select topological faces, avoiding the problem of disconnect between ordinary mesh bounding box selection and CAD topology, thus improving selection accuracy; by prioritizing the judgment of hit edges and then looking up the face set from the hit edges, it reduces the complex detection of directly traversing all topological faces and lowers the amount of computation; the annotation results are based on CAD topological faces and their feature information, ensuring data consistency and facilitating review, export, model training, and traceability; furthermore, it supports two interactive modes: forward bounding box selection and reverse bounding box selection. Users can first quickly select a large range of candidate faces and then remove incorrectly selected faces through reverse bounding box selection, thereby improving the editability and fault tolerance in the complex manufacturing feature annotation process. Attached Figure Description
[0019] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0020] Figure 1 This is a flowchart illustrating the method in Embodiment 1 of the present invention; Figure 2 This is a schematic diagram illustrating the relationship between topological edges and topological surfaces. Figure 3 This is a schematic diagram of the projection of the sampling points corresponding to the topological edges; Figure 4 This is a schematic diagram of the system architecture in Embodiment 2 of the present invention. Detailed Implementation
[0021] It should be noted that the descriptions of these embodiments are intended to aid in understanding the invention and do not constitute a limitation thereof. The specific structural and functional details disclosed herein are merely for describing exemplary embodiments of the invention. However, the invention may be embodied in many alternative forms and should not be construed as being limited to the embodiments described herein.
[0022] It should be understood that, unless otherwise explicitly specified and limited, the corresponding terms should be interpreted broadly. For example, "connection" can be a fixed connection, a detachable connection, or an integral connection; it can be a direct connection or an indirect connection through an intermediate medium; it can be a connection within two components. Those skilled in the art can understand the specific meaning of the above terms in the embodiments according to the specific circumstances.
[0023] Specific details are provided in the following description to provide a complete understanding of the exemplary embodiments. However, those skilled in the art will understand that the exemplary embodiments can be implemented without these specific details. For example, apparatus may be shown in block diagrams to avoid obscuring the examples with unnecessary details. In other embodiments, well-known processes, structures, and techniques may be omitted with non-essential details to avoid obscuring the embodiments.
[0024] Example 1: This embodiment provides a surface-level annotation method for 3D CAD models based on topological edge projection, which can be applied to corresponding computer-aided design systems, such as... Figure 1 As shown, the method includes the following steps: S1. Load the 3D CAD model and parse the B-Rep topology of the 3D CAD model to obtain the topological face set, topological edge set, and edge-face mapping table of the 3D CAD model. The topological face set contains several topological faces, the topological edge set contains several topological edges, and the edge-face mapping table contains the mapping relationship between each topological face and each topological edge.
[0025] In practice, after loading the 3D CAD model, the system first parses the B-Rep (Boundary Representation) topology of the 3D CAD model (a core data format in computer-aided design systems that describes the shape of 3D entities; it accurately expresses the geometric shape of an object by explicitly defining the boundary elements (such as faces, edges, and vertices) and their topological connections), obtaining the topological face set and topological edge set of the 3D CAD model. The topological face set contains several topological faces, each assigned a unique face identifier (FaceID), and the topological edge set contains several topological edges, each assigned a unique edge identifier (EdgeID). Then, an edge-face mapping table is established based on the topological adjacency relationships between topological edges and topological faces in the 3D CAD model, such as... Figure 2 As shown, in the edge-face mapping table, each topological face and each topological edge are mapped through a unique face identifier and a unique edge identifier. A topological edge can be associated with one topological face or with two or more adjacent topological faces.
[0026] S2. In the edge sampling stage, each topological edge is sampled to obtain the set of sampling points for each topological edge, and the three-dimensional model coordinates of each sampling point in the set of sampling points are determined.
[0027] In practice, during the edge sampling phase, the system samples each topological edge to obtain a set of sampling points for each topological edge, and determines the 3D model coordinates of each sampling point in the set. When sampling each topological edge, for straight edges, sampling can be performed at equal intervals according to the edge length; for circular arc edges, spline edges, or other curved edges, adaptive sampling can be performed according to curvature changes, chord height errors, or screen projection errors. The number of sampling points can be dynamically determined based on the edge length, curvature, model scaling ratio, or current viewport parameters to balance selection accuracy and computational efficiency.
[0028] S3. When performing a selection operation on a 3D CAD model in response to a user's operation command, record the selection area formed by the user dragging within the 2D screen, and determine the 2D screen coordinates of the selection area in the current user coordinate system.
[0029] In practice, when a user performs a selection operation, the system responds to the user's operation command by performing a selection operation on the 3D CAD model, records the selection area R formed by the user dragging within the 2D screen, and determines the 2D screen coordinates of the selection area R in the current user coordinate system (UCS).
[0030] S4. Project each sampling point in the set of sampling points corresponding to each topological edge onto the current user coordinate system to obtain the corresponding projection point, and obtain the two-dimensional screen coordinates of the corresponding projection point in the current user coordinate system based on the three-dimensional model coordinate transformation of each sampling point.
[0031] In specific implementation, such as Figure 3As shown, the system can project each sampling point in the set of sampling points corresponding to each topological edge onto the current user coordinate system to obtain the corresponding projection point. Then, it determines the two-dimensional screen coordinates of the projection point in the current user coordinate system. For example, it obtains the model matrix, view matrix, and projection matrix corresponding to the three-dimensional CAD model, collectively called the MVP matrix (which can realize the projection transformation from virtual three-dimensional world coordinates to two-dimensional screen coordinates), and determines the viewport size of the screen. Then, it uses the model matrix, view matrix, and projection matrix to perform model transformation, view transformation, and projection transformation on the three-dimensional model coordinates of each sampling point to obtain the two-dimensional screen coordinates of the corresponding projection point in the current user coordinate system and viewport size.
[0032] S5. Based on the two-dimensional screen coordinates of the projection points corresponding to each sampling point in the corresponding sampling point set and the two-dimensional screen coordinates of the selected area, determine whether there is a projection intersection relationship between the corresponding topological edge and the selected area.
[0033] In practice, when determining whether a corresponding topological edge intersects with the selected region R, the system can determine the number of sampling points in the sampling point set whose corresponding projection points fall within the selected region R based on the two-dimensional screen coordinates of the projection points corresponding to each sampling point in the corresponding sampling point set and the two-dimensional screen coordinates of the selected region R. If the number of sampling points in the corresponding sampling point set whose corresponding projection points fall within the selected region R exceeds a set threshold, then it is determined that the topological edge corresponding to the sampling point set intersects with the selected region R.
[0034] Alternatively, the proportion of sampling points whose corresponding projection points fall within the selected region R can be determined based on the two-dimensional screen coordinates of the projection points corresponding to each sampling point in the corresponding sampling point set and the two-dimensional screen coordinates of the selected region R. If the proportion of sampling points whose corresponding projection points fall within the selected region R exceeds a set threshold, it is determined that the topological edge corresponding to the sampling point set has a projection intersection relationship with the selected region R.
[0035] Alternatively, the projection line of the corresponding topological edge can be fitted based on the two-dimensional screen coordinates of the projection points corresponding to each sampling point in the corresponding sampling point set, and the two-dimensional screen coordinates of the projection line can be determined. Based on the two-dimensional screen coordinates of the projection line and the two-dimensional screen coordinates of the selected area R, it can be determined whether the projection line intersects with the selected area R. If the projection line intersects with the selected area R, it is determined that the topological edge corresponding to the projection line has a projection intersection relationship with the selected area R.
[0036] Alternatively, the projection bounding box can be determined based on the projection points corresponding to each sampling point in the corresponding sampling point set. Then, it can be determined whether the projection bounding box intersects with the selected region R. If the projection bounding box intersects with the selected region R, it can be determined that the corresponding topological edge has a projection intersection relationship with the selected region R.
[0037] S6. Select the topological edges that have a projection intersection relationship with the selected area as the hit edges, and use the topological surfaces that have a mapping relationship with the hit edges in the edge-surface mapping table to form a candidate surface set.
[0038] In practice, the system uses the topological edges that intersect with the selected region R through projection as the hit edges, thus obtaining a set of hit edges. After obtaining the set of hit edges, the system does not directly use screen objects or triangular mesh patches as annotation objects. Instead, it uses the edge-face mapping table to look up the topological faces associated with the hit edges to construct a candidate face set. The system uses the unique edge identifier (EdgeID) of each hit edge to retrieve the edge-face mapping table, determining the topological faces and their unique face identifiers (FaceID) that are mapped to the hit edges and their unique edge identifiers (EdgeID). Then, it uses these topological faces mapped to each hit edge to form a candidate face set. When forming the candidate face set, the system can remove duplicate topological faces. For cases with many adjacent faces or complex chamfers or rounded corners, the system can further filter or sort the candidate face set by combining face normals, face type, visibility, depth cache, or the current annotation category.
[0039] S7. In the selection update phase, determine the user's current selection mode and the set of selected faces, and add the set of candidate faces to the set of selected faces or remove the set of candidate faces from the set of selected faces according to the selection mode to obtain the set of labeled faces.
[0040] In practice, during the selection and update phase, the system, based on the user's current bounding box selection mode and the current set of selected faces, adds the candidate face set to the set of selected faces or removes the candidate face set from the set of selected faces to obtain the annotation face set: if the bounding box selection mode is a forward bounding box selection mode, the candidate face set is added to the set of selected faces to obtain the annotation face set; if the bounding box selection mode is a reverse bounding box selection mode, the candidate face set is removed from the set of selected faces to obtain the annotation face set.
[0041] S8. Obtain the feature information set of the labeled surface set, and combine the labeled surface set and its feature information set to generate surface-level annotation data.
[0042] In practice, after obtaining the set of annotated surfaces, the system can acquire the manufacturing feature category (such as holes, slots, cavities, chamfers, fillets, etc.), feature instance number (GroupID), sub-feature category (such as bottom surface, side surface, transition surface, etc.), and unique face identifier (FaceID) of each topological surface in the annotated surface set, forming a feature information set. Then, the annotated surface set and its feature information set are combined to generate surface-level annotation data, thereby realizing surface-level annotation of the 3D CAD model.
[0043] This method can select multiple relevant topological faces with a single bounding box selection, reducing the process of selecting each face individually and improving the efficiency of face-level annotation in 3D CAD models. It utilizes the edge-face topological relationships of the real CAD model to select topological faces, avoiding the disconnect between ordinary mesh selection and CAD topology, thus improving selection accuracy. By prioritizing the detection of hit edges and then using these hit edges to look up the face set, it reduces the complex detection of directly traversing all topological faces, lowering the computational load. The annotation results ensure data consistency, facilitating review, export, model training, and traceability. Furthermore, it supports both forward and reverse bounding box selection modes, allowing users to quickly select a large range of candidate faces and then remove incorrectly selected faces using reverse bounding box selection, thereby improving editability and fault tolerance in the annotation process of complex manufacturing features.
[0044] Example 2: This embodiment provides a surface-level annotation system for 3D CAD models based on topological edge projection, such as... Figure 4 As shown, it includes a model parsing unit, a topology sampling unit, a bounding box selection operation unit, a projection transformation unit, an association determination unit, a hit candidate unit, a selection update unit, and a data assembly unit, wherein: The model parsing unit is used to load the 3D CAD model and parse the B-Rep topology of the 3D CAD model to obtain the topological face set, topological edge set, and edge-face mapping table of the 3D CAD model. The topological face set contains a number of topological faces, the topological edge set contains a number of topological edges, and the edge-face mapping table contains the mapping relationship between each topological face and each topological edge. The topology sampling unit is used to sample each topology edge during the edge sampling stage, obtain the set of sampling points for each topology edge, and determine the three-dimensional model coordinates of each sampling point in the set of sampling points. The bounding box operation unit is used to record the bounding box area formed by the user dragging within the two-dimensional screen when performing bounding box operation on the three-dimensional CAD model in response to the user's operation command, and to determine the two-dimensional screen coordinates of the bounding box area in the current user coordinate system. The projection transformation unit is used to project each sampling point in the set of sampling points corresponding to each topological edge onto the current user coordinate system to obtain the corresponding projection point, and to obtain the two-dimensional screen coordinates of the corresponding projection point in the current user coordinate system based on the three-dimensional model coordinate transformation of each sampling point. The association determination unit is used to determine whether there is a projection intersection relationship between the corresponding topological edge and the selected area based on the two-dimensional screen coordinates of the projection points corresponding to each sampling point in the corresponding sampling point set and the two-dimensional screen coordinates of the selected area. The candidate cell is selected by taking the topological edge that has a projection intersection relationship with the selected area as the hit edge, and using the topological surface that has a mapping relationship with the hit edge in the edge-surface mapping table to form a candidate surface set. The selection update unit is used to determine the user's current selection mode and the set of selected faces during the selection update phase, and to add the set of candidate faces to the set of selected faces or remove the set of candidate faces from the set of selected faces according to the selection mode, so as to obtain the set of labeled faces. The data assembly unit is used to obtain the feature information set of the labeled surface set and combine the labeled surface set and its feature information set to generate surface-level annotation data.
[0045] Example 3: This embodiment provides a 3D CAD model surface annotation system based on topological edge projection, which includes the following at the hardware level: The data interface is used to establish data communication between the processor and external data terminals; Memory, used to store instructions; The processor is used to read the instructions stored in the memory and execute the surface annotation of the 3D CAD model based on topological edge projection in Embodiment 1 according to the instructions.
[0046] Optionally, the system also includes an internal bus, through which the processor, memory, and data interface can be interconnected. This internal bus can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc.
[0047] The memory may include, but is not limited to, random access memory (RAM), read-only memory (ROM), flash memory, first-in-first-out (FIFO) memory, and / or first-in-last-out (FILO) memory. The processor may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0048] Example 4: This embodiment provides a computer-readable storage medium storing instructions. When these instructions are executed on a computer, the computer performs the topological edge projection-based 3D CAD model face-level annotation as described in Embodiment 1. The computer-readable storage medium refers to a data storage medium, which may include, but is not limited to, floppy disks, optical disks, hard disks, flash memory, USB flash drives, and / or Memory Sticks. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices.
[0049] This embodiment also provides a computer program product that, when run on a computer, performs the surface-level annotation of a 3D CAD model based on topological edge projection as described in Embodiment 1. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device.
[0050] Finally, it should be noted that the above description is merely a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention. 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 method for surface-level annotation of 3D CAD models based on topological edge projection, characterized in that, include: Load the 3D CAD model and parse the B-Rep topology of the 3D CAD model to obtain the topological face set, topological edge set, and edge-face mapping table of the 3D CAD model. The topological face set contains a number of topological faces, the topological edge set contains a number of topological edges, and the edge-face mapping table contains the mapping relationship between each topological face and each topological edge. During the edge sampling phase, each topological edge is sampled to obtain a set of sampling points for each topological edge, and the 3D model coordinates of each sampling point in the set of sampling points are determined. When performing a selection operation on a 3D CAD model in response to user operation commands, the selection area formed by the user dragging within the 2D screen is recorded, and the 2D screen coordinates of the selection area in the current user coordinate system are determined. Project each sampling point in the set of sampling points corresponding to each topological edge onto the current user coordinate system to obtain the corresponding projection point, and obtain the two-dimensional screen coordinates of the corresponding projection point in the current user coordinate system based on the three-dimensional model coordinate transformation of each sampling point. Based on the two-dimensional screen coordinates of the projection points corresponding to each sampling point in the corresponding sampling point set and the two-dimensional screen coordinates of the selected area, determine whether there is a projection intersection relationship between the corresponding topological edge and the selected area; The topological edges that have a projection intersection relationship with the selected area are used as the hit edges, and the topological surfaces that have a mapping relationship with the hit edges in the edge-face mapping table are used to form a set of candidate surfaces. During the selection and update phase, the user's current selection mode and the set of selected faces are determined, and the candidate face set is added to the set of selected faces or removed from the set of selected faces according to the selection mode, thus obtaining the set of labeled faces; Obtain the feature information set of the labeled surface set, and combine the labeled surface set and its feature information set to generate surface-level annotation data.
2. The method for surface-level annotation of a 3D CAD model based on topological edge projection according to claim 1, characterized in that, Each topological face in the set of topological faces is assigned a unique face identifier, and each topological edge in the set of topological edges is assigned a unique edge identifier. In the edge-face mapping table, each topological face and each topological edge is mapped to each other through the unique face identifier and the unique edge identifier.
3. The method for surface-level annotation of a 3D CAD model based on topological edge projection according to claim 2, characterized in that, The feature information set includes the manufacturing feature category, feature instance number, sub-feature category, and unique face identifier of each topological face in the labeled face set.
4. The method for surface-level annotation of a 3D CAD model based on topological edge projection according to claim 1, characterized in that, The process of transforming the 3D model coordinates of each sampling point to obtain the corresponding projection point's 2D screen coordinates in the current user coordinate system includes: Obtain the model matrix, view matrix, and projection matrix corresponding to the 3D CAD model, and determine the viewport size of the screen; Based on the model matrix, view matrix, projection matrix, and viewport size, the 3D model coordinates of each sampling point are converted into the 2D screen coordinates of the corresponding projection point in the current user coordinate system.
5. The method for surface-level annotation of a 3D CAD model based on topological edge projection according to claim 1, characterized in that, The step of determining whether there is a projection intersection relationship between the corresponding topological edge and the selected area based on the two-dimensional screen coordinates of the projection points corresponding to each sampling point in the corresponding sampling point set and the two-dimensional screen coordinates of the selected area includes: Based on the two-dimensional screen coordinates of the projection points corresponding to each sampling point in the corresponding sampling point set and the two-dimensional screen coordinates of the selected area, determine the number of sampling points in the sampling point set whose corresponding projection points fall within the selected area. If the number of sampling points whose corresponding projection points fall within the selected area in the corresponding sampling point set exceeds the set threshold, it is determined that the topological edge corresponding to the sampling point set has a projection intersection relationship with the selected area.
6. The method for surface-level annotation of a 3D CAD model based on topological edge projection according to claim 1, characterized in that, The step of determining whether there is a projection intersection relationship between the corresponding topological edge and the selected area based on the two-dimensional screen coordinates of the projection points corresponding to each sampling point in the corresponding sampling point set and the two-dimensional screen coordinates of the selected area includes: Based on the two-dimensional screen coordinates of the projection points corresponding to each sampling point in the corresponding sampling point set and the two-dimensional screen coordinates of the selected area, determine the proportion of the number of sampling points in the sampling point set whose corresponding projection points fall within the selected area. If the proportion of the number of sampling points whose corresponding projection points fall within the selected area in the corresponding sampling point set exceeds a set threshold, it is determined that the topological edge corresponding to the sampling point set has a projection intersection relationship with the selected area.
7. The method for surface-level annotation of a 3D CAD model based on topological edge projection according to claim 1, characterized in that, Based on the two-dimensional screen coordinates of the projection points corresponding to each sampling point in the corresponding sampling point set and the two-dimensional screen coordinates of the selected area, determine whether there is a projection intersection relationship between the corresponding topological edge and the selected area, including: The projection line of the corresponding topological edge is fitted based on the two-dimensional screen coordinates of the projection points corresponding to each sampling point in the corresponding sampling point set, and the two-dimensional screen coordinates of the projection line are determined. Based on the two-dimensional screen coordinates of the projection line and the two-dimensional screen coordinates of the selected area, determine whether the projection line intersects with the selected area. If the projection line intersects with the selected area, it is determined that the topological edge corresponding to the projection line has a projection intersection relationship with the selected area.
8. The method for surface-level annotation of a 3D CAD model based on topological edge projection according to claim 1, characterized in that, The step of adding the candidate face set to the selected face set or removing the candidate face set from the selected face set according to the selection mode to obtain the labeled face set includes: If the selection mode is positive selection mode, the candidate face set is added to the selected face set to obtain the labeled face set; if the selection mode is negative selection mode, the candidate face set is removed from the selected face set to obtain the labeled face set.
9. A 3D CAD model surface annotation system based on topological edge projection, characterized in that, It includes a model parsing unit, a topology sampling unit, a bounding box selection operation unit, a projection transformation unit, an association determination unit, a hit candidate unit, a selection update unit, and a data assembly unit, wherein: The model parsing unit is used to load the 3D CAD model and parse the B-Rep topology of the 3D CAD model to obtain the topological face set, topological edge set, and edge-face mapping table of the 3D CAD model. The topological face set contains a number of topological faces, the topological edge set contains a number of topological edges, and the edge-face mapping table contains the mapping relationship between each topological face and each topological edge. The topology sampling unit is used to sample each topology edge during the edge sampling stage, obtain the set of sampling points for each topology edge, and determine the three-dimensional model coordinates of each sampling point in the set of sampling points. The bounding box operation unit is used to record the bounding box area formed by the user dragging within the two-dimensional screen when performing bounding box operation on the three-dimensional CAD model in response to the user's operation command, and to determine the two-dimensional screen coordinates of the bounding box area in the current user coordinate system. The projection transformation unit is used to project each sampling point in the set of sampling points corresponding to each topological edge onto the current user coordinate system to obtain the corresponding projection point, and to obtain the two-dimensional screen coordinates of the corresponding projection point in the current user coordinate system based on the three-dimensional model coordinate transformation of each sampling point. The association determination unit is used to determine whether there is a projection intersection relationship between the corresponding topological edge and the selected area based on the two-dimensional screen coordinates of the projection points corresponding to each sampling point in the corresponding sampling point set and the two-dimensional screen coordinates of the selected area. The candidate cell is selected by taking the topological edge that has a projection intersection relationship with the selected area as the hit edge, and using the topological surface that has a mapping relationship with the hit edge in the edge-surface mapping table to form a candidate surface set. The selection update unit is used to determine the user's current selection mode and the set of selected faces during the selection update phase, and to add the set of candidate faces to the set of selected faces or remove the set of candidate faces from the set of selected faces according to the selection mode, so as to obtain the set of labeled faces. The data assembly unit is used to obtain the feature information set of the labeled surface set and combine the labeled surface set and its feature information set to generate surface-level annotation data.
10. A 3D CAD model surface annotation system based on topological edge projection, characterized in that, include: Memory, used to store instructions; A processor is configured to read instructions stored in the memory and execute the surface annotation method for a 3D CAD model based on topological edge projection as described in any one of claims 1-8 according to the instructions.
