warp

fun RectifiedContour.warp(basis: RectifiedContour, warp: RectifiedContour, errorTolerance: Double = 0.5, maxDepth: Int = 6, samplesPerPiece: Int = 24): ShapeContour(source)

Warps the current contour by applying a distortion based on the provided basis and warp contours. The operation computes a mapping where the nearest position and normal of the basis contour are used to calculate the displacement applied to the warp contour, creating a warped result.

Return

A new warped ShapeContour created by distorting the current contour using the provided basis and warp contours.

Parameters

basis

The contour used as the reference for the nearest position and normal calculation.

warp

The contour used as the source for applying displacement based on the mapped positions and normals.

errorTolerance

Maximum allowed RMS fit error used during the distortion process. Default is 0.5.

maxDepth

Maximum recursion depth for adaptive piece splitting during distortion. Default is 6.

samplesPerPiece

Number of samples per piece used for fitting and error measurement. Default is 24.


fun Shape.warp(basis: RectifiedContour, warp: RectifiedContour, errorTolerance: Double = 0.5, maxDepth: Int = 6, samplesPerPiece: Int = 24): Shape(source)

Warps the shape by applying a transformation based on provided basis and warp contours. Each contour within the shape undergoes the transformation process to produce a new warped shape.

Return

A new Shape object containing the warped contours after applying the transformation process.

Parameters

errorTolerance

The maximum allowed RMS fit error used during the distortion process. Default is 0.5.

maxDepth

The maximum recursion depth for adaptive piece splitting during distortion. Default is 6.

samplesPerPiece

The number of samples per piece used for fitting and error measurement. Default is 24.

basis

The reference contour used for calculating nearest positions and normals during the transformation.

warp

The source contour used to determine displacement and transformation effects on the shape contours.