set meshsize for occ face from python

This commit is contained in:
Christopher Lackner 2019-08-13 18:45:27 +02:00
parent 15e68020ba
commit bc7e632368
2 changed files with 12 additions and 0 deletions

View File

@ -319,6 +319,14 @@ namespace netgen
}
}
void SetFaceMaxH(size_t facenr, double faceh)
{
if(facenr >= fmap.Extent())
throw RangeException("OCCGeometry faces", facenr, 0, fmap.Extent());
face_maxh[facenr] = faceh;
face_maxh_modified[facenr] = true;
}
// Philippose - 15/01/2009
// Returns the local mesh size of a given face
double GetFaceMaxH(int facenr)

View File

@ -48,6 +48,10 @@ DLL_HEADER void ExportNgOCC(py::module &m)
self.HealGeometry();
self.BuildFMap();
},py::arg("tolerance")=1e-3, py::arg("fixsmalledges")=true, py::arg("fixspotstripfaces")=true, py::arg("sewfaces")=true, py::arg("makesolids")=true, py::arg("splitpartitions")=false,R"raw_string(Heal the OCCGeometry.)raw_string",py::call_guard<py::gil_scoped_release>())
.def("SetFaceMeshsize", [](OCCGeometry& self, size_t fnr, double meshsize)
{
self.SetFaceMaxH(fnr, meshsize);
}, "Set maximum meshsize for face fnr. Face numbers are 0 based.")
.def("_visualizationData", [] (shared_ptr<OCCGeometry> occ_geo)
{
std::vector<float> vertices;