threejs-worldgen
    Preparing search index...

    Function simplifyPolygon

    • Drops vertices where the outline barely turns (less than angle radians), and repeated points. tags (one per edge, edge i = p[i]→p[i+1]) are kept in step; an edge merged into its predecessor keeps the predecessor's tag, but only vertices between edges with equal tags are dropped.

      Type Parameters

      • T

      Parameters

      • p: readonly Vec2[]
      • tags: readonly T[]
      • angle: number = 0.035

      Returns TaggedPolygon<T>