Retain boundary after offset

Hi All,

I would like to retain boundary after offset of polylines. Kindly see the attachment for reference.
I used bowerbird but boundary vanishes as soon as it touches. But normal offset curves just overlaps and crosses boundary like after intersection. So I like to stop the offset as soon as it touches and forms a boundary line without disappearing. Is there a way or any other component that can achieve this in gh.

boundary-retain.gh (8.5 KB)

Hi,

you should find the distance to the closest curve and do a regular offset by that distance.
Divided by 2.

thats what I did but gaps are not same so offset wont do good in both directions. For example if distance between polylines is 10 mm along x direction and 15 mm along y direction then it will be difficult. I need something like voronoi but for rectangles.

So, this is not what you are aiming for?

yes kind of but you can see there are gaps still. You took smallest distance between curves and made offset but I am trying to close all the gaps not one by one but together where offset extends equally between gaps.

Then, we are not talking about offseting any more, it is different operation - streching.
If you try to achieve that then you are loosing original proportion of the boundary.

yes kind of like voronoi component does where after intersect it offset on other direction until it intersects. Is there any component in gh or any solution?

That can be achieved with some looping/coding only.
But, even then those zig-zagged shapes will cause trouble, in my opinion.