Create a Cuboid from 8 points

Helllo Everyone,
I want to create a cuboid by 8 points and there is already a post related to it which isn’t helping.
If I use Element.BoundingBox then the output I need is not correct as it doesn’t take the rotation of the element. However I am able to get 8 corner points from a scope box and I just want a cuboid from these 8 points. so that I can do a Clash check in between the obtained geometry and centroid of all model elements to stamp the Scope Box name in Elements.
please check the snap for better understanding.



All suggestions are welcome.
Thanks in Advance.

There’s probably an easier way to do it, but this should work.

image

Get cuboids.dyn (24.5 KB)

2 Likes

I kinda like this approach but i have two questions @GavinCrump ;

How can i get the Intersecting Elements per Solid. Now it takes the two Solids together.

image

How can get rid of the points i don’t ‘need’. Because bcause of those points
I get that extra Wall in my list(?)

image

The bounding box of that solid will be axis aligned to the Y axis, so may pick up objects outside it. Try getting the geometry of the objects to test for solid intersections with the original extrusions instead.

Try using the geometry.doesIntersect node.
For the first input, use the solids obtained from your scope boxes. For the second input, use the centroid of the elements. This is a better way to determine which scope box an element belongs to since an element can be present in multiple scope boxes, and this method determines which box it is in based on the majority of the element’s volume. To obtain the centroid of an element, use the element.getCentroid method. If that doesn’t work, try obtaining the bounding boxes for the elements and then calculate the centroid of the bounding box.

1 Like

Thanks for putting me in the right direction.

Using Geometry.DoesIntersect Cross Product did it for me.