The triangulation of the different shapes (sphere, cylinder, torus … plane surfaces) uses the same algorithm with only small differences due to the mathematical dependencies.

See

Triangulation sphere with holes

Triangulation cylinder with holes

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)

https://hofk.de/main/threejs/sandboxthreei/InnerGeometryTHREEi_01.html

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.

example https://hofk.de/main/threejs/Triangulation/02_InnerGeometry.html

example

https://hofk.de/main/threejs/sandboxthreei/InnerGeometryTHREEi_03.html

**GitHub** https://github.com/hofk/THREEi.js

examples

https://github.com/hofk/THREEi.js/blob/master/examples/InnerGeometryTHREEi_01.html

https://github.com/hofk/THREEi.js/blob/master/examples/InnerGeometryTHREEi_02.html

https://github.com/hofk/THREEi.js/blob/master/examples/InnerGeometryTHREEi_03.html