Rasterized output with vtkGL2PSExporter

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Rasterized output with vtkGL2PSExporter

Roman Hiestand
Hello

Since upgrading to VTK 8.1.1 and using the OpenGL2 backend I have noticed that when exporting to vector graphics formats such as PDF and SVG using vtkGL2PSExporter a large part of the scene is rasterized.
I have a 2D scene with a vtkPolyDataMapper and some axis (vtkCubeAxesActor2D), the camera is set to parallel projection.
When I try to export the scene to PDF or SVG using vtkGL2PSExporter the vtkPolyData is rasterized, while the axis (including labels etc) is exported in vector graphics.

I tried fiddling around with the parameters of vtkGL2PSExporter, but I wasn't able to achieve all-vector-graphics like with VTK 8.0 and (old) OpenGL backend.

Has anyone a clue how to create a non-rasterized output? When debugging the code, I saw that vtkGL2PSExporter rasterizes the background, but why is the vtkPolyDataMapper considered to be background?

I also tried exporting the same vtkPolyData with ParaView (5.5.1 64bit Windows) to PDF or SVG, and I have the same effect there, the polydata is rasterized.

Regards
Roman



_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
https://public.kitware.com/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|

Re: Rasterized output with vtkGL2PSExporter

Dan Lipsa-2
Roman,
For the new OpenGL2 backend only 2D polygon data drawn within a vtkContext2D can be exported as vector data in a PDF or SVG. This is because GL2PS uses a feature removed from recent OpenGL versions (glFeedbackBuffer). So, if exporting vector data is important to your application you'll have to port it to draw everything inside a vtkContext2D class. We are currently doing this port for the cdat.


On Thu, Jun 14, 2018 at 11:16 AM Roman Hiestand <[hidden email]> wrote:
Hello

Since upgrading to VTK 8.1.1 and using the OpenGL2 backend I have noticed that when exporting to vector graphics formats such as PDF and SVG using vtkGL2PSExporter a large part of the scene is rasterized.
I have a 2D scene with a vtkPolyDataMapper and some axis (vtkCubeAxesActor2D), the camera is set to parallel projection.
When I try to export the scene to PDF or SVG using vtkGL2PSExporter the vtkPolyData is rasterized, while the axis (including labels etc) is exported in vector graphics.

I tried fiddling around with the parameters of vtkGL2PSExporter, but I wasn't able to achieve all-vector-graphics like with VTK 8.0 and (old) OpenGL backend.

Has anyone a clue how to create a non-rasterized output? When debugging the code, I saw that vtkGL2PSExporter rasterizes the background, but why is the vtkPolyDataMapper considered to be background?

I also tried exporting the same vtkPolyData with ParaView (5.5.1 64bit Windows) to PDF or SVG, and I have the same effect there, the polydata is rasterized.

Regards
Roman


_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
https://public.kitware.com/mailman/listinfo/vtkusers

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
https://public.kitware.com/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|

Re: Rasterized output with vtkGL2PSExporter

Roman Hiestand
Dan,

Thank you for the information! I assume there is no mapper from vtkPolyData to vtkContext2D? At least I didn't find one.
Migrating our code to vtkContext2D would be too tedious, so for now we stick to the current solution. If we need a better SVG/PDF output, we will use either Qt or a specialized library like cairo.

Regards
Roman


On Thu, Jun 14, 2018 at 5:39 PM, Dan Lipsa <[hidden email]> wrote:
Roman,
For the new OpenGL2 backend only 2D polygon data drawn within a vtkContext2D can be exported as vector data in a PDF or SVG. This is because GL2PS uses a feature removed from recent OpenGL versions (glFeedbackBuffer). So, if exporting vector data is important to your application you'll have to port it to draw everything inside a vtkContext2D class. We are currently doing this port for the cdat.


On Thu, Jun 14, 2018 at 11:16 AM Roman Hiestand <[hidden email]> wrote:
Hello

Since upgrading to VTK 8.1.1 and using the OpenGL2 backend I have noticed that when exporting to vector graphics formats such as PDF and SVG using vtkGL2PSExporter a large part of the scene is rasterized.
I have a 2D scene with a vtkPolyDataMapper and some axis (vtkCubeAxesActor2D), the camera is set to parallel projection.
When I try to export the scene to PDF or SVG using vtkGL2PSExporter the vtkPolyData is rasterized, while the axis (including labels etc) is exported in vector graphics.

