From bce715acc947b3302eb1772509fc5937aae095be Mon Sep 17 00:00:00 2001 From: Joachim Schoeberl Date: Sun, 16 Oct 2022 13:08:27 +0200 Subject: [PATCH] switch back to manual projection for OCC geometry (wta/coil.ipynb make a huge difference) --- libsrc/meshing/basegeom.hpp | 4 ++++ libsrc/occ/occ_face.cpp | 9 +++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/libsrc/meshing/basegeom.hpp b/libsrc/meshing/basegeom.hpp index 228ecfad..272f8374 100644 --- a/libsrc/meshing/basegeom.hpp +++ b/libsrc/meshing/basegeom.hpp @@ -151,8 +151,12 @@ namespace netgen { newp = p1 + secpoint * (p2-p1); newgi.trignum = gi1.trignum; + /* newgi.u = 0.5 * (gi1.u + gi1.u); newgi.v = 0.5 * (gi1.v + gi2.v); + */ + newgi.u = gi1.u + secpoint*(gi2.u - gi1.u); + newgi.v = gi1.v + secpoint*(gi2.v - gi1.v); if(!ProjectPointGI(newp, newgi)) newgi = Project(newp); } diff --git a/libsrc/occ/occ_face.cpp b/libsrc/occ/occ_face.cpp index a818767e..7a04c623 100644 --- a/libsrc/occ/occ_face.cpp +++ b/libsrc/occ/occ_face.cpp @@ -148,16 +148,18 @@ namespace netgen bool OCCFace::ProjectPointGI(Point<3>& p_, PointGeomInfo& gi) const { + /* static Timer t("OCCFace::ProjectPointGI"); RegionTimer rt(t); - + // *testout << "input, uv = " << gi.u << ", " << gi.v << endl; auto suval = shape_analysis->NextValueOfUV({gi.u, gi.v}, ng2occ(p_), tolerance); gi.trignum = nr+1; suval.Coord(gi.u, gi.v); + // *testout << "result, uv = " << gi.u << ", " << gi.v << endl; + p_ = occ2ng(surface->Value( gi.u, gi.v )); return true; - + */ // Old code: do newton iterations manually - /* double u = gi.u; double v = gi.v; auto p = ng2occ(p_); @@ -207,7 +209,6 @@ namespace netgen p_ = occ2ng(x); return true; - */ } Point<3> OCCFace::GetPoint(const PointGeomInfo& gi) const