| 377 | |
| 378 | |
| 379 | void extractEdgePolygon(const TopoDS_Edge& edge, std::vector<float>& positions) |
| 380 | { |
| 381 | if (edge.IsNull()) { |
| 382 | StdFail_NotDone::Raise("Face is Null"); |
| 383 | } |
| 384 | TopLoc_Location loc; |
| 385 | occHandle(Poly_Polygon3D) polygon = BRep_Tool::Polygon3D(edge, loc); |
| 386 | if (polygon.IsNull()) { |
| 387 | StdFail_NotDone::Raise("cannot find Poly_Polygon3D on edge with BRep_Tool::Polygon3Dated"); |
| 388 | } |
| 389 | |
| 390 | //xx if (polygon.Deflection() == factor) |
| 391 | const TColgp_Array1OfPnt& points = polygon->Nodes(); |
| 392 | positions.clear(); |
| 393 | |
| 394 | int n = points.Length(); |
| 395 | positions.reserve(n * 3); |
| 396 | for (int i = 0; i < n; i++) { |
| 397 | gp_Pnt pt = points(i); |
| 398 | positions.push_back(static_cast<float>(pt.X())); |
| 399 | positions.push_back(static_cast<float>(pt.Y())); |
| 400 | positions.push_back(static_cast<float>(pt.Z())); |
| 401 | } |
| 402 | return; |
| 403 | |
| 404 | } |
| 405 | |
| 406 | v8::Local<v8::Object> Edge::polygonize(double factor) |
| 407 | { |
no outgoing calls
no test coverage detected