Make new vertex creation more robust

* Require that the length of the new segment is shorter than the *current*
  distance to the end of the original segment, rather than the length of the
  complete original segment.
This commit is contained in:
Gaute Lindkvist
2018-05-07 20:07:12 +02:00
parent 0d8a034886
commit 043eaf7db6
2 changed files with 9 additions and 9 deletions

View File

@@ -422,7 +422,7 @@ void Riv3dWellLogCurveGeometryGenerator::createNewVerticesAlongSegment(const cvf
cvf::Vec3f newVertex = connectingLine.end();
cvf::Vec3f newSegmentVector = newVertex - extraVertices->back();
if (withinSegments && newSegmentVector.lengthSquared() < fullSegmentVector.lengthSquared())
if (withinSegments && newSegmentVector.lengthSquared() < currentSubSegment.lengthSquared())
{
extraVertices->push_back(newVertex);