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

Merging meshes resulting in gaps #181

Open
Eric-R-Liang opened this issue Jun 10, 2020 · 7 comments
Open

Merging meshes resulting in gaps #181

Eric-R-Liang opened this issue Jun 10, 2020 · 7 comments
Labels
filtering General topics around filtering and usage of filters mesh-altering

Comments

@Eric-R-Liang
Copy link

When I merge multiple triangulated meshes together, the resulting geometry has small gaps between its components. It seems like the gaps occur at the merging points.
Screen Shot 2020-06-10 at 5 05 52 PM

How can I get rid of those gaps without distorting the triangulations? Thanks.

@github-actions
Copy link

Hi and welcome! Thanks for posting your first issue in the PyVista project! Someone from @pyvista/developers will chime in before too long. If your question is support related, it may be automatically transferred to https://github.com/pyvista/pyvista-support

@Eric-R-Liang
Copy link
Author

I am using the boolean addition filter to merge the individual meshes

@banesullivan
Copy link
Member

Can you share these meshes for us to try?

@Eric-R-Liang
Copy link
Author

Yep, there is a total of 8 meshes.
Meshes.zip

@akaszynski
Copy link
Member

This will get you a little closer. I'm afraid that the meshes are really far apart and it won't be possible to merge them all without corrupting the mesh as increasing tolerance starts to cause the faces to collapse.

import pyvista as pv

block = pv.MultiBlock()
[block.append(pv.read('Component_%d.stl' % i)) for i in range(1, 9)]

combined = block.combine(True).extract_surface()
merged = combined.clean(tolerance=0.6)
merged.plot(show_edges=True, lighting=True, background='w')

image

@Eric-R-Liang
Copy link
Author

Thanks a lot for the suggestion. Just as a side note, I have a mesh like this:
tunnel_mesh.obj.zip
Screen Shot 2020-06-11 at 7 15 06 PM
I want to systematically split it into individual components (doesn't matter if the 'component' is composed of 1 or multiple segments of the initial geometry, like using a bounding box for example, and within each bounding box there can be multiple segments), and remove 1 or multiple of those components. And I want to essentially, remove 1 or more of those components from the initial geometry (via boolean subtract maybe). Is there a way to do that?

I've tried using the clip_box method but I can't figure out a way to use it to systematically break down the geometry and adjust the number of components that I want split into.

@banesullivan banesullivan transferred this issue from pyvista/pyvista Jun 13, 2020
@akaszynski
Copy link
Member

This might be a good example for pyvista/pyvista#797.

For the time being, I'd use several clip planes spaced at regular intervals along the XZ and YZ planes. Use mesh.bounds to determine your initial ranges and then generate several planes to clip your mesh.

@banesullivan banesullivan added filtering General topics around filtering and usage of filters mesh-altering labels Jun 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
filtering General topics around filtering and usage of filters mesh-altering
Projects
None yet
Development

No branches or pull requests

3 participants