@@ -236,7 +236,7 @@ Generates a new mesh containing all the data of the individual meshes.
236236If all meshes are consistent in their use of FaceViews they will be preserved.  
237237Otherwise all of them will be converted with `clear_faceviews(mesh)`. 
238238""" 
239- function  Base. merge (meshes:: AbstractVector{<:Mesh{D}}  )  where  {D} 
239+ function  Base. merge (meshes:: AbstractVector{<:Mesh}  ) 
240240    return  if  isempty (meshes)
241241        return  Mesh (Point3f[], GLTriangleFace[])
242242
@@ -271,12 +271,18 @@ function Base.merge(meshes::AbstractVector{<:Mesh{D}}) where {D}
271271        @label  DOUBLE_BREAK
272272
273273        if  consistent_face_views
274- 
274+              
275275            #  All the same kind of face, can just merge
276276            new_attribs =  NamedTuple {names} (map (names) do  name
277-                 return  reduce (vcat, getproperty .(meshes, name))
277+                 if  name ===  :position 
278+                     D =  maximum (ndims, meshes)
279+                     T =  mapreduce (m ->  eltype (pointtype (m)), promote_type, meshes)
280+                     PT =  Point{D, T}
281+                     return  reduce (vcat, decompose .(PT, meshes))
282+                 else 
283+                     return  reduce (vcat, getproperty .(meshes, name))
284+                 end 
278285            end )
279-             #  fs = reduce(vcat, faces.(meshes))
280286            fs =  reduce (vcat, faces .(meshes))
281287
282288            #  TODO : is the type difference in offset bad?
0 commit comments