Polygonal Shape generator for a building walls

Hi all.

I’ve been looking into how to go about making a simple shape generator blueprint to place wall sections and such with given lengths of each wall to then spit out coordinates and rotations of the meshes so that each mesh would then start and end on locations where another mesh would either start or end on again. (wondering if that makes sense whilst writing this?!?!)

The idea is something like lets say the shape selection would be a irregular Pentagon (5 sided shape).
each modeled segment would possibly be 400 units wide and a ForLoop would determinate how many sections would be used per side on construct
side a for example would be 2 sections =800 units - b would be 3 sections =1200units - c would be 2 sections = 800units - d would be 4 sections = 1600units and lastly - d would have lets say 2 sections = 800units which accumulates to a total perimeter of 5200units.
Now how would i go about the math (searching for pentagon shape math online for days now, but cant find anything that works for finding angles from given side lengths only, everything seems to only refer to shapes with equal sided lengths).
What i’m after would be the vector location of the center of the shape as well as the 5 vector locations of each corner and the rotation angle relative to each other so that all meshes seamlessly meetup with each other.
maybe i’m not seeing something very obvious here, but i’ve been at it for 4 days now and can’t seem to wrap my head around it anymore.
Placing meshes and such isn’t the issue, its just the math that revolves around the locations and rotations that throws me off ( any help would be greatly appreciated).
i’ve tried playing with trigonometry and mixing triangles together into multi sided polygonal shapes but somehow it never ends up with aligning corners since only the sides are a given and the shape gets determined by random number of sections for each side (can be set manually or auto randomize thru a bool)

Thanks in advance.
Akamaru