+ // calculate tolerances for start and end points of the arc and set them to the result shape
+ // (this is done to fix gaps which appear because of inaccurate computation of arcs in PlaneGCS,
+ // which leads to difference in SketchPlugin_Arc attributes and boundary points of result shape)
+ if (anArcShape) {
+ for (int ind = 0; ind < 2; ++ind) {
+ bool isFirst = ind == 0;
+ GeomPointPtr anArcBndPoint = isFirst == isReversed ? anEnd : aStart;
+ GeomPointPtr aShapePoint = isFirst ? anArcShape->firstPoint() : anArcShape->lastPoint();
+ double aDistance = anArcBndPoint->distance(aShapePoint);
+ // avoid setting too high tolerance because it may be caused by incomplete update of an arc
+ if (aDistance > tolerance && aDistance < 100. * tolerance) {
+ if (isFirst)
+ anArcShape->setFirstPointTolerance(aDistance);
+ else
+ anArcShape->setLastPointTolerance(aDistance);
+ }
+ }
+ }
+