How to limit geometry within another geometry

as the title.

I have many points like [new Vector3(), …].

through these points, I created a TubeGeomtry(this radius = 0.2).

now, I use these points created CylinderGeometry( radusTop/radiusBottom = 0.2, h = 0.2).

but CylinderGeometry not within TubeGeomtry.

how to limit this.

20230428171955
20230428172011

If you could provide a better description of the problem, maybe someone might be able to suggest something.