How can I make good tube with three.js? for example railings

Yeah, actually I am thinking about a similar solution already.
Have 2 ends parts and link them with generated geometry…
But I thought in this case, I will have 3D models of ends of railings.
Can you help me to understand what you mean with curved path example?

You can take your pre-generated sections for the railing… and connect them along a curve using the curve modifier.

The curve modifier takes a mesh and warps it around a curve.

https://manthrax.github.io/InstanceCurve/index.html

3 Likes

I see… I thought I will have those end parts from glb model.
Using curved mesh is a good idea, but I am worried that whether it will be more efficient than creating geometry using those points…

it might be more efficient than creating a static mesh, and be dynamic as well… but that’s hard to say without experimenting.

For a rail with only 3 segments, it might not be quite as efficient… but the more segments you have the more efficient instancing becomes.

Here’s an article about the original modifier by @AdaRoseCannon :smiley:

Revisiting this topic only because once upon a time I did rounded corners of polygons. Here is a demo, it may give some ideas for railings in 3D:

1 Like