BUG: Grasshopper BBox error for blocks with units different to document

Hello,

by the looks of it, since a few updates ago the Bounding Box (also with “Union Box” -setting) of Block Instances keeps extending to the World Origin. I suspect it’s somehow including a “plane” -element inherent to Blocks (by which I mean a transform matrix from world XY, that somehow leaves behind the world XY plane as geometry included in the bounding box).

If I explode the Block Instance geometry, the Bounding Box resolves as expected; there is no ‘actual’ geometry in the Blocks at the world origin.

-Pekka

I don’t see this in the latest update.

Might help sharing a Rhino file and Grasshopper definition

Looks like I did write too soon; false alarm.

Upon further investigation, I see not all of my blocks have this issue and I’ll have to troubleshoot them.

Thanks for the resulting rubber-duckie debugging help!

It looks like the real issue is blocks that have a different Unit system to that of the Rhino document have their bounding boxes calculated differently in Grasshopper.

In my case my document is in meters, with some blocks definitions also in meters and others in millimeters - the latters’ bounding boxes don’t encompass their geometry correctly, though the center-point of “Box Properties” calculates out correctly.

I’ve attached a Rhino file with a few blocks in meters and millimeters, with associated Grasshopper -file calculating the bounding box and box-properties-center for the block instances and their exploded contents.

Rhino Bug report, block bounding boxes in grasshopper.3dm (1.2 MB)

Rhino Bug report, block bounding boxes in grasshopper.gh (9.6 KB)

Should I change the name of my post to better fit this issue?

You can retrieve the units of the block definitions. There is a component to convert units but I’m currently confused how to use it.

I think I figured out how to scale so everything is the same but 26 meters bbox diagonal seems a bit long.

block unit conversion meters.gh (29.2 KB)

I was also trying to use the convert units component, and I was also confused and I got the impression the component is more for numerical conversions (for, say, reports or use in formulas) rather than for modifying the unit system of blocks.

I solved my situation by manually modifying the blocks with millimeter scale. In Rhino, I first ran “BlockResetScale” on them, and then changed the units in the Block Definition list, selecting the option “Change unit system and maintain object sizes”. This resulted in the block geometry staying the effectively the same size, while the block definitions’ units changed.

So my situation is solved, however I’m still reporting that the bounding box calculation for blocks with a unit system different to the Rhino document appears to have a bug in it.

Try my new file in the post above, I replaced it

Thanks, Martin,

that works great!

I’d like to celebrate that in that definition, content-caching the scaled block definitions doesn’t break the script, while ‘repairing’ blocks of the undesired unit system imported from elsewhere (as I want to do in this case), because after the caching the unit conversion becomes meter->meter and does no harm.

A nifty component, then!

Should we update the topic title so it says something about block definition units confusion?

I gave it a shot!

So is it a bug?

Hi @pekka.riihonen,

I’ve logged a ticket so a developer can investigate.

– Dale