code for drawing occ identifications in webgui

This commit is contained in:
Christopher Lackner 2023-06-29 12:22:00 +02:00
parent fffe1831a3
commit 8da01ff353
2 changed files with 11 additions and 2 deletions

View File

@ -1209,7 +1209,16 @@ DLL_HEADER void ExportNetgenMeshing(py::module &m)
.def ("GetCD3Name", &Mesh::GetCD3Name) .def ("GetCD3Name", &Mesh::GetCD3Name)
.def ("SetCD3Name", &Mesh::SetCD3Name) .def ("SetCD3Name", &Mesh::SetCD3Name)
.def("GetIdentifications", [](Mesh & self) -> py::list
{
py::list points;
for(const auto& pair : self.GetIdentifications().GetIdentifiedPoints())
{
py::tuple pnts = py::make_tuple(pair.first.I1(), pair.first.I2());
points.append(pnts);
}
return points;
})
.def ("AddPointIdentification", [](Mesh & self, py::object pindex1, py::object pindex2, int identnr, Identifications::ID_TYPE type) .def ("AddPointIdentification", [](Mesh & self, py::object pindex1, py::object pindex2, int identnr, Identifications::ID_TYPE type)
{ {
if(py::extract<PointIndex>(pindex1).check() && py::extract<PointIndex>(pindex2).check()) if(py::extract<PointIndex>(pindex1).check() && py::extract<PointIndex>(pindex2).check())

View File

@ -14,7 +14,7 @@ if not USE_OCC:
raise ImportError("Netgen was not built with Opencascade support") raise ImportError("Netgen was not built with Opencascade support")
from .libngpy._NgOCC import * from .libngpy._NgOCC import *
from .meshing import meshsize from .meshing import meshsize, IdentificationType
gp_Ax3 = Axes gp_Ax3 = Axes