ITADN

isnan for Point and Vec with NaN values

#341OpencserteGT3 创建于 2026-02-26
C
cserteGT3commented
I'm working with 3D camera depth maps, where the image pixels contain 3D points. Sometimes pixel contain no data, indicated by Points with NaN coordinates. I can easily define a function to filter these points, but would be better to use `isnan`, which would be type piracy. Can we have `Base.isnan` defined for `Point` and `Vec`? Now that I'm writing this, I'm thinking on how `isnan` is defined for arrays. Docstrings says: > Test whether a number value is a NaN, an indeterminate value which is neither an infinity nor a finite number ("not a number"). And it is not defined for arrays. So now I'm not entirely sure if this should be baked into the package or would be better if everyone can define their own isnan.
1 条评论