Skip to content

fix #28 #30

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,8 @@ language: julia
os:
- linux
julia:
- 1.3
- nightly
matrix:
allow_failures:
- julia: nightly
fast_finish: true
- 1
if: branch = master OR tag IS present OR type = pull_request
notifications:
email: false
after_success:
Expand Down
8 changes: 4 additions & 4 deletions src/boundingboxes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,22 @@ function Rect{N1, T1}(geometry::AbstractArray{PT}) where {N1, T1, PT <: Abstract
end

function Rect(primitive::GeometryPrimitive{N, T}) where {N, T}
Rect{N, T}(primitive)
return Rect{N, T}(primitive)
end

function Rect{T}(primitive::GeometryPrimitive{N, T}) where {N, T}
Rect{N, T}(primitive)
return Rect{N, T}(primitive)
end

function Rect{T}(a::Pyramid) where T
w,h = a.width / T(2), a.length
m = Vec{3,T}(a.middle)
Rect{T}(m .- Vec{3,T}(w,w,0), m .+ Vec{3,T}(w, w, h))
return Rect{T}(m .- Vec{3,T}(w,w,0), m .+ Vec{3,T}(w, w, h))
end

function Rect{T}(a::Sphere) where T
mini, maxi = extrema(a)
Rect{T}(mini, maxi .- mini)
return Rect{T}(mini, maxi .- mini)
end

Rect{T}(a) where T = Rect{T}(coordinates(a))
Expand Down
8 changes: 7 additions & 1 deletion src/viewtypes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,13 @@ Tables.schema(faceview::FaceView) = Tables.schema(getfield(faceview, :elements))

Base.size(faceview::FaceView) = size(getfield(faceview, :faces))

Base.show(io::IO, ::Type{<: FaceView{Element}}) where Element = print(io, "FaceView{", Element, "}")
function Base.show(io::IO, ::Type{<: FaceView{Element}}) where Element
if @isdefined Element
print(io, "FaceView{", Element, "}")
else
print(io, "FaceView{T}")
end
end

@propagate_inbounds function Base.getindex(x::FaceView{Element}, i) where Element
return Element(map(idx-> coordinates(x)[idx], faces(x)[i]))
Expand Down