Function prepareForRenderingWithCycles

  • Parameters

    • inputGraph: FOLDExtended

      a FOLD object

    • options: {
          earcut?: Function;
          layerNudge?: number;
      } = {}

      a small amount to nudge the faces in the cross axis to prevent Z-fighting.

      • Optional earcut?: Function
      • Optional layerNudge?: number

    Returns FOLD

    a copy of the input FOLD graph, with exploded faces

    Description

    This is a subroutine of prepareForRendering, if the layer order of faces in a graph is found to have cycles, this method is called instead. This explodes a graph so that faces which otherwise share vertices are separated (creating more vertices). This method will also nudge coplanar faces away from each other, based on their layer ordering (via. faceOrders or faces_layer) by a tiny amount in the cross axis to prevent z-fighting between coplanar faces.