Skip to content

Commit 22cef5d

Browse files
committed
Merge branch 'master' into new_find_boundary_level
2 parents acca25d + 72cb458 commit 22cef5d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/math.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,8 @@ Ramer-Douglas-Peucker algorithm. The `epsilon` parameter controls the maximum di
344344
allowed between a point on the original line and its simplified representation.
345345
"""
346346
function rdp_simplify_2d_path(x::AbstractArray{T}, y::AbstractArray{T}, epsilon::T) where {T<:Real}
347+
@assert x[1] != x[end] || y[1] != y[end]
348+
347349
n = length(x)
348350
if n != length(y)
349351
error("Input arrays must have at least 3 elements and the same length")
@@ -507,7 +509,7 @@ function resample_2d_path(
507509
# points of interest
508510
ti = range(t[1], t[end], n_points)
509511
if retain_original_xy
510-
ti = unique(vcat(t,ti))
512+
ti = sort!(unique!(vcat(t, ti)))
511513
end
512514

513515
# interpolate

0 commit comments

Comments
 (0)