gap=abs(p[i].x-p[i-1].x); if(abs(p[i].y-p[i-1].y)>gap) gap=abs(p[i].y-p[i-1].y); } return gap; } //判断是否可以终止更精细得拆分 bool EndBezierCut(CPoint *ptBezier, int nExtent) { double C,dx,dy,delt,delt1,delt2; if (nExtent<2) nExtent = 2; dx = (double)(ptBezier[3].x - ptBezier[0].x); dy = (double)(ptBezier[3].y - ptBezier[0].y); C = dx * ptBezier[0].y - dy * ptBezier[0].x; delt = (double)nExtent*nExtent*(dy*dy+dx*dx); delt1 = dy * ptBezier[1].x - dx * ptBezier[1].y + C; delt2 = dy * ptBezier[2].x - dx * ptBezier[2].y + C; delt1 = delt1 * delt1; delt2 = delt2 * delt2; if (delt1 > delt || delt2 > delt) return FALSE; else return TRUE; } |
正在阅读:贝赛尔曲线的拆分算法贝赛尔曲线的拆分算法
2004-05-27 15:17
出处:CSDN
责任编辑:linjixiong
键盘也能翻页,试试“← →”键