# Merging triangles in mesh?

**URL:** <https://discourse.julialang.org/t/merging-triangles-in-mesh/8741>\
**Category:** General Usage\
**Created:** [February 1, 2018, 2:30pm UTC](https://discourse.julialang.org/t/merging-triangles-in-mesh/8741 "2018-02-01T14:30:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mlhetland](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mlhetland/32/283_2.png) [@mlhetland](https://discourse.julialang.org/u/mlhetland)\
**Post date:** [February 1, 2018, 2:30pm UTC](https://discourse.julialang.org/t/merging-triangles-in-mesh/8741/1 "2018-02-01T14:30:44Z")

</div>

Is there some existing library with functionality for merging triangles (or other faces) with (essentially) the same angles into single polygonal faces (based on GeometryTypes.jl, for example)? Trying to generate line-drawings using Polyhedra.jl, and as far as I can tell, I can only extract triangular meshes (with CDDLib)…?

(I could implement something myself, of course – either for the merging or for simply locating neighbor vertices, etc. :-))

---

<div class="post-metadata">

**Author:** ![goretkin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/goretkin/32/167_2.png) [@goretkin](https://discourse.julialang.org/u/goretkin)\
**Post date:** [February 6, 2018, 2:22pm UTC](https://discourse.julialang.org/t/merging-triangles-in-mesh/8741/2 "2018-02-06T14:22:53Z")

</div>

As far as I know, CDDLib exposes the incidence information, which is a polygon mesh, not a triangle mesh.

I was working on getting this incidence information within Julia recently:  
[https://gist.github.com/goretkin/e72c1a5eb8aecf946e4273c823271a44](https://gist.github.com/goretkin/e72c1a5eb8aecf946e4273c823271a44)

---

<div class="post-metadata">

**Author:** ![mlhetland](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mlhetland/32/283_2.png) [@mlhetland](https://discourse.julialang.org/u/mlhetland)\
**Post date:** [February 6, 2018, 2:58pm UTC](https://discourse.julialang.org/t/merging-triangles-in-mesh/8741/3 "2018-02-06T14:58:04Z")

</div>

Ah, cool. I ended up implementing the thing myself, fusing the triangles from `Polyhedra.jl`. A bit wasteful, but the polytopes in question are tiny (for figures), anyway. Might rewrite, though!-)
