Skip to content

Commit e58d235

Browse files
committed
add getindex for faces for vec too
1 parent 848e281 commit e58d235

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/basic_types.jl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,11 @@ abstract type AbstractNgonFace{N,T} <: AbstractFace{N,T} end
2020
abstract type AbstractSimplex{Dim,N,T} <: StaticVector{Dim,T} end
2121

2222
@propagate_inbounds function Base.getindex(points::AbstractVector{P}, face::F) where {P<: Point, F <: AbstractFace}
23-
Polytope(P, F)(map(i-> points[i], face.data))
23+
return Polytope(P, F)(map(i-> points[i], face.data))
24+
end
25+
26+
@propagate_inbounds function Base.getindex(points::AbstractVector{P}, face::F) where {P<: Vec, F <: AbstractFace}
27+
return map(i-> points[i], face.data)
2428
end
2529

2630
@fixed_vector SimplexFace AbstractSimplexFace

0 commit comments

Comments
 (0)