ProToolkit-based three-dimensional model feature extraction method
By using a feature extraction method for Creo 3D models based on ProToolkit, the Creo model tree structure is automatically parsed, features and dimensions are identified and classified, and structured data is generated. This solves the compatibility and efficiency problems of batch automated extraction in Creo software, and achieves complete parametric information and efficient data extraction.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-20
- Publication Date
- 2026-03-10
AI Technical Summary
Existing technologies lack the ability to automatically extract features in batches within Creo 3D CAD design software, resulting in low data integration efficiency. Furthermore, existing methods cannot maintain the integrity of parametric information, leading to compatibility issues.
The 3D model feature extraction method based on ProToolkit analyzes the Creo model tree structure, identifies features and their associated dimensions, performs automated extraction and classification, generates structured data format, and supports batch processing and process grouping.
It achieves efficient and automated extraction of feature information and dimensional data from Creo 3D models, ensuring the integrity of parametric information, improving data extraction efficiency, solving the problem of inaccurate dimensional orientation judgment in traditional methods, and supporting the generation of lightweight models and inspection item tables.
Smart Images

Figure CN121640504A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of computer-aided design and data extraction, specifically a method for extracting features from 3D models based on ProToolkit. Background Technology
[0002] Traditional product dimension information extraction relies primarily on designers manually measuring geometric elements in CAD models. This method is inefficient and prone to data errors due to human factors. While Creo, a mainstream 3D CAD design software, offers the ability to manually query individual dimensions, it lacks batch automated extraction capabilities, failing to meet the data integration requirements of modern intelligent manufacturing. Existing automation solutions often use intermediate formats for data conversion, such as STEP and IGES neutral files. However, this method loses crucial parametric design information, including key data such as feature relationships, design intent, and dimensional constraints. Furthermore, while some J-Link API-based scripting tools can achieve partial automation, they require users to possess advanced programming skills, posing a significant technical barrier for ordinary designers and technicians. Moreover, most existing methods are developed for specific CAD platforms and cannot directly adapt to Creo's data structure and API interfaces, leading to compatibility issues in practical applications. Therefore, developing an automated feature extraction method that directly utilizes Creo's native interface, maintains the integrity of parametric information, and supports batch processing has significant practical application value. Summary of the Invention
[0003] The purpose of this invention is to provide a feature extraction method for Creo 3D models based on ProToolkit, which realizes the automated extraction of feature information and size data in Creo 3D models, reduces manual intervention, and improves the efficiency and accuracy of data extraction.
[0004] The technical solution adopted by this invention to achieve the above objectives is: a 3D model feature extraction method based on ProToolkit, comprising the following steps:
[0005] Step S1: Access the target Creo 3D model and parse the model tree structure of the Creo 3D model to obtain the current model object; identify each feature in the model and its associated size object by traversing the feature element tree;
[0006] Step S2: Traverse the dimension objects associated with the feature and extract dimension information containing dimension values, tolerance limits, parameter names, and attached geometric primitive information;
[0007] Step S3: Based on the extracted size information, classify the dimensions by calculating the size direction vector and mapping the dimensions to the axis of the model's default coordinate system;
[0008] Step S4: Output the feature and size information in a structured data format and attach model version information and timestamp;
[0009] Step S5: Group the model data into process groups according to the preset process division strategy and generate lightweight sub-models and inspection item tables for each inspection station. The output files are available for subsequent information management system or MES system to call.
[0010] Step S1 includes the following steps:
[0011] Step S1-1: Establish a connection with the Creo application and obtain the currently active 3D model object;
[0012] Step S1-2: Through the ProFeatureRefsVisit callback mechanism function, recursively access each feature in the model tree, traverse according to the feature creation order, identify the core information of each feature, including obtaining the user identifier of the feature displayed in the model tree, initializing the feature object to obtain its internal unique identifier, obtaining the feature type classification and the user-defined feature name;
[0013] Step S1-3: Traverse the feature element tree according to the structural pattern of the boundary representation method, and access the geometric information of the entity, face, and contour levels in turn;
[0014] Steps S1-4: Obtain the display status of the judged features through the feature display correlation function, including whether they are hidden, concealed, or suppressed; use the feature reference function to traverse all other features or geometric primitives referenced by the feature, and construct a detailed feature dependency graph in memory by analyzing the reference relationship.
[0015] Step S1-2 specifically includes:
[0016] In the callback mechanism function, the ProFeatureInit function is used to initialize the current feature object and obtain its internal unique identifier to prevent feature confusion.
[0017] The ProFeatureIdGet function is used to obtain the user ID of the feature displayed in the model tree, which is used for manual identification and subsequent reference.
[0018] The feature type is determined by the ProFeatureTypeGet function to distinguish different geometric construction methods;
[0019] At the same time, the user-defined feature name is obtained through the ProFeatureNameGet function to enhance the understanding of design intent.
[0020] Steps S1-3 are specifically as follows:
[0021] Step S1-3-1: Use the ProSurfaceVisit callback mechanism function to traverse all surfaces of the part solid model and obtain the geometric parameters and topology information of each surface;
[0022] Step S1-3-2: For each surface that is traversed, use the ProContourVisit function to traverse all the contours contained in the surface;
[0023] Step S1-3-3: For each identified contour, use the ProEdgeVisit function to traverse all boundary edges of the contour;
[0024] Step S1-3-4: Use the ProPointVisit function to obtain the endpoint coordinates of all boundary edges, completing the extraction of the full-size object from the entity to the point.
[0025] Step S2 includes the following steps:
[0026] Step S2-1: Based on the identified features, initialize the size traversal environment, obtain all size objects associated with each feature through the ProFeatureDimensionGet function, and initialize the size handle using the ProDimensionInit function to verify the validity of the size objects;
[0027] Step S2-2: Iterate through each size object sequentially using a loop structure, use the ProParameterValueGet function to extract the size numerical attributes, including nominal and actual values, and use the ProUnitSystemGet function to perform unit conversion to ensure data standardization;
[0028] Step S2-3: Use the ProToleranceGet function to extract dimensional tolerance attributes, including upper deviation, lower deviation, and tolerance type, and mark dimensions without tolerance.
[0029] Step S2-4: Obtain the size parameter name through the ProModelitemNameGet function, and obtain the geometric primitive associated with the size leader through the ProDimensionEntityGet function. Then, infer the geometric element's affiliation through the ProSurfaceOwnerGet or ProEdgeOwnerGet function.
[0030] Step S2-5: Perform logical verification on the extracted dimensional information, including numerical range check and tolerance consistency check. After verification, store the data in the memory data structure.
[0031] Step S3 includes the following steps:
[0032] Step S3-1: Determine the direction vector:
[0033] For linear dimensions, if the dimension is associated with two parallel planes, the direction vector of the dimension is determined to be the normal vector of these two planes; if the dimension is associated with a cylindrical surface, the direction of the dimension is determined to be the direction of the cylinder's axis; if the dimension is a locating dimension, the direction of the dimension is determined to be perpendicular to the reference plane. For angular dimensions, the direction of the dimension is determined to be the direction of the rotation axis.
[0034] Step S3-2: Obtain the dimension direction vector. For linear dimensions, obtain the plane normal vector by obtaining the surface normal function or obtain the axis direction by calculating the curve tangent function; for angular dimensions, determine its rotation axis direction vector.
[0035] Step S3-3: Obtain the three axis unit vectors of the model's default coordinate system;
[0036] Step S3-4: Perform a dot product operation between the dimension direction vector and the three axial unit vectors of the default coordinate system and calculate the included angle;
[0037] Step S3-5: Classify the dimensions based on the angle calculation results and establish the association mapping between the classified dimensions and the coordinate system.
[0038] Step S3-5 specifically includes:
[0039] Based on the angle calculation results, the following classification rules are applied:
[0040] Step S3-5-1: When the angle between the dimension direction vector and a certain coordinate axis is close to 0° or 180°, and the angle between the dimension direction vector and the other two coordinate axes is close to 90°, it is determined that the dimension direction vector is parallel to the coordinate axis, and the dimension is classified as a linear dimension in the direction of the axis.
[0041] Step S3-5-2: For the dimension controlling the diameter of the cylinder, based on its classification in the axial direction, the dimension is further marked as the radial dimension;
[0042] Step S3-5-3: For angular dimensions, classify them uniformly as angular dimension types and record the specific direction of their rotation axis in the model coordinate system;
[0043] Step S3-5-4: For dimensions whose direction vectors are not parallel to any coordinate axis, they are classified as oriented dimensions, and their complete direction vector data is recorded;
[0044] Step S3-5-5: After classification, establish an association mapping between each type of dimension and its orientation information in the model coordinate system, store the orientation attributes and geometric parameters relative to the coordinate system for each dimension, and ensure that the geometric consistency and coordinate accuracy of the dimension data can be maintained when the model undergoes translation or rotation transformation.
[0045] Step S4 specifically includes:
[0046] Step S4-1: Organize the extracted feature information and size information according to a predefined data structure to form a complete data set containing model name, coordinate system information, feature list and size list;
[0047] Step S4-2: Attach model metadata to the dataset, including model version information, creation timestamp, author information, and unit of measurement;
[0048] Step S4-3: Convert the dataset into a specified structured format according to the output requirements, including JavaScript Object Notation (JSON), Extensible Markup Language (XML), or spreadsheet format Excel.
[0049] Step S4-4: Automatically perform data export operations through the programming interface, generate the corresponding data file, and save it to the specified storage path.
[0050] Step S5 specifically includes:
[0051] Step S5-1: According to the preset process division strategy, the extracted feature information and size information are grouped into processes according to the inspection station;
[0052] Step S5-2: Intelligently decompose the original 3D model and generate a corresponding lightweight sub-model for each process group. The lightweight sub-model retains only the features and size information related to that process.
[0053] Step S5-3: Generate a dedicated inspection item table for each inspection station based on the grouped dimensional information. The table includes dimensional identifiers, nominal values, tolerance requirements, and inspection method information.
[0054] Step S5-4: Associate and package the lightweight sub-model with the inspection item table, and forward it to the corresponding inspection station terminal through the manufacturing execution system;
[0055] Step S5-5: Implement the linkage display of the model and the inspection item on the inspection station terminal, and automatically highlight the model position corresponding to the current inspection item during the inspection process.
[0056] A feature extraction system based on ProToolkit's 3D model feature extraction method includes:
[0057] The model parsing module is used to access the target Creo 3D model and parse its model tree structure to obtain the current model object. It identifies each feature in the model and its associated size object by traversing the feature element tree.
[0058] The dimension extraction module is used to traverse the dimension objects associated with the feature and extract complete dimension information, including dimension values, tolerance upper and lower limits, parameter names, and attached geometric primitive information.
[0059] The classification mapping module is used to classify dimensions based on the extracted size information by calculating the size direction vector and mapping the size to the axis of the model's default coordinate system.
[0060] The data output module is used to output feature and size information in a structured data format and attach model version information and timestamps;
[0061] The manufacturing collaboration module is used to group model data into processes according to a preset process division strategy and generate lightweight sub-models and inspection item tables for each inspection station, which can then be called by the information management system or MES system.
[0062] The rules configuration module provides a graphical interface for users to set feature extraction rules, size classification rules, and process grouping strategies.
[0063] The system integration interface is used to enable low-level data interaction with the Creo application and data communication with external information management systems.
[0064] The present invention has the following beneficial effects and advantages:
[0065] 1. This invention replaces traditional manual measurement with automated extraction, which improves the efficiency of feature and size information extraction by several times and significantly shortens the product design and manufacturing preparation cycle.
[0066] 2. This invention directly accesses model data based on Creo's native interface, avoiding information loss caused by intermediate format conversion and ensuring the integrity of parametric design information.
[0067] 3. This invention is based on spatial geometric calculations of direction vectors and coordinate systems to achieve automatic size classification and coordinate mapping, effectively solving the problem of inaccurate size direction judgment in traditional methods.
[0068] 4. This invention uses a hierarchical traversal mechanism based on boundary representation to extract complete geometric information from entities, faces, contours to edges, ensuring accurate identification and classification of the geometric features of complex 3D models.
[0069] 5. This invention ensures consistency between feature and size data during model modification and updates by constructing a feature dependency graph and analyzing reference relationships, thereby avoiding data conflicts. Attached Figure Description
[0070] Figure 1 This is a system functional architecture diagram of the present invention;
[0071] Figure 2 This is a flowchart illustrating the method for feature extraction from a 3D model according to the present invention. Detailed Implementation
[0072] The present invention will now be described in further detail with reference to the accompanying drawings and embodiments.
[0073] like Figure 2 The diagram shown is a flowchart of the 3D model feature extraction method of the present invention. The 3D model feature extraction method of the present invention based on ProToolkit includes the following steps:
[0074] Step S1: Access the target Creo 3D model and parse the model tree structure of the Creo 3D model to obtain the current model object; identify each feature in the model and its associated size object by traversing the feature element tree;
[0075] Step S1-1: Establish a connection with the Creo application and obtain the currently active 3D model object;
[0076] Step S1-2: Through the ProFeatureRefsVisit callback mechanism function, recursively access each feature in the model tree, traverse according to the feature creation order, identify the core information of each feature, including obtaining the user identifier of the feature displayed in the model tree, initializing the feature object to obtain its internal unique identifier, obtaining the feature type classification and the user-defined feature name;
[0077] In the callback mechanism function, the ProFeatureInit function is used to initialize the current feature object and obtain its internal unique identifier to prevent feature confusion.
[0078] The ProFeatureIdGet function is used to obtain the user ID of the feature displayed in the model tree, which is used for manual identification and subsequent reference.
[0079] The feature type is determined by the ProFeatureTypeGet function to distinguish different geometric construction methods;
[0080] At the same time, the user-defined feature name is obtained through the ProFeatureNameGet function to enhance the understanding of design intent.
[0081] Step S1-3: Traverse the feature element tree according to the structural pattern of the boundary representation method, and access the geometric information of the entity, face, and contour levels in turn;
[0082] Step S1-3-1: Use the ProSurfaceVisit callback mechanism function to traverse all surfaces of the part solid model and obtain the geometric parameters and topology information of each surface;
[0083] Step S1-3-2: For each surface that is traversed, use the ProContourVisit function to traverse all the contours contained in the surface;
[0084] Step S1-3-3: For each identified contour, use the ProEdgeVisit function to traverse all boundary edges of the contour;
[0085] Step S1-3-4: Use the ProPointVisit function to obtain the endpoint coordinates of all boundary edges, completing the extraction of the full-size object from the entity to the point.
[0086] Steps S1-4: Obtain the display status of the judged features through the feature display correlation function, including whether they are hidden, concealed, or suppressed; use the feature reference function to traverse all other features or geometric primitives referenced by the feature, and construct a detailed feature dependency graph in memory by analyzing the reference relationship.
[0087] Step S2: Traverse the dimension objects associated with the feature and extract dimension information containing dimension values, tolerance limits, parameter names, and attached geometric primitive information;
[0088] Step S2-1: Based on the identified features, initialize the size traversal environment, obtain all size objects associated with each feature through the ProFeatureDimensionGet function, and initialize the size handle using the ProDimensionInit function to verify the validity of the size objects;
[0089] Step S2-2: Iterate through each size object sequentially using a loop structure, use the ProParameterValueGet function to extract the size numerical attributes, including nominal and actual values, and use the ProUnitSystemGet function to perform unit conversion to ensure data standardization;
[0090] Step S2-3: Use the ProToleranceGet function to extract dimensional tolerance attributes, including upper deviation, lower deviation, and tolerance type, and mark dimensions without tolerance.
[0091] Step S2-4: Obtain the size parameter name through the ProModelitemNameGet function, and obtain the geometric primitive associated with the size leader through the ProDimensionEntityGet function. Then, infer the geometric element's affiliation through the ProSurfaceOwnerGet or ProEdgeOwnerGet function.
[0092] Step S2-5: Perform logical verification on the extracted dimensional information, including numerical range check and tolerance consistency check. After verification, store the data in the memory data structure.
[0093] Step S3: Based on the extracted size information, classify the dimensions by calculating the size direction vector and mapping the dimensions to the axis of the model's default coordinate system;
[0094] Step S3-1: Determine the direction vector:
[0095] For linear dimensions, if the dimension is associated with two parallel planes, the direction vector of the dimension is determined to be the normal vector of these two planes; if the dimension is associated with a cylindrical surface, the direction of the dimension is determined to be the direction of the cylinder's axis; if the dimension is a locating dimension, the direction of the dimension is determined to be perpendicular to the reference plane. For angular dimensions, the direction of the dimension is determined to be the direction of the rotation axis.
[0096] Step S3-2: Obtain the dimension direction vector. For linear dimensions, obtain the plane normal vector by obtaining the surface normal function or obtain the axis direction by calculating the curve tangent function; for angular dimensions, determine its rotation axis direction vector.
[0097] Step S3-3: Obtain the three axis unit vectors of the model's default coordinate system;
[0098] Step S3-4: Perform a dot product operation between the dimension direction vector and the three axial unit vectors of the default coordinate system and calculate the included angle;
[0099] Step S3-5: Classify the dimensions based on the angle calculation results and establish the association mapping between the classified dimensions and the coordinate system.
[0100] Based on the angle calculation results, the following classification rules are applied:
[0101] Step S3-5-1: When the angle between the dimension direction vector and a certain coordinate axis is close to 0° or 180°, and the angle between the dimension direction vector and the other two coordinate axes is close to 90°, it is determined that the dimension direction vector is parallel to the coordinate axis, and the dimension is classified as a linear dimension in the direction of the axis.
[0102] Step S3-5-2: For the dimension controlling the diameter of the cylinder, based on its classification in the axial direction, the dimension is further marked as the radial dimension;
[0103] Step S3-5-3: For angular dimensions, classify them uniformly as angular dimension types and record the specific direction of their rotation axis in the model coordinate system;
[0104] Step S3-5-4: For dimensions whose direction vectors are not parallel to any coordinate axis, they are classified as oriented dimensions, and their complete direction vector data is recorded;
[0105] Step S3-5-5: After classification, establish an association mapping between each type of dimension and its orientation information in the model coordinate system, store the orientation attributes and geometric parameters relative to the coordinate system for each dimension, and ensure that the geometric consistency and coordinate accuracy of the dimension data can be maintained when the model undergoes translation or rotation transformation.
[0106] Step S4: Output the feature and size information in a structured data format and attach model version information and timestamp;
[0107] Step S4-1: Organize the extracted feature information and size information according to a predefined data structure to form a complete data set containing model name, coordinate system information, feature list and size list;
[0108] Step S4-2: Attach model metadata to the dataset, including model version information, creation timestamp, author information, and unit of measurement;
[0109] Step S4-3: Convert the dataset into a specified structured format according to the output requirements, including JavaScript Object Notation (JSON), Extensible Markup Language (XML), or spreadsheet format Excel.
[0110] Step S4-4: Automatically perform data export operations through the programming interface, generate the corresponding data file, and save it to the specified storage path.
[0111] Step S5: Group the model data into process groups according to the preset process division strategy and generate lightweight sub-models and inspection item tables for each inspection station. The output files are available for subsequent information management system or MES system to call.
[0112] Step S5-1: According to the preset process division strategy, the extracted feature information and size information are grouped into processes according to the inspection station;
[0113] Step S5-2: Intelligently decompose the original 3D model and generate a corresponding lightweight sub-model for each process group. The lightweight sub-model retains only the features and size information related to that process.
[0114] Step S5-3: Generate a dedicated inspection item table for each inspection station based on the grouped dimensional information. The table includes dimensional identifiers, nominal values, tolerance requirements, and inspection method information.
[0115] Step S5-4: Associate and package the lightweight sub-model with the inspection item table, and forward it to the corresponding inspection station terminal through the manufacturing execution system;
[0116] Step S5-5: Implement the linkage display of the model and the inspection item on the inspection station terminal, and automatically highlight the model position corresponding to the current inspection item during the inspection process.
[0117] like Figure 1 The diagram shown is a system functional architecture diagram of the present invention. The system includes:
[0118] The model parsing module is used to access the target Creo 3D model and parse its model tree structure to obtain the current model object. It identifies each feature in the model and its associated size object by traversing the feature element tree.
[0119] The dimension extraction module is used to traverse the dimension objects associated with the feature and extract complete dimension information, including dimension values, tolerance upper and lower limits, parameter names, and attached geometric primitive information.
[0120] The classification mapping module is used to classify dimensions based on the extracted size information by calculating the size direction vector and mapping the size to the axis of the model's default coordinate system.
[0121] The data output module is used to output feature and size information in a structured data format and attach model version information and timestamps;
[0122] The manufacturing collaboration module is used to group model data into processes according to a preset process division strategy and generate lightweight sub-models and inspection item tables for each inspection station, which can then be called by the information management system or MES system.
[0123] The rules configuration module provides a graphical interface for users to set feature extraction rules, size classification rules, and process grouping strategies.
[0124] The system integration interface is used to enable low-level data interaction with the Creo application and data communication with external information management systems.
[0125] Example:
[0126] The implementation of this invention is based on the following development environment: the operating system is Windows 10 or above, the CAD platform is Creo Parametric 5.0, Creo secondary development is carried out using the Creo / TOOLKIT method, and C++ programs are written using the VS2022 development platform to call API functions to access model data, expand Creo functions, and perform feature recognition and process information extraction from the workpiece 3D model.
[0127] like Figure 2 As shown, the Creo 3D model feature extraction method in this embodiment includes the following four steps:
[0128] Step 1: Analyze the Creo model tree structure and identify features and associated dimensions;
[0129] Step 2: Iterate through the dimensional parameters using the Creo Toolkit API to extract attributes such as values, tolerances, and datums;
[0130] Step 3: Categorize dimensional information (such as geometric dimensions and assembly dimensions) and associate it with the model coordinate system;
[0131] Step 4: Generate structured data (JSON / XML / Excel), which can be exported to a database or information management system.
[0132] In step 1, the model tree in Creo is composed of features arranged in the order of their creation. It is a collection of all feature information in the model and also the basic starting point for obtaining accurate data information. When creating features in Creo, the system internally expresses the created features using a feature element tree structure, storing and displaying all feature information within the feature tree structure. Functions such as ProElementCollectionGet are used to traverse the feature element tree and access the feature objects to be extracted. The access process reads information sequentially from the solid, face, contour, edge, and point according to the B-Rep structure. Reading feature information is a process of traversing the entire solid according to the B-Rep structure: using the functions for traversing and accessing faces, contours, and lines, all faces of the part solid model are traversed; for traversed faces, all contours of that face are traversed; for traversed contours, all edges of that contour are traversed, until the endpoint information of all edges is finally obtained.
[0133] The specific process for feature extraction is as follows: First, connect to Creo and obtain the model, using ProMdlCurrentGet to get the part object. Next, traverse the model tree to obtain all features; the core function is ProSolidFeatVisit. Then, in the callback function, identify feature information: use ProFeatureIdGet to get the user ID of the feature displayed in the model tree, use ProFeatureInit to initialize the feature object, and obtain its internal unique identifier. Use ProFeatureTypeGet to get the feature type, and use ProFeatureNameGet to get the user-defined feature name. Features may be grouped, implicit, or hidden in the model tree. Use ProFeatureDisplay related functions to get their display status. The core of the model tree is the parent-child relationship; later-created features (child features) usually refer to earlier-created features (parent features). Use the ProFeatureRefsVisit function to traverse all other features or geometric primitives referenced by a feature. In the callback function, determine the type of reference and the referenced feature. By analyzing the references of each feature, a more detailed dependency graph than the graphical interface model tree is built in memory.
[0134] In step 2, for all dimension objects (ProDimension objects) contained in each feature, extract the metadata of the dimensions. Use ProParameterValueGet to get the numerical value of the dimension, use ProModelitemNameGet to get the parameter name of the dimension, then determine which (or which) geometric primitives this dimension controls. Use ProDimensionEntityGet to get the "leader" primitive to which the dimension is attached, and then infer the geometric elements it controls by querying the primitive's affiliation.
[0135] Regarding step 3, which involves classifying dimensions and associating them with the coordinate system, the specific implementation is as follows:
[0136] 1) Determine the "direction of action" of the dimension. For linear dimensions, if the dimension is associated with two parallel planes, the direction vector of the dimension is determined to be the normal vector of these two planes; if the dimension is associated with a cylindrical surface, the direction of the dimension is determined to be the direction of the cylinder's axis; if the dimension is a locating dimension, the direction of the dimension is determined to be perpendicular to the reference datum plane. For angular dimensions, the direction of the dimension is determined to be the direction of the rotation axis.
[0137] 2) Obtain the orientation vector. The dimension orientation vector is calculated using ProToolkit's geometric functions (e.g., using ProSurfaceNormalGet to obtain the plane normal, using ProCurveTangentEval to obtain the axis direction, etc.). This vector is in model space.
[0138] 3) Associating / Classifying with the Model Coordinate System. First, obtain the three axis unit vectors (X, Y, Z) of the model's default coordinate system (PRT_CSYS_DEF). Next, perform a dot product operation between the dimension direction vector obtained in step 2 and the three axis vectors of the coordinate system, and calculate the included angle. Then, classify according to the following rules:
[0139] Axial dimension classification: If the angle between the direction vector and a certain coordinate axis (such as the X-axis) is close to 0° or 180° (the absolute value of the dot product is close to 1, such as > 0.99), and the angle between the direction vector and other axes is close to 90°, then the dimension is classified as "X-direction dimension". Similarly, Y and Z-direction dimensions can be defined.
[0140] Radial / Diameter Dimension Classification: If the dimension controls the diameter of a cylinder, the dimension itself can be labeled as "radial dimension" after its direction (axis) is classified.
[0141] Angular dimension classification: Classified as "angular dimension" and its rotation axis direction is recorded (categorized into X, Y or Z axis).
[0142] Non-axial dimension classification: If the direction vector is not parallel to any principal axis, it can be classified as an "orientation dimension" and its direction vector is recorded.
[0143] Finally, the extracted Creo 3D model features are output in a structured format, supporting JSON, XML, or Excel formats. This example uses JSON format, and the output content format is as follows:
[0144] {
[0145] "model_name": "block.prt",
[0146] "coordinate_system": "PRT_CSYS_DEF",
[0147] "dimensions": [
[0148] {
[0149] "id": "d0",
[0150] "value": 20.0,
[0151] "type": "Linear",
[0152] "direction": "Z",
[0153] "tolerance": {"upper": 0.0, "lower": -0.1}
[0154] ...
[0155] {
[0156] "id": "d2",
[0157] "value": 50.0,
[0158] "type": "Linear",
[0159] "direction": "Y",
[0160] "tolerance": {"upper": 0.1, "lower": -0.1}
[0161] ...
[0162] }
[0163] In other embodiments, XML format output uses a DOM parser to generate data files conforming to a predefined XSD; Excel format output uses OLE automation or the LibXL library to create worksheets and populate data; version identifiers (such as "V1.0-20240520") and timestamp information are automatically added.
[0164] After extracting features from the Creo 3D model, this process information is sent to the inspection terminal to achieve collaboration with the manufacturing stage. Based on the existing inspection stations in the workshop, the information extracted is categorized, grouping the information corresponding to each process at each inspection station into a group. The workpiece model is then disassembled according to these process groups. Only the information corresponding to the specific process group is retained in the disassembled model, while all other information is deleted, thus achieving model lightweighting. Simultaneously, during the disassembly process, the inspection information is also grouped according to process, and an inspection item table is generated. This table, along with the lightweight model, is forwarded to the inspection station terminal via MES.
[0165] At each inspection station, a tablet computer is configured as the inspection terminal. The workpiece model displayed on the tablet only contains the model information corresponding to the measurement process of that station, thus significantly reducing the model size and allowing for smooth operation of the model on the tablet. The tablet also displays only the inspection items corresponding to that station in tabular form. During inspection, the model position corresponding to the current inspection item is highlighted for easy viewing by the inspection personnel.
[0166] In summary, based on the embodiments of this invention, this invention constructs a complete technical solution from design to manufacturing. Through deep integration with the Creo native interface, automated extraction of feature information and dimensional data is achieved; a hierarchical traversal mechanism based on boundary representation ensures the integrity and accuracy of geometric information extraction; innovative dimensional direction vector calculation and coordinate mapping algorithms establish an intelligent dimensional classification system; multi-format structured data output and lightweight model generation break down data barriers between design and manufacturing. This technical solution effectively solves industry pain points such as low efficiency of traditional manual extraction, loss of parametric information, and difficulties in system integration, providing manufacturing enterprises with a reliable solution for 3D model data extraction and utilization, significantly enhancing the reuse value of product design data, and strongly supporting enterprise digital transformation and intelligent manufacturing upgrades.
[0167] Those skilled in the art will understand that the above description is merely a preferred embodiment of the present invention, and the features described in the various embodiments and / or claims of this disclosure can be combined or combined in various ways, even if such combinations or combinations are not explicitly described in this disclosure. This is not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
[0168] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including both the preferred embodiments and all changes and modifications falling within the scope of the invention. Clearly, those skilled in the art can make various alterations and modifications to the invention without departing from its spirit and scope. Thus, if these modifications and modifications of the invention fall within the scope of the claims and their equivalents, the invention is also intended to include these modifications and modifications.
Claims
1. A method for feature extraction from a three-dimensional model based on ProToolkit, characterized in that, The method comprises the following steps: Step S1: accessing a target Creo three-dimensional model and parsing a model tree structure of the Creo three-dimensional model to obtain a current model object; identifying each feature and a size object associated with the feature in the model by traversing a feature element tree; Step S2: traversing the size object associated with the feature and extracting size information including a size value, a tolerance upper and lower limit, a parameter name, and information of a dependent geometric primitive; Step S3: based on the extracted size information, classifying the size in an axial direction by calculating a size direction vector and mapping the size to an axial direction of a default coordinate system of the model; Step S4: outputting the feature and the size information in a structured data format and attaching model version information and a time stamp; Step S5: grouping the model data according to a preset process division strategy and generating a lightweight sub-model and a detection item table for each detection station, and the output file is called by a subsequent information management system or an MES system.
2. The ProToolkit-based three-dimensional model feature extraction method according to claim 1, characterized in that, The step S1 comprises the following steps: Step S1-1: establishing a connection with a Creo application program and obtaining a current active three-dimensional model object; Step S1-2: recursively accessing each feature in the model tree through a ProFeatureRefsVisit callback mechanism function, traversing according to a feature creation order, identifying core information of each feature, including obtaining a user ID of the feature displayed in the model tree, initializing a feature object to obtain an internal unique identifier, obtaining a type classification of the feature, and obtaining a user-defined feature name; Step S1-3: traversing the feature element tree according to a structure mode of a boundary representation method, and sequentially accessing geometric information of an entity, a surface, and a contour level; Step S1-4: obtaining a display state of the identified feature through a feature display related function, including whether the feature is hidden, concealed, or suppressed; using a traversed feature reference function to traverse all other features or geometric primitives referenced by the feature, and constructing a detailed feature dependency graph in memory by analyzing the reference relationship.
3. The ProToolkit-based three-dimensional model feature extraction method according to claim 2, characterized in that, The step S1-2 specifically comprises: In the callback mechanism function, a ProFeatureInit function is used to initialize the current feature object to obtain an internal unique identifier, thereby preventing feature confusion; A ProFeatureIdGet function is used to obtain a user ID of the feature displayed in the model tree, so as to facilitate manual identification and subsequent reference; A ProFeatureTypeGet function is used to determine the feature type, so as to distinguish different geometric construction methods; Meanwhile, a ProFeatureNameGet function is used to obtain a user-defined feature name, so as to enhance the understanding of the design intention.
4. The ProToolkit-based three-dimensional model feature extraction method according to claim 2, characterized in that, The step S1-3 specifically comprises: Step S1-3-1: traversing all surfaces of a part entity model through a ProSurfaceVisit callback mechanism function to obtain geometric parameters and topological information of each surface; Step S1-3-2: for each traversed surface, a ProContourVisit function is used to traverse all contours contained in the surface; Step S1-3-3: for each identified contour, a ProEdgeVisit function is used to traverse all boundary edges of the contour; Step S1-3-4: Obtain the endpoint coordinate information of all boundary edges using the ProPointVisit function, and complete the complete dimension object extraction from the entity to the point.
5. The ProToolkit-based three-dimensional model feature extraction method of claim 1, wherein, The step S2 comprises the following steps: Step S2-1: Based on the identified features, initialize the dimension traversal environment, obtain all dimension objects associated with each feature through the ProFeatureDimensionGet function, and initialize the dimension handle using the ProDimensionInit function to verify the validity of the dimension object; Step S2-2: Traverse each dimension object in turn through a loop structure, extract the dimension value attribute including the nominal value and the actual value using the ProParameterValueGet function, and perform unit conversion through the ProUnitSystemGet function to ensure data standardization; Step S2-3: Extract the dimension tolerance attribute including the upper deviation, the lower deviation and the tolerance type using the ProToleranceGet function, and mark the dimension without tolerance; Step S2-4: Obtain the dimension parameter name through the ProModelitemNameGet function, and obtain the geometry primitive associated with the dimension lead using the ProDimensionEntityGet function, and then infer the geometry element attribution through the ProSurfaceOwnerGet or ProEdgeOwnerGet function; Step S2-5: Perform logical verification on the extracted dimension information, including value range checking and tolerance consistency checking, and store the data in the memory data structure after verification.
6. The Pro Toolkit based three-dimensional model feature extraction method of claim 1, wherein, The step S3 comprises the following steps: Step S3-1: Determine the direction vector: For linear dimensions, if the dimension is associated with two parallel planes, the direction vector of the dimension is determined as the normal vector of the two planes; if the dimension is associated with a cylindrical surface, the direction of the dimension is determined as the axis direction of the cylinder; if the dimension is a positioning dimension, the direction of the dimension is determined as the direction perpendicular to the reference datum plane. For angle dimensions, the direction of the dimension is determined as the direction of the rotation axis; Step S3-2: Obtain the dimension direction vector, for linear dimensions, obtain the plane normal vector through the surface normal function or obtain the axis direction through the curve tangent function; for angle dimensions, determine the rotation axis direction vector; Step S3-3: Obtain the three axial unit vectors of the default coordinate system of the model; Step S3-4: Perform dot product operation on the dimension direction vector and the three axial unit vectors of the default coordinate system and calculate the included angle; Step S3-5: Classify the dimensions based on the included angle calculation result and establish the association mapping of the classified dimensions and the coordinate system.
7. The Pro Toolkit based three-dimensional model feature extraction method of claim 6, wherein, The step S3-5 specifically comprises: According to the included angle calculation result, the following classification rules are executed: Step S3-5-1: When the included angle between the dimension direction vector and a coordinate axis is close to 0° or 180°, and the included angles with the other two coordinate axes are both close to 90°, it is determined that the dimension direction vector is parallel to the coordinate axis, and the dimension is classified as a linear dimension in the direction of the axis; Step S3-5-2: For the size of the control cylinder diameter, further mark it as a radial size on the basis of its classification in the axial direction; Step S3-5-3: For the angular size, uniformly classify it as an angular size type, and record the specific direction of its rotation axis in the model coordinate system; Step S3-5-4: For the size whose direction vector is not parallel to any coordinate axis, classify it as an oriented size, and record its complete direction vector data; Step S3-5-5: After classification, associate each size with its orientation information in the model coordinate system, store the direction attribute and geometric parameters of each size relative to the coordinate system, and ensure that the geometric consistency and coordinate accuracy of the size data are maintained when the model is translated or rotated.
8. The Pro Toolkit based three-dimensional model feature extraction method of claim 1, wherein, The step S4 is specifically: Step S4-1: Organize the extracted feature information and size information according to the pre-defined data structure to form a complete data set containing model name, coordinate system information, feature list and size list; Step S4-2: Attach model metadata to the data set, including model version information, creation timestamp, author information and unit of measurement; Step S4-3: Convert the data set to a specified structured format according to the output requirements, including JavaScript Object Notation format JSON, Extensible Markup Language format XML or Excel format; Step S4-4: Automatically perform data export operations through a programming interface, generate corresponding data files and save them to a specified storage path.
9. The Pro Toolkit based three-dimensional model feature extraction method of claim 1, wherein, The step S5 is specifically: Step S5-1: According to the preset process division strategy, group the extracted feature information and size information according to the detection station; Step S5-2: Intelligently disassemble the original three-dimensional model, and generate a corresponding lightweight sub-model for each process group, which only retains the features and size information related to the process; Step S5-3: Generate a detection item table specific to each detection station based on the grouped size information, which includes size identification, nominal value, tolerance requirement and detection method information; Step S5-4: Package the lightweight sub-model with the detection item table and forward it to the corresponding detection station terminal through the manufacturing execution system; Step S5-5: Implement the linkage display of the model and the detection item on the detection station terminal, and automatically highlight the model position corresponding to the current detection item during the detection process.
10. The feature extraction system of the ProToolkit-based three-dimensional model feature extraction method according to claim 1, characterized by, It includes: A model analysis module for accessing a target Creo three-dimensional model and analyzing its model tree structure, obtaining the current model object, and identifying each feature and its associated size object in the model by traversing the feature element tree; A size extraction module for traversing the size object associated with the feature and extracting complete size information including size value, tolerance upper and lower limits, parameter name, and attached geometric primitive information; A classification mapping module for classifying the size information based on the extracted size information by calculating the size direction vector and mapping the size to the axial direction of the model default coordinate system; a data output module configured to output the feature and dimension information in a structured data format and attach model version information and a timestamp thereto; a manufacturing collaboration module configured to group the model data according to a preset process division strategy, generate lightweight sub-models and inspection item tables for each inspection station, and provide the subsequent information management system or MES system with the lightweight sub-models and the inspection item tables; a rule configuration module configured to provide a graphical interface for a user to set feature extraction rules, dimension classification rules, and process grouping strategies; a system integration interface configured to realize underlying data interaction with the Creo application program and data communication with an external information management system.