摘要
针对传统基于线与方形刷子原理的任意宽度直线生成算法的缺点,提出了一种高效的任意宽度直线生成新算法.该方法首先将任意宽度的直线段看作1个矩形域,并根据直线的宽度和斜率自适应地确定该矩形域的4个顶点;然后,利用改进的Bresenham直线算法连接上述4个顶点得到1个封闭的矩形域;最后,利用扫描线种子填充算法对该封闭矩形域进行填充即可得到任意宽度的直线.数值实例表明,该方法不仅可以生成任意宽度、任意斜率的直线,而且算法简单、有效,可以广泛地应用于各种CAD/CAM造型系统中任意宽度直线的生成.
Focusing on the defects of the algorithm of arbitrary width line generation that based on Line-brush and Square-brush,this paper proposes an efficient algorithm.Firstly,taking the arbitrary width line as rectangular area,fix the four vertexes adaptively according to the width and slope.Secondly,get a closed rectangular area by connecting the four vertexes through the modified Bresenham algorithm of line drawing.Finally,make it by filling the closed rectangular area through scan line seed fill algorithm.Numerical examples demonstrate the method not only can generate arbitrary width and slope line,but also be concise and efficient.It can be extensively applied to arbitrary width line generation in CAD/CAM.
出处
《沈阳工程学院学报(自然科学版)》
2012年第4期353-355,358,共4页
Journal of Shenyang Institute of Engineering:Natural Science
基金
陕西省教育厅基金资助项目(11JK1052)