Rendering a hollow cylinder/pipe

Does anyone have any guidance on or experience with rendering a hollow cylinder or pipe with JME3? I would like to create render a nuclear fuel pin and slice it in half: there’s an outer pipe or “clad” with stacks of pellets, which are just smaller cylinders, on the inside.

My first idea was to look at the Cylinder class to determine if an inner radius could be specified in addition to an outer radius, but it only allows for the radii of th ends to be specified (to create a cone).

I imagine this could also be done by extruding a simple annulus.

Any thoughts would be greatly appreciated. If this results in new, useful code, I’ll gladly commit it to the JME3 repo if you like.


Just model it in blender or look at the “custom meshes” docs.

@normen said:
Just model it in blender or look at the "custom meshes" docs.

Thanks Normen! I considered both of those yesterday. I don't think Blender will work because the inner radius is not set as constant fraction of the outer radius.

I was looking at the source for Cylinder for some insight on more complicated meshes than the quad discussed in the "Custom Meshes" doc. I came across this:

That's exactly what we need - a tube - so we will give it a try. If we are able to get this working, do you think it would be possible to migrate this contribution into the source (with credit going to the original posters, of course)?

We reduced the number of basic shapes in jME3 as for most real-life situations they are always insufficient and bloating them with lots of features or adapting them all the time so they’re useful for everybody isn’t really feasible and just makes for feature creeps and maintenance overhead.

Still you’re very welcome to at least post the code here so it might help others. Maybe it’ll even be integrated in the core engine but like I said, probably not :slight_smile:

Thanks, Normen.

If we post anything and it is possible to integrate it into the engine, I’ll gladly take personal responsibility for maintaining it.

1 Like

That sounds good :slight_smile:

Have you looked at boolean operations in blender? You have to be a little careful with the resulting mesh but you can easily generate some complex meshes that way.

Thanks for the suggestion Zarch. Unfortunately that won’t work because we need to dynamically update the inner radius of the cylinder at runtime.


InShadow and kotoko’s method (linked above) works perfectly for an annulus/tube mesh right out of the box.

Sounds like you need a custom/dynamic mesh then.

It’s pretty easy to write one really, especially for simple geometric shapes like this.