You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/algorithms/voronoi/clipped_coordinates.jl
+53-7Lines changed: 53 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -220,32 +220,78 @@ Truncates the unbounded edges of the `i`th polygon of `vorn` so that the line co
220
220
- `new_vertices`: The new vertices of the polygon. This is not a circular vector.
221
221
- `new_points`: The new points of the polygon. This is not a circular vector.
222
222
"""
223
-
functiongrow_polygon_outside_of_box(vorn::VoronoiTessellation, i, bounding_box, predicates::AbstractPredicateKernel=AdaptiveKernel())
223
+
functiongrow_polygon_outside_of_box(vorn::VoronoiTessellation, i, bounding_box, predicates::AbstractPredicateKernel=AdaptiveKernel())
224
+
# try provided number type first
225
+
new_vertices, new_points =
226
+
_grow_polygon_outside_of_box(number_type(vorn), vorn, i, bounding_box, predicates)
227
+
228
+
# if the default produced Inf values, rerun with BigFloat
229
+
has_inf =!allfinite(new_points)
230
+
231
+
if has_inf
232
+
return_grow_polygon_outside_of_box(BigFloat, vorn, i, bounding_box, predicates)
233
+
else
234
+
return new_vertices, new_points
235
+
end
236
+
end
237
+
238
+
"""
239
+
_grow_polygon_outside_of_box(::Type{T}, vorn::VoronoiTessellation, i, bounding_box, predicates::AbstractPredicateKernel=AdaptiveKernel()) -> (Vector{Int}, Vector{NTuple{2,Number}})
240
+
241
+
Internal method that is called by [`grow_polygon_outside_of_box`](@ref). Can be used to specify the number type `T` to allow for higher precision computations.
242
+
243
+
# Arguments
244
+
- `T`: The number type to use for computations.
245
+
- `vorn`: The [`VoronoiTessellation`](@ref).
246
+
- `i`: The index of the polygon. The polygon must be unbounded.
247
+
- `bounding_box`: The bounding box to clip the polygon to. See also [`polygon_bounds`](@ref).
248
+
- `predicates::AbstractPredicateKernel=AdaptiveKernel()`: Method to use for computing predicates. Can be one of [`FastKernel`](@ref), [`ExactKernel`](@ref), and [`AdaptiveKernel`](@ref). See the documentation for a further discussion of these methods.
249
+
250
+
# Outputs
251
+
- `new_vertices`: The new vertices of the polygon. This is not a circular vector.
252
+
- `new_points`: The new points of the polygon. This is not a circular vector.
0 commit comments