How can I generate 3d wall from 2d lines in three.js?

I am going to build 3d wall from 2d lines given as following.
image
I tried to create shape geometry from the lines and extruded it using Extrude geometry.
image
This causes a gap at the edge.
image
How can I get a shape that overcome this issue?
I expect something like this one.
image
Maybe it is one kind of polygon offset.
I have already worked around polygon offset, but I hope threejs has easier way for this problem.

Hi!
Have a look at this forum topic: ProfiledContourGeometry

@prisoner849, thanks for quick reply.
I have already checked it but not sure it is helpful.
Does it work for the case when a vertex has more than 3 lines?
image

No, it doesn’t, but feel free to modify it for your needs.

Maybe, thanks anyway.

But I think, as you need to build walls like you showed, that topic is inappropriate for you in general. You need a different approach.

I think it’s the easier and fastest way, but do you have any other suggestion about it?