47 points.push_back(p.front());
50 for (
size_t i = 1; i < (p.size() - 1); i++)
52 const Eigen::Vector2f& prev = p.at(i - 1);
53 const Eigen::Vector2f& at = p.at(i);
54 const Eigen::Vector2f& next = p.at(i + 1);
57 const float maxRadius = std::min((prev - at).
norm(), (next - at).
norm());
58 const float radius = std::min(maxRadius, 300.F);
60 const Eigen::Vector2f vIn = (prev - at).normalized();
61 const Eigen::Vector2f vOut = (next - at).normalized();
64 const float phi = getAngleBetweenVectors(vIn, vOut);
65 const float l = radius / std::tan(phi / 2);
67 points.emplace_back(at + Eigen::Vector2f(prev - at).normalized() * l);
68 points.emplace_back(at + Eigen::Vector2f(next - at).normalized() * l);
71 points.push_back(p.back());
82 points.push_back(p.front());
85 for (
size_t i = 1; i < (p.size() - 1); i++)
87 const Eigen::Vector2f& prev =
90 const Eigen::Vector2f& next =
94 const float maxRadius = std::min((prev - at).
norm(), (next - at).
norm());
95 const float radius = std::min(maxRadius, 300.F);
97 const Eigen::Vector2f vIn = (prev - at).normalized();
98 const Eigen::Vector2f vOut = (next - at).normalized();
101 const float phi = getAngleBetweenVectors(vIn, vOut);
104 if (std::abs(phi) < deg2rad(10.F))
106 points.push_back(p.at(i));
110 const float l = radius / std::tan(phi / 2);
112 const Eigen::Vector2f prePos = at + Eigen::Vector2f(prev - at).normalized() * l;
113 const Eigen::Vector2f postPos = at + Eigen::Vector2f(next - at).normalized() * l;
121 return proj.projection;
124 points.push_back(tpProj(prePos));
125 points.push_back(tpProj(postPos));
129 points.push_back(p.back());