MCPcopy Create free account
hub / github.com/IfcOpenShell/IfcOpenShell / edge_from_compound

Function edge_from_compound

src/serializers/SvgSerializer.cpp:399–416  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

397 typedef std::pair<std::array<double, 3>, std::array<double, 3>> box_t;
398
399 boost::optional<TopoDS_Edge> edge_from_compound(TopoDS_Shape& compound) {
400 TopoDS_Iterator it(compound);
401 if (it.More()) {
402 TopoDS_Shape wire = it.Value();
403 it.Next();
404 if (!it.More() && wire.ShapeType() == TopAbs_WIRE) {
405 TopoDS_Iterator jt(wire);
406 if (jt.More()) {
407 TopoDS_Shape edge = jt.Value();
408 jt.Next();
409 if (!jt.More() && edge.ShapeType() == TopAbs_EDGE) {
410 return TopoDS::Edge(edge);
411 }
412 }
413 }
414 }
415 return boost::none;
416 }
417
418 class almost {
419 private:

Callers 1

writeMethod · 0.85

Calls 2

MoreMethod · 0.80
NextMethod · 0.45

Tested by

no test coverage detected