I tried fiddling around with the parameters of vtkGL2PSExporter, but I wasn't able to achieve all-vector-graphics like with VTK 8.0 and (old) OpenGL backend.

Has anyone a clue how to create a non-rasterized output? When debugging the code, I saw that vtkGL2PSExporter rasterizes the background, but why is the vtkPolyDataMapper considered to be background?

I also tried exporting the same vtkPolyData with ParaView (5.5.1 64bit Windows) to PDF or SVG, and I have the same effect there, the polydata is rasterized.

Regards
Roman


_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
https://public.kitware.com/mailman/listinfo/vtkusers



--

Fluxim AG
Roman Hiestand
Katharina-Sulzer-Platz 2
8406 Winterthur
Switzerland


www.fluxim.com
Email: [hidden email]
Phone: +41 44 500 4770
Fax: +41 44 500 4779

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
https://public.kitware.com/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|

Re: Rasterized output with vtkGL2PSExporter

Dan Lipsa-2
Context2D should support vtkPolyData. See the following commit.

commit 1469ea5dcb33d69710ed4099789ebc0fa2bcdf57

Author: Alvaro Sanchez <[hidden email]>

Date:   Mon Oct 17 19:00:43 2016 -0400


    Added support for vtkPolyData in vtkContext2D.

    

    vtkContext2D takes a new type of item which directly draws a 2D mesh

    represented by a vtkPolyData object. Internally, vtkContextDevice2D makes

    the API calls necessary to draw the internal primitives of vtkPolyData.

    Added a test demonstrating the use of vtkPolyDataItem.

    

    Added interaction and batched primitives for drawing.

    

    vtkInteractiveArea derives from vtkContextArea and implements basic interaction

    (zoom and panning). Currently, two types of vtkPolyData primitives are supported,

    Lines and Polygons. Lines are batched and drawn using ContextDevice2D::DrawLines.

    Polygons are first decomposed into a set of triangles and then drawn using

    ContextDevice2D::CoreDrawTriangles. Primitives are colored per vertex.

    

    Suppressed run-time warning.

    

    Setting the current renderer in the interactor style. Removed

    unecessary initializations.

    

    Using defined symbolic names for scalar modes.



On Fri, Jun 15, 2018 at 5:02 AM Roman Hiestand <[hidden email]> wrote:
Dan,

Thank you for the information! I assume there is no mapper from vtkPolyData to vtkContext2D? At least I didn't find one.
Migrating our code to vtkContext2D would be too tedious, so for now we stick to the current solution. If we need a better SVG/PDF output, we will use either Qt or a specialized library like cairo.

Regards
Roman


On Thu, Jun 14, 2018 at 5:39 PM, Dan Lipsa <[hidden email]> wrote:
Roman,
For the new OpenGL2 backend only 2D polygon data drawn within a vtkContext2D can be exported as vector data in a PDF or SVG. This is because GL2PS uses a feature removed from recent OpenGL versions (glFeedbackBuffer). So, if exporting vector data is important to your application you'll have to port it to draw everything inside a vtkContext2D class. We are currently doing this port for the cdat.


On Thu, Jun 14, 2018 at 11:16 AM Roman Hiestand <[hidden email]> wrote:
Hello

Since upgrading to VTK 8.1.1 and using the OpenGL2 backend I have noticed that when exporting to vector graphics formats such as PDF and SVG using vtkGL2PSExporter a large part of the scene is rasterized.
I have a 2D scene with a vtkPolyDataMapper and some axis (vtkCubeAxesActor2D), the camera is set to parallel projection.
When I try to export the scene to PDF or SVG using vtkGL2PSExporter the vtkPolyData is rasterized, while the axis (including labels etc) is exported in vector graphics.

I tried fiddling around with the parameters of vtkGL2PSExporter, but I wasn't able to achieve all-vector-graphics like with VTK 8.0 and (old) OpenGL backend.

Has anyone a clue how to create a non-rasterized output? When debugging the code, I saw that vtkGL2PSExporter rasterizes the background, but why is the vtkPolyDataMapper considered to be background?

