Merge branch 'draw_occ_identifications' into 'master'

code for drawing occ identifications in webgui

See merge request ngsolve/netgen!579
This commit is contained in:
Lackner, Christopher 2023-06-29 13:24:10 +02:00
commit 993ed0bde3
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