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

Computing the difference along an axis between two meshes #2289

Open
swiss-knight opened this issue Sep 15, 2024 · 1 comment
Open

Computing the difference along an axis between two meshes #2289

swiss-knight opened this issue Sep 15, 2024 · 1 comment

Comments

@swiss-knight
Copy link

swiss-knight commented Sep 15, 2024

Hello,

Given two meshes files (*.PLY), how could I compare, i.e. compute the difference along the Z-axis between those 2 meshes?

Both meshes are representing terrain, so all triangles have an upward facing z-component (i.e. there is no overhang).

Individual triangles of each meshes are not aligned (i.e. they do not share (x,y) coordinates).

I am currently using trimesh version 4.4.9 with Python 3.12.6.

Thank you!

Warm Regards.

@Kiord
Copy link

Kiord commented Sep 16, 2024

Hello,

The Z component of the mesh vertices is mesh.vertices[:, 2].

If the two meshes have the same topology and if they are already superimposed w.r.t. the X and Y coordinates, the difference can be made vertex-wise (mesh1.vertices[:, 2] - mesh2.vertices[:, 2]).

Else, the comparison is still possible by projecting the vertices of one mesh on the other, or by using the texture/uv space of the two meshes to make the comparison. I think it depends on the type of result that you are expecting.

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