Skip to content

Add various pixel-generation methods to GoostGeometry2D - #78

Merged
Xrayez merged 3 commits into
gd3from
geometry-pixelated
May 17, 2021
Merged

Xrayez merged 3 commits into
gd3from
geometry-pixelated

Conversation

@Xrayez

@Xrayez Xrayez commented May 16, 2021 •

Copy link
Copy Markdown
Contributor

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