Is it possible to calculate the length of a Brep using Grasshopper?

I have a Python component script that generates a specification for beams (how many beams of a given length). At first, I took lengths from the guide curves along which I lofted the profile, but later I needed to trim the resulting Brep. Is there a way to get the lengths of a Brep, and if so, how?


Looks like the columns line up nicely with the worldxy plane, so I think you can use the boundingbox component and then feed that into the deconstruct bounding box component, and then feed the Z value (the start Z to the end Z). Since the columns are one the floor plane, the height would just be the end value of the Z slot. If they were not on the floor, you would need to subtract the Z’s start value from its end value (which also works if they are on the floor).

This solution only works for things that are lined up with the floor plane. For things that are not lined nicely up with the floor plane, it can get complicated.

Be sure to verify the results (like test it out on a few columns that you have measured in Rhino).

bbox example.gh (11.7 KB)

You can get the same result by deconstructing the diagonal vector:


bbox example_2025May23a.gh (13.1 KB)

All my columns are indeed parallel to the floor, but I also need to calculate the lengths of the beams, some of which are positioned diagonally. One more important clarification: my beams aren’t square; they’re assigned a specific cross-section (I-beam, channel, or angle).

Am I correct in understanding that for such an arrangement, neither your solution nor @Joseph_Oster will work?

NO :bangbang: Definitely not. Your “understanding” is incorrect.
If you had posted a file we could have helped you.

3. Attach minimal versions of all the relevant files

The diagonal of the bounding box will be a close approximation (as long as the beams are much longer than their profile size). Another way would be to get the length of the longest edge (DeconstructBrep → CurveLength → Sort → ListItem).

The Z component of the diagonal will work even for short beams, eh?

The longest vertical edge?

My understanding is that the OP needs the physical 3D length of the beam rather than a specific component.

I must be missing your point? The Z component of a bounding box diagonal will be the height.

I agree that you can measure the height that way. I just don’t think the height is the value the OP is trying to measure.

I reduced the number of beams and columns (the number of columns depends on the number of beam intersections) so that the file wouldn’t hang. I’m also attaching a picture showing exactly what I want to measure.

script.gh (53.0 KB)

script.gh (54.8 KB)

1 Like

OH :bangbang: I thought you meant the vertical columns.

Isn’t it enough to get the lengths of the ‘x_segments’ and ‘y_segments’ outputs of your Python Segments component :question:

The segments correspond to the beam’s length before it was cut, so this option is possible, but it will not exactly match the length of the final Brep(

Your solution suits me perfectly (I didn’t actually need to display the values on the model—my current task is just to extract the list of lengths, though showing them is very informative). If I can’t figure out how to do this without plugins, I’ll go with your solution.

1 Like

Construction detail. If you cut the beams in advance, some are likely to be short (or long).

Of course it can be done without plugins :bangbang: Easily.

P.S. But… the longest edge might not be the beam’s actual maximum length :bangbang:

I’ve come up with this approach: trim the guide segments in the same way the beams are trimmed (at the columns), and then collect the lengths of the trimmed segments. There will likely still be some error, but it won’t be nearly as large.



cutted_segments.py (431 Bytes)


beam_length_2025May23a.gh (404.9 KB)

P.S. Added white group to display cut beam lengths at the middle of each beam.


beam_length_2025May23b.gh (409.0 KB)

1 Like