Cutting a mesh

Hello.

I’m working on a file that uses lines to generate filaments for a lattice. These filaments are directly built as a mesh to reduce computational load and file size. I want to then 3D print this lattice using an SLA printer but since the filaments have a round edge there isn’t much surface area for the lattice to bond to the build platform. Is there anyway to cut a flat surface on the mesh? I’ve tried using functions such as mesh difference but this cuts the flat surface and then also deletes every mesh body that doesn’t enter into the volume. Any help here would be appreciated. Thanks.

Mesh Trim Example.gh (39.0 KB)

Hello @derek1,

Unfortunately, what you’re trying to accomplish might be harder than you think.

Let’s start at the beginning! Joining meshes does not union them.
It just kind of groups both meshes together, but they can be disjoint/ungrouped at any moment. It’s not like doing boolean operations on geometry.
Closed, watertight meshes aren’t usually joined together! Mesh joining is used to join two or more adjacent, open meshes that share naked edges. After joining, their overlapping vertices can be welded together to form a single mesh.

This does you no good for the boolean difference that you later apply.
Many of the joined/grouped meshes don’t intersect your cutting volume at all, and thus can’t be processed.
Generally speaking, mesh booleans are messy! Meshes are all about clean topology and face flow. Boolean operations tend to destroy the neatest mesh topology. Now, in manual modelling, you would fix these mistakes by hand, which is quite cumbersome in Rhino, and would interrupt your parametrical workflow either way.
Long story short, in my opinion, mesh booleans should be avoided altogether.

Here are a couple of strategies that could lead to success:

  1. For 3D printing, it usually doesn’t matter if you have clean individual meshes that overlap or intersect, or a single watertight mesh. Sure the result might be a little less clean, and the print time longer, but printing should pose no problem. I’ve done it myself.
    This means that you could append one ore more meshes at the base level to form a flat printing area: Mesh Trim Example 2.gh (57.3 KB)

  2. Another option could be to produce your mesh in a different fashion, with the goal to obtain a single, clean, watertight mesh from your base lines. This would probably allow you to perform the boolean operation in the end, but no guarantees here.
    You could try Dendro (Windows only), Cocoon, or the Fattener component for this.

2 Likes

Hey @diff-arch,

I was able to get the trim mesh to work using your help as well as some other examples I found online. The trim seems to work in my full code but not in the example code. My main issue now is that the trim mesh code work most of the time but every now and then it won’t show a preview but when I try and bake it I get the error, “You’re about to bake an invalid object, do you want to procede”. Do you have any idea on what an invalid object is or what could be happening?

In any case, thanks so much for your help through this. It was very helpful in this process.
-Derek

You’re welcome, @derek1.

As mentioned above, bollean’ing meshes is a messy operation.

The invalid object warning means that there is something wrong with your mesh (i.e. non-manifold edges, intersecting faces, etc.). For now, try to ignore the warning and bake it.
In Rhino you can analyse the mesh with MeshRepair, and it will tell exactly what is wrong.

In order to fix the issues, you might need to change your current workflow.