Options
All
  • Public
  • Public/Protected
  • All
Menu

Package harp-lines

@here/harp-lines

Overview

This module provides the functionality needed to create three.js geometries for wide lines.

Index

References

HighPrecisionLine

Re-exports HighPrecisionLine

HighPrecisionObject

Re-exports HighPrecisionObject

HighPrecisionUtils

Re-exports HighPrecisionUtils

HighPrecisionWireFrameLine

Re-exports HighPrecisionWireFrameLine

LineGeometry

Re-exports LineGeometry

LineGroup

Re-exports LineGroup

createLineGeometry

Re-exports createLineGeometry

createSimpleLineGeometry

Re-exports createSimpleLineGeometry

numCirclePoints

Re-exports numCirclePoints

reconstructLine

Re-exports reconstructLine

reconstructLineWidth

Re-exports reconstructLineWidth

triangulateLine

Re-exports triangulateLine

Functions

createLineGeometry

  • createLineGeometry(center: Vector3, polyline: ArrayLike<number>, projection: Projection, offsets?: ArrayLike<number>, uvs?: ArrayLike<number>, colors?: ArrayLike<number>, geometry?: LineGeometry, highPrecision?: boolean): LineGeometry
  • Creates a LineGeometry object out of a polyline.

    Parameters

    • center: Vector3

      Center of the polyline.

    • polyline: ArrayLike<number>

      Array of numbers describing a polyline.

    • projection: Projection
    • Optional offsets: ArrayLike<number>

      Array of numbers representing line segment offsets.

    • Optional uvs: ArrayLike<number>

      Array of numbers representing texture coordinates.

    • Optional colors: ArrayLike<number>

      Array of numbers describing a polyline's colors.

    • Default value geometry: LineGeometry = new LineGeometry()

      LineGeometry object used to store the vertex and index attributes.

    • Default value highPrecision: boolean = false

      If true will create high-precision vertex information.

    Returns LineGeometry

createSimpleLineGeometry

  • createSimpleLineGeometry(polyline: ArrayLike<number>, colors?: ArrayLike<number>, geometry?: LineGeometry): LineGeometry

numCirclePoints

  • numCirclePoints(lineWidth: number): number

reconstructLine

  • reconstructLine(inBuffer: Float32Array, startOffset: number): Float32Array
  • Reconstruct the original points of a line from the vertices of the triangulated line.

    Parameters

    • inBuffer: Float32Array

      Buffer with vertices.

    • startOffset: number

      Start index, will differ from 0 if the line has caps.

    Returns Float32Array

    Buffer containing the original points of the triangulated line.

reconstructLineWidth

  • reconstructLineWidth(inBuffer: Float32Array, startIndex: number): number
  • Extract the line width from a triangulated line.

    Parameters

    • inBuffer: Float32Array

      Array of vertex elements of a triangulated line.

    • startIndex: number

      Start index, will differ from 0 if the line has caps.

    Returns number

triangulateLine

  • triangulateLine(points: ArrayLike<number>, width: number, vertices: number[], indices: number[], startWithCircle?: boolean, endWithCircle?: boolean): void
  • Create a triangle mesh from the given polyline.

    Parameters

    • points: ArrayLike<number>

      Sequence of (x,y,z) coordinates.

    • width: number

      The width of the extruded line.

    • vertices: number[]

      The output vertex buffer.

    • indices: number[]

      The output index buffer.

    • Default value startWithCircle: boolean = true

      true if the line should start will a circle.

    • Default value endWithCircle: boolean = startWithCircle

      true if the line should end with a circle.

    Returns void

Generated using TypeDoc