-
Notifications
You must be signed in to change notification settings - Fork 19.4k
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
[FEATURE REQUEST] Add Line Clipping Algorithms: Cohen-Sutherland, Midpoint Subdivision, Liang-Barsky #5472
Comments
Are you working on this ? |
is anyone working on this? |
I am 😃 |
@TarunVishwakarma1 I wanna work on this so I created this issue. If you wanna join lets collab here. |
@ShikariSohan Yes sure works for me, DM me on discord - |
I wanna work on this assign to me.. |
@ShikariSohan the line clipping algorithms look interesting, feel free to create a PR to add them to the repository! |
@siriak I will soon create a PR for this. |
What would you like to Propose?
I propose implementing three line clipping algorithms: Cohen-Sutherland, Midpoint Subdivision, and Liang-Barsky. These algorithms are essential for performing efficient line clipping in 2D graphics. They enable the clipping of lines within a rectangular clipping window or viewport in computer graphics applications. Each algorithm has its approach to solving the problem and would be useful for different scenarios in graphical rendering.
Issue details
Problem Statement:
The goal is to implement efficient line clipping algorithms to determine the intersection of lines with a rectangular clipping window. The following algorithms will be implemented:
Cohen-Sutherland Algorithm: This algorithm categorizes points with outcodes, allowing for fast rejection or acceptance of lines based on their positions relative to the clipping window.
Midpoint Subdivision Algorithm: This algorithm recursively divides lines into segments, checking if they lie within the clipping window to determine if they should be clipped or not.
Liang-Barsky Algorithm: This algorithm employs parametric equations to find intersection points of lines with the clipping window, enabling precise clipping operations.
Benefits:
Implementation:
LineClipping
class.Sample Use Case (Test Scenario):
The following use case demonstrates how the algorithms will operate:
The text was updated successfully, but these errors were encountered: