# Existing package for basic mesh manipulation?

**URL:** <https://discourse.julialang.org/t/existing-package-for-basic-mesh-manipulation/53941>\
**Category:** Data\
**Tags:** mesh, geometry\
**Created:** [January 25, 2021, 11:05pm UTC](https://discourse.julialang.org/t/existing-package-for-basic-mesh-manipulation/53941 "2021-01-25T23:05:19Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![OliverEvans96](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oliverevans96/32/4177_2.png) [@OliverEvans96](https://discourse.julialang.org/u/OliverEvans96)\
**Post date:** [January 25, 2021, 11:05pm UTC](https://discourse.julialang.org/t/existing-package-for-basic-mesh-manipulation/53941/1 "2021-01-25T23:05:19Z")

</div>

Hi all,

Just a quick question: is there a package out there that I can use to perform basic mesh manipulations such as subdivide, extrude, etc.? I see [Meshes.jl](https://github.com/JuliaGeometry/Meshes.jl), which has some triangulation functions, but I don’t see much else related to mesh manipulation.

Thanks!  
Oliver

---

<div class="post-metadata">

**Author:** ![juliohm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/juliohm/32/215266_2.png) [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Post date:** [January 25, 2021, 11:17pm UTC](https://discourse.julialang.org/t/existing-package-for-basic-mesh-manipulation/53941/2 "2021-01-25T23:17:07Z")

</div>

What kind of manipulation you have in mind @OliverEvans96 ? I am actively working on Meshes.jl and it is getting into a really good shape. The goal is to provide a flexible api to manipulate all kinds of meshes.

---

<div class="post-metadata">

**Author:** ![OliverEvans96](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oliverevans96/32/4177_2.png) [@OliverEvans96](https://discourse.julialang.org/u/OliverEvans96)\
**Post date:** [January 25, 2021, 11:58pm UTC](https://discourse.julialang.org/t/existing-package-for-basic-mesh-manipulation/53941/3 "2021-01-25T23:58:05Z")

</div>

Oh, cool! Subdivide and extrude are on the top of my mind.

---

<div class="post-metadata">

**Author:** ![OliverEvans96](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oliverevans96/32/4177_2.png) [@OliverEvans96](https://discourse.julialang.org/u/OliverEvans96)\
**Post date:** [January 25, 2021, 11:59pm UTC](https://discourse.julialang.org/t/existing-package-for-basic-mesh-manipulation/53941/4 "2021-01-25T23:59:08Z")

</div>

Basically, I’m thinking of doing basic mesh edits similar to what I would do manually in Blender, just programmatically in Julia.

---

<div class="post-metadata">

**Author:** ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Post date:** [January 26, 2021, 12:10am UTC](https://discourse.julialang.org/t/existing-package-for-basic-mesh-manipulation/53941/5 "2021-01-26T00:10:51Z")

</div>

Check out FinEtools.jl. Or, MeshCore/MeshSteward. Both combinations would allow you to refine meshes by subdivision and extrude. [https://github.com/PetrKryslUCSD/](https://github.com/PetrKryslUCSD/)

---

<div class="post-metadata">

**Author:** ![juliohm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/juliohm/32/215266_2.png) [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Post date:** [January 26, 2021, 12:20am UTC](https://discourse.julialang.org/t/existing-package-for-basic-mesh-manipulation/53941/6 "2021-01-26T00:20:16Z")

</div>

@OliverEvans96 these operations are certainly interesting to have. Stay tuned for upcoming features 🙂

---

<div class="post-metadata">

**Author:** ![OliverEvans96](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oliverevans96/32/4177_2.png) [@OliverEvans96](https://discourse.julialang.org/u/OliverEvans96)\
**Post date:** [January 29, 2021, 11:55pm UTC](https://discourse.julialang.org/t/existing-package-for-basic-mesh-manipulation/53941/7 "2021-01-29T23:55:52Z")

</div>

These look great, thanks! In FinETools.jl, I see `T3refine` for subdivision and `H8extrudeQ4` for extrusion. I haven’t found equivalent functions in MeshCore/MeshSteward yet.

More importantly, is there currently any way to convert between a GeometryBasics mesh and a FinETools/MeshCore mesh? Or read a FinETools/MeshCore mesh from an obj?

Thanks!  
Oliver

---

<div class="post-metadata">

**Author:** ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Post date:** [January 30, 2021, 12:07am UTC](https://discourse.julialang.org/t/existing-package-for-basic-mesh-manipulation/53941/8 "2021-01-30T00:07:46Z")

</div>

There is a `Q4refine` and `T4refine` and `T10refine` and `T4refine20`. This is an `FinEtools`, I haven’t had time to test properly the refinement in `MeshSteward`, so that isn’t publicly available yet. Sorry.

So your inputs are `.obj` files? Triangular meshes then?

And how do you want to process them?

---

<div class="post-metadata">

**Author:** ![OliverEvans96](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oliverevans96/32/4177_2.png) [@OliverEvans96](https://discourse.julialang.org/u/OliverEvans96)\
**Post date:** [January 30, 2021, 12:11am UTC](https://discourse.julialang.org/t/existing-package-for-basic-mesh-manipulation/53941/9 "2021-01-30T00:11:20Z")

</div>

Basically, I intend to load a set of rectangles from a `.obj` file, then extrude, subdivide and triangulate each one to produce something like this

 ![2021-01-29-191111_891x766_scrot](https://global.discourse-cdn.com/julialang/original/3X/7/6/7661a8dda863d7929d9bca6e0c696d51231c2311.jpeg)

which I will then perfom some light/shading calculations on with environmental obstacles loaded from another `.obj`.

---

<div class="post-metadata">

**Author:** ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Post date:** [January 30, 2021, 12:15am UTC](https://discourse.julialang.org/t/existing-package-for-basic-mesh-manipulation/53941/10 "2021-01-30T00:15:49Z")

</div>

If you wish to generate a tetrahedral mesh for a block, you can use a built-in function in `FinEtools`.  
Either crossed mesh, or all diagonal edges the same direction. If you are interested only in the surface, simply generate the tetrahedral mesh and extract the boundary.

---

<div class="post-metadata">

**Author:** ![OliverEvans96](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oliverevans96/32/4177_2.png) [@OliverEvans96](https://discourse.julialang.org/u/OliverEvans96)\
**Post date:** [January 30, 2021, 12:25am UTC](https://discourse.julialang.org/t/existing-package-for-basic-mesh-manipulation/53941/11 "2021-01-30T00:25:21Z")

</div>

Thanks. In my case, I’m just interested in the surface. So is there any way to convert between `GeometryBasics` and `FinEtools`?

---

<div class="post-metadata">

**Author:** ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Post date:** [January 30, 2021, 12:39am UTC](https://discourse.julialang.org/t/existing-package-for-basic-mesh-manipulation/53941/12 "2021-01-30T00:39:50Z")

</div>

Of course. One way, or both ways?

---

<div class="post-metadata">

**Author:** ![OliverEvans96](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oliverevans96/32/4177_2.png) [@OliverEvans96](https://discourse.julialang.org/u/OliverEvans96)\
**Post date:** [January 30, 2021, 2:08am UTC](https://discourse.julialang.org/t/existing-package-for-basic-mesh-manipulation/53941/13 "2021-01-30T02:08:00Z")

</div>

Both ways

---

<div class="post-metadata">

**Author:** ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Post date:** [January 30, 2021, 4:49pm UTC](https://discourse.julialang.org/t/existing-package-for-basic-mesh-manipulation/53941/14 "2021-01-30T16:49:05Z")

</div>

If you give me a better idea of what it is you wish to accomplish, I can be more helpful.

The conversion needs to be programmed, it is not built-in. The data is stored in `FinEtools` in a flat array for the node coordinates, and in a vector of tuples for the connectivities, but can be retrieved as a flat array.

Depending on what it is you wish to do, this double conversion may or may not be the way to go. For instance exports to format suitable for visualization are available. Import from a number of finite element format is available.

---

<div class="post-metadata">

**Author:** ![pablosanjose](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pablosanjose/32/7006_2.png) [@pablosanjose](https://discourse.julialang.org/u/pablosanjose)\
**Post date:** [January 30, 2021, 5:04pm UTC](https://discourse.julialang.org/t/existing-package-for-basic-mesh-manipulation/53941/15 "2021-01-30T17:04:06Z")

</div>

I’m also interested in mesh manipulations, but in my case I need to add one or more points to a Delaunay mesh, and reconnect the vertices so that it stays a Delaunay mesh… Does Meshes.jl (or other package) have this kind of Delaunay mesh refinement?

---

<div class="post-metadata">

**Author:** ![OliverEvans96](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oliverevans96/32/4177_2.png) [@OliverEvans96](https://discourse.julialang.org/u/OliverEvans96)\
**Post date:** [January 31, 2021, 12:12am UTC](https://discourse.julialang.org/t/existing-package-for-basic-mesh-manipulation/53941/16 "2021-01-31T00:12:43Z")

</div>

Thanks! It sounds like it should be easy for me to write the conversion functions given the coordinate array. I’m not using finite element methods, and I’ve been visualizing with Makie thus far. I’m just importing from `.obj`, manipulating the mesh, and running some other Julia code to analyze the light/shading. Thanks for your help!

---

<div class="post-metadata">

**Author:** ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Post date:** [January 31, 2021, 12:13am UTC](https://discourse.julialang.org/t/existing-package-for-basic-mesh-manipulation/53941/17 "2021-01-31T00:13:18Z")

</div>

No prob. Let me know if you get stuck.
