generateCap

fun generateCap(sides: Int, radius: Double, envelope: List<Vector2> = listOf( Vector2(0.0, 0.0), Vector2(1.0, 0.0) ), writer: VertexWriter)(source)

Generate a shape by rotating an envelope around a vertical axis.

Parameters

sides

the angular resolution of the cap

radius

the radius of the cap

envelope

a list of points defining the profile of the cap. The default envelope is a horizontal line which produces a flat round disk. By providing a more complex envelope one can create curved shapes like a bowl.

writer

the vertex writer function