At My Fingertips

Rapid Playground

Documentation

Rounded Rectangle

In this activity we will implement the rounded_rectangle function that generates a rounded rectangle of the given width and height and with the given corner_radius, like the following ones

rectangles

Decomposing the rectangle

The images below give you a hint on how you could decompose the rounded rectangle

decomposed rectangle

The edge

Start by implementing the rounded_edge function that generates the top edge of a rounded rectangle, with corners of the given corner_radius and total width of the given width.

Use the pytamaro functions PyTamaro iconrectangle, PyTamaro iconcircular_sector and PyTamaro iconbeside.

If needed, you can also use the PyTamaro iconrotate function.

Loading...

The rounded rectangle

Now you're ready to implement the rounded_rectangle function! Remember that the given width and height should be the total width and height of the rectangle.

Use the rounded_edge function you just implemented and the pytamaro functions PyTamaro iconrectangle, PyTamaro iconrotate and PyTamaro iconabove.

Loading...

This activity has been created by LuCE Research Lab and is licensed under CC BY-SA 4.0.

Rounded Rectangle

Logo of PyTamaro

PyTamaro is a project created by the Lugano Computing Education Research Lab at the Software Institute of USI

Privacy PolicyPlatform Version d693e64 (Sun, 05 May 2024 13:57:26 GMT)