-9

Edit: The question is about "minimum-area rectangle packing" algorithm - with the difference that rectangles are grouped "around the center point" instead of inside of a bin.
Image is provided to visualize the concept, since no similar problem was found on SO.
Problem is UI agnostic and does not need code for UI.

bin-packing tag seems to be closest one to this question (but packing might fit better)

Orginal:
There is list of rectangles with different (known) widths and heights.

How to pack those rectangles around center point - like this: enter image description here

Above was implemented with library that costs $4,000, so too much for now.

https://jsfiddle.net/zw5ncrom/

Only coordinates of those rectangles are required.

I'm open to implementation in any language that can be compiled to WASM (for browser) or plain js.

//code's length in the fiddle is above StackOverflow post body limit,
//not posting it here
8

0

Browse other questions tagged or ask your own question.