MeshLib icon indicating copy to clipboard operation
MeshLib copied to clipboard

Surface to solid algorithm

Open MarcoWang1 opened this issue 2 years ago • 17 comments

https://www.emerald.com/insight/content/doi/10.1108/RPJ-02-2012-0013/full/html Do you have plans to study surface thicken algorithm as shown in above link. But I do not think their algorithm is awesome,since it takes a lot of memory and running time.

MarcoWang1 avatar May 28 '23 14:05 MarcoWang1

Thanks for the reference, we will study it in detail later.

Here is a picture from the article: image

  1. We already have bidirectional voxel-based offset in MeshLib (left side, gray)
  2. And we can create thinking by combining single-directional offset of a closed surface, merging it with inversed original surface (right side, blue). See the steps in the video: https://youtu.be/hvihpSILEkY

Does it work for you?

Fedr avatar May 28 '23 16:05 Fedr

My input is open contour triangle mesh surface, and I just want to thicken inside(Contrary to the normal direction of the input triangles) and also keep sharp . (by the way, I want to use many tools that I can not see in other softwares,so ask you for help(pull several issues))

MarcoWang1 avatar May 29 '23 02:05 MarcoWang1

I see, we will try to support thickening for open mesh. Either with the method from the paper or by some other means.

Your requests are very welcome, since it points us the directions, where we can improve. At the same time they are not easy to implement, so it is hard to predict when they will be ready.

Fedr avatar May 29 '23 13:05 Fedr

dont use the method shown in the paper ,memory consuming

MarcoWang1 avatar May 30 '23 17:05 MarcoWang1

We have some progress with thickening of open meshes.

For example, a mesh containing a face: image NefertitiFace.stl.zip

After processing (very fast, but not yet automated) it becomes a solid using hollowing method: image NefertitiFaceHollow10.stl.zip

Fedr avatar Jun 01 '23 17:06 Fedr

wow ,your response is very fast. 1 you did a good job,but still need to optimize,since the cross section of result is not that smooth or flat. 2 how did you do that?

MarcoWang1 avatar Jun 02 '23 02:06 MarcoWang1

cad surface.zip

MarcoWang1 avatar Jun 02 '23 02:06 MarcoWang1

wow ,your response is very fast. 1 you did a good job,but still need to optimize,since the cross section of result is not that smooth or flat. 2 how did you do that?

Thanks! It is implemented via bidirectional shell, and new function in MeshLib

/// Finds inner-shell vertices on bidirectional \param shell constructed for an open \param mesh;
/// \param side specifies which side of shell is of interest: negative or positive relative to mesh normals;
/// The function will return all shell vertices that have distance to mesh of same sign as \param side
/// excluding the vertices projecting on mesh boundary
[[nodiscard]] MRMESH_API VertBitSet findInnerShellVerts( const Mesh & mesh, const Mesh & shell, Side side );

which selects the region on the shell mesh to be preserved.

Then original mesh and the piece of the shell are merged and Stitch Two Holes is applied. It is not present in MeshInspector UI yet.

As to smoothness, we need to work more on the cut region, but inner region is already correct. Please note that positive offset of concave surface and negative offset of convex surface are not smooth in general.

Fedr avatar Jun 02 '23 10:06 Fedr

cad surface.zip

This object is almost closed except for a few small holes: image

The simplest approach here is to fill these holes and then apply the ordinary offset to get thickened mesh: image cad surface thickened.stl.zip

Fedr avatar Jun 02 '23 12:06 Fedr

Thanks for the expected result.

Do you want to convert holes in your original mesh into tunnels of resulting solid model? image

Fedr avatar Jun 02 '23 16:06 Fedr

yes

MarcoWang1 avatar Jun 04 '23 02:06 MarcoWang1

In the next version of MeshInspector, one can make a similar solid object in few steps, see this video. Here is the result: cad-surface-offset-filled.stl.zip

After that we will work on further improvements and automation.

Fedr avatar Jun 05 '23 18:06 Fedr

In the next version of MeshInspector, one can make a similar solid object in few steps, see this video. Here is the result: cad-surface-offset-filled.stl.zip

After that we will work on further improvements and automation.

Thanks for the video explain.The holes you stitch is not smooth, so If I want to 3d print it,the customer will not satisfied.

MarcoWang1 avatar Jun 07 '23 02:06 MarcoWang1

I see. We will research how to make holes smoother. The option that is available right now is to decrease voxel size during offsetting.

Fedr avatar Jun 07 '23 18:06 Fedr

Today we improved thickenMesh function, and now it produces much smoother holes in offset: Snap38

Fedr avatar Jul 07 '23 14:07 Fedr