Comment 5 for bug 1479167

Revision history for this message
Diederik van Lierop (mail-diedenrezi) wrote :

The tolerances used in 2Geom::EllipticalArc::_filterIntersections() are apparently a bit too tight, triggering the asserts. If I change both tolerances from 1e-6 to 1e-5 then everything works as expected:

void EllipticalArc::_filterIntersections(std::vector<ShapeIntersection> &xs, bool is_first) const
{
    Interval unit(0, 1);
    std::vector<ShapeIntersection>::reverse_iterator i = xs.rbegin(), last = xs.rend();
    while (i != last) {
        Coord &t = is_first ? i->first : i->second;
        assert(are_near(_ellipse.pointAt(t), i->point(), 1e-5));
        t = timeAtAngle(t);
        if (!unit.contains(t)) {
            xs.erase((++i).base());
            continue;
        } else {
            assert(are_near(pointAt(t), i->point(), 1e-5));
            ++i;
        }
    }
}

I'll have to check with Krzysztof though if this is OK.