| 79 | } |
| 80 | |
| 81 | int Edge::createArc(Vertex *start, Vertex *end, const gp_Pnt& center) |
| 82 | { |
| 83 | try { |
| 84 | gp_Pnt aP1 = start->point(); |
| 85 | gp_Pnt aP2 = center; |
| 86 | gp_Pnt aP3 = end->point(); |
| 87 | |
| 88 | Standard_Real Radius = aP1.Distance(aP2); |
| 89 | gce_MakeCirc MC(aP2, gce_MakePln(aP1, aP2, aP3).Value(), Radius); |
| 90 | const gp_Circ& Circ = MC.Value(); |
| 91 | |
| 92 | Standard_Real Alpha1 = ElCLib::Parameter(Circ, aP1); |
| 93 | Standard_Real Alpha2 = ElCLib::Parameter(Circ, aP3); |
| 94 | occHandle(Geom_Circle) C = new Geom_Circle(Circ); |
| 95 | occHandle(Geom_TrimmedCurve) arc = new Geom_TrimmedCurve(C, Alpha1, Alpha2, false); |
| 96 | |
| 97 | this->setShape(BRepBuilderAPI_MakeEdge(arc, start->vertex(), end->vertex())); |
| 98 | |
| 99 | } |
| 100 | CATCH_AND_RETHROW_NO_RETURN("Failed to create arc"); |
| 101 | return 1; |
| 102 | } |
| 103 | |
| 104 | int Edge::createArc3P(Vertex *start, Vertex *end, const gp_Pnt& aPoint) |
| 105 | { |