I also tried exporting the same vtkPolyData with ParaView (5.5.1 64bit Windows) to PDF or SVG, and I have the same effect there, the polydata is rasterized.

Regards
Roman


_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
https://public.kitware.com/mailman/listinfo/vtkusers



--

Fluxim AG
Roman Hiestand
Katharina-Sulzer-Platz 2
8406 Winterthur
Switzerland


www.fluxim.com
Email: [hidden email]
Phone: +41 44 500 4770
Fax: +41 44 500 4779

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
https://public.kitware.com/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|

Re: Rasterized output with vtkGL2PSExporter

Roman Hiestand
I tried your suggestion, but after some testing I found that the exported SVG/PDF does not contain the vtkPolyData. I assume it is because it's not yet implemented:


Another issue I am having is that I would like to draw the cells in vtkPolyData as wireframe, which does not seem to be supported directly. I could convert the cells to lines myself, however.

But thanks for your tips and suggestions, I appreciate your help very much!


On Fri, Jun 15, 2018 at 2:59 PM, Dan Lipsa <[hidden email]> wrote:
Context2D should support vtkPolyData. See the following commit.

commit 1469ea5dcb33d69710ed4099789ebc0fa2bcdf57

Author: Alvaro Sanchez <[hidden email]>

Date:   Mon Oct 17 19:00:43 2016 -0400


    Added support for vtkPolyData in vtkContext2D.

    

    vtkContext2D takes a new type of item which directly draws a 2D mesh

    represented by a vtkPolyData object. Internally, vtkContextDevice2D makes

    the API calls necessary to draw the internal primitives of vtkPolyData.

    Added a test demonstrating the use of vtkPolyDataItem.

    

    Added interaction and batched primitives for drawing.

    

    vtkInteractiveArea derives from vtkContextArea and implements basic interaction

    (zoom and panning). Currently, two types of vtkPolyData primitives are supported,

    Lines and Polygons. Lines are batched and drawn using ContextDevice2D::DrawLines.

    Polygons are first decomposed into a set of triangles and then drawn using

    ContextDevice2D::CoreDrawTriangles. Primitives are colored per vertex.

    

    Suppressed run-time warning.

    

    Setting the current renderer in the interactor style. Removed

    unecessary initializations.

    

    Using defined symbolic names for scalar modes.



On Fri, Jun 15, 2018 at 5:02 AM Roman Hiestand <[hidden email]> wrote:
Dan,

Thank you for the information! I assume there is no mapper from vtkPolyData to vtkContext2D? At least I didn't find one.
Migrating our code to vtkContext2D would be too tedious, so for now we stick to the current solution. If we need a better SVG/PDF output, we will use either Qt or a specialized library like cairo.

Regards
Roman


On Thu, Jun 14, 2018 at 5:39 PM, Dan Lipsa <[hidden email]> wrote:
Roman,
For the new OpenGL2 backend only 2D polygon data drawn within a vtkContext2D can be exported as vector data in a PDF or SVG. This is because GL2PS uses a feature removed from recent OpenGL versions (glFeedbackBuffer). So, if exporting vector data is important to your application you'll have to port it to draw everything inside a vtkContext2D class. We are currently doing this port for the cdat.


On Thu, Jun 14, 2018 at 11:16 AM Roman Hiestand <[hidden email]> wrote:
Hello

Since upgrading to VTK 8.1.1 and using the OpenGL2 backend I have noticed that when exporting to vector graphics formats such as PDF and SVG using vtkGL2PSExporter a large part of the scene is rasterized.
I have a 2D scene with a vtkPolyDataMapper and some axis (vtkCubeAxesActor2D), the camera is set to parallel projection.
When I try to export the scene to PDF or SVG using vtkGL2PSExporter the vtkPolyData is rasterized, while the axis (including labels etc) is exported in vector graphics.

I tried fiddling around with the parameters of vtkGL2PSExporter, but I wasn't able to achieve all-vector-graphics like with VTK 8.0 and (old) OpenGL backend.

Has anyone a clue how to create a non-rasterized output? When debugging the code, I saw that vtkGL2PSExporter rasterizes the background, but why is the vtkPolyDataMapper considered to be background?

