Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented Polygon type + refactored Rectangle to make use of it #69

Merged
merged 7 commits into from
Dec 13, 2023

Conversation

FayCarsons
Copy link
Collaborator

@FayCarsons FayCarsons commented Oct 26, 2023

Linked issue: #59

Implemented N-sided polygon type, functions, etc. Not covered in 'scale' because implementation may change soon. Refactored rectangle to be a specific case of a 4-sided polygon so that it may be transformed more easily. Exposed 'point' type to make polygon construction easier and for destructuring etc in sketches.

Copy link
Collaborator

@nikochiko nikochiko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @FayCarsons for the changes!

I've suggested some changes:

  • the previous Rectangle constructor can be removed entirely because it doesn't hold enough data
  • the rectangle function can keep having the same interface and we calculate the polygon points from the arguments

examples/higher_transforms.ml Outdated Show resolved Hide resolved
examples/polygon.ml Outdated Show resolved Hide resolved
lib/shape.ml Outdated Show resolved Hide resolved
lib/shape.ml Outdated Show resolved Hide resolved
lib/shape.ml Outdated Show resolved Hide resolved
@FayCarsons
Copy link
Collaborator Author

Fixed conflicts & applied suggestions. Ran dune fmt. Should be good to go!

@nikochiko nikochiko merged commit 91123cf into Sudha247:main Dec 13, 2023
0 of 3 checks passed
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