I do apologize beforehand as geometry is forever my Achilles heel. This might have some obvious solution I just cannot see. Please have a patience with me, if the schema is not marked or described by standards etc. Thanks
I have this geometrical object G1 (area filled with yellow):

It is a polygon created by 'widening' of geometry (G2) marked in black, widened by thickness (T).
All known values (lengths) are marked in the schema.
And I am trying to find a way to calculate X.
(It is a piece from graphic tool I am programming.)
The known values are: bounds of the object (width W1, height H1), bounds of the geometry G2, rectangular sides of the geometry G2 (W2,H2), radius (or offset) of the sloped corners of G2 (R) and coordinates of all vertices of geometry G2.
I was staring at it for 2 hours, charted all the known values, and trying to find a triangle in it with enough known values to calculate the unknown but came up with nothing so far.
Be glad for any advice

