How to calculate inner vertices of a line renderer? (math question)

Hello guys,
I would like to ask you a math question, if I can. :slight_smile:

I have this:

alt text

I have the red line (generated with line renderer), and I’ve to generate the white line.

WHAT I KNOW:

  • Position of the vertices of the red line.
  • Position of the center vertex of the red line

WHAT I NEED TO KNOW/CALCULATE:

  • Position of the vertices of the white line.

Any help?
Thank you.

here’s a rough approach.

for each point:
  calculate the inward-facing normal of each of the two line-segments touching the point.
    eg, inNorm(p1, p2) = (p2 - p1).Normalize().Rotate90AboutZ().
  add those two normals together.
  normalize the resulting vector.
  scale the resulting vector by whatever offset distance you want.
  that's the new point position.