Closing ribons vertices

Hi.

I can’t close this ribon posints at the end there is a gap, I can’t tell why, I tried Ai as well it makes it worse…

// Ribbon mesh creation let number = 1000; let frenetFrames = this.curve.computeFrenetFrames(number, true); let spacedPoints = this.curve.getSpacedPoints(number); let dimensions = [-0.1, 0.1];
    let finalPoints = []; // Using finalPoints instead of vertices

    // Iterate over each dimension to create the ribbon effect
    dimensions.forEach((d) => {
        let binormalShift = new THREE.Vector3();

        // Loop through all the points and create finalPoints
        for (let i = 0; i < number; i++) {
            const point = spacedPoints[i].clone();
            binormalShift.copy(frenetFrames.binormals[i]).multiplyScalar(d);
            finalPoints.push(point.add(binormalShift));
        }
    });

    // Close the ribbon by connecting the first and last points
    for (let d = 0; d < dimensions.length; d++) {
        const point = spacedPoints[0].clone();
        const binormalShift = frenetFrames.binormals[0].clone().multiplyScalar(dimensions[d]);
        finalPoints.push(point.add(binormalShift));
    }

Closed:

CarRacing

from the Collection of examples from discourse.threejs.org

The example you sent me is a bit too complex for me to understand, I tried… :frowning:

Why not try to have a look at how things work under the hood in something similar to what you want to achieve?
Link: three.js/src/geometries/TubeGeometry.js at beab9e845f9e5ae11d648f55b24a0e910b56a85a · mrdoob/three.js · GitHub

I tried, did my best I just can’t close the darn thing…

I figured it out, I added substracted one index in the plane geometry and I did not noticed it…

https://webdesign-flash.ro/ht/ic/