Skip to main content

Function: updateContourPolyline()

updateContourPolyline(annotation, polylineData, transforms, options?): void

Update the contour polyline data

Parameters​

• annotation: ContourAnnotation

Contour annotation

• polylineData

Polyline data (points, winding direction and closed)

• polylineData.closed?: boolean

• polylineData.points: Point2[]

• polylineData.targetWindingDirection?: ContourWindingDirection

• transforms?

Methods to convert points to/from canvas and world spaces

• transforms.canvasToWorld?

• transforms.worldToCanvas?

• options?

Options

  • decimate: allow to set some parameters to decimate the polyline reducing the amount of points stored which also affects how fast it will draw the annotation in a viewport, compute the winding direction, append/remove contours and create holes. A higher epsilon value results in a polyline with less points.

• options.decimate?

• options.decimate.enabled?: boolean

• options.decimate.epsilon?: number

• options.updateWindingDirection?: boolean

Returns​

void

Defined in​

tools/src/utilities/contours/updateContourPolyline.ts:24