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

Add various pixel-generation methods to GoostGeometry2D #78

Merged
merged 3 commits into from
May 17, 2021

Conversation

Xrayez
Copy link
Contributor

@Xrayez Xrayez commented May 16, 2021

Having bresenham_line() is nice, but proves to be difficult to use via script (have to handle rounding, potentially avoiding duplicate points etc.)

Pixelated circle

Adds pixel_circle() method.

image

Pixelated polygon/polyline

Adds polygon_to_pixels() and polyline_to_pixels() methods.

image


This PR also renames bresenham_line() to pixel_line() for consistency with added features, also see other rationale in the commit description.

@Xrayez Xrayez added enhancement Improvement of existing features breaks compat Compatibility breakage feature 💡 New feature proposal component:geometry 📐 labels May 16, 2021
@Xrayez Xrayez added this to the gd3 milestone May 16, 2021
Xrayez added 3 commits May 17, 2021 23:00
For consistency with other pixel-based methods. This also avoids potential confusion with original/correct Bresenham line algorithm, so this is mentioned in the documentation. We'd also like to avoid having API with names of the algorithms, unless absolutely necessary.
For compatibility with the `circle()` method in the same class.
@Xrayez Xrayez force-pushed the geometry-pixelated branch from 0574c34 to cfeb8ed Compare May 17, 2021 20:02
@Xrayez Xrayez merged commit f1959df into gd3 May 17, 2021
@Xrayez Xrayez deleted the geometry-pixelated branch May 17, 2021 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaks compat Compatibility breakage component:geometry 📐 enhancement Improvement of existing features feature 💡 New feature proposal
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant