-
Notifications
You must be signed in to change notification settings - Fork 14
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
feat: illustrations for polygon, parallelogram and semi-circle #40
Conversation
Mankavelda
commented
Oct 11, 2023
•
edited
Loading
edited
- More examples on basic illustrations for polygon, parallelogram and semi circle
There was a problem hiding this 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?
examples/semi_circle.ml
Outdated
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; |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
Ok I will |
Hello, @Sudha247 please can you review this PR? |
1 similar comment
Hello, @Sudha247 please can you review this PR? |
examples/semi_circle.ml
Outdated
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; |
There was a problem hiding this comment.
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 i think you missed this comment -- #40 (comment) Please take a look at it. |
Thanks @nikochiko , I will attend to it |