I also tried exporting the same vtkPolyData with ParaView (5.5.1 64bit Windows) to PDF or SVG, and I have the same effect there, the polydata is rasterized.

Regards
Roman


_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
https://public.kitware.com/mailman/listinfo/vtkusers



--

Fluxim AG
Roman Hiestand
Katharina-Sulzer-Platz 2
8406 Winterthur
Switzerland


www.fluxim.com
Email: [hidden email]
Phone: +41 44 500 4770
Fax: +41 44 500 4779



--

Fluxim AG
Roman Hiestand
Katharina-Sulzer-Platz 2
8406 Winterthur
Switzerland


www.fluxim.com
Email: [hidden email]
Phone: +41 44 500 4770
Fax: +41 44 500 4779

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
https://public.kitware.com/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|

Re: Rasterized output with vtkGL2PSExporter

Dan Lipsa-2
Roman,
Thanks for testing. Indeed, this is work in progress and we add and fix things as we move along with our port of cdat.

Dan


On Mon, Jun 18, 2018 at 6:18 AM Roman Hiestand <[hidden email]> wrote:
I tried your suggestion, but after some testing I found that the exported SVG/PDF does not contain the vtkPolyData. I assume it is because it's not yet implemented:


Another issue I am having is that I would like to draw the cells in vtkPolyData as wireframe, which does not seem to be supported directly. I could convert the cells to lines myself, however.

But thanks for your tips and suggestions, I appreciate your help very much!


On Fri, Jun 15, 2018 at 2:59 PM, Dan Lipsa <[hidden email]> wrote:
Context2D should support vtkPolyData. See the following commit.

commit 1469ea5dcb33d69710ed4099789ebc0fa2bcdf57

Author: Alvaro Sanchez <[hidden email]>

Date:   Mon Oct 17 19:00:43 2016 -0400


    Added support for vtkPolyData in vtkContext2D.

    

    vtkContext2D takes a new type of item which directly draws a 2D mesh

    represented by a vtkPolyData object. Internally, vtkContextDevice2D makes

    the API calls necessary to draw the internal primitives of vtkPolyData.

    Added a test demonstrating the use of vtkPolyDataItem.

    

    Added interaction and batched primitives for drawing.

    

    vtkInteractiveArea derives from vtkContextArea and implements basic interaction

    (zoom and panning). Currently, two types of vtkPolyData primitives are supported,

    Lines and Polygons. Lines are batched and drawn using ContextDevice2D::DrawLines.

    Polygons are first decomposed into a set of triangles and then drawn using

    ContextDevice2D::CoreDrawTriangles. Primitives are colored per vertex.

    

    Suppressed run-time warning.

    

    Setting the current renderer in the interactor style. Removed

    unecessary initializations.

    

    Using defined symbolic names for scalar modes.



On Fri, Jun 15, 2018 at 5:02 AM Roman Hiestand <[hidden email]> wrote:
Dan,

Thank you for the information! I assume there is no mapper from vtkPolyData to vtkContext2D? At least I didn't find one.
Migrating our code to vtkContext2D would be too tedious, so for now we stick to the current solution. If we need a better SVG/PDF output, we will use either Qt or a specialized library like cairo.

Regards
Roman


On Thu, Jun 14, 2018 at 5:39 PM, Dan Lipsa <[hidden email]> wrote:
Roman,
For the new OpenGL2 backend only 2D polygon data drawn within a vtkContext2D can be exported as vector data in a PDF or SVG. This is because GL2PS uses a feature removed from recent OpenGL versions (glFeedbackBuffer). So, if exporting vector data is important to your application you'll have to port it to draw everything inside a vtkContext2D class. We are currently doing this port for the cdat.


On Thu, Jun 14, 2018 at 11:16 AM Roman Hiestand <[hidden email]> wrote:
Hello

Since upgrading to VTK 8.1.1 and using the OpenGL2 backend I have noticed that when exporting to vector graphics formats such as PDF and SVG using vtkGL2PSExporter a large part of the scene is rasterized.
I have a 2D scene with a vtkPolyDataMapper and some axis (vtkCubeAxesActor2D), the camera is set to parallel projection.
When I try to export the scene to PDF or SVG using vtkGL2PSExporter the vtkPolyData is rasterized, while the axis (including labels etc) is exported in vector graphics.

