diff --git a/libsrc/csg/genmesh.cpp b/libsrc/csg/genmesh.cpp index dbae83a9..26f30409 100644 --- a/libsrc/csg/genmesh.cpp +++ b/libsrc/csg/genmesh.cpp @@ -221,6 +221,16 @@ namespace netgen static void MeshSurface (CSGeometry & geom, Mesh & mesh) { + /* + Point3d pmin, pmax; + mesh.GetBox(pmin, pmax); + cout << "box = " << pmin << " - " << pmax << endl; + cout << "localhbox = " + << mesh.LocalHFunction().GetBoundingBox().PMin() << " - " + << mesh.LocalHFunction().GetBoundingBox().PMax() + << endl; + */ + const char * savetask = multithread.task; multithread.task = "Surface meshing"; @@ -416,12 +426,12 @@ namespace netgen Meshing2Surfaces meshing(*surf, geom.BoundingBox()); meshing.SetStartTime (starttime); - + double eps = 1e-8 * geom.MaxSize(); for (PointIndex pi = PointIndex::BASE; pi < noldp+PointIndex::BASE; pi++) { //if(surf->PointOnSurface(mesh[pi])) meshing.AddPoint (mesh[pi], pi, NULL, - (surf->PointOnSurface(mesh[pi])!=0)); + (surf->PointOnSurface(mesh[pi], eps) != 0)); } segments.SetSize (0); diff --git a/libsrc/meshing/meshing2.cpp b/libsrc/meshing/meshing2.cpp index 1d159c86..73e8b187 100644 --- a/libsrc/meshing/meshing2.cpp +++ b/libsrc/meshing/meshing2.cpp @@ -1475,7 +1475,7 @@ namespace netgen - +// #define OPENGL #ifdef OPENGL /* *********************** Draw Surface Meshing **************** */ diff --git a/libsrc/visualization/vsmesh.cpp b/libsrc/visualization/vsmesh.cpp index e1a6ecec..2f3ab3eb 100644 --- a/libsrc/visualization/vsmesh.cpp +++ b/libsrc/visualization/vsmesh.cpp @@ -144,6 +144,7 @@ namespace netgen BuildFilledList (); } + #ifdef PARALLELGL if (ntasks > 1 && vispar.drawtetsdomain > 0 && vispar.drawtetsdomain < ntasks) glCallList (par_filledlists[vispar.drawtetsdomain]); @@ -1097,13 +1098,13 @@ namespace netgen } else // not high order { - glBegin (GL_TRIANGLES); + glBegin (GL_TRIANGLES); const Point<3> & lp0 = (*mesh) [el[0]]; const Point<3> & lp1 = (*mesh) [el[1]]; const Point<3> & lp2 = (*mesh) [el[2]]; - Vec<3> n = Cross (lp1-lp0, lp2-lp0); + Vec<3> n = Cross (lp1-lp0, lp2-lp0).Normalize(); glNormal3dv (n); if (vispar.colormeshsize)