compas icon indicating copy to clipboard operation
compas copied to clipboard

VolMesh public accessor and query methods

Open Sam-Bouten opened this issue 2 years ago • 0 comments

Feature Request

Being able to query VolMesh the same way as Mesh for elements, predicates, etc. Public query methods being the same for VolMesh as for Mesh makes for an intuitive interface.

  • Some accessor/query/... functionality is not yet implemented for VolMesh (halfface.py), although it's naturally a superset of accessor functionality of Mesh (halfedge.py). -> for DRY-ness, could accessor/query methods be implemented as a mixin or shared base class?

in halfface.py :

    def vertices_where(self):
        raise NotImplementedError

    def edges_where(self):
        raise NotImplementedError

    def faces_where(self):
        raise NotImplementedError
  • key-index maps getting the same public aliases in halfface.py as in halfedge.py :
    def key_index(self):
        return {vertex: index for index, vertex in enumerate(self.vertices())}

    vertex_index = key_index

    def index_key(self):
        return dict(enumerate(self.vertices()))

    index_vertex = index_key

Sam-Bouten avatar Sep 21 '21 19:09 Sam-Bouten