Apply clipping planes to only specific area of object

I tried slightly different approach and there is no visible problem where the two halves are attached, although there are transparency issues in other parts of the shape, but they are not related to the cutting and stitching. Here is the result (left is stitched object, middle and right are both halves):

https://codepen.io/boytchev/full/ExeoeOJ

image

I do the following:

  • Cutting is done by an additional horizontal cutting plane through the middle of the object. So, there are two identical obejcts: one shows only its top half, the other – its bottom.
  • To resolve transparency at the point of object cutting, each of the two identical objects are additionally split into two – with FrontSides and BackSides.
  • Overall I have 4 identical objects – top-front, top-back, bottom-front, bottom-back. Render order ensures the back objects are drawn before the front objects.
  • Obviously there are no caps.