[vtkusers] Oriented vtkCubeAxesActor issues

Ignacio Fernández Galván jellby at yahoo.com
Sun Feb 4 03:45:44 EST 2018


On 03/02/18, at 19:29, Ignacio Fernández Galván via vtkusers wrote:
> Hi,
> 
> This was apparently mentioned some time ago 
> (http://vtk.1045678.n5.nabble.com/oriented-vtkCubeAxesActor-issue-td5726648.html), 
> but there was no solution, and I think I'm having the same problem.
> 
> Basically, I set up a vtkCubeAxesActor with custom range:
> 
>      axes = vtk.vtkCubeAxesActor()
>      axes.SetCamera(renderer.GetActiveCamera())
>      axes.SetAxisBaseForX(1,0,0)
>      axes.SetAxisBaseForY(0,1,0)
>      axes.SetAxisBaseForZ(0,0,1)
>      axes.SetBounds(0,10,0,10,0,10)
>      axes.SetOrientedBounds(0,10,0,10,0,10)
>      axes.SetUseOrientedBounds(1)
>      axes.SetXAxisRange(0,1)
>      renderer.AddActor(axes)
> 
> I set the "BaseFor" axes to the Cartesian ones, so the actor should look 
> the same with "UseOrientedBounds" or without. But with oriented bounds I 
> get an X axis labeled from 0 to 10, while without it it's 0 to 1, as I 
> requested.
> 
> Also, if I use the oriented bounds and do not set the bounds, there is 
> some clipping, as if the renderer didn't notice the actor's real extent.
> 
> In the thread linked above, it was mentioned that this is done correctly 
> in Paraview. Is it really so? How can I test it?
> 
> My ultimate goal is to show the outline of a transformed ImageData grid, 
> with ticks marking the gridpoints on the outline. Is there some other 
> way to achieve that? (I have the outline as a transformed box, I'm just 
> missing the ticks. So in fact I would also like to disable the axis line 
> in the vtkCubeAxesActor and leave the ticks...)


Going one level down, I tried with vtkAxisActor:

- Like vtkCubeAxesActor, it seems impervious to SetUserTransform.

- Like vtkCubeAxesActor, not setting the bounds results in clipping 
issues, but I guess that's intended.

- I can't set the lines to translucent. Get*Property().SetOpacity(x), 
for any x<1.0 makes the lines disappear, as if the x is interpreted as 
an integer (I'm using the python wrapper, if it matters). SetColor works 
fine.

I also noticed that the automatic positioning of vtkCubeAxesActor get's 
confused if one used a too distorted frame, or exchanges some axes (with 
the "BaseFor" axes): in some orientations the axes end up in the wrong 
side. It looks like there are some hardcoded assumptions about where x, 
y and z are.

These all look like bugs or limitations to me. Is it worth reporting 
them on gitlab?

Ignacio


More information about the vtkusers mailing list