来旭辉, 魏正英. 面向数控加工系统的3D打印切片算法与分区扫描策略[J]. 农业工程学报, 2019, 35(12): 58-64. DOI: 10.11975/j.issn.1002-6819.2019.12.007
    引用本文: 来旭辉, 魏正英. 面向数控加工系统的3D打印切片算法与分区扫描策略[J]. 农业工程学报, 2019, 35(12): 58-64. DOI: 10.11975/j.issn.1002-6819.2019.12.007
    Lai Xuhui, Wei Zhengying. 3D printing slice algorithm and partition scanning strategy for numerical control machining system[J]. Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE), 2019, 35(12): 58-64. DOI: 10.11975/j.issn.1002-6819.2019.12.007
    Citation: Lai Xuhui, Wei Zhengying. 3D printing slice algorithm and partition scanning strategy for numerical control machining system[J]. Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE), 2019, 35(12): 58-64. DOI: 10.11975/j.issn.1002-6819.2019.12.007

    面向数控加工系统的3D打印切片算法与分区扫描策略

    3D printing slice algorithm and partition scanning strategy for numerical control machining system

    • 摘要: 为实现大型农机零部件的快速修复与更换,该文针对3D打印协同数控成形大型零件中的折线拐点金属过堆积、工件翘曲变形、层厚难以实时调整等问题,提出数控系统与电子束成形相结合的3D打印切片算法与分区扫描策略。为提高切片速度,实现成形过程中的层厚实时调整,采用反向光线追踪算法对三维模型渲染切片,通过MS(marching squares)算法提取二值图像的坐标序列,快速获取指定层的轮廓坐标;为避免成形过程中电子枪运行速度不均匀引起的金属过堆积现象,选用B样条基函数对轮廓数据进行曲线插值,结合数控系统的曲线插补命令,实现恒定线速度成形。针对大型零件在成形过程中的变形问题,采用六边形分区与平行线变角度扫描技术,根据各分区图案的形心欧式距离规划扫描顺序,实现变形控制。结果表明:采用非均匀有理B样条曲线和直线分段插值后,拟合曲线对原始多重曲面截线的逼近误差范围与切片数据相比减少了30%。选用网格数量为1 483 132的STL(stereolithography)模型进行效率测试,该算法切片用时90 s,与商用软件Magics15.01切片相比用时减少了34.6%,与开源软件Cura15.06切片相比用时减少了31.4%,研究结果可为大型零件成形过程中的层厚动态调整及变形控制等提供新的思路。

       

      Abstract: Abstract: In the field of selective melting using laser or electron beam as heat source, the rapid development of augmentation manufacturing technology makes it possible to form small parts precisely, but there is still great resistance to the printing of large and medium-sized parts. In order to solve the problem of rapid repair and replacement of large and medium-sized key components of agricultural machinery and equipment, a solution combining numerical control system and electron beam forming is proposed, which combines the high precision of the computerized numerical control system with the high efficiency of electron beam forming, and can quickly form the precision blank of the original part. In order to solve the jitter problem of the electron gun in forming a small linear contour, the NURBS basis function is used to perform curve interpolation on the contour data. When the angle between the adjacent lines exceeds 140 degrees, it is considered that the part of the data is composed of straight line and curved line, and the intersection point is the dividing point of the straight line portion and the curved portion. And then the adjacent points, repeat points and internal points in the same line are removed to reduce the amount of command data of the G code, and B-Spline curve processing function of computerized numerical control system is adopted to reduce the starting and stopping times of motor, thus ensuring that the linear speed is constant and the remaining fluctuation is controlled within 1 mm during the curve processing. Aiming at warping deformation caused by too long single scanning line, a zoning scanning strategy is proposed. According to the centroid of each zoning, the forming sequence is planned according to the principle of farthest distance. Randomly select a pattern based on the centroid of the polygon as the first forming area, and then the centroid coordinates of other polygons are read from memory in order to ensure the maximum euclidean distance between the coordinate and the centroid coordinates of all processed polygons. Aiming at the problem of layer thickness dynamic adjustment in the forming process, the GPU(graphics processing unit) slicing technique of 3D model is proposed. The STL file is colored in parallel according to the normal vector and vertex coordinates. The voxel information of the specified layer is dynamically obtained by adjusting the projection matrix to the slice height. The matching square contour extraction algorithm is used to read the pixel information clockwise from the upper left of the picture, and then traverse the entire binary image against the search direction table to find the image boundary, and finally the contour matrix is transformed into an ordered 2D contour coordinates based on the ratio of the model bounding box length to the pixel width. Based on this, closed-loop control of forming process is realized by dynamically calculating slice and partition filling data in two plane printing gaps. The results show that the projection matrix can be adjusted to the height of the slice during the rendering of the 3D model. The cross-sectional binary image can be obtained by using the intersection of the viewpoint and the voxel. The contour data can be dynamically extracted by using the matching square algorithm to search. After segmentation fitting of the slice data using the spline basis function, the fitting curve is closer to the original multi-surface section line. When the triangle tolerance is 1 mm, the conversion error of the STL file can be reduced by 30%. As the number of triangular meshes increases, the efficiency of the algorithm is improved. The STL file containing 1 483 132 triangular meshes can be cut into 4 488 layers in only 90 s, which is 34.6% less than that of Magic Slices. Compared with the multi-segment linear forming, after fitting with the NURBS basis function, the fitting data has a constant linear velocity during the forming process, resulting in the same amount of metal being fed into the molten pool per unit time. In addition, the maximum weld height of the data after fitting is 0.65 mm. Compared with the original slicing data, the weld height fluctuation range is reduced by 67.8%, which is more conducive to subsequent stack forming.

       

    /

    返回文章
    返回