mirror of
https://github.com/NGSolve/netgen.git
synced 2025-01-12 14:10:34 +05:00
set uv-params in quads correctly
Just projecting might lead to wrong results if a face contains edges twice.
This commit is contained in:
parent
a9234a589a
commit
d837d92f0f
@ -817,6 +817,14 @@ namespace netgen
|
|||||||
Transformation<3> trafo;
|
Transformation<3> trafo;
|
||||||
|
|
||||||
if(face.IsConnectingCloseSurfaces())
|
if(face.IsConnectingCloseSurfaces())
|
||||||
|
{
|
||||||
|
Array<ArrayMem<int, 2>, PointIndex> p2seg(mesh.Points().Size());
|
||||||
|
for(int si : Range(segments))
|
||||||
|
{
|
||||||
|
const auto & s = segments[si];
|
||||||
|
p2seg[s[0]].Append(si);
|
||||||
|
p2seg[s[1]].Append(si);
|
||||||
|
}
|
||||||
for(const auto & s : segments)
|
for(const auto & s : segments)
|
||||||
{
|
{
|
||||||
auto edgenr = s.edgenr-1;
|
auto edgenr = s.edgenr-1;
|
||||||
@ -850,13 +858,35 @@ namespace netgen
|
|||||||
sel[1] = s[1];
|
sel[1] = s[1];
|
||||||
sel[2] = tree.Find(trafo(mesh[s[1]]));
|
sel[2] = tree.Find(trafo(mesh[s[1]]));
|
||||||
sel[3] = tree.Find(trafo(mesh[s[0]]));
|
sel[3] = tree.Find(trafo(mesh[s[0]]));
|
||||||
for(auto i : Range(4))
|
auto gis = sel.GeomInfo();
|
||||||
sel.GeomInfo()[i] = face.Project(mesh[sel[i]]);
|
for(auto i : Range(2))
|
||||||
|
{
|
||||||
|
gis[i].u = s.epgeominfo[i].u;
|
||||||
|
gis[i].v = s.epgeominfo[i].v;
|
||||||
|
}
|
||||||
|
|
||||||
|
// find mapped segment to set PointGeomInfo correctly
|
||||||
|
Segment s_other;
|
||||||
|
for(auto si_other : p2seg[sel[2]])
|
||||||
|
{
|
||||||
|
s_other = segments[si_other];
|
||||||
|
if(s_other[0] == sel[2] && s_other[1] == sel[3])
|
||||||
|
break;
|
||||||
|
if(s_other[0] == sel[3] && s_other[1] == sel[2])
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
for(auto i : Range(2))
|
||||||
|
{
|
||||||
|
auto i_other = sel[i+2] == s_other[i] ? i : 1-i;
|
||||||
|
gis[i+2].u = s_other.epgeominfo[i_other].u;
|
||||||
|
gis[i+2].v = s_other.epgeominfo[i_other].v;
|
||||||
|
}
|
||||||
|
|
||||||
sel.SetIndex(face.nr+1);
|
sel.SetIndex(face.nr+1);
|
||||||
mesh.AddSurfaceElement(sel);
|
mesh.AddSurfaceElement(sel);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
if(MeshFace(mesh, mparam, k, glob2loc))
|
if(MeshFace(mesh, mparam, k, glob2loc))
|
||||||
n_failed_faces++;
|
n_failed_faces++;
|
||||||
|
Loading…
Reference in New Issue
Block a user