@@ -40,11 +40,11 @@ GI.coordinates.(inter_points)
4040```
4141"""
4242function intersection (
43- alg:: FosterHormannClipping , geom_a, geom_b, :: Type{T} = Float64; target= nothing , kwargs...
43+ alg:: FosterHormannClipping , geom_a, geom_b, :: Type{T} = Float64; target= nothing , exact = True (), kwargs...
4444) where {T<: AbstractFloat }
4545 return _intersection (
4646 alg, TraitTarget (target), T, GI. trait (geom_a), geom_a, GI. trait (geom_b), geom_b;
47- exact = True () , kwargs... ,
47+ exact, kwargs... ,
4848 )
4949end
5050# fallback definitions
@@ -64,8 +64,8 @@ _intersection(
6464 alg:: FosterHormannClipping , :: TraitTarget{GI.PointTrait} , :: Type{T} ,
6565 trait_a:: Union{GI.LineTrait, GI.LineStringTrait, GI.LinearRingTrait} , geom_a,
6666 trait_b:: Union{GI.LineTrait, GI.LineStringTrait, GI.LinearRingTrait} , geom_b;
67- kwargs... ,
68- ) where T = _intersection_points (alg. manifold, alg. accelerator, T, trait_a, geom_a, trait_b, geom_b)
67+ exact, kwargs... ,
68+ ) where T = _intersection_points (alg. manifold, alg. accelerator, T, trait_a, geom_a, trait_b, geom_b; exact )
6969
7070#= Polygon-Polygon Intersections with target Polygon
7171The algorithm to determine the intersection was adapted from "Efficient clipping
@@ -200,10 +200,10 @@ function _intersection(
200200end
201201
202202"""
203- intersection_points(geom_a, geom_b, [T::Type])
203+ intersection_points(geom_a, geom_b, [T::Type]; exact = True() )
204204
205205Return a list of intersection tuple points between two geometries. If no intersection points
206- exist, returns an empty list.
206+ exist, returns an empty list. Set `exact = false` to use the inexact predicate path.
207207
208208## Example
209209
@@ -218,13 +218,14 @@ inter_points = GO.intersection_points(line1, line2)
2182181-element Vector{Tuple{Float64, Float64}}:
219219 (125.58375366067548, -14.83572303404496)
220220"""
221- intersection_points (geom_a, geom_b, :: Type{T} = Float64) where T <: AbstractFloat = intersection_points (FosterHormannClipping (Planar ()), geom_a, geom_b, T)
222- function intersection_points (alg:: FosterHormannClipping{M, A} , geom_a, geom_b, :: Type{T} = Float64) where {M, A, T <: AbstractFloat }
223- return _intersection_points (alg. manifold, alg. accelerator, T, GI. trait (geom_a), geom_a, GI. trait (geom_b), geom_b)
221+ intersection_points (geom_a, geom_b, :: Type{T} = Float64; exact = True ()) where T <: AbstractFloat =
222+ intersection_points (FosterHormannClipping (Planar ()), geom_a, geom_b, T; exact)
223+ function intersection_points (alg:: FosterHormannClipping{M, A} , geom_a, geom_b, :: Type{T} = Float64; exact = True ()) where {M, A, T <: AbstractFloat }
224+ return _intersection_points (alg. manifold, alg. accelerator, T, GI. trait (geom_a), geom_a, GI. trait (geom_b), geom_b; exact)
224225end
225226
226- function intersection_points (m:: Manifold , a:: IntersectionAccelerator , geom_a, geom_b, :: Type{T} = Float64) where T <: AbstractFloat
227- return _intersection_points (m, a, T, GI. trait (geom_a), geom_a, GI. trait (geom_b), geom_b)
227+ function intersection_points (m:: Manifold , a:: IntersectionAccelerator , geom_a, geom_b, :: Type{T} = Float64; exact = True () ) where T <: AbstractFloat
228+ return _intersection_points (m, a, T, GI. trait (geom_a), geom_a, GI. trait (geom_b), geom_b; exact )
228229end
229230
230231
0 commit comments