I tried fiddling around with the parameters of vtkGL2PSExporter, but I wasn't able to achieve all-vector-graphics like with VTK 8.0 and (old) OpenGL backend.

Has anyone a clue how to create a non-rasterized output? When debugging the code, I saw that vtkGL2PSExporter rasterizes the background, but why is the vtkPolyDataMapper considered to be background?

I also tried exporting the same vtkPolyData with ParaView (5.5.1 64bit Windows) to PDF or SVG, and I have the same effect there, the polydata is rasterized.

Regards
Roman


_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
https://public.kitware.com/mailman/listinfo/vtkusers



--

Fluxim AG
Roman Hiestand
Katharina-Sulzer-Platz 2
8406 Winterthur
Switzerland


www.fluxim.com
Email: [hidden email]
Phone: +41 44 500 4770
Fax: +41 44 500 4779



--

Fluxim AG
Roman Hiestand
Katharina-Sulzer-Platz 2
8406 Winterthur
Switzerland


www.fluxim.com
Email: [hidden email]
Phone: +41 44 500 4770
Fax: +41 44 500 4779

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
https://public.kitware.com/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|

Re: Rasterized output with vtkGL2PSExporter

Aashish Chaudhary-2
Dear Roman,

As Dan mentioned improving the PDF support in Context 2D is our roadmap and we have fairly good idea on how to get there but it may take some time because we are still porting our code to OpenGL2 backend. If you need it sooner, let us know and we can talk offline. 

- aashish

On Mon, Jun 18, 2018 at 9:02 AM Dan Lipsa <[hidden email]> wrote:
Roman,
Thanks for testing. Indeed, this is work in progress and we add and fix things as we move along with our port of cdat.

Dan


On Mon, Jun 18, 2018 at 6:18 AM Roman Hiestand <[hidden email]> wrote:
I tried your suggestion, but after some testing I found that the exported SVG/PDF does not contain the vtkPolyData. I assume it is because it's not yet implemented:


Another issue I am having is that I would like to draw the cells in vtkPolyData as wireframe, which does not seem to be supported directly. I could convert the cells to lines myself, however.

But thanks for your tips and suggestions, I appreciate your help very much!


On Fri, Jun 15, 2018 at 2:59 PM, Dan Lipsa <[hidden email]> wrote:
Context2D should support vtkPolyData. See the following commit.

commit 1469ea5dcb33d69710ed4099789ebc0fa2bcdf57

Author: Alvaro Sanchez <[hidden email]>

Date:   Mon Oct 17 19:00:43 2016 -0400


    Added support for vtkPolyData in vtkContext2D.

    

    vtkContext2D takes a new type of item which directly draws a 2D mesh

    represented by a vtkPolyData object. Internally, vtkContextDevice2D makes

    the API calls necessary to draw the internal primitives of vtkPolyData.

    Added a test demonstrating the use of vtkPolyDataItem.

    

    Added interaction and batched primitives for drawing.

    

    vtkInteractiveArea derives from vtkContextArea and implements basic interaction

    (zoom and panning). Currently, two types of vtkPolyData primitives are supported,

    Lines and Polygons. Lines are batched and drawn using ContextDevice2D::DrawLines.

    Polygons are first decomposed into a set of triangles and then drawn using

    ContextDevice2D::CoreDrawTriangles. Primitives are colored per vertex.

    

    Suppressed run-time warning.

    

    Setting the current renderer in the interactor style. Removed

    unecessary initializations.

    

    Using defined symbolic names for scalar modes.



On Fri, Jun 15, 2018 at 5:02 AM Roman Hiestand <[hidden email]> wrote:
Dan,

Thank you for the information! I assume there is no mapper from vtkPolyData to vtkContext2D? At least I didn't find one.
Migrating our code to vtkContext2D would be too tedious, so for now we stick to the current solution. If we need a better SVG/PDF output, we will use either Qt or a specialized library like cairo.

Regards
Roman


