# Paraviewweb and Draco

**URL:** https://discourse.paraview.org/t/paraviewweb-and-draco/8392
**Category:** Web Support
**Created:** [November 12, 2021, 10:06pm UTC](https://discourse.paraview.org/t/paraviewweb-and-draco/8392 "2021-11-12T22:06:16Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![CapLek](https://discourse.paraview.org/user_avatar/discourse.paraview.org/caplek/32/3430_2.png) [@CapLek](https://discourse.paraview.org/u/CapLek)
#### Post date: [November 12, 2021, 10:06pm UTC](https://discourse.paraview.org/t/paraviewweb-and-draco/8392/1 "2021-11-12T22:06:17Z")

</div>

Hi everyone,

In paraviewweb I need to output mesh and associated field data in the draco format. Known Python wrappers (actually, I’ve found only one so far, [GitHub - seung-lab/DracoPy: Python wrapper for Google's Draco mesh compression library.](https://github.com/seung-lab/DracoPy)) do not support encoding of additional geometry attributes.

Basically, the idea is to create a C++ paraview plugin for filter which will use native C++ Draco API to output Draco encoded buffers. Then this plugin will be used by paraviewweb to forward compressed data further over the network.

So the question - is this possible and could theoretically work?

Thanks!

---

<div class="post-metadata">

### Author: ![jourdain](https://discourse.paraview.org/user_avatar/discourse.paraview.org/jourdain/32/11_2.png) [@jourdain](https://discourse.paraview.org/u/jourdain)
#### Post date: [November 12, 2021, 10:59pm UTC](https://discourse.paraview.org/t/paraviewweb-and-draco/8392/2 "2021-11-12T22:59:42Z")

</div>

It should be possible. But you will need to handle the  
`vtkPloyData => Draco ...network... Draco => vtkPolyData`

The only unknown from my side is the draco API. But if you handle `vtkDataArray => TypedArray`, you should be good with little remapping.

---

<div class="post-metadata">

### Author: ![CapLek](https://discourse.paraview.org/user_avatar/discourse.paraview.org/caplek/32/3430_2.png) [@CapLek](https://discourse.paraview.org/u/CapLek)
#### Post date: [November 15, 2021, 1:55pm UTC](https://discourse.paraview.org/t/paraviewweb-and-draco/8392/3 "2021-11-15T13:55:24Z")

</div>

Sebastien, thank you for the help.

Could you please give another tip on how to declare a plugin method which is then can be called from pvpython?

---

<div class="post-metadata">

### Author: ![jourdain](https://discourse.paraview.org/user_avatar/discourse.paraview.org/jourdain/32/11_2.png) [@jourdain](https://discourse.paraview.org/u/jourdain)
#### Post date: [November 17, 2021, 10:32pm UTC](https://discourse.paraview.org/t/paraviewweb-and-draco/8392/4 "2021-11-17T22:32:59Z")

</div>

If your ParaView plugin have some vtk modules, those will be available in your python.  
You can see it used here:

- [Load plugin](https://github.com/Kitware/py-web-vue/blob/master/examples/ParaView/ContourGeometry/DynamicLocalRemoteRendering/app.py#L37)
- [Use class defined in plugin](https://github.com/Kitware/py-web-vue/blob/master/examples/ParaView/ContourGeometry/DynamicLocalRemoteRendering/app.py#L49)
- [Plugin definition](https://github.com/Kitware/ParaView/tree/master/Plugins/AcceleratedAlgorithms)

In that case it just expose some pre-existing code in VTK but you can see plugins with vtkModules in them as ref.
