import * as THREE from 'three';

export default function objectLineToArray(structuredObject: any) {
    if (!structuredObject || !structuredObject.line) {
        return [];
    }

    // Destructure common properties
    const { layer, type, line } = structuredObject;

    // Map points back to the original array format
    return line.map(({ position, uuid }: any) => [new THREE.Vector3(position.x, position.y, position.z), uuid, layer, type]);
}