Hey Everyone, I am trying to get the length width and height from a cuboid relative to its greatest surface area. The difference would be between the vertical and horizonal pieces. but i want the to all read as if they are horizontal.
I was just sorting by largest value for the length being the first value and the width the second. but that becomes problematic what you have a side that is shorter than it is long. its mixes the length and width.
Any Ideas how to do this? could we normalize the .cuboid based on largest surface area?
Whats Wrong (type 24 is switched)
Not sure i fully understand but i would look into using vector to sort the surfaces perimeter curves to make sure i use the same direction on all measurements
I’m not sure I am following the question here, but it sounds like you want to get matching LxW dimensions for the cuboid faces which have the same orientation as the surface with the largest area…
This should work assuming you work thus far follows some assumptions:
- Only have cuboids
- All cuboids are built by standard Dynamo means
- All cuboids were created and not manipulated inconsistently (ie: one rotated by 90 degrees, another not)
This is absolutely working within the limits of the typical geometry creation, so if you’re not sticking to any of the above it won’t work, and you’d have to orient your surfaces first, but Cuboid.Length won’t work if the first two aren’t true, so I’m assuming the 3rd is as well. If not you may need to sort by orientation/rotation (something it’d be nice to query directly, but you can get this from the Curve Direction property of the respective edges - the order of creation for a cuboid even after rotation will be consistent again).
1 Like
Thanks Jacob! That worked!
1 Like