File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -344,6 +344,8 @@ Ramer-Douglas-Peucker algorithm. The `epsilon` parameter controls the maximum di
344
344
allowed between a point on the original line and its simplified representation.
345
345
"""
346
346
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
+
347
349
n = length (x)
348
350
if n != length (y)
349
351
error (" Input arrays must have at least 3 elements and the same length" )
@@ -507,7 +509,7 @@ function resample_2d_path(
507
509
# points of interest
508
510
ti = range (t[1 ], t[end ], n_points)
509
511
if retain_original_xy
510
- ti = unique (vcat (t,ti ))
512
+ ti = sort! ( unique! (vcat (t, ti) ))
511
513
end
512
514
513
515
# interpolate
You can’t perform that action at this time.
0 commit comments