www.mxdraw.com
内容索引主面
前一个向上下一个
圆弧的凸度参数说明

圆弧的凸度计算如下图: 

 

 

// 由圆弧的开始点,结束点,凸度,计算圆弧的中心点
bool GetArcCenter(McGePoint3d startPoint,McGePoint3d endPoint,double bulge,McGePoint3d& center)
{
    if (bulge==0.0)
    {
        center = startPoint;
        return false;
    }

    if (bulge < 0.0)
    {
        McGePoint3d tmpPt    =    endPoint;
        endPoint            =    startPoint;
        startPoint            =    tmpPt;
        bulge                =    -bulge;
    }

    // 计算圆弧的半径

    double dDX,dDY,dR;
    dDX    =    startPoint.distanceTo(endPoint) / 2.0;
    dDY    =    bulge    *    dDX;
    dR    =    ((dDX*dDX)+(dDY*dDY)) / (2.0 * dDY);

    // 计算圆弧的中心点
    double tmpAng;
    ads_point tmpPt;
    tmpAng    =    Mx::mcutAngle(startPoint,endPoint);

    Mx::mcutPolar(asDblArray(startPoint),tmpAng,dDX,tmpPt);
    ads_point tmpCenter;
    Mx::mcutPolar(tmpPt,(tmpAng + (3.14159265 / 2.0) ),(dR-dDY),tmpCenter);
    center = asPnt3d(tmpCenter);

    return true;
};
Copyright (c) 2010. All rights reserved.
你认为该帮助怎么样? 发送反馈信息!