On Thu, Jun 14, 2018 at 5:39 PM, Dan Lipsa <[hidden email]> wrote:
Roman,
For the new OpenGL2 backend only 2D polygon data drawn within a vtkContext2D can be exported as vector data in a PDF or SVG. This is because GL2PS uses a feature removed from recent OpenGL versions (glFeedbackBuffer). So, if exporting vector data is important to your application you'll have to port it to draw everything inside a vtkContext2D class. We are currently doing this port for the cdat.


On Thu, Jun 14, 2018 at 11:16 AM Roman Hiestand <[hidden email]> wrote:
Hello

Since upgrading to VTK 8.1.1 and using the OpenGL2 backend I have noticed that when exporting to vector graphics formats such as PDF and SVG using vtkGL2PSExporter a large part of the scene is rasterized.
I have a 2D scene with a vtkPolyDataMapper and some axis (vtkCubeAxesActor2D), the camera is set to parallel projection.
When I try to export the scene to PDF or SVG using vtkGL2PSExporter the vtkPolyData is rasterized, while the axis (including labels etc) is exported in vector graphics.

I tried fiddling around with the parameters of vtkGL2PSExporter, but I wasn't able to achieve all-vector-graphics like with VTK 8.0 and (old) OpenGL backend.

Has anyone a clue how to create a non-rasterized output? When debugging the code, I saw that vtkGL2PSExporter rasterizes the background, but why is the vtkPolyDataMapper considered to be background?

I also tried exporting the same vtkPolyData with ParaView (5.5.1 64bit Windows) to PDF or SVG, and I have the same effect there, the polydata is rasterized.

Regards
Roman


_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
https://public.kitware.com/mailman/listinfo/vtkusers



--

Fluxim AG
Roman Hiestand
Katharina-Sulzer-Platz 2
8406 Winterthur
Switzerland


www.fluxim.com
Email: [hidden email]
Phone: <a href="tel:+41%2044%20500%2047%2070" value="+41445004770" target="_blank">+41 44 500 4770
Fax: <a href="tel:+41%2044%20500%2047%2079" value="+41445004779" target="_blank">+41 44 500 4779



--

Fluxim AG
Roman Hiestand
Katharina-Sulzer-Platz 2
8406 Winterthur
Switzerland


www.fluxim.com
Email: [hidden email]
Phone: <a href="tel:+41%2044%20500%2047%2070" value="+41445004770" target="_blank">+41 44 500 4770
Fax: <a href="tel:+41%2044%20500%2047%2079" value="+41445004779" target="_blank">+41 44 500 4779

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
https://public.kitware.com/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|

Re: Rasterized output with vtkGL2PSExporter

Roman Hiestand
Aashish,

Thanks for your offer. For the time being I will stay on the current solution, which is to use the vtkPolyDataMapper and GL2PS, with the drawback of the rasterized output. So you don't need to change your priorities because of me.


On Mon, Jun 18, 2018 at 3:49 PM, Aashish Chaudhary <[hidden email]> wrote:
Dear Roman,

As Dan mentioned improving the PDF support in Context 2D is our roadmap and we have fairly good idea on how to get there but it may take some time because we are still porting our code to OpenGL2 backend. If you need it sooner, let us know and we can talk offline. 

- aashish

On Mon, Jun 18, 2018 at 9:02 AM Dan Lipsa <[hidden email]> wrote:
Roman,
Thanks for testing. Indeed, this is work in progress and we add and fix things as we move along with our port of cdat.

Dan


On Mon, Jun 18, 2018 at 6:18 AM Roman Hiestand <[hidden email]> wrote:
I tried your suggestion, but after some testing I found that the exported SVG/PDF does not contain the vtkPolyData. I assume it is because it's not yet implemented:


Another issue I am having is that I would like to draw the cells in vtkPolyData as wireframe, which does not seem to be supported directly. I could convert the cells to lines myself, however.

But thanks for your tips and suggestions, I appreciate your help very much!


On Fri, Jun 15, 2018 at 2:59 PM, Dan Lipsa <[hidden email]> wrote:
Context2D should support vtkPolyData. See the following commit.

commit 1469ea5dcb33d69710ed4099789ebc0fa2bcdf57

Author: Alvaro Sanchez <[hidden email]>

