Add Ring Mesh to available meshes

Hello! Dan from Frame (framevr.io) here.

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. :smiley:

Appreciate all the great work you folks are doing. We’re digging Babylon more and more as we explore it further.

Thanks!

3 Likes

Hello and welcome Dan!

Is it different from our torus? Creating A Torus | Babylon.js Documentation

Hi, @Deltakosh!

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.

Thanks so much for entertaining the idea.

1 Like

Hi @DanSinni and welcome to the forum.

True . You can get close by using CreateLathe with a thin shape.

https://playground.babylonjs.com/#PQ0GIE#9

@DanSini welcome we have a lot tools for make geometry please look GeometryBuilder

Too

editor : GeometryBuilder

result : 3dBind | GeometryBuilder

spiral: 3dBind | GeometryBuilder

2 Likes

Hi all! Another newbie here.

@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). :smile: and almost a day integrating it with react, so I can use redux to manipulate 3d data.

After reading Creating custom meshes porting it seemed quite straightforward.

Here is what I came up with. Hope it helps.
https://playground.babylonjs.com/#VA2P34

FYI. Before today I had no idea what UV is. :smile: so I guess thank you BabylonJS for making my day.

3 Likes