I can't say that I remember exactly how I calculated it in
Selba Ward's Spline; I reduced it to remove some unnecessary (in Spline's case) calculations and to work with the other calculations.
As I mentioned previously, though, instead of copying the code,
Spline can do the work for you. Maybe something like:
sw::Spline spline{ { 150.f, 300.f }, { 150.f, 100.f }, { 300.f, 200.f } }; // 3 vertices
spline.setThickness(40); // very thick spline
spline.update();
std::vector<sf::Vector2f> outer;
std::vector<sf::Vector2f> inner;
for (unsigned int i{ 0u }; i < spline.getVertexCount(); ++i)
{
outer.push_back(spline.getPosition(i) +
spline.getInterpolatedPositionNormal(i) *
spline.getInterpolatedPositionThickness(i) *
spline.getInterpolatedPositionThicknessCorrectionScale(i));
inner.push_back(spline.getPosition(i) -
spline.getInterpolatedPositionNormal(i) *
spline.getInterpolatedPositionThickness(i) *
spline.getInterpolatedPositionThicknessCorrectionScale(i));
}
Although I am currently unable to test this, it should mean that:
outer contains the three points of the corners on the outside of the shape, and
inner contains the three points of the corners on the inside of the shape.
You can then do what you want with these points