How can I punch a hole in a cylinder?

I’m trying to create an “info” button by combining some primitive shapes. So far I have the outer wall (cylinder), inner wall (tube), the white background (disc), and the “i” (another cylinder, and a cube):

The tricky part I can’t figure out – how can I use the “tube” to punch a “hole” in the outer cylinder? I looked around for some sort of notion of subtracting meshes, but haven’t found anything. I see there’s a way to “merge” meshes with a custom function, but the math involved in that is daunting.

My other option is to use a “filled” info button with a raised “i” (e.g., File:Eo circle blue white info.svg - Wikimedia Commons) instead of a “ring” info button like I’d prefer to use (e.g., Category:SVG Info icons - Wikimedia Commons).

I’d be happy with either one, but if there is a way to easily use one mesh to punch out the interior of the other (and still have the inside faces), I’d love to know how!

You might be able to rely on CSG for this which lets you add substract meshes together:
CSG | Babylon.js Documentation

2 Likes

Dadgumit, I looked all over the place and never ran into that class!

It worked beautifully, here’s the result:

3 Likes

What a frighteningly complex problem.