MCPcopy Create free account
hub / github.com/OpenWebCAD/node-occ / createArc

Method createArc

src/Edge.cc:81–102  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

79}
80
81int 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
104int Edge::createArc3P(Vertex *start, Vertex *end, const gp_Pnt& aPoint)
105{

Callers

nothing calls this directly

Calls 2

setShapeMethod · 0.95
pointMethod · 0.80

Tested by

no test coverage detected