Method and device for measuring lightweight model in cutting simulation and storage medium
By analyzing NC programs and performing solid cutting simulation, identifying and correlating triangular grids and feature data, the problem of lightweight model measurement difficulties in three-dimensional industrial software is solved, and high accuracy and high efficiency measurement effects are achieved.
Patent Information
- Application Number
- CN202411737569.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2025-04-08
- Estimated Expiration
- 2044-11-29
AI Technical Summary
Existing three-dimensional industrial software is difficult to measure the center distance, arc radius, hole spacing and other measurements of lightweight models after cutting simulation, especially when geometric data has been lost.
By analyzing the NC program, solid cutting simulation is performed, geometric data of continuous instructions is identified, relevant geometric information and feature data are extracted, triangle grids and feature data are associated, and measurement is performed using adaptive measurement methods.
Accurate measurement of lightweight models after cutting simulation is achieved, avoiding the problem of random sampling in traditional methods and improving the accuracy and efficiency of measurement.
Smart Images

Figure CN119782147A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of three-dimensional industrial software, and in particular to a measurement method, device and storage medium for a lightweight model in cutting simulation. Background Art
[0002] In order to help users accurately grasp the size of 3D models, 3D industrial software usually provides corresponding measurement tools, such as straight line measurement tools, angle measurement tools, coordinate measurement tools, etc. These tools can not only provide point-to-point, point-to-line, line-to-line, line-to-plane, and plane-to-plane distance measurement functions, but also provide advanced measurement functions such as circle center distance, arc radius, and hole spacing.
[0003] However, for lightweight models in 3D industrial software, geometric data already exists in the form of triangular meshes, and the original feature data (such as arcs, cylinders, curved surfaces, etc.) has been lost, making it difficult to measure the center distance, arc radius, hole spacing, etc. In these scenarios, features such as arc surfaces, cylindrical surfaces, and circular holes are generally identified through feature recognition, and then the corresponding feature data (such as the center of the circle, the axis, the axis, etc.) are constructed, and finally related measurements are performed based on the reconstructed feature data. Summary of the invention
[0004] The purpose of the present invention is to solve the shortcomings of the prior art and provide a solution to measure the lightweight results after cutting simulation to meet the needs of verifying the cutting simulation results.
[0005] To achieve the above object, the present invention provides a method for measuring a lightweight model in cutting simulation, and the specific steps are as follows:
[0006] S1: Analyze each NC program;
[0007] S2: Perform solid cutting simulation according to each NC instruction;
[0008] S3: Perform geometric fitting or data analysis on the geometric data of the continuous instructions in the program segment to identify the features corresponding to the program segment;
[0009] S4: data association is performed on the newly generated triangular mesh in the solid cutting simulation in S2, the relevant geometric information extracted in step 3, and the features identified in step 4;
[0010] S5: When the measuring tool interacts with the triangular mesh, an adapted measuring method is used for measurement according to the information associated in step S5.
[0011] Preferably, the step S1 specifically includes: each program segment starts with code O+program number, and each NC instruction in the program segment is parsed.
[0012] Preferably, the step S2 further includes a step S21, and the step S21 is specifically as follows:
[0013] S21: If it is a G0 command, the tool position is updated directly; if it is a G1 command, the tool position is updated and solid cutting simulation such as Boolean operations is performed. The simulation results will change the shape of the workpiece and generate a new triangular mesh.
[0014] Preferably, the step S2 further includes a step S22, and the step S22 is specifically as follows:
[0015] S22: If it is a G2 / G3 command, the tool position is updated and solid cutting simulation such as Boolean operations is performed. The simulation results will change the shape of the workpiece and generate a new triangular mesh.
[0016] Preferably, the step S2 further includes a step S23, and the specific details of the step S23 are as follows:
[0017] S23: If it is a G2 or G3 command, extract the relevant geometric information of the arc center and radius from the command.
[0018] Preferably, the step S5 is specifically as follows: when the feature corresponding to the triangular mesh is an arc surface, an arc surface measurement module is used to display the center and radius of the circle; when the feature corresponding to the triangular mesh is a circular hole, a circular hole measurement module is used to display the central axis and radius of the circular hole.
[0019] The present invention also provides a computer device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above method when executing the program.
[0020] The present invention also provides a computer-readable storage medium on which a computer program is stored, and the program implements the steps of the above method when executed by a processor.
[0021] Compared with the prior art, the technical solution proposed in this application has the following beneficial effects:
[0022] Correctness advantage:
[0023] The method of extracting machining features by geometric fitting and analysis of data in continuous instructions of NC code avoids the randomness of local sampling of triangular mesh vertices in traditional methods, and can more accurately obtain the type and basic data of machining features.
[0024] Processing speed advantage:
[0025] The method of extracting machining features by geometric fitting and analysis of data in continuous instructions of NC code avoids the low efficiency of identifying features based on a large amount of geometric information in lightweight models in traditional methods. In addition, the NC code may already contain the basic data of the feature. By associating the triangular mesh and the basic data of the feature, the process of calculating the feature size by the measurement function can be reduced. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] Other features, objects and advantages of the present invention will become more apparent from the detailed description of non-limiting embodiments made with reference to the following drawings:
[0027] Figure 1 It is a schematic diagram of the method of the present invention;
[0028] Figure 2 It is a code schematic diagram of the present invention. DETAILED DESCRIPTION
[0029] The following will clearly and completely describe and discuss the technical solutions in the embodiments of the present invention in conjunction with the drawings of the present invention. Obviously, what is described here is only a part of the examples of the present invention, not all the examples. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0030] It should be noted that when a component is referred to as being "fixed to" another component, it may be directly on the other component or there may also be a component centered. When a component is considered to be "connected to" another component, it may be directly connected to the other component or there may also be a component centered. When a component is considered to be "set on" another component, it may be directly set on the other component or there may also be a component centered. The terms "vertical", "horizontal", "left", "right" and similar expressions used herein are for illustrative purposes only.
[0031] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art of the present invention. The terms used herein in the specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The term "and / or" used herein includes any and all combinations of one or more related listed items.
[0032] Example 1
[0033] Cutting simulation software performs machining simulation based on NC codes. Most CAM design software generates NC codes based on different features, and the generated NC codes are organized in segments according to the features.
[0034] Some single instructions in NC code contain information related to features, for example, G02 / G03 arc interpolation instructions in NC code contain data of circle center coordinates or arc radius. However, some NC codes have been interpolated, and single instructions have lost feature information, for example, a section of arc may have been interpolated into multiple straight line instructions. In this case, since the instructions in the instruction segment are continuous, the processing features corresponding to the instruction segment can be obtained by performing geometric analysis and surface fitting on the data in the continuous instructions. This method avoids the randomness of local sampling in traditional methods and increases the accuracy of feature recognition.
[0035] This embodiment performs geometric fitting or data analysis through the data of continuous instructions in the instruction segment, identifies the features corresponding to the NC instruction segment, parses a single NC instruction and extracts the dimensional data in the instruction, and then associates the features and the corresponding dimensional data with the data of the triangular mesh generated by the instruction. During the interactive measurement process, the corresponding measurement interaction can be generated according to the feature type in the currently interactive triangular mesh data. For example, when the triangular mesh data to which the mouse moves corresponds to a circular hole feature, the measurement tool can display its central reference axis in the form of a circular hole according to the corresponding circular hole data, and measure the radius of the circular hole.
[0036] See also Figure 1 and Figure 2 This embodiment provides a method for measuring a lightweight model in a cutting simulation, and the specific implementation steps are as follows:
[0037] Step 1: parse each NC program. Each program starts with code O+program number, and parse each NC instruction in the program segment.
[0038] Step 2: Perform entity cutting simulation according to each NC instruction. If it is a G0 instruction, directly update the tool position; if it is a G1 instruction, update the tool position and perform Boolean operations and other entity cutting simulations. The simulation results will change the shape of the workpiece and generate a new triangular mesh; if it is a G2 / G3 instruction, update the tool position and perform Boolean operations and other entity cutting simulations. The simulation results will change the shape of the workpiece and generate a new triangular mesh.
[0039] Step 3: If it is a G2 or G3 command, extract the relevant geometric information of the arc center and radius from the command.
[0040] Step 4: Perform geometric fitting or data analysis on the geometric data of continuous instructions in the program segment to identify the features corresponding to the program segment, such as plane, arc surface, circular hole, etc.
[0041] Step five, data association is performed on the newly generated triangular mesh in the solid cutting simulation in step two, the relevant geometric information extracted in step three, and the features identified in step four.
[0042] Step 6: During measurement, when the measurement tool interacts with the triangular mesh, different measurement methods are used according to the information associated in step 5. For example, when the feature corresponding to the triangular mesh is an arc surface, the arc surface measurement module is used to display the center and radius of the circle; when the feature corresponding to the triangular mesh is a circular hole, the circular hole measurement module is used to display the center axis and radius of the circular hole.
[0043] Example 2
[0044] The present embodiment provides a computer device, such as a smart phone, tablet computer, laptop computer, desktop computer, rack server, blade server, tower server or cabinet server (including an independent server or a server cluster composed of multiple servers) that can execute programs. The computer device of the present embodiment includes at least but is not limited to: a memory and a processor that can communicate with each other through a system bus.
[0045] In this embodiment, the memory (i.e., readable storage medium) includes flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory may be an internal storage unit of a computer device, such as a hard disk or memory of the computer device. In other embodiments, the memory may also be an external storage device of a computer device, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the computer device. Of course, the memory may also include both the internal storage unit of the computer device and its external storage device. In this embodiment, the memory is generally used to store an operating system and various application software installed on the computer device. In addition, the memory may also be used to temporarily store various types of data that have been output or are to be output.
[0046] The processor may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chip in some embodiments. The processor 22 is generally used to control the overall operation of the computer device. In this embodiment, the processor is used to run the program code stored in the memory or process data.
[0047] This embodiment also provides a computer-readable storage medium, such as a flash memory, a hard disk, a multimedia card, a card-type memory (for example, an SD or DX memory, etc.), a random access memory (RAM), a static random access memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a disk, an optical disk, a server, an App application store, etc., on which a computer program is stored, and the corresponding function is realized when the program is executed by a processor.
[0048] The above describes the specific embodiments of the present invention. It should be understood that the present invention is not limited to the above specific embodiments, and one or more of the above embodiments are combined into one embodiment. Those skilled in the art can make various changes or modifications or combinations within the scope of the claims, which does not affect the essence of the present invention. In the absence of conflict, the embodiments of the present application and the features in the embodiments can be combined with each other at will.
Claims
1. A method for measuring a lightweight model in cutting simulation, characterized in that: The specific steps are as follows: S1: Analyze each NC program; S2: Perform solid cutting simulation according to each NC instruction; S3: Perform geometric fitting or data analysis on the geometric data of the continuous instructions in the program segment to identify the features corresponding to the program segment; S4: data association is performed on the newly generated triangular mesh in the solid cutting simulation in S2, the relevant geometric information extracted in step 3, and the features identified in step 4; S5: When the measuring tool interacts with the triangular mesh, an adapted measuring method is used for measurement according to the information associated in step S5.
2. The method for measuring a lightweight model in cutting simulation according to claim 1, characterized in that: The step S1 specifically includes: each program segment starts with code O+program number, and each NC instruction in the program segment is parsed.
3. The method for measuring a lightweight model in cutting simulation according to claim 2, characterized in that: The step S2 also includes a step S21, and the step S21 is specifically as follows: S21: If it is a G0 command, the tool position is updated directly; if it is a G1 command, the tool position is updated and solid cutting simulation such as Boolean operations is performed. The simulation results will change the shape of the workpiece and generate a new triangular mesh.
4. The method for measuring a lightweight model in cutting simulation according to claim 3, characterized in that: The step S2 further includes a step S22, and the step S22 is specifically as follows: S22: If it is a G2 / G3 command, the tool position is updated and solid cutting simulation such as Boolean operations is performed. The simulation results will change the shape of the workpiece and generate a new triangular mesh.
5. The method for measuring a lightweight model in cutting simulation according to claim 4, characterized in that: The step S2 also includes a step S23, and the step S23 is specifically as follows: S23: If it is a G2 or G3 command, extract the relevant geometric information of the arc center and radius from the command.
6. The method for measuring a lightweight model in cutting simulation according to claim 5, characterized in that: The step S5 is specifically as follows: when the feature corresponding to the triangular mesh is an arc surface, an arc surface measurement module is used to display the center and radius of the circle; when the feature corresponding to the triangular mesh is a circular hole, a circular hole measurement module is used to display the central axis and radius of the circular hole.
7. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the method according to any one of claims 1 to 6 are implemented.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Method for checking precision of numerical control program
CN110096033A
NC code detection method and device based on collision and overcut prevention and intelligent terminal
CN114282376A
Geometric model processing method and device, electronic equipment and storage medium
CN115828349A
Calculation auxiliary manufacturing method and device for impeller and medium
CN117452881A
CAM system, CAM program, and method for controlling CAM system
CN1501201A
Cited By
Real-time cutting simulation method and system for staged processing
CN121328138A