# Invalid mesh? Oh really?

**URL:** <https://discourse.mcneel.com/t/invalid-mesh-oh-really/147086>\
**Category:** Grasshopper\
**Tags:** windows, mesh, dendro\
**Created:** [August 27, 2022, 6:07pm UTC](https://discourse.mcneel.com/t/invalid-mesh-oh-really/147086 "2022-08-27T18:07:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Birk\_Binnard](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/birk_binnard/32/769957_2.png) [@Birk\_Binnard](https://discourse.mcneel.com/u/Birk_Binnard)\
**Post date:** [August 27, 2022, 6:07pm UTC](https://discourse.mcneel.com/t/invalid-mesh-oh-really/147086/1 "2022-08-27T18:07:19Z")

</div>

After reading some posts here about Dendro I decided to try it for the first time. To do that I used pieces of GH files I’ve used before that contained no meshing routines at all. It was an interesting learning experience for sure, and it brought up what might be considered a quirk in the way meshes function.

Because this was my first experience with Dendro I opted to start with small geometry that looks like this:

![Screenshot_2](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/b/4/d/b4d5eb7d232fed2515eb318f4b0049d7a3bfd6ea.jpeg)

On the left are 5 feet formed from 5 closed Breps, and on the right is the top, also a closed Brep.

Here is a screenshot of the attached GH file which I simplified by internalizing the above geometry:

 ![Screenshot_1](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/a/d/1/ad1936b679072e3f643b0ed7c207c46f921d1cdd.jpeg)

The interesting part is the final Invalid mesh. Even though it is Invalid it can be baked into Rhino and then exported as an STL file for 3D printing. Here is a photo of the printed part:

 ![600](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/1/3/5/135adc9e2d7d718e8ac04ecc0e76bb5578c3d1cd.jpeg)

Even though GH/Dendro says the final mesh is invalid, it displays just fine in Rhino. I thought this was interesting, but it got even more interesting when I tried to Bake it:

 ![Screenshot_3](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/f/0/0/f00ab03e809c0beae56c23392f6235366c1aefbb.jpeg)

Whoa baby! I had never seen this dialog before - probably because I stick to closed Breps almost exclusively. But I figured what the heck, let’s Bake it and see what happens.

This is what happened:

 ![Screenshot_4](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/3/c/8/3c8ef0a10bc6c706a468be522fe68801d2614e76.jpeg)

Needless to say, that got my attention. But much to my surprise it exported as an STL just fine. And when I imported that STL file into my slicer (SuperSlicer) it reported that it found and corrected 4 mesh errors, and then subsequently sliced the result with no problems. My printed result is what I showed above.

So - I’m not sure what all this is trying to tell me. Since I deal only with 3D printable geometry the issue of invalid meshes that actually work may be of value only to me, but maybe this little example might help someone else for whom meshes are a big deal.

[InvalidMesh-maybe.gh](https://discourse.mcneel.com/uploads/short-url/6L5aDNrZOFgMMl4vNEDrKxlyVnw.gh) (619.2 KB)

---

<div class="post-metadata">

**Author:** ![ryein](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/ryein/32/602638_2.png) [@ryein](https://discourse.mcneel.com/u/ryein)\
**Post date:** [August 27, 2022, 6:49pm UTC](https://discourse.mcneel.com/t/invalid-mesh-oh-really/147086/2 "2022-08-27T18:49:26Z")

</div>

there is a new version of dendro up on food4rhino that has a fix for the invalid mesh output. don’t known if that is the version you are using but thought i’d mention that. i don’t think it will completely eliminate invalid mesh results, but in testing the new version it seems to take care of 99% of the issue. when all else fails, playing around with the adaptivity and isovalue can fix the invalid mesh output sometimes as well.

---

<div class="post-metadata">

**Author:** ![laurent\_delrieu](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/laurent_delrieu/32/601605_2.png) [@laurent\_delrieu](https://discourse.mcneel.com/u/laurent_delrieu)\
**Post date:** [August 27, 2022, 7:40pm UTC](https://discourse.mcneel.com/t/invalid-mesh-oh-really/147086/3 "2022-08-27T19:40:17Z")

</div>

Hello  
@Birk_Binnard invalid mesh could be healed “quite easily”.

> [@Fixing Invalid Mesh in Grasshopper](https://discourse.mcneel.com/t/fixing-invalid-mesh-in-grasshopper/118308):
>
> Hello, I am trying to write a C# script that will automate mesh fixing at the end of my grasshopper definition, before exporting. 99% of the time the mesh has 1 or 2 degenerate faces that can be easily fixed using the Rhino CullDegenerateFaces command and then there’s no more problem. However, I am trying to create a small C# component that will automate this for me. Any ideas how this could be done? I am trying to use private void RunScript(Mesh M, ref object R) { if (M != null) { M.Fac…

It is a “new” problem since Rhino 6 or 7, because Rhino doesn’t want degenerate face (face without area) or others problem.  
@ryein thanks for adding this healing.

---

<div class="post-metadata">

**Author:** ![Birk\_Binnard](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/birk_binnard/32/769957_2.png) [@Birk\_Binnard](https://discourse.mcneel.com/u/Birk_Binnard)\
**Post date:** [August 27, 2022, 7:56pm UTC](https://discourse.mcneel.com/t/invalid-mesh-oh-really/147086/4 "2022-08-27T19:56:44Z")

</div>

Good info - thanks. I didn’t know if Dendro was now part of Rhino or not. I’ll get the current version and see what happens.

Edit: Good news - it’s fixed! Nice job.
