# how to draw mesh equal distance from irregular shape geometry bounding box

I am given an irregular geometry shape with its vertices, bounding box information.

How to draw a smooth mesh equal distance from that irregular geometry shape's bounding box?

Please refer to the image here:

My attempt: 1) I have tried to create 8 spheres at 8 corners of a bounding box and a box for X, Y, Z direction. The result looks very ugly and not smooth like this:

Is there any algorithm or formula I can utilise to draw mesh around a bounding box?

Thank you

• You're almost there, just add cylinders along each edge of the bounding box as well. If you then want to render it transparent and not see all the intersections between the spheres, cylinders, and boxes, there is a simple way to do that too, but it is too long for this comment box. – Rahul May 4 '18 at 15:40
• @Rahul, how to render the intersections between spheres, cylinders, boxes to be transparent? You can write it as an answer if you wish. Thanks. – user2150279 May 4 '18 at 19:56

## 1 Answer

One way to visualize an object's bounding box would be like this:

$$\hskip2.5in$$

As Rahul mentioned in a comment, you can achieve this by adding a total of 12 cylinders at the edges of the bounding box, connecting the spheres at the corners.

If you want to render the bounding box transparently, I don't see an easy way to hide the intersections of the spheres and cylinders without knowing what program you are using. You could try to use partial spheres for the corners and see if that helps, i.e.

$$\hskip2.5in$$

Maybe this is already sufficient for your purpose. (This is exactly 1/8th of a full sphere.)