We had a great meeting with @RaananW earlier, and I mentioned that it would be great if Babylon had a Ring Mesh, similar to Three.js’ RingGeometry (three.js docs).
I realize there are other ways to achieve this shape, but it seems common enough that it might be useful to have this readily available, and might be appealing to those coming from Three.js.
Appreciate all the great work you folks are doing. We’re digging Babylon more and more as we explore it further.
Thank you for welcoming me and for the quick reply.
Yes, it’s a bit different from a Torus in that it’s a 2D / flat planar shape, rather than a 3D donut shape. Unless there’s a property of Torus in Babylon that I’m missing that could achieve this without overlapping faces.
It’s somewhat similar to Circle (in Three.js) or Disc but with an innerRadius for the hole (although the geometry is different from a Circle/Disc).
This allows to easily create polygons with holes in them by adjusting the thetaSegments for the number of sides and phiSegments for more complex inner geometry.
I’ve found it to be very useful in Three.js, so just thought it might be worth a mention here as I think it would add some benefit to Babylon as well.
@DanSinni, I came across your post while scratching my head how to do exactly what you asked. Since none of the suggestions made any sense for my use case (I’m attempting sci-fi strategy game with BabylonJS), I decided to port it directly from ThreeJS.
I have no prior ThreeJS experience and only spent few hours with Babylon documentation (its really good). and almost a day integrating it with react, so I can use redux to manipulate 3d data.
I was looking for a similar solution, but for an unclosed ring (donut). I realized that there is no ready-made solution, so I created my own donut builder function. I’m posting it here, if anyone needs it