Set one model the size as the other model, how to?

What I am trying to do is set model at to the size of model b.

So for example. I need to get model b’s size and then make model a the same size as model b.

How would I do this.

First I need to get model b’s size and then set it to model a.

I’ve tried getBounds and getRadius but the size I get increases model a to a way larger size. Model a and b can be varying sizes so I cant really use setScale to set the scale of it eiher :[ i’m at a loss for how to figure this out

Thanks for the help!

What do you mean by the “size”? Do you mean the distance between the lowest point and the height point in the model?

You can do something like this:

amin, amax = a.calcTightBounds()
aheight = amax[2] - amin[2]

bmin, bmax = b.calcTightBounds()
bheight = amax[b] - amin[b]

b.setScale(aheight / bheight)

David

I just tried to use calcTightBound which raise following error “TypeError: calcTightBounds() takes 3 or 4 arguments (1 given)”. This error is consistent with the documentation of this function. So how can one get the min/max edge?

David probably means:

amin, amax = Point3(), Point3()
a.calcTightBounds(amin, amax)
aheight = amax[2] - amin[2]

bmin, bmax = Point3(), Point3()
b.calcTightBounds(bmin, bmax)
bheight = amax[b] - amin[b]

b.setScale(aheight / bheight)

Ah, yes, my apologies. Actually I meant getTightBounds(), which is a convenience function that does the call to calcTightBounds() with two parameters that rdb describes, and then returns the two parameters.

David