42
42
43
43
"""
44
44
HalfEdgeTopology(elements; sort=true)
45
- HalfEdgeTopology(halfedges)
45
+ HalfEdgeTopology(halfedges; nelems=nothing )
46
46
47
47
A data structure for orientable 2-manifolds based on
48
48
half-edges constructed from a vector of connectivity
@@ -52,6 +52,9 @@ The option `sort` can be used to sort the elements in
52
52
adjacent-first order in case of inconsistent orientation
53
53
(i.e. mix of clockwise and counter-clockwise).
54
54
55
+ The option `nelems` can be used to specify an approximate
56
+ number of `elements` as a size hint.
57
+
55
58
## Examples
56
59
57
60
Construct half-edge topology from a list of top-faces:
@@ -97,7 +100,7 @@ struct HalfEdgeTopology <: Topology
97
100
edge4pair:: Dict{Tuple{Int,Int},Int}
98
101
end
99
102
100
- function HalfEdgeTopology (halves:: AbstractVector{Tuple{HalfEdge,HalfEdge}} , nelems= nothing )
103
+ function HalfEdgeTopology (halves:: AbstractVector{Tuple{HalfEdge,HalfEdge}} ; nelems= nothing )
101
104
# pre-allocate memory and provide size hints
102
105
halfedges = Vector {HalfEdge} (undef, 2 * length (halves))
103
106
edge4pair = Dict {Tuple{Int,Int},Int} ()
@@ -222,7 +225,7 @@ function HalfEdgeTopology(elems::AbstractVector{<:Connectivity}; sort=true)
222
225
end
223
226
end
224
227
225
- HalfEdgeTopology (halves, length (elems))
228
+ HalfEdgeTopology (halves; nelems = length (elems))
226
229
end
227
230
228
231
function adjsort (elems:: AbstractVector{<:Connectivity} )
0 commit comments