Options
All
  • Public
  • Public/Protected
  • All
Menu

Class OwllySvgUtil

Hierarchy

  • OwllySvgUtil

Index

Constructors

Methods

  • convertCmds2T3(context: OwllyRenderContext, cmds2d: (string | number)[][]): (string | number)[][]
  • Parameters

    Returns (string | number)[][]

  • convertCmds3T2(context: OwllyRenderContext, cmds3d: (string | number)[][]): (string | number)[][]
  • Parameters

    Returns (string | number)[][]

  • convertCoords(cmds: (string | number)[][]): [number, number][][]
  • Parameters

    • cmds: (string | number)[][]

    Returns [number, number][][]

  • convertCoordsByPath(path: string): [number, number][][]
  • Parameters

    • path: string

    Returns [number, number][][]

  • createPath(cmds: (string | number)[][]): string
  • Parameters

    • cmds: (string | number)[][]

    Returns string

  • get2dPoint(context: OwllyRenderContext, x: number, y: number, z?: number): null | { x: number; y: number }
  • Parameters

    Returns null | { x: number; y: number }

  • get3dPoint(context: OwllyRenderContext, x: number, y: number): null | { x: number; y: number }
  • Parameters

    Returns null | { x: number; y: number }

  • getCenter(path: [number, number][]): [number, number]
  • Parameters

    • path: [number, number][]

    Returns [number, number]

  • getCmd3d(context: OwllyRenderContext, cmds2d: PathCommand[], getCoords?: boolean): { centroid?: [number, number]; cmds3d: (string | number)[][]; coords?: [number, number][][]; path: string }
  • Parameters

    Returns { centroid?: [number, number]; cmds3d: (string | number)[][]; coords?: [number, number][][]; path: string }

    • Optional centroid?: [number, number]
    • cmds3d: (string | number)[][]
    • Optional coords?: [number, number][][]
    • path: string
  • parsePath(path: string): (string | number)[][]
  • 解析owlly shape路径

    Parameters

    • path: string

    Returns (string | number)[][]

  • toDataJson(svgStr: string): Promise<Shape[]>
  • Parameters

    • svgStr: string

    Returns Promise<Shape[]>