The triangulation of the different shapes (sphere, cylinder, torus … plane surfaces) uses the same algorithm with only small differences due to the mathematical dependencies.
If you want to combine different shapes into an inner geometry, it is better to have only one function. This function then uses the appropriate mathematics for the geometry (normal, surface point …).
In addition to the triangulation functions, the construction of the matching fronts (boundaries, holes) causes a not inconsiderable effort. Currently approximately 1 to 1. If other forms are added (torus), the ratio shifts further.
Cylinders can be connected excentrically with tilt and have tilted caps.
A first example https://hofk.de/main/threejs/Triangulation/01_InnerGeometry.html
Use the slider.
Update 25 February 2020
Now in Addon THREEi (https://github.com/hofk/THREEi.js)
Different colors for front and back are realized with the shader @prisoner849. See How to have different colors/textures on bottom and top side of a Plane?
cap: ‘btm’ ‘top’ -> added
Because of the different distances you cannot simply turn the cap and InnerGeometryTHREEi_01.html uses different colors for front and back.