Automatic curved surface generation method suitable for PowerMill software
By automatically generating surface meshes with PowerMill and importing them into STL files, the cross-software compatibility and accuracy loss issues of surface modeling in toolpath design with PowerMill software are resolved. This achieves efficient and automated surface generation and import, and is suitable for various machining strategies.
Patent Information
- Application Number
- CN202511760025.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-27
- Publication Date
- 2026-01-09
AI Technical Summary
PowerMill software lacks comprehensive surface modeling capabilities in toolpath design, which necessitates frequent switching between CAD software and PowerMill, resulting in compatibility and accuracy losses, affecting the quality of toolpath generation, and increasing operational steps.
The reference geometry data is obtained through PowerMill's OLE Automation interface, the surface mesh is automatically generated and imported into the STL file, and the surface model is directly imported using PowerMill's IMPORT MODEL command, avoiding cross-software collaboration.
It enables surface generation within PowerMill, avoiding compatibility and accuracy losses caused by cross-software collaboration, improving machining programming efficiency and consistency, and is suitable for automated machining scenarios.
Smart Images

Figure CN121304978A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of numerical control machining, in particular to an automatic curved surface generation method suitable for PowerMill software. BACKGROUND
[0002] In the field of numerical control machining programming, PowerMill software, as a professional high-end computer-aided manufacturing software, is widely used in multi-axis machining and high-speed machining of complex parts. Its powerful tool path calculation capability and its built-in optimization algorithm can effectively meet the machining requirements of high precision and high efficiency. However, in the process of tool path design, it is often necessary to construct local auxiliary curved surfaces to achieve tool path guidance, machining area protection or geometric support, etc. For example, when machining complex surfaces or transition areas, auxiliary curved surfaces can guide the tool path to avoid overcutting or collision, while improving the quality of the machined surface.
[0003] In the prior art, since PowerMill itself does not have perfect curved surface modeling function, it is usually necessary to first construct a curved surface model in an external CAD software (such as UG, CATIA, SolidWorks, etc.), and then import it into PowerMill in a general format (such as IGES, STEP, STL, etc.) for subsequent machining planning.
[0004] Although the above method can meet the basic requirements, the user needs to frequently switch between CAD and PowerMill software, which not only increases the operation steps, but also must return to the CAD software to re-model each time the curved surface is adjusted; in addition, when the CAD model is transferred between different software, problems such as curved surface discretization, topological fracture, normal flip, precision reduction, etc. may occur, resulting in distortion of geometric information in PowerMill, affecting the quality of tool path generation and even causing interference risk. SUMMARY
[0005] Therefore, the present application provides an automatic curved surface generation method suitable for PowerMill software, which can automatically generate curved surface grids according to internal or external reference geometric data and directly import them into PowerMill to realize the generation of curved surfaces.
[0006] To achieve the above purpose, the technical scheme of the present application is as follows:
[0007] An automatic curved surface generation method suitable for PowerMill software, characterized in that it comprises the following steps:
[0008] S1, obtaining reference geometric data and discretizing it into a set of point columns;
[0009] S2, geometrically transforming the point columns in step S1 according to a set mode to generate a second set of point columns;
[0010] S3, constructing continuous triangular patches according to the two groups of point columns to generate a continuous triangular mesh;
[0011] S4, writing each triangular patch obtained in step S3 into an STL file in ASCII format;
[0012] S5, loading the file obtained in step S4 by using PowerMill to generate a surface model.
[0013] By using the above steps, the surface generation can be completed by using PowerMill only, without the need of constructing a surface in a CAD software, thereby avoiding the compatibility and accuracy loss problems caused by cross-software cooperation.
[0014] As a preferred example, the reference geometry data obtained in step S1 includes external point columns, straight line data or PowerMill internal reference line data. By using the above method, the boundary data of the model can be obtained conveniently, and the first group of point columns for surface generation can be formed by discretizing the boundary data into three-dimensional coordinate point columns.
[0015] As a preferred example, the geometric transformation in step S2 includes translation or biasing in a specified direction. By using the above method, a stretched surface with fixed direction extension characteristics can be generated according to actual requirements, or a strip-shaped surface extending along the contour normal can be generated.
[0016] As a preferred example, step S3 specifically includes the following steps:
[0017] S3.1, selecting any two adjacent points in the point columns in step S1;
[0018] S3.2, finding the corresponding points of the two points in step S3.1 in the point columns in step S2;
[0019] S3.3, constructing two triangular patch units according to the four points in step S3.1 and step S3.2;
[0020] S3.4, repeating steps S3.1 to S3.3 to generate a continuous triangular mesh.
[0021] By using the above method, a continuous triangular mesh is constructed by using the points in the two groups of point columns, and then the auxiliary surface is quickly constructed.
[0022] As a preferred example, step S4 specifically includes the following steps:
[0023] S4.1, creating a temporary STL file path;
[0024] S4.2, create and open STL file, write STL file header information;
[0025] S4.3, read the coordinates of the adjacent two points and the corresponding two points after the change;
[0026] S4.4, write triangle piece data in STL triangle face format;
[0027] S4.5, write STL file end marker.
[0028] Using the above method, each triangle piece obtained in step S3 can be written into the STL file.
[0029] As a preferred: each triangle piece written in step S4 includes a normal vector and three vertices. Using the above method, the spatial position of each triangle piece can be ensured.
[0030] As a preferred: the writing format of each triangle piece is as follows:
[0031] facet normal nx ny nz
[0032] outer loop
[0033] vertex x1 y1 z1
[0034] vertex x2 y2 z2
[0035] vertex x3 y3 z3
[0036] endloop
[0037] endfacet.
[0038] Using the above method, the spatial position angle of each triangle piece can be ensured.
[0039] As a preferred: it also includes: S6, delete temporary STL file. Using the above step, the system storage management can be optimized. After successfully importing the model, the temporary STL file in step four is deleted to avoid occupying disk space. When PowerMILL Automation.dll supporting multiple instance control is used, this step can be executed in parallel in multiple PowerMill instances, thereby meeting the batch processing and parallel computing requirements.
[0040] As a preferred: the step S5 automatically loads the generated STL surface through the IMPORT MODEL command in PowerMill. Using the above method, the STL surface model can be imported into the current PowerMill project, so that it can participate in tool path planning, protection area setting or other machining strategy processes.
[0041] Compared with the prior art, the present application has the beneficial effects that:
[0042] 1. The automatic curved surface generation method suitable for PowerMill software provided by the present application can complete the generation of curved surfaces by using PowerMill only, without the need to construct curved surfaces in CAD software, thereby avoiding the compatibility and accuracy loss problems caused by cross-software cooperation, enabling the auxiliary curved surface to respond to the tool path parameter changes in real time, and being more suitable for automatic machining scenes.
[0043] 2. The present application realizes the full-process automation of obtaining reference geometric data from PowerMill, automatically generating curved surface meshes, creating STL files and automatically importing them into PowerMill, and the entire process does not require human intervention, can be directly embedded into tool path programming scripts or automatic machining systems, greatly reduces the repetitive operation of programmers, and improves the machining programming efficiency and consistency.
[0044] 3. Since the curved surface meshes generated by the present application adopt the general STL format, they can be stably parsed by PowerMill and are not affected by the differences in PowerMill versions or CAD file formats, and have high cross-version and cross-process compatibility capabilities.
[0045] 4. The present application adopts the point-to-line conversion + triangular mesh generation method, which can support various curved surface construction forms, including stretched curved surfaces along fixed directions, strip curved surfaces generated along curve normal offset, local protection surfaces, height-limited surfaces, etc. Developers can adjust parameters such as point lines, direction vectors, and offset distances according to actual machining needs, thereby quickly generating different types of auxiliary curved surfaces, which are suitable for various machining strategies.
[0046] 5. The present application generates curved surfaces based on STL structure and adopts text writing method, which can easily realize extension. For example, different precision meshes can be generated as needed, normal optimization can be added, closed curved surfaces or local hole filling curved surfaces can be generated. Since the STL format is a general triangular sheet format, the generated curved surfaces can not only be used in PowerMill, but also be suitable for other CAM or simulation software, providing general support for automatic machining, process verification, collision analysis and other scenes. BRIEF DESCRIPTION OF DRAWINGS
[0047] Figure 1 Flowchart of the automatic curved surface generation method suitable for PowerMill software;
[0048] Figure 2 Schematic diagram of curve A and its discrete point line;
[0049] Figure 3This is a schematic diagram of the structure after curve A has been translated;
[0050] Figure 4 A schematic diagram of the continuous triangular mesh constructed between curve A and curve a;
[0051] Figure 5 This is a schematic diagram of the structure of a horizontally stretched curved surface C;
[0052] Figure 6 This is a schematic diagram of curve B and its discrete point sequence;
[0053] Figure 7 This is a schematic diagram of the structure after curve B is offset along the vertical direction;
[0054] Figure 8 A schematic diagram of the continuous triangular mesh constructed between curve B and curve b;
[0055] Figure 9 This is a schematic diagram of the structure of strip surface D. Detailed Implementation
[0056] The present invention will be further described below with reference to the embodiments and accompanying drawings.
[0057] Based on the specific surface structure generated, the present invention provides the following two implementation methods.
[0058] Example 1:
[0059] This embodiment is mainly used to generate a horizontally stretched surface C of a three-dimensional curve.
[0060] like Figures 1 to 5 As shown, an automated surface generation method for PowerMill software includes the following steps:
[0061] S1. Obtain reference geometric data and discretize it into a set of points. Specifically, this invention obtains the data through PowerMill's OLEAutomation interface. Figure 2 The curve A shown is discretized into a set of points. It should be noted that the reference geometry data includes PowerMill internal reference line data, toolpath geometry, or model boundaries, as well as other geometric elements accessible by PowerMill. In this embodiment, the OLE Automation interface is called in the VB.NET environment through .NET wrapper components such as PowerSolutionDOTNetOLE.dll or PowerMILLAutomation.dll. It should also be noted that the above interface components are only one implementation method; this invention is not limited to a specific DLL name, and any equivalent technique capable of accessing the OLE Automation interface and extracting geometric points is applicable.
[0062] S2. Translate the point array in step S1 according to the set direction to generate, as shown below. Figure 3 The curve a and the corresponding second set of points are shown. It should be noted that the setting direction depends on the actual orientation of the surface during the machining process. In this embodiment, each point on curve a is converted from each point on curve A using the following formula:
[0063] P'i = Pi + (dx, dy, dz)
[0064] Where Pi represents any point in the point sequence containing curve A, P'i represents the point corresponding to the stretching and translation transformation, and (dx,dy,dz) is the stretching direction vector.
[0065] S3. Construct continuous triangular patches based on the two sets of points to generate a continuous triangular surface mesh.
[0066] Specifically, S3 includes the following steps:
[0067] S3.1. Randomly select any two adjacent points within the point column in step S1. In this embodiment, we take... Figure 2 Take points 1 and 2 as examples.
[0068] S3.2, Find the corresponding point of the two points in step S3.1 within the point column in step S2, that is... Figure 3 The corresponding points are 11 and 22.
[0069] S3.3, Construct the following based on the four points from steps S3.1 and S3.2: Figure 4 The two triangular facets shown should be noted that the two constructed triangular facets (point 1-point 2-point 11 and point 2-point 22-point 11) share a common edge, namely the line connecting point 2 and point 11, and the two triangular facets have no overlapping areas.
[0070] S3.4 Repeat steps S3.1 to S3.3 to generate... Figure 4 The continuous triangular surface mesh shown.
[0071] S4. Write each triangle obtained in step S3 into an STL file in ASCII format. It should be noted that this step is automatically created and converted by the computer and does not require manual intervention.
[0072] Specifically, step S4 includes the following steps:
[0073] S4.1. Create a temporary STL file path. The PowerMill system generates a unique temporary file name based on the current operating environment and determines the output path of the STL file, which is used to store the subsequently generated surface mesh file.
[0074] S4.2, create and open STL file, write STL file header information. Specifically, the system creates and opens an STL file in ASCII form to write a stream, writes the beginning of the STL file to identify to comply with the STL format specification, and the specific beginning identification is as follows:
[0075] solid ruledsurface.
[0076] S4.3, read the coordinates of the two adjacent points on curve A and the corresponding two points on curve a;
[0077] S4.4, combine any four adjacent points on curve A and curve a into two triangular patches, and write the triangular patch data in the format of ASCII STL. It should be noted that each triangular patch data includes a normal vector and three vertices, and the specific writing format is as follows:
[0078] facet normal nx ny nz
[0079] outer loop
[0080] vertex x1 y1 z1
[0081] vertex x2 y2 z2
[0082] vertex x3 y3 z3
[0083] endloop
[0084] endfacet.
[0085] S4.5, after all the triangular patches are written, write the end line and close the text output stream to complete the generation of the STL file, wherein the end line is specifically as follows:
[0086] endsolid ruledsurface.
[0087] S5, load the file obtained in step S4 by using PowerMill to generate Figure 5 the horizontal stretch surface C shown. In this embodiment, the IMPORT MODEL command is executed through the PowerMill OLE Automation interface to automatically load the generated STL surface, and the newly generated STL surface model is automatically imported into the current PowerMill project, so that it can participate in tool path calculation, collision analysis, area limitation, protection surface creation or other machining strategy planning.
[0088] S6, deleting the temporary STL file. After successfully importing the generated horizontal stretch surface C, the above-mentioned temporary STL file can be selectively deleted to avoid occupying disk space; when PowerMillAutomation.dll supporting multi-instance control is used, this step can be executed in parallel in multiple PowerMill instances, thereby meeting the batch processing and parallel computing requirements.
[0089] The embodiment realizes a complete and automatic process from curve→surface mesh→model import, and has the characteristics of high efficiency, rapidity and stability.
[0090] Embodiment two:
[0091] In the embodiment, the curve B is offset along the specified direction. Specifically, the embodiment generates a strip-shaped auxiliary surface based on the local normal characteristics of the reference curve B. The strip surface D refers to a strip-shaped triangular mesh structure formed by calculating the normal (or median direction) according to the local tangent direction of the curve and offsetting and expanding in the direction.
[0092] As shown in Figure 1 , Figure 6 , Figure 7 , Figure 8 and Figure 9 , an automatic surface generation method suitable for PowerMill software includes the following steps:
[0093] S1, acquiring reference geometric data and discretizing into a set of point columns. Specifically, the present application acquires the curve B shown in Figure 6 through the OLEAutomation interface of PowerMill and discretizes it into a set of point columns.
[0094] S2, calculating the median direction and generating the offset point column as shown in Figure 7 . Specifically, first, any adjacent points Pi and P(i+1) in the first set of point columns are calculated, then the tangent direction vector Ti is calculated in the XY plane, and a 90° rotation operation is performed on Ti to obtain the local median direction Ni. Finally, according to the preset offset distance d, each point is offset along the Ni direction to obtain the second set of point columns:
[0095] P'i=Pi+d·Ni.
[0096] Since the offset direction is always orthogonal to the tangent direction throughout the curve range, the generated strip surface maintains the same normal characteristics as the original curve as a whole.
[0097] S3, constructing a strip-shaped triangular mesh structure.
[0098] Specifically, S3 includes the following steps:
[0099] S3.1, any two adjacent points in the point list in step S1 are taken, and in this embodiment, point 1 and point 2 in Figure 6 are taken as examples.
[0100] S3.2, in step S2, the corresponding points of the two points in step S3.1 are found, that is, Figure 7 corresponding points 11 and 22 in .
[0101] Figure 8 S3.3, two triangular facet units as shown in are constructed according to the four points in step S3.1 and step S3.2.
[0102] Figure 8 S3.4, steps S3.1 to S3.3 are repeated to generate a strip-shaped triangular mesh structure as shown in .
[0103] S4, the strip-shaped triangular mesh structure obtained in step S3 is written into an STL file in ASCII format, and the specific steps are the same as those in step S4 in Embodiment 1, which will not be repeated here.
[0104] Figure 9 S5, the file obtained in step S4 is loaded by PowerMill to generate a strip surface D as shown in . In this embodiment, the IMPORT MODEL command is executed through the PowerMill OLE Automation interface to automatically load the generated STL surface, and the newly generated STL surface model is automatically imported into the current PowerMill project, so that it can participate in tool path calculation, collision analysis, area limitation, protection surface creation or other processing strategy planning.
[0105] S6, delete the temporary STL file. After successfully importing the generated strip surface D, the above-mentioned temporary STL file can be selectively deleted to avoid occupying disk space; when PowerMill Automation.dll supporting multi-instance control is used, this step can be executed in parallel in multiple PowerMill instances, thereby meeting the batch processing and parallel computing requirements.
[0106] This embodiment realizes the whole process automation operation from the reference curve → normal offset → strip surface construction → automatic import, and has the characteristics of high efficiency, rapidity and stability.
[0107] The above two embodiments can complete surface generation only by relying on PowerMill software in the actual operation process, without the intervention of other CAD software, avoiding the compatibility and accuracy loss problems caused by cross-software cooperation, so that the auxiliary surface can respond to the tool path parameter changes in real time, and is more suitable for automatic processing scenes.
[0108] Because the surface mesh generated by this invention uses the universal STL format, it can be stably parsed by PowerMill and is not affected by differences in PowerMill versions or CAD file formats, thus possessing a high degree of cross-version and cross-process compatibility.
[0109] Finally, it should be noted that the above description is merely a preferred embodiment of the present invention. Those skilled in the art, under the guidance of the present invention, can make various similar representations without departing from the spirit and claims of the present invention, and such modifications all fall within the protection scope of the present invention.
Claims
1. An automated surface generation method for PowerMill software, characterized in that, Includes the following steps: S1. Obtain reference geometric data and discretize it into a set of points; S2. Perform geometric transformations on the point sequence in step S1 according to the set method to generate a second set of point sequences; S3. Construct continuous triangular patches based on the two sets of points to generate a continuous triangular surface mesh; S4. Write each triangular piece obtained in step S3 into an STL file in ASCII format; S5. Use PowerMill to load the file obtained in step S4 to generate the surface model.
2. The automated surface generation method for PowerMill software according to claim 1, characterized in that: Step S1 obtains reference geometry data through PowerMill's OLE Automation interface. The reference geometry data includes PowerMill internal reference line data, toolpath geometry, or model boundaries.
3. The automated surface generation method for PowerMill software according to claim 1, characterized in that: The geometric transformation in step S2 includes translation or offset along a specified direction.
4. The automated surface generation method for PowerMill software according to claim 1, characterized in that, Step S3 specifically includes the following steps: S3.
1. Take any two adjacent points in the point list in step S1; S3.2 Find the corresponding point of the two points in step S3.1 within the point list in step S2; S3.3 Construct two triangular facet units based on the four points in steps S3.1 and S3.2; S3.4 Repeat steps S3.1 to S3.3 to generate a continuous triangular surface mesh.
5. The automated surface generation method for PowerMill software according to claim 1, characterized in that, Step S4 specifically includes the following steps: S4.1, Create a temporary STL file path; S4.2 Create and open an STL file, and write the STL file header information; S4.3 Read the coordinates of two adjacent points and the corresponding coordinates of the two points after the change; S4.4 Write the triangle data in STL triangle face format; S4.
5. Write the end marker for the STL file.
6. The automated surface generation method for PowerMill software according to claim 5, characterized in that: Each triangle written in step S4 includes a normal vector and three vertices.
7. The automated surface generation method for PowerMill software according to claim 6, characterized in that, The writing format for each triangle is as follows: facet normal nx ny nz outer loop vertex x1 y1 z1 vertex x2 y2 z2 Vertex X3 Y3 Z3 endloop endfacet.
8. The automated surface generation method for PowerMill software according to claim 1, characterized in that, Also includes: S6. Delete the temporary STL file.
9. The automated surface generation method for PowerMill software according to claim 1, characterized in that: Step S5 automatically loads the generated STL surface using the IMPORT MODEL command in PowerMill.
