Help: working with irregular geometry

Hi all,

I have a 3D scanned mesh of a tree trunk in Rhino, and I’m trying to simulate how it would be processed in a sawmill. Specifically, I want to identify the longest, straightest section of the trunk from top to bottom—essentially the part that would yield the largest usable cut. Once that axis is found, I want to generate a square profile around it, representing the portion of the trunk that would be milled into standard lumber, like a 2x4. Around that, I also want to define the offcut sections—the leftover parts of the trunk that surround the milled core, similar to how rough cuts and slabs are made in the milling process.

What’s the best way to approach this in Grasshopper? I’m working from a mesh and looking for a method to align the cut geometry properly along the trunk, extract the primary section, and optionally define the offcuts. Any suggestions on how to set this up would be greatly appreciated.

Thanks!

First thing what came up in my mind was this forum-thread: How do I find the smallest possible bounding box for a solid? - #3 by RadovanG
It is about the smallest possible box around a solid.
Your question could be defined as the largest possible box inside a solid.

Second approach:

  • Contour could be used to slice your tree in all directions: radial, horizontal, vertical to find the slice with the largest area.

Third approach: Assuming your largest possible cut will have the length of your tree, then you are sure that, there must be possible to draw 4 parallel lines (the corners of the cut) from one end to the other. You could use randomly placed points at both side and connect them. Cull all what cross the surface of the tree.

It might give you directions on how to search from there.
Nice project!. Regards, Eef