From e4fe3eb50e14fbe113dcfcf2e6a0d8ed8ad613da Mon Sep 17 00:00:00 2001 From: cormullion Date: Mon, 15 Apr 2024 18:10:25 +0100 Subject: [PATCH] misc updates for release 4.0 --- CHANGELOG.md | 76 +++++++++++++------------ docs/Project.toml | 2 +- docs/src/howto/polygons.md | 10 ++-- src/Luxor.jl | 2 +- src/deprecations.jl | 6 -- src/point.jl | 28 ++++++++-- src/polygons.jl | 111 ++++++++++++++++++------------------- test/polybspline-test.jl | 3 +- 8 files changed, 128 insertions(+), 110 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2230752a..2bedb925 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,12 +1,13 @@ # Changelog -## [v4.0] - soon ... +## [v4.0] - 2024-04-15 ### This is a breaking release compared with v3.8 Some 'invalid' `Point` methods have been removed: - Broadcasting on xy-elements like `Point(x, y) .+ n` are no longer valid. Use `Point(x, y) + Point(n, n)`. + - `Point`-`Real` arithmetic operations such as `Point(x, y) + n` are also no longer valid. LaTeX support is still under development. @@ -20,7 +21,8 @@ See https://github.com/JuliaGraphics/Cairo.jl/pull/357. - use package extension for LaTeX support - add CompatHelper git workflow - add Aqua.jl testing -- `createmovie` option for `animate` +- `createmovie` option for `animate` to make MKV and MP4 videos +- `polybspline` draws bspline polygons ### Changed @@ -36,9 +38,11 @@ See https://github.com/JuliaGraphics/Cairo.jl/pull/357. ### Removed +- invalid `Point` methods such as `Point(1, 3) + 6` or `Point(1, 3) .+ 4` + ### Deprecated -# ──────────────────────────────────────────────────────────────────────────────────── +# ─────────────────────────────────────────────────── ## [v3.8.0] - 2023-09-08 @@ -65,7 +69,7 @@ See https://github.com/JuliaGraphics/Cairo.jl/pull/357. ### Deprecated -# ──────────────────────────────────────────────────────────────────────────────────── +# ─────────────────────────────────────────────────── ## [v3.7.0] - 2023-02-04 @@ -91,7 +95,7 @@ See https://github.com/JuliaGraphics/Cairo.jl/pull/357. ### Deprecated -# ──────────────────────────────────────────────────────────────────────────────────── +# ─────────────────────────────────────────────────── ## [v3.6.0] - 2022-12-11 @@ -119,7 +123,7 @@ See https://github.com/JuliaGraphics/Cairo.jl/pull/357. ### Deprecated - `rotate_point_around_point()` is now `rotatepoint()` -# ──────────────────────────────────────────────────────────────────────────────────── +# ─────────────────────────────────────────────────── ## [v3.5.0] - 2022-07-28 10:15 @@ -141,7 +145,7 @@ See https://github.com/JuliaGraphics/Cairo.jl/pull/357. ### Deprecated -# ──────────────────────────────────────────────────────────────────────────────────── +# ─────────────────────────────────────────────────── ## [v3.4.0] - 2022-07-13 09:01:18 @@ -165,7 +169,7 @@ See https://github.com/JuliaGraphics/Cairo.jl/pull/357. ### Deprecated -# ──────────────────────────────────────────────────────────────────────────────────── +# ─────────────────────────────────────────────────── ## [v3.3.0] - 2022-06-01 11:28:44 @@ -186,7 +190,7 @@ See https://github.com/JuliaGraphics/Cairo.jl/pull/357. ### Deprecated -# ──────────────────────────────────────────────────────────────────────────────────── +# ─────────────────────────────────────────────────── ## [v3.2.0] - 2022-04-05 09:41:54 ### Added @@ -206,7 +210,7 @@ See https://github.com/JuliaGraphics/Cairo.jl/pull/357. ### Deprecated -# ──────────────────────────────────────────────────────────────────────────────────── +# ─────────────────────────────────────────────────── ## [v3.1.1] - 2022-03-06 @@ -220,7 +224,7 @@ See https://github.com/JuliaGraphics/Cairo.jl/pull/357. ### Deprecated -# ──────────────────────────────────────────────────────────────────────────────────── +# ─────────────────────────────────────────────────── ## [v3.1.0] - 2022-02-26 @@ -242,7 +246,7 @@ See https://github.com/JuliaGraphics/Cairo.jl/pull/357. ### Deprecated -# ──────────────────────────────────────────────────────────────────────────────────── +# ─────────────────────────────────────────────────── ## [v3.0.0] - 2022-01-23 @@ -269,7 +273,7 @@ See https://github.com/JuliaGraphics/Cairo.jl/pull/357. ### Deprecated -# ──────────────────────────────────────────────────────────────────────────────────── +# ─────────────────────────────────────────────────── ## [v2.19.0] - 2022-01-03 @@ -289,7 +293,7 @@ See https://github.com/JuliaGraphics/Cairo.jl/pull/357. ### Deprecated -# ──────────────────────────────────────────────────────────────────────────────────── +# ─────────────────────────────────────────────────── ## [v2.18.0] - 2021-12-18 ### Added @@ -312,7 +316,7 @@ See https://github.com/JuliaGraphics/Cairo.jl/pull/357. ### Deprecated -# ──────────────────────────────────────────────────────────────────────────────────── +# ─────────────────────────────────────────────────── ## [v2.17.0] - 2021-11-05 @@ -334,7 +338,7 @@ See https://github.com/JuliaGraphics/Cairo.jl/pull/357. ### Deprecated -# ──────────────────────────────────────────────────────────────────────────────────── +# ─────────────────────────────────────────────────── ## [v2.16.0] - 2021-10-07 @@ -351,7 +355,7 @@ See https://github.com/JuliaGraphics/Cairo.jl/pull/357. ### Deprecated -# ──────────────────────────────────────────────────────────────────────────────────── +# ─────────────────────────────────────────────────── ## [v2.15.0] - 2021-08-20 @@ -375,7 +379,7 @@ See https://github.com/JuliaGraphics/Cairo.jl/pull/357. ### Deprecated -# ──────────────────────────────────────────────────────────────────────────────────── +# ─────────────────────────────────────────────────── ## [v2.14.0] - 2021-07-20 @@ -394,7 +398,7 @@ See https://github.com/JuliaGraphics/Cairo.jl/pull/357. ### Deprecated -# ──────────────────────────────────────────────────────────────────────────────────── +# ─────────────────────────────────────────────────── ## [v2.13.0] - 2021-07-06 @@ -414,7 +418,7 @@ See https://github.com/JuliaGraphics/Cairo.jl/pull/357. ### Deprecated -# ──────────────────────────────────────────────────────────────────────────────────── +# ─────────────────────────────────────────────────── ## [v2.12.0] - 2021-06-12 @@ -434,7 +438,7 @@ See https://github.com/JuliaGraphics/Cairo.jl/pull/357. ### Deprecated -# ──────────────────────────────────────────────────────────────────────────────────── +# ─────────────────────────────────────────────────── ## [v2.11.0] - 2021-04-06 @@ -453,7 +457,7 @@ See https://github.com/JuliaGraphics/Cairo.jl/pull/357. ### Deprecated -# ──────────────────────────────────────────────────────────────────────────────────── +# ─────────────────────────────────────────────────── ## [v2.10.0] - 2021-03-08 @@ -470,7 +474,7 @@ See https://github.com/JuliaGraphics/Cairo.jl/pull/357. ### Deprecated -# ──────────────────────────────────────────────────────────────────────────────────── +# ─────────────────────────────────────────────────── ## [v2.9.0] - 2021-02-18 @@ -494,7 +498,7 @@ See https://github.com/JuliaGraphics/Cairo.jl/pull/357. ### Deprecated -# ──────────────────────────────────────────────────────────────────────────────────── +# ─────────────────────────────────────────────────── ## [v2.8.0] - 2021-02-02 @@ -516,7 +520,7 @@ See https://github.com/JuliaGraphics/Cairo.jl/pull/357. ### Deprecated -# ──────────────────────────────────────────────────────────────────────────────────── +# ─────────────────────────────────────────────────── ## [v2.7.0] - January 7 2021 @@ -534,7 +538,7 @@ See https://github.com/JuliaGraphics/Cairo.jl/pull/357. ### Deprecated -# ──────────────────────────────────────────────────────────────────────────────────── +# ─────────────────────────────────────────────────── ## [v2.6.0] - 12 November 2020 @@ -549,7 +553,7 @@ See https://github.com/JuliaGraphics/Cairo.jl/pull/357. ### Deprecated -# ──────────────────────────────────────────────────────────────────────────────────── +# ─────────────────────────────────────────────────── ## [v2.5.1] - September 8 2020 @@ -563,7 +567,7 @@ See https://github.com/JuliaGraphics/Cairo.jl/pull/357. ### Deprecated -# ──────────────────────────────────────────────────────────────────────────────────── +# ─────────────────────────────────────────────────── ## [v2.5.0] - September 6 2020 @@ -584,7 +588,7 @@ See https://github.com/JuliaGraphics/Cairo.jl/pull/357. ### Deprecated -# ──────────────────────────────────────────────────────────────────────────────────── +# ─────────────────────────────────────────────────── ## [v2.4.0] - August 13 2020 @@ -603,7 +607,7 @@ See https://github.com/JuliaGraphics/Cairo.jl/pull/357. ### Deprecated -# ──────────────────────────────────────────────────────────────────────────────────── +# ─────────────────────────────────────────────────── ## [v2.3.0] - August 1 2020 @@ -619,7 +623,7 @@ See https://github.com/JuliaGraphics/Cairo.jl/pull/357. ### Deprecated -# ──────────────────────────────────────────────────────────────────────────────────── +# ─────────────────────────────────────────────────── ## [v2.2.1] - patch 14 July 2020 @@ -635,7 +639,7 @@ See https://github.com/JuliaGraphics/Cairo.jl/pull/357. ### Deprecated -# ──────────────────────────────────────────────────────────────────────────────────── +# ─────────────────────────────────────────────────── ## [v2.2.0] - 2 July 2020 @@ -652,7 +656,7 @@ See https://github.com/JuliaGraphics/Cairo.jl/pull/357. ### Deprecated -# ──────────────────────────────────────────────────────────────────────────────────── +# ─────────────────────────────────────────────────── ## [v2.1.0] - 2020 June 18 @@ -673,7 +677,7 @@ See https://github.com/JuliaGraphics/Cairo.jl/pull/357. ### Deprecated -# ──────────────────────────────────────────────────────────────────────────────────── +# ─────────────────────────────────────────────────── ## [v2.0.0] - 2020 May 30 @@ -693,7 +697,7 @@ See https://github.com/JuliaGraphics/Cairo.jl/pull/357. - `bars()` - use `barchart()` -# ──────────────────────────────────────────────────────────────────────────────────── +# ─────────────────────────────────────────────────── ## [v1.12.0] - 2020 May 4 @@ -713,7 +717,7 @@ See https://github.com/JuliaGraphics/Cairo.jl/pull/357. ### Deprecated -# ──────────────────────────────────────────────────────────────────────────────────── +# ─────────────────────────────────────────────────── ## [v1.11.0] - 2020 February 18 diff --git a/docs/Project.toml b/docs/Project.toml index fb701ff9..eea26060 100644 --- a/docs/Project.toml +++ b/docs/Project.toml @@ -8,5 +8,5 @@ MathTeXEngine = "0a4f8689-d25c-4efe-a92b-7142dfc1aa53" [compat] Colors = "0.12" Documenter = "1" -Images = "0.26" +Images = "0.26.1" MathTeXEngine = "0.5.7" diff --git a/docs/src/howto/polygons.md b/docs/src/howto/polygons.md index c48c38f1..a65df6a1 100644 --- a/docs/src/howto/polygons.md +++ b/docs/src/howto/polygons.md @@ -22,13 +22,13 @@ Luxor also provides a BezierPath type, which is an array of four-point tuples, e |[`epitrochoid`](@ref) | | |[`ispolyconvex`](@ref) |[`polyclip`](@ref) | |[`polyrotate!`](@ref) | | |[`ispointonpoly`](@ref) |[`polymove!`](@ref) | |[`polyfit`](@ref) | | | |[`polyscale!`](@ref) | -|[`polyhull`](@ref) | | | | | -|[`polysuper`](@ref) | | | | | -| | | | |[`polyreflect!`](@ref) | -| | | | |[`polysample`](@ref) | -| | | | |[`polytriangulate`](@ref) | +|[`polyhull`](@ref) | | | |[`polyreflect!`](@ref) | +|[`polysuper`](@ref) | | | |[`polysample`](@ref) | +| [`polybspline`](@ref) | | | |[`polytriangulate`](@ref) | | | | | |[`insertvertices!`](@ref) | | | | | |[`polymorph`](@ref) | +| | | | | | +| | | | | | | *paths* | | | | | |[`storepath`](@ref) | | | | | |[`getpath`](@ref) |[`pathtopoly`](@ref) |[`drawpath`](@ref) |[`pathlength`](@ref) |[`pathsample`](@ref) | diff --git a/src/Luxor.jl b/src/Luxor.jl index f73869d9..84375845 100644 --- a/src/Luxor.jl +++ b/src/Luxor.jl @@ -148,7 +148,7 @@ export Drawing, noise, initnoise, # experimental polygon functions - polyremovecollinearpoints, polytriangulate!, + polyremovecollinearpoints, polytriangulate, ispointinsidetriangle, ispolyclockwise, polyorientation, ispolyconvex, polymorph, diff --git a/src/deprecations.jl b/src/deprecations.jl index 1402a673..6d5b39d1 100644 --- a/src/deprecations.jl +++ b/src/deprecations.jl @@ -1,7 +1 @@ using Base: @deprecate - -@deprecate intersection(pt1::Point, pt2::Point, pt3::Point, pt4::Point) intersectionlines(pt1::Point, pt2::Point, pt3::Point, pt4::Point) - -@deprecate polytriangulate!(pt) polytriangulate(pt) - -@deprecate rotate_point_around_point(targetpt, pt, angle) rotatepoint(targetpt, pt, angle) diff --git a/src/point.jl b/src/point.jl index 8b7dfc83..ee2c9062 100644 --- a/src/point.jl +++ b/src/point.jl @@ -111,8 +111,8 @@ end """ isequal(p1::Point, p2::Point) = - isapprox(p1.x, p2.x, atol = 0.00000001) && - (isapprox(p1.y, p2.y, atol = 0.00000001)) +isapprox(p1.x, p2.x, atol = 0.00000001) && +(isapprox(p1.y, p2.y, atol = 0.00000001)) Compare points. """ @@ -214,6 +214,26 @@ function between(couple::NTuple{2,Point}, x) return p1 + (x * (p2 - p1)) end +# convenience functions for my own use :) +""" + between(p1::Point, p2::Point, r:range) + between(p1::Point, p2::Point, a:array) + +Return an array of Points between point `p1` and point `p2` for +every `x` in range `r` or array `a`. + +If `x` is 0.0, that point will be at `p1`; if `x` is 1.0, that point will be at `p2`. + +When `x` is 0.5, that point is the midpoint between `p1` and `p2`. +""" +function between(pt1::Point, pt2::Point, r::AbstractRange) + [between(pt1, pt2, e) for e in r] +end + +function between(pt1::Point, pt2::Point, a::AbstractArray) + [between(pt1, pt2, e) for e in a] +end + """ perpendicular(p1::Point, p2::Point, p3::Point) @@ -311,9 +331,9 @@ function ispointonline(pt::Point, pt1::Point, pt2::Point; # point on the line if (abs(dxl) >= abs(dyl)) - return dxl > 0 ? pt1.x <= pt.x+atol && pt.x <= pt2.x+atol : pt2.x <= pt.x+atol && pt.x <= pt1.x+atol + return dxl > 0 ? pt1.x <= pt.x + atol && pt.x <= pt2.x + atol : pt2.x <= pt.x + atol && pt.x <= pt1.x + atol else - return dyl > 0 ? pt1.y <= pt.y+atol && pt.y <= pt2.y+atol : pt2.y <= pt.y+atol && pt.y <= pt1.y+atol + return dyl > 0 ? pt1.y <= pt.y + atol && pt.y <= pt2.y + atol : pt2.y <= pt.y + atol && pt.y <= pt1.y + atol end end diff --git a/src/polygons.jl b/src/polygons.jl index 3d34fa73..3519b2ed 100644 --- a/src/polygons.jl +++ b/src/polygons.jl @@ -1,13 +1,11 @@ # polygons, part of Luxor """ -Draw a polygon. - poly(pointlist::Array{Point, 1}, action = :none; close=false, reversepath=false) -Create a path with the points in `pointlist` and apply `action`. +Draw a polygon. Create a path with the points in `pointlist` and apply `action`. By default `poly()` doesn't close or fill the polygon. """ function poly(pointlist::Array{Point,1}; @@ -38,13 +36,12 @@ poly(pointlist::Array{Point,1}, a::Symbol; close = false, reversepath = false) = poly(pointlist, action = action, close = close, reversepath = reversepath) - """ + polysortbyangle(pointlist::Array, refpoint=minimum(pointlist)) + Sort the points of a polygon into order. Points are sorted according to the angle they make with a specified point. - polysortbyangle(pointlist::Array, refpoint=minimum(pointlist)) - The `refpoint` can be chosen, but the default minimum point is usually OK too: polysortbyangle(parray, polycentroid(parray)) @@ -59,11 +56,11 @@ function polysortbyangle(pointlist::Array{Point,1}, refpoint = minimum(pointlist end """ + polysortbydistance(p, starting::Point) + Sort a polygon by finding the nearest point to the starting point, then the nearest point to that, and so on. - polysortbydistance(p, starting::Point) - You can end up with convex (self-intersecting) polygons, unfortunately. """ function polysortbydistance(pointlist::Array{Point,1}, starting::Point) @@ -82,9 +79,9 @@ function polysortbydistance(pointlist::Array{Point,1}, starting::Point) end """ -Use a non-recursive Douglas-Peucker algorithm to simplify a polygon. Used by `simplify()`. + douglas_peucker(pointlist::Array, start_index, last_index, epsilon) - douglas_peucker(pointlist::Array, start_index, last_index, epsilon) +Use a non-recursive Douglas-Peucker algorithm to simplify a polygon. Used by `simplify()`. """ function douglas_peucker(pointlist::Array{Point,1}, start_index, last_index, epsilon) temp_stack = Tuple{Int,Int}[] @@ -117,10 +114,10 @@ function douglas_peucker(pointlist::Array{Point,1}, start_index, last_index, eps end """ -Simplify a polygon: - simplify(pointlist::Array, detail=0.1) +Simplify a polygon. + `detail` is the maximum approximation error of simplified polygon. """ function simplify(pointlist::Array{Point,1}, detail = 0.1) @@ -380,7 +377,7 @@ function polysmooth(points::Array{Point,1}, radius, action::Symbol; debug = fals # there are less than three points to smooth return nothing else - @inbounds for i in 1:(close ? l : l-2) + @inbounds for i in 1:(close ? l : l - 2) p1 = points[mod1(i, l)] p2 = points[mod1(i + 1, l)] p3 = points[mod1(i + 2, l)] @@ -622,7 +619,7 @@ end # third method """ -offsetpoly(plist, shape::Function) + offsetpoly(plist, shape::Function) Return a closed polygon that is offset from and encloses an polyline. @@ -651,8 +648,8 @@ This example draws a tilde, with the ends starting at 20 the middle, as f(0.5) = 25. ```julia -f(x, θ) = 10 + 15sin(x * π) -sinecurve = [Point(50x, 50sin(x)) for x in -π:π/24:π] +f(x, θ) = 10 + 15sin(x * π) +sinecurve = [Point(50x, 50sin(x)) for x in (-π):(π / 24):π] pgon = offsetpoly(sinecurve, f) poly(pgon, :fill) ``` @@ -662,7 +659,7 @@ thins the horizontal parts. ```julia g(x, θ) = rescale(abs(sin(θ)), 0, 1, 0.1, 30) -sinecurve = [Point(50x, 50sin(x)) for x in -π:π/24:π] +sinecurve = [Point(50x, 50sin(x)) for x in (-π):(π / 24):π] pgon = offsetpoly(sinecurve, g) poly(pgon, :fill) ``` @@ -781,34 +778,36 @@ end Generate a B-spline curve from a given set of control points. # Arguments -- `controlpoints::Array{Point,1}`: An array of control points that define the B-spline. -- `npoints=100`: The number of points to generate on the B-spline curve. -- `degree=3`: The degree of the B-spline. Default is 3. -- `clamped=true`: A boolean to indicate if the B-spline is clamped. Default is true. + + - `controlpoints::Array{Point,1}`: An array of control points that define the B-spline. + - `npoints=100`: The number of points to generate on the B-spline curve. + - `degree=3`: The degree of the B-spline. Default is 3. + - `clamped=true`: A boolean to indicate if the B-spline is clamped. Default is true. # Returns -- An array of points on the B-spline curve. + + - An array of points on the B-spline curve. """ -function polybspline(controlpoints::Array{Point,1}, npoints=30;degree=3, clamped=true) +function polybspline(controlpoints::Array{Point,1}, npoints = 30; degree = 3, clamped = true) nCP::Int64 = length(controlpoints) nCP == 0 && error("Error: controlpoints array cannot be empty.") npoints <= 0 && error("Error: npoints must be greater than zero.") degree <= 0 && error("Error: degree must be greater than zero.") degree >= nCP && error("Error: degree cannot be greater than the number of control points.") points = Array{Point,1}(undef, npoints) - T = Array{Float64,1}(undef, nCP+degree+1) + T = Array{Float64,1}(undef, nCP + degree + 1) if clamped - T[1:degree] .= 0. - for i=degree+1:nCP+1 + T[1:degree] .= 0.0 + for i in (degree + 1):(nCP + 1) T[i] = (i - degree - 1) / (nCP - degree) end - T[nCP+2:end] .= 1. + T[(nCP + 2):end] .= 1.0 else - for i=1:nCP+degree+1 + for i in 1:(nCP + degree + 1) T[i] = (i - 1) / (nCP + degree) end end - + """De Boor's algorithm for B-spline evaluation. from https://en.wikipedia.org/wiki/De_Boor%27s_algorithm Arguments @@ -819,33 +818,33 @@ function polybspline(controlpoints::Array{Point,1}, npoints=30;degree=3, clamped c: Array of control points. p: Degree of B-spline. """ - function deBoor(k::Int64,x::Float64,t::Array{Float64,1},c::Array{Point,1},p::Int64)::Point - d = Array{Point,1}(undef, p+1) - for j=1:p+1 - d[j] = c[j+k-p] + function deBoor(k::Int64, x::Float64, t::Array{Float64,1}, c::Array{Point,1}, p::Int64)::Point + d = Array{Point,1}(undef, p + 1) + for j in 1:(p + 1) + d[j] = c[j + k - p] end - @inbounds for r=1:p - for j=p+1:-1:r+1 - alpha=(x-t[j+k-p])/(t[j+1+k-r] - t[j+k-p]) - d[j]=(1-alpha)*d[j-1]+alpha*d[j] + @inbounds for r in 1:p + for j in (p + 1):-1:(r + 1) + alpha = (x - t[j + k - p]) / (t[j + 1 + k - r] - t[j + k - p]) + d[j] = (1 - alpha) * d[j - 1] + alpha * d[j] end end - return d[p+1] + return d[p + 1] end - @inbounds for i=0:npoints-1 - t=i/(npoints-1) + @inbounds for i in 0:(npoints - 1) + t = i / (npoints - 1) if !clamped - t =t*(T[nCP+1]-T[degree+1])+T[degree+1] + t = t * (T[nCP + 1] - T[degree + 1]) + T[degree + 1] end - k=1 #index of knot interval + k = 1 #index of knot interval while k < nCP - if t (v < val), a) if isnothing(ind) throw(error("nearestindex: no index")) @@ -963,9 +962,9 @@ using `polydistances(p, closed=closed)`. Use the complementary `polyremainder()` function to return the other part. """ -function polyportion(p::Array{Point,1}, portion = 0.5; - closed = true, - pdist = Array{Float64, 1}[]) +function polyportion(p::Array{Point,1}, portion = 0.5; + closed = true, + pdist = Array{Float64,1}[]) # portion is 0 to 1 if isempty(pdist) pdist = polydistances(p, closed = closed) @@ -1017,9 +1016,9 @@ calculated afresh, using `polydistances(p, closed=closed)`. Use the complementary `polyportion()` function to return the other part. """ -function polyremainder(p::Array{Point,1}, portion = 0.5; - closed = true, - pdist = Array{Union{Float64, Int}, 1}[]) +function polyremainder(p::Array{Point,1}, portion = 0.5; + closed = true, + pdist = Array{Union{Float64,Int},1}[]) # portion is 0 to 1 if isempty(pdist) pdist = polydistances(p, closed = closed) @@ -1277,7 +1276,7 @@ Scale (permanently) a polygon by `sh` horizontally and `sv` vertically, relative to `center`. """ function polyscale!(pgon, sh, sv; - center = O) + center = O) return pgon .= (pgon .- center) .* Ref((sh, sv)) end @@ -1654,10 +1653,10 @@ end ``` """ function polymorph(pgon1::Array{Array{Point,1}}, pgon2::Array{Array{Point,1}}, k; - samples = 100, - easingfunction = easingflat, - kludge = true, - closed = true) + samples = 100, + easingfunction = easingflat, + kludge = true, + closed = true) isapprox(k, 0.0) && return pgon1 isapprox(k, 1.0) && return pgon2 loopcount1 = length(pgon1) diff --git a/test/polybspline-test.jl b/test/polybspline-test.jl index e6bc18dc..edfc57ac 100644 --- a/test/polybspline-test.jl +++ b/test/polybspline-test.jl @@ -30,4 +30,5 @@ function test_polybspline() @test all(min_x <= p.x <= max_x && min_y <= p.y <= max_y for p in resultUnClamped) end -test_polybspline() \ No newline at end of file +test_polybspline() +println("...finished polybpline() test") \ No newline at end of file