mirror of
https://github.com/NGSolve/netgen.git
synced 2024-12-25 21:40:33 +05:00
visual
This commit is contained in:
parent
f14a04a837
commit
8187d4f4e8
@ -221,6 +221,16 @@ namespace netgen
|
|||||||
|
|
||||||
static void MeshSurface (CSGeometry & geom, Mesh & mesh)
|
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;
|
const char * savetask = multithread.task;
|
||||||
multithread.task = "Surface meshing";
|
multithread.task = "Surface meshing";
|
||||||
|
|
||||||
@ -416,12 +426,12 @@ namespace netgen
|
|||||||
Meshing2Surfaces meshing(*surf, geom.BoundingBox());
|
Meshing2Surfaces meshing(*surf, geom.BoundingBox());
|
||||||
meshing.SetStartTime (starttime);
|
meshing.SetStartTime (starttime);
|
||||||
|
|
||||||
|
double eps = 1e-8 * geom.MaxSize();
|
||||||
for (PointIndex pi = PointIndex::BASE; pi < noldp+PointIndex::BASE; pi++)
|
for (PointIndex pi = PointIndex::BASE; pi < noldp+PointIndex::BASE; pi++)
|
||||||
{
|
{
|
||||||
//if(surf->PointOnSurface(mesh[pi]))
|
//if(surf->PointOnSurface(mesh[pi]))
|
||||||
meshing.AddPoint (mesh[pi], pi, NULL,
|
meshing.AddPoint (mesh[pi], pi, NULL,
|
||||||
(surf->PointOnSurface(mesh[pi])!=0));
|
(surf->PointOnSurface(mesh[pi], eps) != 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
segments.SetSize (0);
|
segments.SetSize (0);
|
||||||
|
@ -1475,7 +1475,7 @@ namespace netgen
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// #define OPENGL
|
||||||
#ifdef OPENGL
|
#ifdef OPENGL
|
||||||
|
|
||||||
/* *********************** Draw Surface Meshing **************** */
|
/* *********************** Draw Surface Meshing **************** */
|
||||||
|
@ -144,6 +144,7 @@ namespace netgen
|
|||||||
BuildFilledList ();
|
BuildFilledList ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#ifdef PARALLELGL
|
#ifdef PARALLELGL
|
||||||
if (ntasks > 1 && vispar.drawtetsdomain > 0 && vispar.drawtetsdomain < ntasks)
|
if (ntasks > 1 && vispar.drawtetsdomain > 0 && vispar.drawtetsdomain < ntasks)
|
||||||
glCallList (par_filledlists[vispar.drawtetsdomain]);
|
glCallList (par_filledlists[vispar.drawtetsdomain]);
|
||||||
@ -1097,13 +1098,13 @@ namespace netgen
|
|||||||
}
|
}
|
||||||
else // not high order
|
else // not high order
|
||||||
{
|
{
|
||||||
glBegin (GL_TRIANGLES);
|
glBegin (GL_TRIANGLES);
|
||||||
|
|
||||||
const Point<3> & lp0 = (*mesh) [el[0]];
|
const Point<3> & lp0 = (*mesh) [el[0]];
|
||||||
const Point<3> & lp1 = (*mesh) [el[1]];
|
const Point<3> & lp1 = (*mesh) [el[1]];
|
||||||
const Point<3> & lp2 = (*mesh) [el[2]];
|
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);
|
glNormal3dv (n);
|
||||||
|
|
||||||
if (vispar.colormeshsize)
|
if (vispar.colormeshsize)
|
||||||
|
Loading…
Reference in New Issue
Block a user