openmesh-python issueshttps://gitlab.vci.rwth-aachen.de:9000/OpenMesh/openmesh-python/-/issues2020-06-29T10:19:19Zhttps://gitlab.vci.rwth-aachen.de:9000/OpenMesh/openmesh-python/-/issues/23Integrate OpenMesh 8.1 SmartHandles properly.2020-06-29T10:19:19ZIsaak LimIntegrate OpenMesh 8.1 SmartHandles properly.This requires some rework of the python bindings to properly integrate the new SmartHandles introduced in OpenMesh 8.1.This requires some rework of the python bindings to properly integrate the new SmartHandles introduced in OpenMesh 8.1.https://gitlab.vci.rwth-aachen.de:9000/OpenMesh/openmesh-python/-/issues/21Host full documentation online2018-06-11T15:23:10ZMartin HeistermannHost full documentation onlineI can't find an online version of the documentation, except for a download from the not easily discoverable CI artifacts. Maybe on openmesh.org or readthedocs.org?I can't find an online version of the documentation, except for a download from the not easily discoverable CI artifacts. Maybe on openmesh.org or readthedocs.org?https://gitlab.vci.rwth-aachen.de:9000/OpenMesh/openmesh-python/-/issues/19saving custom properties2018-05-24T11:23:15ZJanis Bornsaving custom propertiesAccording to [this question on StackOverflow](https://stackoverflow.com/questions/50413319/how-to-save-custom-vertex-properties-with-openmesh-in-python), it's currently not possible to save custom properties.
Is that something we would ...According to [this question on StackOverflow](https://stackoverflow.com/questions/50413319/how-to-save-custom-vertex-properties-with-openmesh-in-python), it's currently not possible to save custom properties.
Is that something we would want to support? Would this cause any issues with array-based properties?https://gitlab.vci.rwth-aachen.de:9000/OpenMesh/openmesh-python/-/issues/16convenience features for set_*_property_array methods2018-05-09T07:20:26ZJanis Bornconvenience features for set_*_property_array methodsYou need to call `set_*_property_array` in order to initialize a property as a 'numpy property', e.g.:
```python
m.set_vertex_property_array('test', np.zeros(m.n_vertices(), 3))
```
Constructing the second argument can be a bit tedious ...You need to call `set_*_property_array` in order to initialize a property as a 'numpy property', e.g.:
```python
m.set_vertex_property_array('test', np.zeros(m.n_vertices(), 3))
```
Constructing the second argument can be a bit tedious and I'd like to simplify it by broadening the interface of the `set_*_property_array` methods a bit, allowing the following calls:
```python
# the old interface: explicitly setting all values at once;
# data.shape[0] must be equal to the number of elements
m.set_vertex_property_array('test', data)
# setting the same value for each element, e.g. the vector [1,2,3]
m.set_vertex_property_array('test', element_value=[1,2,3])
# setting the same value for each element with a specific shape
# e.g. a 3x3 matrix filled with 4's
# (4 is broadcasted to the 3x3 shape to fill the matrix)
m.set_vertex_property_array('test', element_shape=(3,3), element_value=4)
# creating an uninitialized data array with a specific shape for each element:
m.set_vertex_property_array('test', element_shape=(3,3))
# creating an uninitialized data array with space for a scalar value for each element:
# (common use case)
m.set_vertex_property_array('test')
```
You can try out this interface by applying the following monkeypatch snippet:
```python
orig_set_vertex_property_array = om.TriMesh.set_vertex_property_array
def svpa(self, prop_name, array=None, element_shape=None, element_value=None):
if element_shape is None:
if element_value is None:
element_shape = ()
else:
element_shape = np.shape(element_value)
if array is None:
if element_value is None:
orig_set_vertex_property_array(self, prop_name, np.empty((self.n_vertices(), *element_shape)))
else:
orig_set_vertex_property_array(self, prop_name, np.array(np.broadcast_to(element_value, (self.n_vertices(), *element_shape))))
else:
assert element_value is None, 'both array and element_value are set'
orig_set_vertex_property_array(self, prop_name, np.reshape(array, (self.n_vertices(), *element_shape)))
om.TriMesh.set_vertex_property_array = svpa
```
I'm currently not sure whether it's better to implement this on the C++ or Python side. Python code likely makes it easier to use numpy features like `broadcast_to` and `reshape` but I don't know how to deduplicate the code for the different mesh types and mesh elements.Alexander DielenAlexander Dielenhttps://gitlab.vci.rwth-aachen.de:9000/OpenMesh/openmesh-python/-/issues/13complete and check existing documentation2018-06-11T15:23:04ZIsaak Limcomplete and check existing documentationAlexander DielenAlexander Dielenhttps://gitlab.vci.rwth-aachen.de:9000/OpenMesh/openmesh-python/-/issues/18set_points method (etc.)2018-04-06T11:56:54ZJanis Bornset_points method (etc.)Maybe we should have `m.set_points(p)` as an alias for `m.points()[:] = p` since the latter is not discoverable.
We would probably also need corresponding methods for normals, uvs, etc., then.Maybe we should have `m.set_points(p)` as an alias for `m.points()[:] = p` since the latter is not discoverable.
We would probably also need corresponding methods for normals, uvs, etc., then.Alexander DielenAlexander Dielen