convertPrimitiveToLines

  • convertPrimitiveToLines(prim: Primitive): void
  • Converts a LINE_STRIP or LINE_LOOP Primitive to LINES, which is more widely supported. Any other topology given as input (points or triangles) will throw an error.

    Example:

    import { convertPrimitiveToLines } from '@gltf-transform/functions';
    
    console.log(prim.getMode()); // 2 (LINE_LOOP)
    convertPrimitiveToLines(prim);
    console.log(prim.getMode()); // 1 (LINES)
    
Function symbol, where the argument and output are a box labeled 'glTF'.

Made by Don McCurdy. Documentation built with greendoc and published under Creative Commons Attribution 3.0.