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

feat: illustrations for polygon, parallelogram and semi-circle #40

Conversation

Mankavelda
Copy link
Contributor

@Mankavelda Mankavelda commented Oct 11, 2023

  • More examples on basic illustrations for polygon, parallelogram and semi circle

Screenshot from 2023-10-11 13-41-26
Screenshot from 2023-10-11 13-43-37
Screenshot from 2023-10-11 13-42-56

Copy link
Owner

@Sudha247 Sudha247 left a comment

Choose a reason for hiding this comment

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

Thank you @Mankavelda! Are you able to add screenshots of the illustrations please?

Comment on lines 12 to 22
draw_circle x y radius;

(* Calculate the coordinates for the rectangle to erase the unwanted part *)
let rect_x = x - radius in
let rect_y = y in
let rect_width = 2 * radius in
let rect_height = radius in

(* Erase the upper part of the circle to create a semi-circle effect *)
set_color Graphics.background;
fill_rect rect_x rect_y rect_width rect_height;
Copy link
Owner

Choose a reason for hiding this comment

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

I suspect it might be simpler to do this with draw_arc -- https://github.com/ocaml/graphics/blob/master/src/graphics.mli#L167

Copy link
Collaborator

Choose a reason for hiding this comment

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

@Mankavelda i think you missed this comment.

@Mankavelda
Copy link
Contributor Author

Thank you @Mankavelda! Are you able to add screenshots of the illustrations please?

Ok I will

@Mankavelda
Copy link
Contributor Author

Hello, @Sudha247 please can you review this PR?

1 similar comment
@Mankavelda
Copy link
Contributor Author

Hello, @Sudha247 please can you review this PR?

Comment on lines 12 to 22
draw_circle x y radius;

(* Calculate the coordinates for the rectangle to erase the unwanted part *)
let rect_x = x - radius in
let rect_y = y in
let rect_width = 2 * radius in
let rect_height = radius in

(* Erase the upper part of the circle to create a semi-circle effect *)
set_color Graphics.background;
fill_rect rect_x rect_y rect_width rect_height;
Copy link
Collaborator

Choose a reason for hiding this comment

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

@Mankavelda i think you missed this comment.

@nikochiko
Copy link
Collaborator

@Mankavelda i think you missed this comment -- #40 (comment)

Please take a look at it.

@Mankavelda
Copy link
Contributor Author

@Mankavelda i think you missed this comment -- #40 (comment)

Please take a look at it.

Thanks @nikochiko , I will attend to it

@nikochiko nikochiko closed this Jan 19, 2024
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.

3 participants