mirror of
https://github.com/NGSolve/netgen.git
synced 2024-12-26 05:50:32 +05:00
Merge branch 'stable_parameter_projection' into 'master'
more stable occ parameter space projection See merge request ngsolve/netgen!548
This commit is contained in:
commit
8e8e0498e0
@ -817,6 +817,7 @@ public:
|
|||||||
: BoxTree(box.PMin(), box.PMax())
|
: BoxTree(box.PMin(), box.PMax())
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
|
void SetTolerance(double _tol) { tol = _tol; }
|
||||||
double GetTolerance() { return tol; }
|
double GetTolerance() { return tol; }
|
||||||
|
|
||||||
size_t GetNLeaves()
|
size_t GetNLeaves()
|
||||||
|
@ -79,12 +79,17 @@ namespace netgen
|
|||||||
Meshing2 :: ~Meshing2 ()
|
Meshing2 :: ~Meshing2 ()
|
||||||
{ ; }
|
{ ; }
|
||||||
|
|
||||||
void Meshing2 :: AddPoint (const Point3d & p, PointIndex globind,
|
int Meshing2 :: AddPoint (const Point3d & p, PointIndex globind,
|
||||||
MultiPointGeomInfo * mgi,
|
MultiPointGeomInfo * mgi,
|
||||||
bool pointonsurface)
|
bool pointonsurface)
|
||||||
{
|
{
|
||||||
//(*testout) << "add point " << globind << endl;
|
//(*testout) << "add point " << globind << endl;
|
||||||
adfront.AddPoint (p, globind, mgi, pointonsurface);
|
return adfront.AddPoint (p, globind, mgi, pointonsurface);
|
||||||
|
}
|
||||||
|
|
||||||
|
PointIndex Meshing2 :: GetGlobalIndex(int pi) const
|
||||||
|
{
|
||||||
|
return adfront.GetGlobalIndex(pi);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Meshing2 :: AddBoundaryElement (int i1, int i2,
|
void Meshing2 :: AddBoundaryElement (int i1, int i2,
|
||||||
|
@ -66,8 +66,9 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
DLL_HEADER void AddPoint (const Point3d & p, PointIndex globind, MultiPointGeomInfo * mgi = NULL,
|
DLL_HEADER int AddPoint (const Point3d & p, PointIndex globind, MultiPointGeomInfo * mgi = NULL,
|
||||||
bool pointonsurface = true);
|
bool pointonsurface = true);
|
||||||
|
DLL_HEADER PointIndex GetGlobalIndex(int pi) const;
|
||||||
|
|
||||||
///
|
///
|
||||||
DLL_HEADER void AddBoundaryElement (INDEX i1, INDEX i2,
|
DLL_HEADER void AddBoundaryElement (INDEX i1, INDEX i2,
|
||||||
|
@ -350,6 +350,14 @@ namespace netgen
|
|||||||
uv_box.Add( {seg.epgeominfo[i].u, seg.epgeominfo[i].v } );
|
uv_box.Add( {seg.epgeominfo[i].u, seg.epgeominfo[i].v } );
|
||||||
|
|
||||||
BoxTree<2> uv_tree(uv_box);
|
BoxTree<2> uv_tree(uv_box);
|
||||||
|
double tol = 1e99;
|
||||||
|
for(auto& seg : segments)
|
||||||
|
{
|
||||||
|
Point<2> p1 = { seg.epgeominfo[0].u, seg.epgeominfo[0].v };
|
||||||
|
Point<2> p2 = { seg.epgeominfo[1].u, seg.epgeominfo[1].v };
|
||||||
|
tol = min2(tol, Dist(p1, p2));
|
||||||
|
}
|
||||||
|
uv_tree.SetTolerance(0.9 * tol);
|
||||||
Array<int> found_points;
|
Array<int> found_points;
|
||||||
|
|
||||||
for(auto & seg : segments)
|
for(auto & seg : segments)
|
||||||
@ -368,15 +376,21 @@ namespace netgen
|
|||||||
Point<2> uv = {gi[j].u, gi[j].v};
|
Point<2> uv = {gi[j].u, gi[j].v};
|
||||||
uv_tree.GetIntersecting(uv, uv, found_points);
|
uv_tree.GetIntersecting(uv, uv, found_points);
|
||||||
|
|
||||||
if(found_points.Size())
|
bool found = false;
|
||||||
locpnum[j] = found_points[0];
|
for(auto& fp : found_points)
|
||||||
else
|
{
|
||||||
|
if(meshing.GetGlobalIndex(fp - 1) == seg[j])
|
||||||
|
{
|
||||||
|
locpnum[j] = fp;
|
||||||
|
found = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(!found)
|
||||||
{
|
{
|
||||||
PointIndex pi = seg[j];
|
PointIndex pi = seg[j];
|
||||||
meshing.AddPoint (mesh.Point(pi), pi);
|
locpnum[j] = meshing.AddPoint (mesh.Point(pi), pi) + 1;
|
||||||
glob2loc[pi] = ++cntpt;
|
glob2loc[pi] = locpnum[j];
|
||||||
gis.Append (gi[j]);
|
gis.Append (gi[j]);
|
||||||
locpnum[j] = gis.Size();
|
|
||||||
uv_tree.Insert(uv, locpnum[j]);
|
uv_tree.Insert(uv, locpnum[j]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -391,11 +405,10 @@ namespace netgen
|
|||||||
auto gi = occface.Project(mesh[pi]);
|
auto gi = occface.Project(mesh[pi]);
|
||||||
MultiPointGeomInfo mgi;
|
MultiPointGeomInfo mgi;
|
||||||
mgi.AddPointGeomInfo(gi);
|
mgi.AddPointGeomInfo(gi);
|
||||||
meshing.AddPoint(mesh[pi], pi, &mgi);
|
glob2loc[pi] = meshing.AddPoint(mesh[pi], pi, &mgi) + 1;
|
||||||
gis.Append(gi);
|
gis.Append(gi);
|
||||||
Point<2> uv = { gi.u, gi.v };
|
Point<2> uv = { gi.u, gi.v };
|
||||||
uv_tree.Insert(uv, gis.Size());
|
uv_tree.Insert(uv, glob2loc[pi]);
|
||||||
glob2loc[pi] = ++cntpt;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user