示例#1
0
文件: RArc.cpp 项目: seem-sky/qcad
double RArc::getAngleAt(double distance, RS::From from) const {
    QList<RVector> points = getPointsWithDistanceToEnd(distance, from);
    if (points.length()!=1) {
        return RNANDOUBLE;
    }
    return center.getAngleTo(points[0]) + (reversed ? -M_PI/2 : M_PI/2);
}
示例#2
0
double RSpline::getAngleAt(double distance, RS::From from) const {
    QList<RVector> points = getPointsWithDistanceToEnd(distance, from);
    if (points.length()!=1) {
        return RNANDOUBLE;
    }
    double t = getTAtPoint(points[0]);
    ON_3dVector v = curve.DerivativeAt(t);
    return RVector(v.x, v.y).getAngle();
}
示例#3
0
/**
 * \return Point at given percentile.
 */
RVector RShape::getPointAtPercent(double p) const {
    double length = getLength();
    double distance = p * length;
    QList<RVector> candidates = getPointsWithDistanceToEnd(distance, RS::FromStart);
    if (candidates.length()!=1) {
        return RVector::invalid;
    }
    return candidates.at(0);
}