Skip to content

Conversation

@ToddGeorgeKelly
Copy link
Contributor

Added 'radius:' to all the regular polygons to make it so we can have curved corners.

I made these changes for my own purposes, so it may not fit everyone's needs, but it does work and is as simple as I could make it, so I believe it should do the job for most uses. There is one missing functionality that needs to be added before I would call it a completed update.

What it will do:

  • Allow you to make any regular polygon have curved sides, I updated not only the base regular polygon code, but also the 'pre-made' shapes like Hexagon() and the others.

What it won't do currently:

  • It won't, as of yet, have the inner line of the shapes be curved when using '.stroke()' or '.strokeBorder()'. I didn't need this functionality, so I haven't put any thought into how to go about this yet, but I imagine it won't be too hard to update.

A Note: I only began to teach myself to program in December of 2019 and then I took a break from March/April till November, so I may not have done everything perfectly and am definitely open to feedback.

Added 'radius' to all the regular polygons to make it so we can have curved corners.
@ay42
Copy link
Member

ay42 commented Dec 13, 2020

@ToddGeorgeKelly this is great! Thank you.
I'll probably split it to RegularPolygon and RoundedRegularPolygon structs in the future updates so there is no corner calculations on non-rounded polygons.

@ay42 ay42 merged commit 99f3c85 into spacenation:master Dec 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants