## Calculate Area of a simple LCD drawing

Feb 28, 2012 at 10:56pm

# Calculate Area of a simple LCD drawing

Hello everybody,

I’m pretty new to Max and I have some troubles doing a simple thing.
I want to be able to output the minimum and maximum values of both x and y when drawing in an LCD object, in order to calculate its simplified area.
Indeed, this technique will not calculate its precise area but the area of the rectangle created by taking these values. (this is what I want)
I have trouble to output the maximum and minimum x and y values of a drawing.
Here is what I’ve tried:

– Pasted Max Patch, click to expand. –

The problem is that the “maximum” object doesn’t seem to receive the “bag” information simultaneously so it doesn’t output the maximum of the bag’s list.

I hope someone can help me!
I’m sure the solution to my problem is simple but I don’t know how to solve it.

Thank you!
Ugo

#62040
Feb 29, 2012 at 1:34am

try the patch below… should do the trick…

– Pasted Max Patch, click to expand. –

ooops. should have read better… this will only calculate the area of the click on and click off area…
not the maximum drawn area….

#224094
Feb 29, 2012 at 1:53am

a quick hack… I think this works…

– Pasted Max Patch, click to expand. –
#224095
Feb 29, 2012 at 2:18am

Wow! This was my first post on the forum and I can say that it is awesome :)
Thank you very much for the quick answer, I really appreciate!
By the way, I also tried to figure out the problem on my own and I came out with this solution.

– Pasted Max Patch, click to expand. –

But yours is nice too because it draws the actual rectangle over it! Very professional indeed.

Thank you again MIB

#224096

You must be logged in to reply to this topic.