Connecting beams without affecting the curve of the initial beam

I’m trying to make beams connect without affecting the curve of the initial beam, and work at any point on the curve.

For example:

The issue is that I have no idea how to convert this idea into code, as I have an issue calculating the CurveSize0 and CurveSize1 for both of the beams.

A temporary way I’m trying to do this is by keeping the initial beam, cutting off the end of it using transparency, and adding another one, and will look like this:


An issue I have with this is that the transparency will look way too obvious and this won’t work when rescaling, as I have to do this over and over.

Please help!