Road with spline

Hey, everybody. Need help from experienced professionals. I have a simple logic to generate a road with spline, but there are some problems. The segments on the spline have several polygons, but they do not want to correctly repeat the curves of the spline, so there are noticeable corners at the joints of the segments. In addition, the segment has the correct UV, but since its deformation is not correct, the texture starts to stretch. This is especially noticeable when using larger segments.



Small segment


Large segment

I’m very new to code and don’t always implement my ideas correctly. Please help me to solve this problem. If you need to provide a code snippet, or anything else, say so.