-
-
Notifications
You must be signed in to change notification settings - Fork 57
Description
@ffreyer I can use something like the below to find the indices of points part of a face not equal to some value (the indices of the other points, this is handy e.g. to find which points of a face do not touch a point of something else).
f = QuadFace{Int64}(1,2,3,4) # Some face
indicesOther = f[f.!=3] For my project, when my compat features GeometryBasics = "0.3, 0.4", the use of f[f.!=3] returns:
3-element Vector{Int64}:
1
2
4This is the desired/expected behaviour, i.e. I can use the boolean f.!=3 to grab the indices that are not 3.
However, when my compat features GeometryBasics = "0.5", the use of f[f.!=3] returns:
ERROR: ArgumentError: invalid index: true of type Bool
Stacktrace:
[1] to_index(i::Bool)
@ Base ./indices.jl:308
[2] to_index(A::TriangleFace{Int64}, i::Bool)
@ Base ./indices.jl:292
[3] to_indices
@ ./indices.jl:368 [inlined]
[4] to_indices
@ ./indices.jl:365 [inlined]
[5] getindex
@ ./abstractarray.jl:1312 [inlined]
[6] (::GeometryBasics.var"#51#52"{TriangleFace{Int64}})(i::Bool)
@ GeometryBasics ~/.julia/packages/GeometryBasics/79wKA/src/basic_types.jl:39
[7] map
@ ./tuple.jl:357 [inlined]
[8] getindex(elements::TriangleFace{Int64}, face::TriangleFace{Bool})
@ GeometryBasics ~/.julia/packages/GeometryBasics/79wKA/src/basic_types.jl:39
[9] top-level scope
@ REPL[7]:1So this is braking behaviour of course. Is this something you will be able to address or do I need to alter my code?
Separately I should add that in both instances above (both for early versions and the latest version of GeometryBasics) I find this behaviour odd, i.e. that f.!=3 returns a face containing Bools, that is never a valid/useful thing I'd say. So perhaps this should return some kind of vector of Bool entries instead? I'd say making that change would solve the above too.
f.!=3
4-element QuadFace{Bool} with indices SOneTo(4):
1
1
0
1Let me know if you need any more information.