openmesh-python issueshttps://gitlab.vci.rwth-aachen.de:9000/OpenMesh/openmesh-python/-/issues2018-02-03T13:36:22Zhttps://gitlab.vci.rwth-aachen.de:9000/OpenMesh/openmesh-python/-/issues/1Use ninja for building if possible2018-02-03T13:36:22ZIsaak LimUse ninja for building if possiblesetup.py should use ninja if possible (see [pytorch](https://github.com/pytorch/pytorch/blob/5a5afa5c17f92a3910e766aeef12218a76cb7ba8/setup.py#L27) for example)setup.py should use ninja if possible (see [pytorch](https://github.com/pytorch/pytorch/blob/5a5afa5c17f92a3910e766aeef12218a76cb7ba8/setup.py#L27) for example)Alexander DielenAlexander Dielenhttps://gitlab.vci.rwth-aachen.de:9000/OpenMesh/openmesh-python/-/issues/2Request standard properties on demand2018-01-30T09:54:43ZIsaak LimRequest standard properties on demandThe openmesh python bindings should request [standard properties](http://openmesh.org/Daily-Builds/Doc/a01839.html#a9787dd5b9b6e3abc8a2401964f998696) (i.e. vertex normals) on demand.
For example:
the wrapper for ```normal(vh)``` should ...The openmesh python bindings should request [standard properties](http://openmesh.org/Daily-Builds/Doc/a01839.html#a9787dd5b9b6e3abc8a2401964f998696) (i.e. vertex normals) on demand.
For example:
the wrapper for ```normal(vh)``` should first check if vertex normals are available with ```mesh.has_vertex_normals()``` and request them if necessary before returning the normal.
This avoids unexpected crashes, while also circumventing the unnecessary copying around of unneeded vectors if we just request all standard properties for our mesh.Alexander DielenAlexander Dielenhttps://gitlab.vci.rwth-aachen.de:9000/OpenMesh/openmesh-python/-/issues/3edge_indices and halfedge_indices2018-02-01T09:18:27ZIsaak Limedge_indices and halfedge_indices`edge_indices` and `halfedge_indices` should return a (nx2) integer numpy array if the mesh has n edges or halfedges`edge_indices` and `halfedge_indices` should return a (nx2) integer numpy array if the mesh has n edges or halfedgesAlexander DielenAlexander Dielenhttps://gitlab.vci.rwth-aachen.de:9000/OpenMesh/openmesh-python/-/issues/4unit tests fail for Python 2.72018-02-01T16:05:19ZJanis Bornunit tests fail for Python 2.7```
AttributeError: 'openmesh.FaceVertexIter' object has no attribute '__next__'
```
see [pipeline](https://www.graphics.rwth-aachen.de:9000/adielen/openmesh-python/-/jobs/39853)```
AttributeError: 'openmesh.FaceVertexIter' object has no attribute '__next__'
```
see [pipeline](https://www.graphics.rwth-aachen.de:9000/adielen/openmesh-python/-/jobs/39853)Alexander DielenAlexander Dielenhttps://gitlab.vci.rwth-aachen.de:9000/OpenMesh/openmesh-python/-/issues/5Build on Windows and Mac2018-02-16T08:46:51ZAlexander DielenBuild on Windows and MacAs far as I know, nobody has done this yet.
We should also add ci scripts.As far as I know, nobody has done this yet.
We should also add ci scripts.Alexander DielenAlexander Dielenhttps://gitlab.vci.rwth-aachen.de:9000/OpenMesh/openmesh-python/-/issues/6Remove all VectorT occurrences2018-02-05T10:35:42ZAlexander DielenRemove all VectorT occurrencesThere are still some mesh functions that take VectorT arguments.
We need to update these functions to take numpy arrays.There are still some mesh functions that take VectorT arguments.
We need to update these functions to take numpy arrays.Alexander DielenAlexander Dielenhttps://gitlab.vci.rwth-aachen.de:9000/OpenMesh/openmesh-python/-/issues/7Expose decimation classes2018-02-07T14:21:03ZAlexander DielenExpose decimation classesDecimation is still missing.Decimation is still missing.Alexander DielenAlexander Dielenhttps://gitlab.vci.rwth-aachen.de:9000/OpenMesh/openmesh-python/-/issues/8New property interface2018-02-06T18:08:22ZAlexander DielenNew property interfaceWe want to replace property handles with string ids. The new interface should look like this:
single-item access:
`val = mesh.vertex_property('test_prop', vh)
mesh.set_vertex_property('test_prop', vh, val)`
all-element access (generic...We want to replace property handles with string ids. The new interface should look like this:
single-item access:
`val = mesh.vertex_property('test_prop', vh)
mesh.set_vertex_property('test_prop', vh, val)`
all-element access (generic):
`list = mesh.vertex_property('test_prop')
mesh.set_vertex_property('test_prop', list)`
all-element access (numpy):
`arr = mesh.vertex_property_array('test_prop')
mesh.set_vertex_property_array('test_prop', vh, arr)`Alexander DielenAlexander Dielenhttps://gitlab.vci.rwth-aachen.de:9000/OpenMesh/openmesh-python/-/issues/9More element index array methods2018-02-06T15:09:22ZJanis BornMore element index array methodsI noticed that for rendering, we will probably need a few more index array methods. Probably, we will eventually need all of them:
`vertex_vertex_indices` (n_vertices, max_vertex_valence), `vv_indices`
`vertex_face_indices` (n_vertice...I noticed that for rendering, we will probably need a few more index array methods. Probably, we will eventually need all of them:
`vertex_vertex_indices` (n_vertices, max_vertex_valence), `vv_indices`
`vertex_face_indices` (n_vertices, max_vertex_valence), `vf_indices`
`vertex_edge_indices` (n_vertices, max_vertex_valence), `ve_indices`
`vertex_outgoing_halfedge_indices` (n_vertices, max_vertex_valence), `voh_indices`
`vertex_incoming_halfedge_indices` (n_vertices, max_vertex_valence), `vih_indices`
`face_vertex_indices` (n_faces, max_face_valence), `fv_indices`
`face_face_indices` (n_faces, max_face_valence), `ff_indices`
`face_edge_indices` (n_faces, max_face_valence), `fe_indices`
`face_halfedge_indices` (n_faces, max_face_valence), `fh_indices`
`edge_vertex_indices` (n_edges, 2), `ev_indices`
`edge_face_indices` (n_edges, 2), `ef_indices`
`edge_halfedge_indices` (n_edges, 2), `eh_indices`
`halfedge_to_vertex_indices` (n_halfedges,), `htv_indices`
`halfedge_from_vertex_indices` (n_halfedges,), `hfv_indices`
`halfedge_face_indices` (n_halfedges,), `hf_indices`
`halfedge_edge_indices` (n_halfedges,), `he_indices`Alexander DielenAlexander Dielenhttps://gitlab.vci.rwth-aachen.de:9000/OpenMesh/openmesh-python/-/issues/10use new OpenMesh all_*s ranges to construct data arrays2018-02-27T12:21:22ZJanis Bornuse new OpenMesh all_*s ranges to construct data arraysOpenMesh/OpenMesh!153 introduces a distinction between ranges that skip over deleted elements (e.g. `mesh.vertices()`) and those that include them (e.g. `mesh.all_vertices()`). As soon as we depend on this new version, we need to make su...OpenMesh/OpenMesh!153 introduces a distinction between ranges that skip over deleted elements (e.g. `mesh.vertices()`) and those that include them (e.g. `mesh.all_vertices()`). As soon as we depend on this new version, we need to make sure to use the `all_*s` ranges for all exposed property access methods that return data as arrays. Otherwise, the entries of index arrays returned by `*_indices` will be invalid.Alexander DielenAlexander Dielenhttps://gitlab.vci.rwth-aachen.de:9000/OpenMesh/openmesh-python/-/issues/11Add unittests for index array dimensions (with deleted elements)2018-02-28T11:54:33ZIsaak LimAdd unittests for index array dimensions (with deleted elements)https://gitlab.vci.rwth-aachen.de:9000/OpenMesh/openmesh-python/-/issues/12constructors / functions to create meshes from index arrays2018-03-16T13:55:24ZJanis Bornconstructors / functions to create meshes from index arraysAn option to construct meshes from arrays, useful e.g. for interop with libigl.
Possible interfaces:
* `om.TriMesh(points=V, face_vertex_indices=F)`
* `om.tri_mesh_from_arrays(points=V, face_vertex_indices=F)`
Need some feedback on the...An option to construct meshes from arrays, useful e.g. for interop with libigl.
Possible interfaces:
* `om.TriMesh(points=V, face_vertex_indices=F)`
* `om.tri_mesh_from_arrays(points=V, face_vertex_indices=F)`
Need some feedback on the interface choice and naming first.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/14read_trimesh fails silently2018-03-26T08:02:27ZJanis Bornread_trimesh fails silentlyCalling `read_trimesh` with a nonexistent file just returns an empty mesh. It should throw an exception.Calling `read_trimesh` with a nonexistent file just returns an empty mesh. It should throw an exception.Alexander DielenAlexander Dielenhttps://gitlab.vci.rwth-aachen.de:9000/OpenMesh/openmesh-python/-/issues/15cannot set 1D arrays as property arrays2018-06-13T18:18:10ZJanis Borncannot set 1D arrays as property arrays```python
m = om.TriMesh()
for _ in range(4):
m.add_vertex(np.random.rand(3))
m.set_vertex_property_array('test', [1,2,3,4]) # doesn't work (fails silently)
m.vertex_property_array('test') # fails here
m.set_vertex_property_array('...```python
m = om.TriMesh()
for _ in range(4):
m.add_vertex(np.random.rand(3))
m.set_vertex_property_array('test', [1,2,3,4]) # doesn't work (fails silently)
m.vertex_property_array('test') # fails here
m.set_vertex_property_array('test', [[1],[2],[3],[4]]) # this works
```
The first `set_vertex_property_array` call should also work and set a property that assigns a scalar to every vertex.Alexander DielenAlexander Dielenhttps://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/17copy method for meshes2018-04-25T12:37:48ZJanis Borncopy method for meshesnumpy arrays have a `copy` method, so maybe meshes should have toonumpy arrays have a `copy` method, so maybe meshes should have tooAlexander 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 Dielenhttps://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/20unbundle the lib2022-03-08T10:39:31ZGhost Userunbundle the libthe python bindings are now in a separate package.
it would be great if the bindings did not bundle the lib (and pybind11 possibly)
or at least there should be an option not to use the bundled lib.
For example it would be possible to pos...the python bindings are now in a separate package.
it would be great if the bindings did not bundle the lib (and pybind11 possibly)
or at least there should be an option not to use the bundled lib.
For example it would be possible to possibly use several versions of the lib (eg 7.1 for which the bundled version was not updated), but this simplifies the packaging.
Here a modified CMakeLists that uses an already built openmesh lib, and external pybind11.
[CMakeLists.txt](/uploads/c308409de1d04694ce33c891587c8c79/CMakeLists.txt)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/22*_property_array fails for scalar-valued properties2018-07-10T11:58:13ZJanis Born*_property_array fails for scalar-valued propertiesWhen 0-dimensional, i.e. scalar properties are set using `set_*_property`, they cannot be queried as a NumPy array afterwards using `*_property_array`:
```python
mesh = om.TriMesh()
v0 = mesh.add_vertex([1,0,0])
v1 = mesh.add_vertex([0,...When 0-dimensional, i.e. scalar properties are set using `set_*_property`, they cannot be queried as a NumPy array afterwards using `*_property_array`:
```python
mesh = om.TriMesh()
v0 = mesh.add_vertex([1,0,0])
v1 = mesh.add_vertex([0,1,0])
v2 = mesh.add_vertex([0,0,1])
mesh.set_vertex_property('foo', v0, 1.0)
mesh.set_vertex_property('foo', v1, 2.0)
mesh.set_vertex_property('foo', v2, 3.0)
mesh.vertex_property_array('foo') # fails:
# IndexError: too many indices for an array: 1 (ndim = 0)
```
Higher-dimensional-valued properties work though:
```python
mesh.set_vertex_property('bar', v0, [1.0])
mesh.set_vertex_property('bar', v1, [2.0])
mesh.set_vertex_property('bar', v2, [3.0])
mesh.vertex_property_array('bar') # works:
# array([[1.],
# [2.],
# [3.]])
```Alexander DielenAlexander Dielenhttps://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.