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

Function extractEdgePolygon

src/Edge.cc:379–404  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

377
378
379void 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
406v8::Local<v8::Object> Edge::polygonize(double factor)
407{

Callers 2

polygonizeMethod · 0.85
NAN_METHODFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected