mirror of
https://github.com/NGSolve/netgen.git
synced 2024-12-25 05:20:34 +05:00
handle case of WP.wires being empty
This commit is contained in:
parent
ee7bcf82be
commit
bda7ea5ac1
@ -632,9 +632,11 @@ public:
|
|||||||
return shared_from_this();
|
return shared_from_this();
|
||||||
}
|
}
|
||||||
|
|
||||||
TopoDS_Wire Last()
|
optional<TopoDS_Wire> Last()
|
||||||
{
|
{
|
||||||
return wires.back();
|
return wires.empty() ?
|
||||||
|
optional<TopoDS_Wire>{} :
|
||||||
|
optional<TopoDS_Wire>{wires.back()};
|
||||||
}
|
}
|
||||||
|
|
||||||
TopoDS_Face Face()
|
TopoDS_Face Face()
|
||||||
@ -1567,7 +1569,7 @@ DLL_HEADER void ExportNgOCCShapes(py::module &m)
|
|||||||
},
|
},
|
||||||
py::keep_alive<0, 1>() /* Essential: keep object alive while iterator exists */)
|
py::keep_alive<0, 1>() /* Essential: keep object alive while iterator exists */)
|
||||||
.def("__getitem__", [](const ListOfShapes & list, size_t i) {
|
.def("__getitem__", [](const ListOfShapes & list, size_t i) {
|
||||||
return CastShape(list[i]); })
|
return CastShape(list.at(i)); })
|
||||||
|
|
||||||
.def("__getitem__", [](const ListOfShapes & self, py::slice inds) {
|
.def("__getitem__", [](const ListOfShapes & self, py::slice inds) {
|
||||||
size_t start, step, n, stop;
|
size_t start, step, n, stop;
|
||||||
|
Loading…
Reference in New Issue
Block a user