mirror of
https://github.com/NGSolve/netgen.git
synced 2025-01-12 22:20:35 +05:00
export edgenr to python as well
This commit is contained in:
parent
0d9980aa8d
commit
02fd6d2712
@ -195,12 +195,13 @@ DLL_HEADER void ExportNetgenMeshing(py::module &m)
|
|||||||
|
|
||||||
py::class_<Segment>(m, "Element1D")
|
py::class_<Segment>(m, "Element1D")
|
||||||
.def("__init__",
|
.def("__init__",
|
||||||
[](Segment *instance, py::list vertices, py::list surfaces, int index)
|
[](Segment *instance, py::list vertices, py::list surfaces, int index, int edgenr)
|
||||||
{
|
{
|
||||||
new (instance) Segment();
|
new (instance) Segment();
|
||||||
for (int i = 0; i < 2; i++)
|
for (int i = 0; i < 2; i++)
|
||||||
(*instance)[i] = py::extract<PointIndex>(vertices[i])();
|
(*instance)[i] = py::extract<PointIndex>(vertices[i])();
|
||||||
instance -> si = index;
|
instance -> si = index;
|
||||||
|
instance -> edgenr = edgenr;
|
||||||
if (len(surfaces))
|
if (len(surfaces))
|
||||||
{
|
{
|
||||||
instance->surfnr1 = py::extract<int>(surfaces[0])();
|
instance->surfnr1 = py::extract<int>(surfaces[0])();
|
||||||
@ -210,6 +211,7 @@ DLL_HEADER void ExportNetgenMeshing(py::module &m)
|
|||||||
py::arg("vertices"),
|
py::arg("vertices"),
|
||||||
py::arg("surfaces")=py::list(),
|
py::arg("surfaces")=py::list(),
|
||||||
py::arg("index")=1,
|
py::arg("index")=1,
|
||||||
|
py:: arg("edgenr")=-1,
|
||||||
"create segment element"
|
"create segment element"
|
||||||
)
|
)
|
||||||
.def("__repr__", &ToString<Segment>)
|
.def("__repr__", &ToString<Segment>)
|
||||||
@ -231,8 +233,12 @@ DLL_HEADER void ExportNetgenMeshing(py::module &m)
|
|||||||
}))
|
}))
|
||||||
.def_property_readonly("index", FunctionPointer([](const Segment &self) -> size_t
|
.def_property_readonly("index", FunctionPointer([](const Segment &self) -> size_t
|
||||||
{
|
{
|
||||||
return self.edgenr;
|
return self.si;
|
||||||
}))
|
}))
|
||||||
|
.def_property_readonly("edgenr", FunctionPointer([](const Segment & self) -> size_t
|
||||||
|
{
|
||||||
|
return self.edgenr;
|
||||||
|
}))
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user