| 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: |