elrnv / vtkio

Visualization ToolKit (VTK) file parser and writer
Apache License 2.0
57 stars 13 forks source link

XML-based format support #4

Closed Andlon closed 3 years ago

Andlon commented 5 years ago

Hi. First, thanks a lot for this crate! It has been super useful for getting up to speed with a reasonable workflow in a short amount of time for some FEM code that I'm working on. Using your crate, I was able to quickly port some Julia code that I had.

That said, the legacy format is limited, and I will run into its limitations in the not too distant future. I might be interested in investing some time on a crate that would work with e.g. XML-based VTK formats. Would you like vtkio to remain strictly a crate for legacy IO, or would it make sense to expand the feature set to encompass the XML-based formats as well? Put differently, if I were to start such a venture, should I create a new crate for this purpose or would you accept contributions in this direction?

elrnv commented 5 years ago

That's awesome to hear! I don't intend for this to be a legacy only crate. I will gladly accept contributions! :)

elrnv commented 5 years ago

I understand that nom has been upgraded twice since I wrote this. I am willing to invest some time into porting the existing code to a newer version of nom. Having said this, I don't mind having dependencies on two different nom versions in the meantime.

Andlon commented 5 years ago

I thought that for XML-based formats we don't have to write parsers/writers ourselves, but we can instead use one of the several available XML crates, don't you think? I have no experience with any of them, but I thought this would be far more productive at least!

I have quite some backlog of other things to do before I can start work on this, but for my current project I only need to be able to write VTK XML files, so I would probably start with that if I were to implement this soon.

elrnv commented 5 years ago

Good point! We should definitely make use of some existing xml crate. https://crates.io/crates/quick-xml looks promising. I suspect we would need support for non utf-8 input since vtk xml has embedded binary data.

Andlon commented 5 years ago

I agree, quick-xml looks like a good candidate! I'll update this issue if/when I get a chance to look at this (I don't expect this to be the case in the next few weeks at the very least).