以下是一个基本的加工中心正六边形编程实例的代码:
O0010(PROGRAM NUMBER) (T1 D=6.0 CR=0. - ZMIN=-20. - FLAT END MILL) G90 G94 G54 G17 G20 M06 T1 S1000 M03 G43 H01 Z0.1 M08 G00 X0. Y0. S1000 M03 G01 Z-2. F50. (Run the drill to make a center hole in the hexagon) G00 X0. Y0. Z0.1 G81 Z-10. R2. F50. M09 G00 Z0.1 G00 X0. Y0. Z0.1 G00 Z0.1 G01 Z-2. F50. (Turn on the spindle and coolant) M08 (Start cutting the hexagon) G01 X10. Y0. F100. G01 X5. Y8.66 G01 X-5. Y8.66 G01 X-10. Y0. G01 X-5. Y-8.66 G01 X5. Y-8.66 G01 X10. Y0. (Inside hexagon) G00 X3. Y0. G00 Z0.1 G01 Z-2. F50. G01 X1.5 Y2.6 G01 X-1.5 Y2.6 G01 X-3. Y0. G01 X-1.5 Y-2.6 G01 X1.5 Y-2.6 G01 X3. Y0. (Move the cutter to the center and finish the program) G00 X0. Y0. Z0.1 M05 M30
请注意,上述代码是一个示例,根据实际情况进行相应调整和更改。