Auto dimensions

 From:  Michael Gibson
11637.16 In reply to 11637.12 
Hi Peticel, for the size not being what you expected, on line #18 of your script that currently has this:

code:
        var bbox = obj.getBoundingBox();


Change it to this:
code:
        var bbox = obj.getBoundingBox( true /* Calculate tight bounding box */ );


When you call obj.getBoundingBox() you'll get bounds that are quickly calculated by the bounding box of all surface control points.

There are just a couple of surfaces in your object that have have been trimmed by the boolean where the underlying surface's control points are a little bit larger than the active trim boundary:


If you want a "tight" bounding box that uses the trimming boundaries you need to pass in a function argument of true to the .getBoundingBox() function. There is quite a bit more calculation involved for getting the tight bounding box.

- Michael
Attachments: