Skip to content

add coordinates for Rect1#277

Open
thchr wants to merge 4 commits intoJuliaGeometry:masterfrom
thchr:master
Open

add coordinates for Rect1#277
thchr wants to merge 4 commits intoJuliaGeometry:masterfrom
thchr:master

Conversation

@thchr
Copy link
Copy Markdown

@thchr thchr commented Apr 21, 2026

I have wanted to use the Rect class here occasionally in some more generic contexts, and the absence of a coordinates method for the 1D case has then been a bit annoying: this just proposes adding it (and adds texturecoordinates alongside).

There is of course more that could be done for fleshing out the Rect{1} methods - and for Rect{N} interfaces more broadly, but my ambition is limited to just this.

Copilot AI review requested due to automatic review settings April 21, 2026 08:25
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds missing coordinates/texturecoordinates decomposition support for 1D rectangles (Rect{1}) so they can be used more uniformly with the rest of the geometry interfaces.

Changes:

  • Add coordinates(::Rect{1,T}) returning the 2 endpoints of the interval.
  • Add texturecoordinates(::Rect{1}) for 1D rects.
  • Add unit tests covering Rect{1} coordinate/texturecoordinate behavior.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
src/primitives/rectangles.jl Implements coordinates and texturecoordinates for Rect{1}.
test/geometrytypes.jl Adds assertions for Rect{1} decomposition outputs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/primitives/rectangles.jl
Comment thread test/geometrytypes.jl Outdated
Comment thread test/geometrytypes.jl Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@ffreyer
Copy link
Copy Markdown
Collaborator

ffreyer commented Apr 21, 2026

I'm not sure if it makes sense to define texturecoordinates because I don't think they make much sense outside a mesh and generating a mesh from a 1D Rect seems odd to me. If you do add them they should be using floats not ints because they are usually interpolated between vertices to sample another resource (texture).

@thchr
Copy link
Copy Markdown
Author

thchr commented Apr 21, 2026

Makes sense: removed now.

@thchr thchr changed the title add coordinates and texturecoordinates for Rect1 add coordinates for Rect1 Apr 22, 2026
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.

3 participants