Arc edit correction.
anEdgeBuilder = BRepBuilderAPI_MakeEdge(aCircle, aStart, anEnd);
boost::shared_ptr<GeomAPI_Shape> aRes(new GeomAPI_Shape);
- TopoDS_Edge anEdge = anEdgeBuilder.Edge();
- aRes->setImpl(new TopoDS_Shape(anEdge));
+ anEdgeBuilder.Build();
+
+ if (anEdgeBuilder.IsDone())
+ aRes->setImpl(new TopoDS_Shape(anEdgeBuilder.Edge()));
+ else
+ aRes = boost::shared_ptr<GeomAPI_Shape>();
return aRes;
}
boost::shared_ptr<GeomDataAPI_Point2D> aPoint3 =
boost::dynamic_pointer_cast<GeomDataAPI_Point2D>(aData->attribute(ARC_ATTR_END));
- aPoint1->setValue(aPoint3->x() + theDeltaX, aPoint3->y() + theDeltaY);
+ aPoint3->setValue(aPoint3->x() + theDeltaX, aPoint3->y() + theDeltaY);
}
double PartSet_FeatureArcPrs::distanceToPoint(FeaturePtr theFeature,
boost::shared_ptr<GeomAPI_Shape> aCircleShape =
GeomAlgoAPI_EdgeBuilder::lineCircleArc(aCenter, aStartPoint, aEndPoint, aNormal);
- aShapes.push_back(aCircleShape);
+ if (aCircleShape)
+ aShapes.push_back(aCircleShape);
}
boost::shared_ptr<GeomAPI_Shape> aCompound = GeomAlgoAPI_CompoundBuilder::compound(aShapes);
setPreview(aCompound);