Skip to content

Commit

Permalink
simplify definition of function gridpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
jbytecode committed Feb 29, 2024
1 parent cfd025c commit 2283a8c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/functions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ function elements2indices(F)
return unique(reduce(vcat,F))
end

function gridpoints(x::Vector{T}, y=x::Vector{T}, z=x::Vector{T}) where T<:Real
function gridpoints(x::Vector{T}, y=x, z=x) where T<:Real
reshape([GeometryBasics.Point{3, T}(x, y, z) for z in z, y in y, x in x],
length(x)*length(y)*length(z))
end

function gridpoints(x::AbstractRange{T}, y=x::AbstractRange{T}, z=x::AbstractRange{T}) where T<:Real
function gridpoints(x::AbstractRange{T}, y=x, z=x) where T<:Real
reshape([GeometryBasics.Point{3, T}(x, y, z) for z in z, y in y, x in x],
length(x)*length(y)*length(z))
end
Expand Down

0 comments on commit 2283a8c

Please sign in to comment.