Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IWM format specification #1235

Open
neurolabusc opened this issue Sep 17, 2024 · 1 comment
Open

IWM format specification #1235

neurolabusc opened this issue Sep 17, 2024 · 1 comment

Comments

@neurolabusc
Copy link

The docs provide an example of converting that is a Serialization of a Mesh . However, the definition of the Cell is never specified, even in the section 4.3.2 Inserting Cells. To make my question concrete, consider the provided example of the 'cow.vtk' format converted to 'cow.iwm.cbor':

The cow.vtk provides vertex indices for quads (4 vertices) and triangles (3 vertices)

POLYGONS 3263 15593
4 250 251 210 252 
4 252 210 201 253 
3 253 201 254 
4 254 255 256 253 

However, the cow.iwm.cbor cells includes an additional element that in this example is always 4 for quads and 2 for triangles. What is the purpose of the element - for this example it just makes the file size larger, but presumably it has the potential to have other values. While I can write a reader for the provided example, I fear it will be fragile if I do not know what this value is supposed to mean. Is 2 a constant for TriangleCell

4 4 250 251 210 252 
4 4 252 210 201 253 
2 3 253 201 254 
4 4 254 255 256 253 

Based on 4.3.8 Iterating Through Cells my best guess is that this is the enum for cell type:

0 VERTEX_CELL
1 LINE_CELL
2 TRIANGLE_CELL
3 QUADRILATERAL_CELL
4 POLYGON_CELL
...

If this is the case, is there any reason the quads are not listed as QUADRILATERAL_CELL and not POLYGON_CELL types? It does seem that for VERTEX_CELL...QUADRILATERAL_CELL the number of indices is explicit, so this seems to lead to large file sizes than necessary. I understand there are always tradeoffs in file formats for consistency across types versus efficiency, I just want to make sure I understand the logic.

iwm

@thewtex
Copy link
Member

thewtex commented Sep 17, 2024

@neurolabusc thanks for the report. I will provide more documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants