import * as THREE from 'three';

import * as Types from "../../../../types/world/worldTypes";

function vectorizeLinesCurrent(
    lines: Types.Lines
): Types.Lines {

    //////////  Storing a vector3 array in localstorage makes the prototype functions go puff. This function brings back the prototype functions by creating it again  //////////

    return lines.map((line) => {
        const p1: Types.Point = [new THREE.Vector3(line[0][0].x, line[0][0].y, line[0][0].z), line[0][1], line[0][2], line[0][3],];
        const p2: Types.Point = [new THREE.Vector3(line[1][0].x, line[1][0].y, line[1][0].z), line[1][1], line[0][2], line[1][3],];
        return [p1, p2];
    });
}

export default vectorizeLinesCurrent;
