Using VTK with unity for reading .VTU files but not Visualizing. Mac OS

Hello,
Working on a project in Unity and looking to be able to read and visualize VTU files that are compressed with “vtkZLibDataCompressor” and use a binary format for the byte information.

Currently I can read and visualize VTU uncompressed files with raw formatting.

There are a couple of things I’m stuck on.

  1. Installing VTK and using its libraries with Unity and C#. I went through the steps here: https://vtk.org/Wiki/VTK/Configure_and_Build#On_Unix-like_systems
    Built the libraries within my unity project, but now trying to use them and I cant seem to use like how the examples for C# do. Basically trying to import like this using Kitware.VTK. The folder I built in to in the unity project is called Kitware. Could be something super simple I’m missing but if there is another way to follow the install process or video of some sort that would be great.

  2. From what I can tell ActiViz is the main way VTK is used with unity. However its libraries are built for windows and there does not seem to be Mac OS support. My understanding is though this is purely the code for rendering and visualization. I do not need that code I only need the code to read through this compressed type of VTU file. So basically I want to read and store the data from the file and use that to build gameobjects to visualize myself. Is that possible or do I have to use ActiViz to access the VTK libraries in unity? This also goes back to installing as I’m sure Im probably installing everything wrong in the first place. lol

For compression sake, here is the current format of VTUi can read and visualize vs the format I want to be able to read and visualize.
What i can read:

<VTKFile type="UnstructuredGrid" byte_order="LittleEndian">
  <UnstructuredGrid>
    <Piece NumberOfPoints="#### NumberOfCells="####">
      <PointData>
      </PointData>
      <CellData Scalars="Pressure" Vectors="Velocity">
        <DataArray Name="Pressure" type="Float32" format="appended" offset="#" /> 
        <DataArray Name="WSS" type="Float32" format="appended" offset="#" /> 
      </CellData>
      <Points>
      </Points>
    </Piece>
  </UnstructuredGrid>
  <AppendedData encoding="raw">
"Bytes here"

What I want to read:

<VTKFile type="UnstructuredGrid" version="0.1" byte_order="LittleEndian" compressor="vtkZLibDataCompressor">
<UnstructuredGrid>
<Piece NumberOfPoints="#" NumberOfCells="#">
<Points>
<DataArray type="Float64" Name="Points" NumberOfComponents="3" format="binary">
"byte information here"
</DataArray>

Any help would be great! Cheers!

Correct

Unity/VTK is only through Activiz afaik, but maybe @LucasGandel can elaborate

Unity/VTK is only through Activiz afaik, but maybe @LucasGandel can elaborate

That’s super unfortunate. Would it be possible to develop with ActiViz on windows but then build the actual application to Mac OS or would that still cause issues with the library? What I’m thinking is that since applications like Paraview and pyVista are compatible Mac OS and I’m pretty sure they use these same libraries that would be possible.

I confirm the VTK-Unity plugin is only available through Activiz. In its current state, it can only run on Windows.
However, we are about to release a cross-platform version of Activiz in a week or so. Windows and Linux are supported in our CD pipeline, and we can generate versions for MacOS on-demand.
This work could then be extended to the VTK-Unity plugin with small effort I think.

2 Likes

Great, I’ll be following this progress in the meantime then.
Thanks for the help guys.