JuliaGeometry / GeometryBasics.jl

Basic Geometry Types
MIT License
165 stars 54 forks source link

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

Open goretkin opened 3 years ago

goretkin commented 3 years ago
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