Packing Rectangles into a polygon using JavaScript
Asked Answered
S

0

6

I need to pack n rectangles (n<10) of different size into a simple polygon. I am aware of two possible solutions:

  • Bin packing rectangles into a rectangle. Then the problem becomes finding a rectangle in the polygon that is reasonably large. It doesn't need to be the largest rectangle, but it should be large enough to be a good approximation of the polygon for packing those small rectangles. Is any algorithm that could do this?

  • Using a constraint solver. The only JavaScript constraint solver I know is Cassowary. However, it is a linear one, and it seems to me that constraining a point inside a simple polygon is not a linear constraint.

Any ideas?

Siddon answered 14/8, 2012 at 23:34 Comment(1)
What ever happened to this issue for you? How did you solve it?Ashmore

© 2022 - 2024 — McMap. All rights reserved.