Solid from mesh?

I’m struggling to take a mesh, offset it only in the Z direction, and close the sides to produce a solid.

The various thicken mesh components all seem to offset by the face normals (or similar), whereas what I need is strictly offset alone one axis.


mesh-problem.gh (1.0 MB)

…In that example I just want to create additional meshes for the four sides and weld the whole thing into one big solid mesh. It’s driving me crazy.

Any thoughts?

A welded mesh is not a “solid” in the same sense as a “Closed Brep”.


loft_mesh_2021_Aug3a.gh (1.0 MB)

1 Like

Indeed, I just need the “solid” in quotes. Thank you so much!

I know you’re happy with the “solid” mesh but I explored some ways to get a “Closed Brep” solid. The extremely high density of your mesh defeated most attempts because they took far too long. Finally I thought of a way that is rather fast, taking less than a minute! You may wonder how I got the number 179 for the ‘U’ input to SrfGrid… Can you guess?


loft_mesh_2021_Aug3e.gh (1.0 MB)

The next best method took half an hour, despite the deceptive profiler times. I’ll post the code without your mesh, you can add that (and wait patiently) if you want to try it:


loft_mesh_2021_Aug3d.gh (9.0 KB)

Thanks for the followup! Very cool to see the different approaches.

I’m assuming you got the 179 from deriving that the mesh has 179x204 vertices, but I’ll admit that I don’t know how you got there. I have it myself a few steps before I internalized the mesh to share here, but I’m guessing you did something like:

Thanks again for not just the solution but the next step. That mesh to brep technique will come in handy in a future project!

No. What Decon is that?

I used my ‘Tree/List Viewer’ tool but this also works:

loft_mesh_2021_Aug3a2

That index value of 177 means there are 178 faces on that edge. So 179 unique vertex points.

P.S. When the mesh/grid is square with ‘World XY’ as this one is, it can be derived like this:

loft_mesh_2021_Aug3a3

That DCon is the same set delete consecutive you’ve used. :slight_smile:

Aha, thanks, I’ve never used that before.

The reason I used Sort Points is because CullPt (Cull Duplicate Points) left the unique points in a corrupted sequence. However, Sort Points will also only work when the grid/mesh is square with ‘World XY’. Surely there are other methods but SrfGrid assumes a rectangular shape anyway, which is likely to be aligned with ‘World XY’, so let’s move on. :sunglasses:

1 Like

Python solution takes ~83 ms. produces a closed mesh.

Edit: forgot to attach file
loft_mesh_re_210804a.gh (1.0 MB)

-Kevin

2 Likes

Impressive, though version ‘Aug3a’ took only a second (1.4 secs.) with standard components.

https://developer.rhino3d.com/api/RhinoCommon/html/M_Rhino_Geometry_Mesh_Offset_2.htm

.public Mesh Offset(
	double distance,
	bool solidify,
	Vector3d direction
)
1 Like

The mesh produced by version ‘Aug3a’ has some problems:

General information about this mesh:

Mesh has 1724 naked edges.  Naked edges can cause problems if the ultimate goal is STL output.
Mesh has 36134 faces with directions different from the mesh as a whole.
  This can cause problems if you're doing mesh boolean operations with it.

Mesh does not have any degenerate faces.
Mesh does not have any ngons.
Mesh does not have any extremely short edges.
Mesh does not have any non manifold edges.
Mesh does not have any duplicate faces.
Mesh does not have any self intersecting faces.
Mesh does not have any disjoint pieces.
Mesh does not have any unused vertices.

-Kevin

1 Like

Indeed! Where did that info come from?

1 Like

I thought there was a grasshopper component for this but couldn’t find it so I used a python script.

https://developer.rhino3d.com/api/RhinoCommon/html/M_Rhino_Geometry_Mesh_Check.htm

You can get the same info if you bake the mesh and use the _MeshRepair command in Rhino.

-Kevin

1 Like

OK… That link doesn’t write the Python script for me but thanks for the info.
(I don’t need the 1 MB mesh, just the code, or at least an image of it?)

1 Like

Here’s the script:

check mesh.gh (3.1 KB)

1 Like

Thanks, there are details that would have eluded me:

import Rhino.Geometry as rg
from Rhino.FileIO import TextLog

ghenv.Component.NickName = "Check Mesh"

log = TextLog()
params = rg.MeshCheckParameters.Defaults()
msh.Check(log, params)
info = log.ToString()

Especially because it apparently requires R7 and I’m still using R6?

  1. Solution exception:‘Rhino.Geometry’ object has no attribute ‘MeshCheckParameters’

Thanks anyway.

1 Like

Sorry, hadn’t noticed that. It says the Rhino.Geometry.Mesh.Check() method was added in Version 7.0

-Kevin

1 Like

Looking around a little more, I did find that you can get the naked edges from a mesh at the E1 output of the Mesh Edges component.

Edit: you obviously knew this already since you used this output to create the curve you lofted.
-Kevin

1 Like

Another alternate method. No plug-ins or scripts ~420 milliseconds.

loft_mesh_re_210804b.gh (1.0 MB)

-Kevin

1 Like

You’re all amazing. I asked for help with a hangnail and got an exploration of the most efficient way to regrow a limb.

2 Likes