Skip to content

Fix placement, transformation, and bounds of 1D entities - #359

Merged
gpeairs merged 2 commits into
mainfrom
arrangop/linesegment-fixes
Oct 29, 2026
Merged

gpeairs merged 2 commits into
mainfrom
arrangop/linesegment-fixes

Conversation

@parrangoiz

Copy link
Copy Markdown
Contributor

Adds transform and convert methods to 1D geometry entities to ensure that they can be properly placed onto coordinate systems and transformed. Also adds lowerleft and upperright to LineSegment so that its bounds can be extracted.

LineSegments could not be placed in a coordinate system of a different
coordinate type (no convert method to GeometryEntity{T}), transform(::D1, f)
called a nonexistent parametric constructor, so placing one through a
reference threw a MethodError, and their bounds fell back to an empty
polygon list and returned a zero rectangle at the origin.

Rebuild D1 entities with their unparameterized constructor in transform,
add convert(::Type{GeometryEntity{T}}, ::D1), and define lowerleft and
upperright for LineSegment so bounds (including of styled segments) give
its extent. Add tests and a CHANGELOG entry.
@parrangoiz
parrangoiz requested a review from gpeairs October 28, 2026 18:45
@parrangoiz parrangoiz changed the title Fix LineSegment placement, transformation, and bounds Fix placement, transformation, and bounds of 1D entities Oct 28, 2026
@parrangoiz parrangoiz mentioned this pull request Oct 28, 2026
1 task
@codecov

codecov Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 88.88889% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/polygons.jl 88.88% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@gpeairs gpeairs left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, I'm just going to apply one minor suggestion myself and then merge

Comment thread src/polygons.jl Resolved
@gpeairs
gpeairs merged commit 756fa9d into main Oct 29, 2026
9 of 10 checks passed
@gpeairs
gpeairs deleted the arrangop/linesegment-fixes branch October 29, 2026 10:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants