trimesh icon indicating copy to clipboard operation
trimesh copied to clipboard

Support for quadrilaterals?

Open jamaa opened this issue 9 years ago • 1 comments

What would it take to make TriMesh also support quadrilateral faces? If you can point me in the right direction, I will try and make the necessary changes myself.

jamaa avatar Jun 15 '16 14:06 jamaa

The main problem is the assumption that .faces stores 3 vertex indices, as opposed to a 3 or 4 (or more!) number of vertex indices. It gets converted to a numpy.array in many places, but numpy.arrays need a fixed dimension. You could either (a) never convert it to a numpy.array or (b) convert it to a numpy.array whose second dimension is 4 (or higher if you want to support general polygons), padding triangles with invalid -1 indices to keep them straight. You could also use a numpy masked_array rather than -1 indices.

yig avatar Jun 22 '16 18:06 yig