Model processing method, model generation method, electronic device, and storage medium
By extracting features and converting them into model reconstruction instructions using a pre-defined function library, the problem of low efficiency in 3D model reconstruction is solved, achieving automated conversion and dynamic reconstruction, thus improving user experience and the application efficiency of heterogeneous software platforms.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- MISUMI (CHINA) PRECISION MASCH TRADING CO LTD
- Filing Date
- 2026-03-30
- Publication Date
- 2026-07-14
Smart Images

Figure CN122391469A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of three-dimensional model processing technology, specifically to a model processing method, a model generation method, an electronic device, and a computer-readable storage medium. Background Technology
[0002] In the field of industrial design and manufacturing, 3D computer-aided design software (such as SolidWorks) is typically used to digitally model various workpieces. To improve the development efficiency of standard parts libraries, it is often necessary to achieve parametric-driven generation of workpiece models within the target runtime environment.
[0003] Currently, common techniques for migrating 3D data or reconstructing models between different software platforms include exchanging files using common 3D geometric data formats, or manually developing and remodeling the target software based on the design parameters of the original model. For example, this involves extracting the geometric features of the workpiece model and manually writing the corresponding geometric construction algorithm in the target geometry engine's interface. In these processes, the parametric logical description of the workpiece model and its feature parsing under different software environments typically require significant manual intervention for feature decomposition and code debugging.
[0004] Meanwhile, some existing 3D data conversion schemes mainly focus on the static restoration of geometric shapes, making it difficult to achieve efficient dynamic reconstruction of workpiece models in the target operating environment. This affects the application flexibility and conversion efficiency of standard parts libraries across heterogeneous software platforms. Summary of the Invention
[0005] To address the above problems, this invention provides a model processing method, a model generation method, an electronic device, and a computer-readable storage medium, which at least solve the problems of low efficiency in 3D model reconstruction and poor user experience in the prior art.
[0006] In one or more embodiments of this application, a model processing method is provided, including a feature extraction step and a data processing step.
[0007] Feature extraction steps: Based on the preset features of the workpiece model, obtain the feature parameters corresponding to the workpiece model and the preset features. The preset features include geometric features. Data processing steps: Construct intermediate data based on preset features and corresponding parameters, and transform the intermediate data into model reconstruction instructions through a preset function library; The model reconstruction instruction includes a parameter interface, which is used to reconstruct the workpiece model based on the numerical update of the feature parameters.
[0008] Through the above methods, the model processing method transforms the feature parameters of the 3D model into executable instruction code via feature mapping logic, realizing automated conversion from the design end to the application end, reducing the tedious work of manual disassembly and remodeling, and providing the basic logic for subsequent parameter-driven processing.
[0009] Optionally, the feature extraction step includes: extracting the geometric features and feature parameters corresponding to the workpiece model based on the feature construction history of the workpiece model.
[0010] By using the above methods, when extracting features, reading the model's construction history and feature data can more accurately restore the designer's original modeling ideas and improve the consistency of the reconstructed model.
[0011] Optionally, in the feature extraction step, geometric features include coordinate information, size information, orientation information, and sketch outline information.
[0012] Optionally, the data processing steps include: establishing a mapping relationship between preset features and internal functions in a preset function library; using the feature parameters corresponding to the preset features as input variables of the corresponding internal functions and logically mapping them with the parameter interface; and calling the internal functions according to the mapping relationship to generate model reconstruction instructions.
[0013] This approach establishes a direct link between design parameters and code execution logic, reconstructing graphics through mathematical information rather than simple geometric shapes, effectively reducing file size and improving processing smoothness.
[0014] Optionally, the model reconstruction instructions can be configured as a dynamic library file containing parameter data and generation logic.
[0015] In some embodiments, this application also provides a model generation method, including: Instruction acquisition steps: Acquire the model reconstruction instructions of the workpiece model. The model reconstruction instructions are derived from intermediate data through a preset function library. The intermediate data includes the preset features of the workpiece model and the corresponding feature parameters. The model reconstruction instructions include parameter interfaces associated with the feature parameters. Model reconstruction steps: Run the model reconstruction command in the target runtime environment to obtain the value of the feature parameter by calling the parameter interface or to determine the value of the feature parameter as the preset value, and reconstruct the workpiece model based on the preset feature and the corresponding feature parameter value.
[0016] Through the above methods, the model generation approach allows target software to dynamically generate 3D entities by reading mathematical information and logic from instruction files. Compared to existing technologies that can only display static models, this application can redraw the model in real time based on parameters, greatly improving the development efficiency and flexibility of standard parts libraries in heterogeneous software platforms.
[0017] Optionally, the model reconstruction step further includes: determining whether the parameter interface has received updated values of the feature parameters; if so, re-executing the instruction acquisition step to obtain and run the model reconstruction instruction corresponding to the updated value; if not, directly running the model reconstruction instruction corresponding to the preset value.
[0018] Through the above methods, this solution achieves a closed-loop logic driven by parameterization, ensuring that the model can be dynamically reconstructed based on real-time values input by the user, while also providing the ability to restore the basic model under default values.
[0019] Optionally, the target runtime environment includes a geometry engine, and the model reconstruction steps include: calling the geometry engine's API interface to reconstruct the workpiece model based on preset features and feature parameters.
[0020] In some embodiments, this application also provides an electronic device that stores a computer program, which, when executed by the processor of the electronic device, applies the model processing method and / or model generation method described above.
[0021] In some embodiments, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-described model processing method and / or model generation method. Attached Figure Description
[0022] Figure 1 This is a flowchart of the model processing method in the embodiments of this application.
[0023] Figure 2 This is another flowchart of the model processing method in the embodiments of this application.
[0024] Figure 3 This is a flowchart of the model generation method in the embodiments of this application.
[0025] Figure 4 This is another flowchart of the model generation method in the embodiments of this application.
[0026] Figure 5 This is an architecture diagram of the model processing system executed by the electronic device in the embodiments of this application. Detailed Implementation
[0027] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0028] <First Implementation Method> refer to Figure 1 This application provides a model processing method that can be applied to server software that requires automated conversion and reconstruction of standard artifact libraries. The model processing method includes a feature extraction step S1 and a data processing step S2.
[0029] Feature extraction step S1: First, acquire the feature data of the workpiece model. Specifically, this involves: based on preset features of the workpiece model, acquiring the feature parameters corresponding to those preset features, including geometric features. These feature parameters reflect the specific numerical and spatial logic of the workpiece model during its construction process. By reading the original model file of the workpiece model, each step in the workpiece model's construction history can be extracted; for example, identifying stretching features or chamfering features.
[0030] Specifically, geometric features can include coordinate information, dimension information, orientation information, and sketch outline information. Coordinate information determines the starting position of the geometric feature in space; for example, it can be expressed as vectors or matrices, determining the absolute position or relative displacement transformation of the feature within the target operating environment. Dimension information defines the size of the geometric feature; for example, it can include length, distance, radius, and angle. Orientation information guides the extension path of the geometric feature; for example, it can be expressed as angles, vectors, or matrices, defining its orientation and spatial rotation. Sketch outline information defines the cross-sectional shape and topological relationships of the geometric feature; for example, it can be expressed as vectors, lengths, radii, and angles, defining boundary lines and their related dimensional constraints. It should be noted that geometric features are the physical basis of the 3D model entity, and the aforementioned geometric information can exist in the form of floating-point numbers or vectors.
[0031] It should be noted that, in addition to the geometric features mentioned above, preset features may also include topological features, material property features, or assembly constraint features, etc.
[0032] Data processing step S2: Construct intermediate data based on preset features and corresponding feature parameters. The intermediate data can adopt a lightweight data exchange format, such as JSON, an intermediate file format. It should be noted that besides intermediate file formats, intermediate data can also be represented as a memory buffer, database records, or streaming data packets. Converting geometric information to this intermediate format enables data decoupling between different software platforms.
[0033] Based on the constructed intermediate data, a pre-defined function library transforms the intermediate data into model reconstruction instructions. This pre-defined function library encapsulates the underlying geometry engine functions as internal functions. The data processing involves establishing a mapping relationship between pre-defined features and internal functions, using feature parameters as input variables for the internal functions, and logically mapping them to the parameter interface. For example, when a stretching feature is identified, its cross-sectional coordinates, stretching depth, and direction are extracted and filled into the corresponding stretching function. It should be noted that, in addition to the pre-defined function library, script interpreters, macro instruction sets, or direct application programming interfaces can also be used for mapping. This mapping mechanism realizes the transformation from static geometric description to dynamically executable code.
[0034] Model reconstruction instructions can include a parameter interface. These instructions can be encapsulated into an executable file containing mathematical information and generation logic, for example, a dynamic link library (DLL). It should be noted that besides DLLs, model reconstruction instructions can also be executable scripts, source code segments, or pre-compiled binary modules. Specifically, the initial state of a model reconstruction instruction is JSON, which can be converted into source code, and the source code can be compiled into a DLL file. The parameter interface is used to receive numerical updates to feature parameters, thereby driving the internal functions to re-run and achieve a further reconstruction of the workpiece model.
[0035] It should be noted that, besides the parameter interface, alternative interaction methods include configuration file listening, shared memory reading, or message queue subscription. Through the parameter interface, the system no longer needs to create separate files for each model specification; instead, it reconstructs the graphics from mathematical information.
[0036] This implementation addresses the problem of high reliance on manual intervention and poor model reconstruction flexibility in existing 3D model conversion processes by transforming preset features of the workpiece model into model reconstruction instructions with parameter interfaces. Traditional static conversion methods can only restore the geometric shape and cannot preserve the parametric logic of the original model. This implementation defines feature parameters as variables of internal functions in a preset function library, giving the reconstruction instructions logical attributes. When the values of the feature parameters change, the system can automatically draw the updated model using the target geometry engine by running instructions from the preset function library, eliminating the need for manual remodeling.
[0037] Through the above methods, automated conversion from the design phase to the application phase is achieved. The model reconstruction instructions encapsulate geometric information and logic, effectively reducing the size of the model file, improving the efficiency of data transmission and processing between heterogeneous software platforms, and achieving a high degree of model lightweighting.
[0038] Specifically, in combination Figure 1 and refer to Figure 2 This embodiment illustrates the above model processing method through a specific stretching function processing flow. Figure 2 The stretching function processing flow shown illustrates the specific process of converting stretching features in a workpiece model into model reconstruction instructions. This stretching function processing flow can be implemented using the model processing system in the third embodiment described below.
[0039] Feature extraction step S1: First, open the workpiece model file with the .SLDPRT extension. By traversing the feature tree of the workpiece model, obtain the extrusion features and automatically ignore non-solid geometric features such as datum planes and origins.
[0040] Next, the sub-step of acquiring sketch outline data is performed. The sketch information in the extrusion feature is read, the edge data in the sketch is read, sorted and deduplicated, and the two-dimensional sketch data is converted into three-dimensional spatial data.
[0041] Subsequently, the refinement and extraction of feature parameters proceeds, specifically including: "Direction 1" Data Extraction: Calculates and outputs the stretch length. Its calculation logic includes stretching to the next face, stretching to a vertex, stretching to a specified face, stretching to a specified distance from a specified face, or stretching to a solid. Simultaneously, it acquires the stretch reference objects (such as points, faces, solids, distances, etc.) and measures the distance between the two objects. Furthermore, it needs to determine the specific pattern of the stretch length, such as given depth, complete penetration, or bilateral symmetry.
[0042] Draft and "Direction 2" processing: Output the draft angle and determine whether to draft outwards; if "Direction 2" exists, repeat the above data extraction logic for "Direction 1"; if "Direction 2" does not exist or data extraction has been completed, merge the data extraction results for "Direction 1".
[0043] Thin-walled feature processing: If thin-walled features are involved, the offset direction, offset thickness, and top cap information are extracted.
[0044] Data processing step S2: The extracted feature parameters are encapsulated into preset intermediate data, which can be represented using a data structure. For example... Figure 2 As shown, the intermediate data can be represented as a structure named "stExtrusion", which contains fields such as feature type (feature_name), contour data (loop_data), first stretch length (depth1), first stretch direction (direction1), entity merging result (merge_result), first draft angle (draft_angle1), and thin wall feature (thin_wall).
[0045] Finally, a mapping relationship between the intermediate data and geometry engine functions is established using a pre-defined function library, such as encapsulating ACIS functions, to ultimately output model reconstruction instructions. It should be noted that the pre-defined function library can be encapsulated based on the OpenCascade geometry engine.
[0046] pass Figure 2 The refined extraction and encapsulation logic shown can accurately transform complex stretching geometric relationships into mathematical logic, ensuring the geometric accuracy of model reconstruction instructions during reconstruction.
[0047] <Second Implementation Method> refer to Figure 3 This embodiment provides a model generation method that can be applied to client software or target operating platform. The model generation method includes an instruction acquisition step S3 and a model reconstruction step S4.
[0048] Step S3: Obtain the model reconstruction instructions for the workpiece model. These instructions are derived from intermediate data through a preset function library. The intermediate data includes the workpiece model's preset features and corresponding feature parameters. The model reconstruction instructions include parameter interfaces associated with the feature parameters. It should be noted that, besides remotely downloading model reconstruction instructions from server software, acquisition methods can also include reading them from local storage media, receiving them via streaming media protocols, or retrieving them from a cloud resource pool. The model reconstruction instructions integrate the workpiece model's geometric reconstruction logic and parameter interaction attributes.
[0049] Model refactoring instructions can contain encapsulated function logic. Model refactoring instructions can be represented as binary executable code, and they also act as a translation medium between the original design data and the target runtime platform.
[0050] Model reconstruction step S4: Run the model reconstruction command in the target runtime environment. The target runtime environment may include the target CAD software, a standalone 3D viewer, a web-based geometry display engine, or an augmented reality display platform. Model reconstruction step S4 obtains the values of feature parameters by calling the parameter interface, or, if no numerical input is received, determines the values of the feature parameters to be preset values, thereby reconstructing the workpiece model based on the preset features and the corresponding feature parameter values.
[0051] Specifically, in combination Figure 3 and refer to Figure 4 The model reconstruction step S4 may also include the following steps: In step S41, based on real-time monitoring of the interaction status of feature parameters, it is determined whether the parameter interface has received the updated value of the feature parameters; if so, step S3 is re-executed to obtain the model reconstruction instruction corresponding to the updated value as the model reconstruction instruction to be run; if not, the current model reconstruction instruction is determined as the model reconstruction instruction to be run.
[0052] In instruction execution step S42, based on the model reconstruction instruction to be executed determined in judgment step S41, the model reconstruction instruction is executed in the target runtime environment. It should be noted that, in addition to the triggering logic described above, the triggering conditions for re-acquiring the instruction can also include external event triggering, time period triggering, or state changes of associated components. This cyclical detection and re-acquisition mechanism ensures that the reconstruction of the workpiece model on the client side is real-time and parameter-driven.
[0053] The target runtime environment may include a geometry engine. Model reconstruction step S4 may also include: calling the geometry engine's API interface to reconstruct the workpiece model based on preset features and feature parameters. It should be noted that, in addition to the general geometry engine interface, the calling object may also include a graphics processor acceleration interface, a specific modeling algorithm library, or a custom rendering plugin. By converting the generation logic in the model reconstruction instructions into drawing commands recognizable by the geometry engine, accurate geometry can be restored in the target runtime environment.
[0054] This implementation addresses the issues of low model reconstruction efficiency and difficulty in dynamic interaction between heterogeneous platforms by running model reconstruction instructions that include generation logic. Existing file exchange schemes typically only transmit static mesh or boundary representation data, lacking parametric reconstruction capabilities. This implementation establishes a dynamic generation system through model reconstruction instructions, which not only contain geometric information but also provide an interactive window through a parameter interface.
[0055] When a user inputs updated values for feature parameters through the parameter interface, the system can trigger an update of the instruction and redraw the workpiece model using the generation logic. This approach avoids repetitive modeling for workpieces of different specifications. This implementation utilizes the mathematical logic in the model reconstruction instruction to reconstruct the model in real time within the target runtime environment, ensuring not only the geometric accuracy of the workpiece model but also significantly reducing storage space usage. By calling the geometry engine to restore preset features, efficient reconstruction of the original modeling intent is achieved on the client side.
[0056] This configuration allows for dynamic model generation by modifying parameters, significantly improving the development efficiency and application flexibility of the standard workpiece library. It enables flexible reconstruction of workpiece models on target platforms, facilitating standardized automated production. The lightweight nature of the model reconstruction instructions reduces network bandwidth requirements, and the coordination between the parameter interface and the generation logic allows for parametric deformation of workpiece models according to actual needs, greatly expanding the applicability of the standard workpiece library in different application environments.
[0057] <Third Implementation Method> This embodiment provides an electronic device, which can be a high-performance computing server, workstation, or cloud computing node of a server nature. The electronic device typically includes a processor and a memory in its structure.
[0058] The memory stores the computer program that implements the model processing method. The processor executes the computer program. Specifically, the memory can store the original 3D design file of the workpiece model, a preset function library, and the generated intermediate data. When the processor executes the above-mentioned model processing method, it can efficiently map the preset features and extracted feature parameters to the preset function library.
[0059] By deploying model processing methods on server-side electronic devices, the high-performance computing power of servers can be leveraged to achieve extremely high throughput in conversion tasks involving large-scale standard parts libraries. By centralizing the computationally intensive feature extraction and instruction generation processes on the electronic devices, the computational burden on the client side is effectively reduced, ensuring the stability and consistency of the model reconstruction instruction generation process.
[0060] Combination Figure 1 and refer to Figure 5 The electronic device provided in this embodiment can be configured to execute a model processing system, which implements the above-described model processing method through the coordinated operation of multiple integrated functional modules. Figure 5 The overall architecture of the model processing system in this application reflects the general logic of data conversion between heterogeneous software platforms.
[0061] On the input side, this application supports the access of various workpiece models, including but not limited to SolidWorks models, ZW3D models, CATIA models, and Creo models. Through a specific API interface (e.g., SWAPI), the model processing system performs feature extraction step S1 to convert workpiece models from different sources into intermediate data in a unified format.
[0062] In this embodiment, the intermediate data is encapsulated in JSON format to describe the modeling process and feature information of the workpiece model. Using JSON format not only makes the data architecture clear and easy to maintain, but also decouples the data from the specific CAD software, greatly improving the scalability of the model processing system.
[0063] On the output side, the model processing system uses a pre-defined function library to transform intermediate data in JSON format into model reconstruction instructions adapted to different target runtime environments. It should be noted that these model reconstruction instructions can be expressed as function call code targeting different geometry engine kernels, such as ACIS code, OpenCascade code, Parasolid code, or custom code. Figure 5 The MSM_Kernel code in it.
[0064] This architecture achieves the technical effect of "extract once, reconstruct on multiple platforms". The server only needs to maintain a standard JSON format, and can restore the workpiece model in different geometry engines through the translation of the preset function library.
[0065] <Fourth Implementation Method> This embodiment provides an electronic device, which can be a client-type mobile terminal, personal computer, or industrial handheld terminal. The electronic device may include a display component, an input component, a memory, and a processor.
[0066] The memory stores the computer program that implements the model generation method. The processor runs the model reconstruction instructions in the target runtime environment. The display component can be used to present the reconstructed workpiece model entity in real time. The input component can be used to receive updated values input by the user through a parameter interface. For example, the input component can be a touch screen, keyboard, mouse, or a voice recognition module and gesture sensing sensor; this application does not limit this.
[0067] By deploying the model generation method on client-side terminal devices, dynamic reconstruction of workpiece models in the application environment was achieved. Due to the lightweight nature of the model reconstruction instructions, even on mobile electronic devices with relatively limited computing power, the generation logic within the instructions can quickly invoke the local geometry engine to reconstruct complex 3D geometric features, greatly enhancing the interactive experience of 3D models in mobile offices and construction sites.
[0068] <Fifth Implementation Method> This embodiment provides a computer-readable storage medium. The computer-readable storage medium stores a computer program. When the computer program is executed by a processor, it implements the model processing method described in the above embodiment. In some embodiments, when the computer program is executed by a processor, it may also implement the model generation method described in the above embodiment.
[0069] This embodiment uses a computer-readable storage medium as a carrier, enabling the model reconstruction instructions containing generation logic to be stored and distributed with minimal space usage. Compared to storing original SolidWorks files or CAD design files that can easily reach hundreds of megabytes, the model reconstruction instructions processed and stored by the computer program of this application only contain core mathematical logic, significantly reducing storage costs and improving the transmission efficiency of model data in narrow bandwidth network environments, while ensuring the data security and integrity of model assets during long-term storage.
[0070] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A model processing method, characterized in that, include: The feature extraction step involves obtaining feature parameters corresponding to the workpiece model and the preset features based on the preset features of the workpiece model. The preset features include geometric features. The data processing steps involve constructing intermediate data based on the preset features and corresponding feature parameters, and then converting the intermediate data into model reconstruction instructions using a preset function library. The model reconstruction instruction includes a parameter interface for reconstructing the workpiece model based on the numerical update of the feature parameters.
2. The model processing method according to claim 1, characterized in that, The feature extraction steps include: Based on the feature construction history of the workpiece model, the geometric features and feature parameters corresponding to the workpiece model are extracted.
3. The model processing method according to claim 1 or 2, characterized in that, In the feature extraction step, the geometric features include coordinate information, size information, orientation information, and sketch outline information.
4. The model processing method according to claim 1, characterized in that, The data processing steps include: Establish a mapping relationship between the preset features and the internal functions in the preset function library; The feature parameters corresponding to the preset features are used as input variables of the corresponding internal functions, and logically mapped and associated with the parameter interface. The internal function is invoked based on the mapping relationship to generate the model reconstruction instruction.
5. The model processing method according to claim 1 or 4, characterized in that, The model reconstruction instructions can be configured as a dynamic library file containing parameter data and generation logic.
6. A model generation method, characterized in that, include: The instruction acquisition step involves acquiring the model reconstruction instruction of the workpiece model. The model reconstruction instruction is derived from intermediate data through a preset function library. The intermediate data includes the preset features and corresponding feature parameters of the workpiece model. The model reconstruction instruction includes a parameter interface associated with the feature parameters. The model reconstruction step involves running the model reconstruction instruction in the target operating environment to call the parameter interface to obtain the value of the feature parameter or determine the value of the feature parameter as a preset value, and reconstructing the workpiece model based on the preset feature and the corresponding value of the feature parameter.
7. The model generation method according to claim 6, characterized in that, The model reconstruction step also includes: Determine whether the parameter interface has received the updated value of the feature parameter; If yes, then the instruction acquisition step is re-executed to obtain and run the model reconstruction instruction corresponding to the updated value; otherwise, the model reconstruction instruction corresponding to the preset value is run directly.
8. The model generation method according to claim 6, characterized in that, The target runtime environment includes a geometry engine, and the model reconstruction steps include: The workpiece model is reconstructed by calling the API interface of the geometry engine based on the preset features and the feature parameters.
9. An electronic device, characterized in that, The electronic device stores a computer program, which, when executed by the processor of the electronic device, applies the model processing method of any one of claims 1-5, and / or the model generation method of any one of claims 6-8.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the model processing method as described in any one of claims 1-5, and / or the model generation method as described in any one of claims 6-8.