Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Surface to solid algorithm #1259

Open
MarcoWang1 opened this issue May 28, 2023 · 16 comments
Open

Surface to solid algorithm #1259

MarcoWang1 opened this issue May 28, 2023 · 16 comments
Assignees

Comments

@MarcoWang1
Copy link

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.

@Fedr
Copy link
Contributor

Fedr commented May 28, 2023

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?

@MarcoWang1
Copy link
Author

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))

@Fedr
Copy link
Contributor

Fedr commented May 29, 2023

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.

@MarcoWang1
Copy link
Author

dont use the method shown in the paper ,memory consuming

@Fedr
Copy link
Contributor

Fedr commented Jun 1, 2023

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

@MarcoWang1
Copy link
Author

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
Copy link
Author

cad surface.zip

@Fedr
Copy link
Contributor

Fedr commented Jun 2, 2023

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
Copy link
Contributor

Fedr commented Jun 2, 2023

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

@MarcoWang1
Copy link
Author

@Fedr Fedr self-assigned this Jun 2, 2023
@Fedr
Copy link
Contributor

Fedr commented Jun 2, 2023

Thanks for the expected result.

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

@MarcoWang1
Copy link
Author

yes

@Fedr
Copy link
Contributor

Fedr commented Jun 5, 2023

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.

@MarcoWang1
Copy link
Author

MarcoWang1 commented Jun 7, 2023

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.

@Fedr
Copy link
Contributor

Fedr commented Jun 7, 2023

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
Copy link
Contributor

Fedr commented Jul 7, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants