🧪 Version 0.2.2 is our alpha release candidate. Please send us bug reports and suggestions!

Sketchingpy

Creative coding and interactive science everywhere for everyone: web, desktop, mobile, Jupyter, and more. Open source!

Reference for close

Add a straight line to the starting coordinate. This is part of the reference section.

Purpose

Add a line in the shape from the current position to the start position, marking the shape as finished and closed which allows it to be filled.

Snippet

Draw a closed shape.
shape = sketch.start_shape(50, 100)
shape.add_line_to(150, 200)
shape.add_line_to(150, 250)
shape.close()
sketch.draw_shape(shape)

Examples

Availability

Available for all platforms.

See also