Date:   Mon Oct 17 19:00:43 2016 -0400


    Added support for vtkPolyData in vtkContext2D.

    

    vtkContext2D takes a new type of item which directly draws a 2D mesh

    represented by a vtkPolyData object. Internally, vtkContextDevice2D makes

    the API calls necessary to draw the internal primitives of vtkPolyData.

    Added a test demonstrating the use of vtkPolyDataItem.

    

    Added interaction and batched primitives for drawing.

    

    vtkInteractiveArea derives from vtkContextArea and implements basic interaction

    (zoom and panning). Currently, two types of vtkPolyData primitives are supported,

    Lines and Polygons. Lines are batched and drawn using ContextDevice2D::DrawLines.

    Polygons are first decomposed into a set of triangles and then drawn using

    ContextDevice2D::CoreDrawTriangles. Primitives are colored per vertex.

    

    Suppressed run-time warning.

    

    Setting the current renderer in the interactor style. Removed

    unecessary initializations.

    

    Using defined symbolic names for scalar modes.



On Fri, Jun 15, 2018 at 5:02 AM Roman Hiestand <[hidden email]> wrote:
Dan,

Thank you for the information! I assume there is no mapper from vtkPolyData to vtkContext2D? At least I didn't find one.
Migrating our code to vtkContext2D would be too tedious, so for now we stick to the current solution. If we need a better SVG/PDF output, we will use either Qt or a specialized library like cairo.

Regards
Roman


On Thu, Jun 14, 2018 at 5:39 PM, Dan Lipsa <[hidden email]> wrote:
Roman,
For the new OpenGL2 backend only 2D polygon data drawn within a vtkContext2D can be exported as vector data in a PDF or SVG. This is because GL2PS uses a feature removed from recent OpenGL versions (glFeedbackBuffer). So, if exporting vector data is important to your application you'll have to port it to draw everything inside a vtkContext2D class. We are currently doing this port for the cdat.


On Thu, Jun 14, 2018 at 11:16 AM Roman Hiestand <[hidden email]> wrote:
Hello

Since upgrading to VTK 8.1.1 and using the OpenGL2 backend I have noticed that when exporting to vector graphics formats such as PDF and SVG using vtkGL2PSExporter a large part of the scene is rasterized.
I have a 2D scene with a vtkPolyDataMapper and some axis (vtkCubeAxesActor2D), the camera is set to parallel projection.
When I try to export the scene to PDF or SVG using vtkGL2PSExporter the vtkPolyData is rasterized, while the axis (including labels etc) is exported in vector graphics.

I tried fiddling around with the parameters of vtkGL2PSExporter, but I wasn't able to achieve all-vector-graphics like with VTK 8.0 and (old) OpenGL backend.

Has anyone a clue how to create a non-rasterized output? When debugging the code, I saw that vtkGL2PSExporter rasterizes the background, but why is the vtkPolyDataMapper considered to be background?

I also tried exporting the same vtkPolyData with ParaView (5.5.1 64bit Windows) to PDF or SVG, and I have the same effect there, the polydata is rasterized.

Regards
Roman


_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
https://public.kitware.com/mailman/listinfo/vtkusers



--

Fluxim AG
Roman Hiestand
Katharina-Sulzer-Platz 2
8406 Winterthur
Switzerland


www.fluxim.com
Email: [hidden email]
Phone: <a href="tel:+41%2044%20500%2047%2070" value="+41445004770" target="_blank">+41 44 500 4770
Fax: <a href="tel:+41%2044%20500%2047%2079" value="+41445004779" target="_blank">+41 44 500 4779



--

Fluxim AG
Roman Hiestand
Katharina-Sulzer-Platz 2
8406 Winterthur
Switzerland


www.fluxim.com
Email: [hidden email]
Phone: <a href="tel:+41%2044%20500%2047%2070" value="+41445004770" target="_blank">+41 44 500 4770
Fax: <a href="tel:+41%2044%20500%2047%2079" value="+41445004779" target="_blank">+41 44 500 4779



--

Fluxim AG
Roman Hiestand
Katharina-Sulzer-Platz 2
8406 Winterthur
Switzerland


www.fluxim.com
Email: [hidden email]
Phone: +41 44 500 4770
Fax: +41 44 500 4779

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
https://public.kitware.com/mailman/listinfo/vtkusers