Skip to content

Add TetraMeshData class to handle tetrahedral mesh data #407

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

Closed

Conversation

munechika-koyo
Copy link
Contributor

@munechika-koyo munechika-koyo commented Jul 25, 2022

Hi,

I would like to propose this PR to introduce new class TetraMesh which is defined reffering to raysect.primitive.mesh.MeshData.
When constructing a kD tree for tetrahedral meshes, MeshKDTree3D class in raysect.core.math.function.float.function3d.interpolate.common module was used, and I need more general way of handling tetrahedral vertices or indices.
So, I decided to add some mesh-handling methods and put it into raysect.primitive module.
According to this modification, I improved some implementations and documents.

In addition, Tetmesh in external package used in demo scripts: Py3DViewer does not work well because of incompatible with version (I guess.), so I changed to use numpy.load method to load tetrahedral vertices and indices arrays.

I would appreciate it if you would confirm my PR and marge it into develop branch:)

@CnlPepper
Copy link
Member

CnlPepper commented Sep 15, 2022

I'm a little unsure how a tetrahedral mesh fits in the primitive module? Primitives are meant to define a surface that may or may not enclose a volume. A tetrahedral mesh doesn't just represent a surface alone. We'd need to think about where this should live, or if the primitive definition should be extended.

I've unfortunately not got much time to look through this at present as it is a large merge request. I will make one quick comment: the tetra mesh bunny file is a bit large! A simpler mesh would be sufficient for a demo.

@munechika-koyo
Copy link
Contributor Author

munechika-koyo commented Sep 15, 2022

As @CnlPepper mentioned, TetraMesh is not actual primitive objects. I think it is similar to the MeshData definition (actually I imitated it to implement TetraMesh)

the tetra mesh bunny file is a bit large! A simpler mesh would be sufficient for a demo.

I removed .mesh file due to the out of use. The numpy binary files (.npy) I added have smaller size (totally 30MB) than the .mesh file (45.9MB).

@munechika-koyo munechika-koyo force-pushed the feature/tetrahedra_mesh branch from f6d4a2d to ab3b7bb Compare February 17, 2023 11:41
@munechika-koyo munechika-koyo force-pushed the feature/tetrahedra_mesh branch from c6811e4 to 43bd751 Compare December 18, 2023 16:11
@munechika-koyo munechika-koyo changed the title Add TetraMesh class to handle tetrahedral mesh Add TetraMeshData class to handle tetrahedral mesh data Dec 18, 2023
@munechika-koyo
Copy link
Contributor Author

munechika-koyo commented Dec 18, 2023

the tetra mesh bunny file is a bit large! A simpler mesh would be sufficient for a demo.

I compressed mesh data in a .npz format, including both the tetra mesh's vertices and indices.
This file has a size of about 12MB. What do you think about this change?

I'm a little unsure how a tetrahedral mesh fits in the primitive module.

As you mentioned, I think the name TetraMesh should be changed to TetraMeshData because the previous one is not inherited from the Primitive object as well.
I want to push this PR to implement the functionality to save/load the tetrahedral mesh structure generated by the kd-tree core like the MeshData.save or MeshData.load because it takes more time to re-generate a tetrahedral kD-tree structure than load it from a .rsm file

I would appreciate it if you would take it into account.

@munechika-koyo munechika-koyo force-pushed the feature/tetrahedra_mesh branch from dea9a5c to 819737a Compare January 12, 2025 18:34
@munechika-koyo munechika-koyo changed the base branch from development to master January 12, 2025 18:38
@munechika-koyo
Copy link
Contributor Author

I would like to revisit this pull request to enhance the handling of tetrahedral meshes.
I also applied the latest change in the master branch into this PR by rebasing.

@munechika-koyo
Copy link
Contributor Author

I think that this PR contains many changes, making the review challenging, so I will separate features and propose each of them again.

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

Successfully merging this pull request may close these issues.

2 participants