From cc1def8d77a5edd5c2ae9f74c259f54a1210ecf3 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 23 May 2021 09:15:53 +0200 Subject: [PATCH] - fixed: When the node builder is used for triangulation, all zero-length lines must be eliminated first. These can cause triangulation errors. --- source/core/sectorgeometry.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/source/core/sectorgeometry.cpp b/source/core/sectorgeometry.cpp index 68c1cb6c1..c7f3c9f25 100644 --- a/source/core/sectorgeometry.cpp +++ b/source/core/sectorgeometry.cpp @@ -369,6 +369,14 @@ bool SectorGeometry::MakeVertices2(unsigned int secnum, int plane, const FVector for (unsigned i = 0; i < lines.Size(); i++) { auto p1 = lines[i].v1->p, p2 = lines[i].v2->p; + + // Throw out any line with zero length. + if (p1 == p2) + { + lines.Delete(i); + continue; + } + for (unsigned j = i + 1; j < lines.Size(); j++) { auto pp1 = lines[j].v1->p, pp2 = lines[j].v2->p;