Skip to content

Commit

Permalink
code proposal (inactive) refs #14691
Browse files Browse the repository at this point in the history
  • Loading branch information
namdre committed Apr 10, 2024
1 parent c163827 commit 79f0360
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/netbuild/NBNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -676,17 +676,29 @@ NBNode::bezierControlPoints(
}
return PositionVector();
}
const double begOffset = begShapeEndLineRev.nearest_offset_to_point2D(intersect);
const double endOffset = endShapeBegLine.nearest_offset_to_point2D(intersect);
/*
if ((shapeFlag & FOUR_CONTROL_POINTS) == 0 && (begOffset >= EXT || endOffset >= EXT)) {
// intersection point lies within begShape / endShape so we cannot use it
if (dist < 2) {
return PositionVector();
}
shapeFlag |= FOUR_CONTROL_POINTS;
extrapolateBeg = MIN2(10.0, dist / 2);
extrapolateEnd = extrapolateBeg;
}
*/
const double minControlLength = MIN2((double)1.0, dist / 2);
const double distBeg = intersect.distanceTo2D(beg);
const double distEnd = intersect.distanceTo2D(end);
const bool lengthenBeg = distBeg <= minControlLength;
const bool lengthenEnd = distEnd <= minControlLength;
const double begOffset = begShapeEndLineRev.nearest_offset_to_point2D(intersect);
const double endOffset = endShapeBegLine.nearest_offset_to_point2D(intersect);
#ifdef DEBUG_SMOOTH_GEOM
if (DEBUGCOND2(recordError)) std::cout
<< " beg=" << beg << " end=" << end << " intersect=" << intersect
<< " distBeg=" << distBeg << " distEnd=" << distEnd
<< " begOffset=" << begOffset << " endOffset=" << endOffset
<< " lEnd=" << lengthenEnd << " lBeg=" << lengthenBeg
<< "\n";
#endif
Expand Down

0 comments on commit 79f0360

Please sign in to comment.