JuliaGeometry / JuliaGeometry/GeometryBasics.jl

`Base.in(point, set)` should error for if point type has different dimensionality

Open
#109 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Julia
Stars
215
Forks
64
Avg merge
3d 18h
Merged PRs (30d)
2

Description

julia> in(GeometryBasics.Point(0,0), GeometryBasics.HyperRectangle(Vec(0,0,0), Vec(1,1,1)))
ERROR: BoundsError: attempt to access (0, 0)
  at index [3]
Stacktrace:
 [1] getindex at ./tuple.jl:24 [inlined]
 [2] getindex at /Users/goretkin/.julia/packages/GeometryBasics/csguK/src/fixed_arrays.jl:90 [inlined]
 [3] in(::Point{2,Int64}, ::GeometryBasics.HyperRectangle{3,Int64}) at /Users/goretkin/.julia/packages/GeometryBasics/csguK/src/primitives/rectangles.jl:491
 [4] top-level scope at REPL[64]:1

julia> in(GeometryBasics.Point(3,3), GeometryBasics.HyperRectangle(Vec(0,0,0), Vec(1,1,1)))
false

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the examples and inspect the in implementation in src/primitives/rectangles.jl around line 491, along with the indexing code in src/fixed_arrays.jl around line 90. Ensure points and hyperrectangles with different dimensionality produce the intended error consistently, then verify both dimensionality-mismatch examples.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
computer-graphics
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.