Don't add new duplicate segments to mesh, if mesh fulfills HaveSingleSegments()

This commit is contained in:
Matthias Hochsteger 2023-04-27 15:35:10 +02:00
parent 875da8ee45
commit 35360df540

View File

@ -360,6 +360,14 @@ namespace netgen
{ {
INDEX_2_HASHTABLE<bool> already_added( 2*new_segments.Size() ); INDEX_2_HASHTABLE<bool> already_added( 2*new_segments.Size() );
for(auto & seg : mesh.LineSegments())
{
INDEX_2 i2 (seg[0], seg[1]);
i2.Sort();
if(!already_added.Used(i2))
already_added.Set(i2, true);
}
for(auto & seg : new_segments) for(auto & seg : new_segments)
{ {
INDEX_2 i2 (seg[0], seg[1]); INDEX_2 i2 (seg[0], seg[1]);