Repository navigation
Add Stroke class, assorted KLDraw fixes + cleanup - #47
Merged
Merged
Conversation
a-hurst
force-pushed
the
kldraw_cleanup
branch
from
October 10, 2026 16:27
69ca543 to
8bf0a20
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Description
This PR adds a new Stroke object for specifying the stroke properties for shapes, cleans up the API/documentation for KLDraw in general, and fixes a number of small rendering bugs.
The old Stroke API was awful to use and also poorly/incorrectly documented. This makes defining strokes much more Pythonic without breaking compatibility with the old method.
A bunch of extra API internal mess exposed in the documentation has also been removed, and the documentation has been cleaned up a bit to be more readable. Unused init/method arguments have been removed, and unnecessary and unused (?) setters for object properties other than fill/stroke/rotation have been removed for consistency (can be added back at a later date if it's determined that they make sense, but better to err on the side of reducing API complexity for now).
Previously, triangles, arrows, and some asterisks would be clipped when rotated due to not being re-centered after rotation. Arrows and Triangles rendered with strokes would also be clipped (and proportioned incorrectly) when rendered due to improper compensation for how stroke size affects the shape size for < 90° angles. Both of these issues have been fixed.
Merge Checklist
closes #<issue-number>to automatically close an issue