Loading

Pcurve


processing
Since v1.0.0
Available on all platforms
See also

Draws a curved line on the screen. The first and second parameters specify the beginning control point and the last two parameters specify the ending control point. The middle parameters specify the start and stop of the curve. Longer curves can be created by putting a series of Pcurve functions together or using PcurveVertex. An additional function called PcurveTightness provides control for the visual quality of the curve. The Pcurve function is an implementation of Catmull-Rom splines. Using the 3D version requires rendering with P3D (see the Environment reference for more information).

Link to original Processing doc

Signature

Examples

// @preview image 300 300 '2D2' PGraphics 255 Pbackground 4 PstrokeWeight 25 25 Ppoint 42 112 Ppoint 150 150 Ppoint 110 170 Ppoint 2 PstrokeWeight 0xff0000ff Pstroke 25 25 42 112 110 170 150 150 Pcurve 0xff0000ff Pfill 14 PtextSize 'Catmull-Rom 0.0' 150 50 Ptext -2.0 PcurveTightness 0xffff0000 Pstroke PnoFill 25 25 42 112 110 170 150 150 Pcurve 0xffff0000 Pfill 'Catmull-Rom -2.0' 150 80 Ptext 0.5 PcurveTightness 0xff009f00 Pstroke PnoFill 25 25 42 112 110 170 150 150 Pcurve 0xff009f00 Pfill 'Catmull-Rom +0.5' 150 110 Ptext Pencode