Remove gaps between packed rectangles

Hello everyone,
So I managed to pack rectangles the way I need using kangaroo 2.
however I cannot manage to have 0 gaps it just screw up with the code.

I am trying to script a c# code that would remove the gaps between the rectangles.
so that they form one region if I do a region union.

If anyone can help me with this I would be really thankful.