gmggroup / omf-python

Python library for working with OMF files
MIT License
79 stars 20 forks source link

Remove Geometries and move these attributes onto the element #37

Closed fwkoch closed 5 years ago

fwkoch commented 5 years ago

Every time you create an Element you must also create a Geometry. These geometries do not have meaning without the information from the element. It would reduce complexity in the data format if geometric info (vertices, segments, etc) was an attribute on each Elements.

Current implementation (and associated serialization):

pts = omf.PointSetElement(
    name='Random Points',
    description='Just random points',
    geometry=omf.PointSetGeometry(
        vertices=np.random.rand(100, 3)
    )
    color='green'
)

Proposed implementation (and associated serialization):

pts = omf.PointSetElement(
    name='Random Points',
    description='Just random points',
    vertices=np.random.rand(100, 3),
    color='green'
)

This would remove the PointSetGeometry structure from the file format. See documentation here: https://omf.readthedocs.io/en/latest/content/pointset.html#omf.pointset.PointSetGeometry

The proposed attributes on each element would be proposed to have the same naming as the current names on each geometry.