Sideof

The sideof function can be used to efficiently query the side of multiple points with respect to a given geometry or mesh.

Meshes.SideTypeType
IntersectionType

The different types of sides that a point may lie in relation to a boundary geometry or mesh. Type SideType in a Julia session to see the full list.

source
Meshes.sideofMethod
sideof(point, line)

Determines on which side the point is in relation to the line. Possible results are LEFT, RIGHT or ON the line.

Notes

Assumes the orientation of Segment(line(0), line(1)).

source
Meshes.sideofMethod
sideof(point, ring)

Determines on which side the point is in relation to the ring. Possible results are IN, OUT or ON the ring.

References

  • Hao et al. 2018. [Optimal Reliable Point-in-Polygon Test and Differential Coding Boolean Operations on Polygons] (https://www.mdpi.com/2073-8994/10/10/477)
source
Meshes.sideofMethod
sideof(point, mesh)

Determines on which side the point is in relation to the surface mesh. Possible results are IN or OUT the mesh.

References

  • Jacobson et al. 2013. [Robust inside-outside segmentation using generalized winding numbers] (https://dl.acm.org/doi/10.1145/2461912.2461916)
source
sideof(Point(0, 0), Line((1, 0), (1, 1)))
LEFT::SideType = 3
points = [Point(0, 0), Point(0.2, 0.2), Point(2, 1)]
polygon = Triangle((0, 0), (1, 0), (0, 1))

sideof(points, boundary(polygon))
3-element Vector{SideType}:
 ON::SideType = 2
 IN::SideType = 0
 OUT::SideType = 1