Skip to content

Enable users to construct meshes from coxeter shapes or external files #2117

@josephburkhart

Description

@josephburkhart

Description

Currently, it is rather painful to construct meshes, as vertices have to be calculated manually, and while faces can be calculated automatically for convex meshes using scipy.spatial.ConvexHull, in the case of concave meshes they must also be calculated manually. (See the Simulating a Vesicle with MD tutorial.)

I propose that we add functionality for constructing meshes from Coxeter geometries. This could provide a much less painful route for modelling meshes with complex geometries. This approach would mostly make sense if it were possible to tesselate 3D shapes and segment 2D shapes within Coxeter - see glotzerlab/coxeter#273. Coxeter would not need to become a required dependency, since we would just provide methods for converting from Coxeter shapes to Mesh objects, and users could opt-in to this functionality by installing Coxeter in their environment.

Alternatively, we could add functionality into HOOMD to construct meshes from common file formats (OBJ, X3D, etc), allowing users to at least construct their meshes in other 3D modelling programs and import them into HOOMD. I am planning to add essentially the same functionality to Coxeter - see glotzerlab/coxeter#272.

Proposed solution

I think the proposed changes would only affect hoomd.mesh.Mesh, since all of the mesh potentials are constructed from that class. To enable construction from Coxeter shapes, a single new method would be sufficient. To enable construction from external files, several methods might be needed.

Additional context

No response

Metadata

Metadata

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions