Hi, I use the following code to apply periodic constraints for meshing occ-geometry, which is working fine. However, for the given geometry the periodic constraint is not applied. I am using Netgen 6.2.2305 and OCCT 7.6.0.
// load geometry
std::string input = "C:\\temp\\geom.brep";
TopoDS_Shape s;
BRepTools::Read(s, input.c_str(), BRep_Builder());
// define periodic geometry
const auto angle = M_PI;
gp_Trsf transf;
transf.SetRotation(gp::OZ(), angle);
netgen::Transformation<3> transfNG;
transfNG.SetAxisRotation(3, angle);
std::vector<TopoDS_Shape> faces;
for (TopExp_Explorer Ex(s, TopAbs_FACE); Ex.More(); Ex.Next())
faces.emplace_back(Ex.Current());
netgen::Identify(faces[0], faces[1], "periodic", netgen::Identifications::PERIODIC, transf);
// make OCCT geometry available for netgen
std::shared_ptr<netgen::OCCGeometry> occgeo = std::make_shared<netgen::OCCGeometry>(s);
const auto identOK = occgeo->HaveIdentifications(faces[0]); // <--- periodic constraint not okay!
// meshing
netgen::MeshingParameters mp;
mp.perfstepsend = netgen::MESHCONST_MESHSURFACE;
mp.minh = 0.3;
mp.maxh = 7.0;
auto mesh = std::make_shared<netgen::Mesh>();
mesh->SetGeometry(occgeo);
int success = occgeo->GenerateMesh(mesh, mp);
The 2 faces are periodic such that one can be transformed onto the other, but identOK
is false
and the resulting mesh is not meshed periodically. Why this does not work as expected?
Thanks, Matthias
PS: For comparison, geom2.brep
is attached, which is meshed periodically.
geom2.brep (31.4 KB)
geom.brep (939.7 KB)