lir icon indicating copy to clipboard operation
lir copied to clipboard

Return the n biggest rectangles

Open kaka1909 opened this issue 2 years ago • 5 comments

First of all, many thanks for your project which help me a lot in my work. And I have a question that, is there any way to find the largest horizon rectangle inside a shape? I need a horizon rectangle to put some words in it.

Thanks, Mi

kaka1909 avatar Oct 16 '23 08:10 kaka1909

Can you make a sketch to describe what excatly you need ?

lukasalexanderweber avatar Oct 17 '23 12:10 lukasalexanderweber

Can you make a sketch to describe what excatly you need ?

Yes. Actually I am trying to find a large horizontal "empty" area outside the main object(like the man in below picture) to put some words in it.

mihai_rect_副本

In this figure, the blue rectangle is the largest rectangle computed by lir, it seems too narrow if I put some words in it. So in this example, maybe the green rectangle( the largest horizontal rectangle) which is indeed smaller than blue one is better for my needs.

Thanks a lot.

kaka1909 avatar Oct 23 '23 06:10 kaka1909

I think there should be the possibility to return multiple rectangles ordered by size

lukasalexanderweber avatar Nov 13 '23 14:11 lukasalexanderweber

Yes, that will be great.

kaka1909 avatar Nov 29 '23 03:11 kaka1909

I would love this as well. As the reporter said, having the widest available rectangle is very useful for finding where text can be placed. If a list of rectangles is returned I imagine you don't even really need to sort them, the caller can sift through them to find the widest themselves.

warriorstar-orion avatar Jan 29 '24 20:01 warriorstar-orion