extrudeContourStepsScaled

fun extrudeContourStepsScaled(contour: ShapeContour, path: Path3D, scale: (Double) -> Double, torsion: (Double) -> Double, contourDistanceTolerance: Double = 0.5, frames: List<Matrix44>, dframes: List<Matrix44>, ts: DoubleArray, startCap: Boolean = true, endCap: Boolean = true, useFaceNormals: Boolean, writer: VertexWriter)(source)


fun extrudeContourStepsScaled(contour: ShapeContour, path: Path3D, stepCount: Int, up0: Vector3, contourDistanceTolerance: Double = 0.5, pathDistanceTolerance: Double = 0.5, steps: List<Vector3> = path.evenSteps(stepCount), frames: List<Matrix44> = path.posesAt(steps, up0), startCap: Boolean = true, endCap: Boolean = true, scale: (Double) -> Double = { _ -> 1.0 }, useFaceNormals: Boolean, writer: VertexWriter)(source)

Extrude a contour along a path specifying the number of steps. The scale argument can be used to make variable width shapes. For example scale = { t: Double -> 0.5 - 0.5 * cos(t * 2 * PI) } produces an extruded shape that begins and ends with hairline thickness.

Parameters

contour

the cross-section of the mesh

path

the 3D path

stepCount

the number of steps along the path

up0

the initial up-vector

contourDistanceTolerance

precision for calculating steps along contour. Lower tolerance results in higher precision.

pathDistanceTolerance

no longer used: the steps are at equal distances along path

steps

the resulting positions in the path

frames

a list of matrices holding the transformation matrices along the path

startCap

adds a start cap if set to true

endCap

adds an end cap if set to true

scale

A function that takes the part of the steps, from 0 at the first to 1 at the last, and returns a scaling factor for contour at that step. Where it is 0 the cross-section is a point, and a cap there is left out.

useFaceNormals

true for the normals of the faces, false for smooth normals that follow the changes of scale

writer

the vertex writer function


fun TriangleMeshBuilder.extrudeContourStepsScaled(contour: ShapeContour, path: Path3D, stepCount: Int, up0: Vector3, contourDistanceTolerance: Double = 0.5, pathDistanceTolerance: Double = 0.5, startCap: Boolean = true, endCap: Boolean = true, scale: (Double) -> Double = { _ -> 1.0 }, useFaceNormals: Boolean = false)(source)

Extrude a contour along a path specifying the number of steps. The scale argument can be used to make variable width shapes. For example scale = { t: Double -> 0.5 - 0.5 * cos(t * 2 * PI) } produces an extruded shape that begins and ends with hairline thickness.

Parameters

contour

the cross-section of the mesh

path

the 3D path

stepCount

the number of steps along the path

up0

the initial up-vector

contourDistanceTolerance

precision for calculating steps along contour. Lower tolerance results in higher precision.

pathDistanceTolerance

precision for calculating steps along

scale

A function that converts t into a radius path. Lower tolerance results in higher precision.