Winding

The winding number is intimately connected to the sideof function, which is used more often in applications.

Meshes.winding — Function
winding(points, object)

Generalized winding number of points with respect to the geometric object.

References

  • Barill et al. 2018. [Fast winding numbers for soups and clouds] (https://dl.acm.org/doi/10.1145/3197517.3201337)
  • Jacobson et al. 2013. [Robust inside-outside segmentation using generalized winding numbers] (https://dl.acm.org/doi/10.1145/2461912.2461916)
  • Oosterom, A. & Strackee, J. 1983. [The Solid Angle of a Plane Triangle] (https://ieeexplore.ieee.org/document/4121581)
source
points = [Point(0, 0), Point(0.2, 0.2), Point(2, 1)]
polygon = Triangle((0, 0), (1, 0), (0, 1))

winding(points, boundary(polygon))
3-element Vector{Float64}:
 0.25
 1.0
 0.0