@@ -133,7 +133,7 @@ function HalfEdgeTopology(elems::AbstractVector{<:Connectivity}; sort=true)
133
133
134
134
# sort elements to make sure that they
135
135
# are traversed in adjacent-first order
136
- adjelems = sort ? adjsort (elems) : elems
136
+ adjelems = sort ? adjsort (elems):: typeof (elems) : elems
137
137
eleminds = sort ? indexin (adjelems, elems) : 1 : length (elems)
138
138
139
139
# start assuming that all elements are
@@ -143,7 +143,7 @@ function HalfEdgeTopology(elems::AbstractVector{<:Connectivity}; sort=true)
143
143
# initialize with first element
144
144
half4pair = Dict {Tuple{Int,Int},HalfEdge} ()
145
145
elem = first (adjelems)
146
- inds = collect (indices (elem))
146
+ inds:: Vector{Int} = collect (indices (elem))
147
147
v = CircularVector (inds)
148
148
n = length (v)
149
149
for i in 1 : n
@@ -183,8 +183,8 @@ function HalfEdgeTopology(elems::AbstractVector{<:Connectivity}; sort=true)
183
183
184
184
# add missing pointers
185
185
for (e, elem) in Iterators. enumerate (adjelems)
186
- inds = CCW[e] ? indices (elem) : reverse (indices (elem))
187
- v = CircularVector (collect ( inds) )
186
+ inds = CCW[e] ? collect ( indices (elem)) : reverse (collect ( indices (elem) ))
187
+ v = CircularVector (inds)
188
188
n = length (v)
189
189
for i in 1 : n
190
190
# update pointers prev and next
219
219
function adjsort (elems:: AbstractVector{<:Connectivity} )
220
220
# initialize list of adjacent elements
221
221
# with first element from original list
222
- list = indices .(elems)
223
- adjs = Tuple[popfirst! (list)]
222
+ list = map (indices, elems)
223
+ adjs = similar (list, 0 )
224
+ push! (adjs, popfirst! (list))
224
225
225
226
# the loop will terminate if the mesh
226
227
# is manifold, and that is always true
@@ -230,7 +231,7 @@ function adjsort(elems::AbstractVector{<:Connectivity})
230
231
# one vertex with the last adjacent element
231
232
found = false
232
233
vinds = last (adjs)
233
- for i in vinds
234
+ for i:: Int in vinds
234
235
einds = findall (e -> i ∈ e, list)
235
236
if ! isempty (einds)
236
237
# lookup all elements that share at
@@ -251,7 +252,7 @@ function adjsort(elems::AbstractVector{<:Connectivity})
251
252
end
252
253
end
253
254
254
- connect .( adjs)
255
+ return map (connect, adjs)
255
256
end
256
257
257
258
paramdim (:: HalfEdgeTopology ) = 2
0 commit comments