VTK issueshttps://gitlab.kitware.com/vtk/vtk/-/issues2022-02-10T05:51:28-05:00https://gitlab.kitware.com/vtk/vtk/-/issues/18462Error in shader when using surface representation and SetLinesAsTubes(true)2022-02-10T05:51:28-05:00casra-developersError in shader when using surface representation and SetLinesAsTubes(true)When using an actor and setting its representation to **surface** and at the same time use the method **SetLinesAsTubes(true)**, the render window shows an error ```error C1503: undefined variable "normalVCGSOutput"``` and the applicatio...When using an actor and setting its representation to **surface** and at the same time use the method **SetLinesAsTubes(true)**, the render window shows an error ```error C1503: undefined variable "normalVCGSOutput"``` and the application crashes.
This was discovered in the Activiz 9.1 library which wraps VTK.
Code to reproduce the error:
```cs
_renderWindow = RenderWindowControl.RenderWindow;
var renderer = _renderWindow.GetRenderers().GetFirstRenderer();
_interactorStyle = vtkInteractorStyleTrackballCamera.New();
_renderWindow.GetInteractor().SetInteractorStyle(_interactorStyle);
_interactorStyle.SetDefaultRenderer(renderer);
var boxSource = vtkCubeSource.New();
var boxMapper = vtkOpenGLPolyDataMapper.New();
boxMapper.SetInputConnection(boxSource.GetOutputPort());
_boxActor = vtkActor.New();
_boxActor.SetMapper(boxMapper);
_boxProperties = vtkProperty.New();
_boxProperties.SetEdgeVisibility(1);
_boxProperties.SetColor(1.0, 0.0, 0.0);
_boxProperties.LightingOff();
_boxProperties.SetRenderLinesAsTubes(true);
_boxProperties.SetLineWidth(3);
// if this line is commented out, the app will crash because one of the shaders is missing a definition of the variable "normalVCGSOutput"
//_boxProperties.SetRepresentationToWireframe();
boxSource.SetXLength(10);
boxSource.SetYLength(5);
boxSource.SetZLength(15);
_boxActor.SetProperty(_boxProperties);
renderer.AddActor(_boxActor);
```
[ShaderCrashDemo.zip](/uploads/501cd59df4ebe0b8cfa6c2358075ecd1/ShaderCrashDemo.zip)
This issue was also discussed with @LucasGandelKitwarehttps://gitlab.kitware.com/vtk/vtk/-/issues/18016Error in svg writer2020-10-07T11:00:35-04:00Ayed YaminError in svg writerThis is a repost from [https://github.com/pyvista/pyvista/issues/901](https://github.com/pyvista/pyvista/issues/901). As per the response there, the issue seems to be with the function "vtk.vtkGL2PSExporter()".
When using the function b...This is a repost from [https://github.com/pyvista/pyvista/issues/901](https://github.com/pyvista/pyvista/issues/901). As per the response there, the issue seems to be with the function "vtk.vtkGL2PSExporter()".
When using the function below to export an image that contains label text with the "<" character in it, the output is an invalid .svg file since the save function does not seem to be properly escaping this character. I suspect a similar issue applies to the ">" character if they are used sequentially.
```py
import pyvista as pv
poly = pv.Polygon()
p1 = pv.Plotter(notebook=False)
p1.add_mesh(poly, label="Test label <")
p1.add_legend()
p1.save_graphic('test.svg', raster=False)
```https://gitlab.kitware.com/vtk/vtk/-/issues/17701Error install on Python 3.8 (rc1) [from git repo]2020-01-07T09:52:26-05:00Alexander HegerError install on Python 3.8 (rc1) [from git repo]This is a follow-up on #17670.
Even with the new fix fix installed, I still get compile errors from the current git version:
```
pip3 install git+https://gitlab.kitware.com/vtk/vtk
Collecting git+https://gitlab.kitware.com/vtk/vtk
Cl...This is a follow-up on #17670.
Even with the new fix fix installed, I still get compile errors from the current git version:
```
pip3 install git+https://gitlab.kitware.com/vtk/vtk
Collecting git+https://gitlab.kitware.com/vtk/vtk
Cloning https://gitlab.kitware.com/vtk/vtk to /tmp/pip-req-build-0qd5q1p7
Running command git clone -q https://gitlab.kitware.com/vtk/vtk /tmp/pip-req-build-0qd5q1p7
Running command git submodule update --init --recursive -q
ERROR: Command errored out with exit status 1:
command: /home/alex/Python/bin/python3.8 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-0qd5q1p7/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-0qd5q1p7/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base pip-egg-info
cwd: /tmp/pip-req-build-0qd5q1p7/
Complete output (5 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/alex/Python/lib/python3.8/tokenize.py", line 392, in open
buffer = _builtin_open(filename, 'rb')
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pip-req-build-0qd5q1p7/setup.py'
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
```
I downloaded the version from git `git clone https://gitlab.kitware.com/vtk/vtk` but after that that I could not locate any trace of installation instructions on your web page on how to build a python package.
I found `https://vtk.org/Wiki/VTK/Configure_and_Build`, which is sort of outdated and incomplete. Even if ccmake is told to generate a python version 3, I only end up with a `lib64/python2.7`. And no wheel or python `setup.py`.
If you would have any information on how to build a python wheel, that will be much appreciated. Maybe I am just not seeing the tree in the forest. It may be very simple.https://gitlab.kitware.com/vtk/vtk/-/issues/18475Errors when using vtkAxesTransformWidget2022-04-12T21:33:52-04:00ZenErrors when using vtkAxesTransformWidgetI want to use the `vtkAxesTransformWidget` to translate/rotate a `vtkActor`, but there is always some errors, like:
```
2022-02-25 13:22:30.804 ( 0.224s) [ 6226DF40] vtkVectorText.cxx:63 ERR| vtkVectorText (0x24e2410): ...I want to use the `vtkAxesTransformWidget` to translate/rotate a `vtkActor`, but there is always some errors, like:
```
2022-02-25 13:22:30.804 ( 0.224s) [ 6226DF40] vtkVectorText.cxx:63 ERR| vtkVectorText (0x24e2410): Text is not set!
2022-02-25 13:22:30.804 ( 0.224s) [ 6226DF40] vtkExecutive.cxx:753 ERR| vtkCompositeDataPipeline (0x24e2990): Algorithm vtkVectorText(0x24e2410) returned failure for request: vtkInformation (0x24e3230)
Debug: Off
Modified Time: 28727
Reference Count: 1
Registered Events: (none)
Request: REQUEST_DATA
FROM_OUTPUT_PORT: 0
ALGORITHM_AFTER_FORWARD: 1
FORWARD_DIRECTION: 0
```
And there is no such thing like a axesTransformWidget in the renderer.
the source code is
```c++
#include <vtkActor.h>
#include <vtkCameraOrientationWidget.h>
#include <vtkNamedColors.h>
#include <vtkNew.h>
#include <vtkPolyDataMapper.h>
#include <vtkProperty.h>
#include <vtkRenderWindow.h>
#include <vtkRenderWindowInteractor.h>
#include <vtkInteractorStyleSwitch.h>
#include <vtkRenderer.h>
#include <vtkSTLReader.h>
#include <vtkAxesActor.h>
#include <vtkCubeSource.h>
#include <vtkAxesTransformRepresentation.h>
#include <vtkAxesTransformWidget.h>
#include <vtkCamera.h>
#include <filesystem>
namespace fs = std::filesystem;
int main(int argc, char *argv[])
{
vtkNew<vtkNamedColors> colors;
vtkNew<vtkRenderWindow> ren_win;
vtkNew<vtkRenderWindowInteractor> iren;
vtkNew<vtkRenderer> ren;
{
vtkNew<vtkCubeSource> src;
src->SetXLength(0.1);
src->SetYLength(0.2);
src->SetZLength(0.3);
vtkNew<vtkPolyDataMapper> mapper;
mapper->SetInputConnection(src->GetOutputPort());
vtkNew<vtkActor> cube;
cube->SetMapper(mapper);
cube->SetPosition(0.5, 1., 0);
ren->AddActor(cube);
}
{
vtkNew<vtkAxesActor> axes;
axes->SetTotalLength(1.0, 1.0, 1.0);
axes->SetAxisLabels(false);
ren->AddActor(axes);
}
ren->SetBackground(colors->GetColor3d("grey").GetData());
ren_win->AddRenderer(ren);
ren_win->SetSize(600, 600);
ren_win->SetWindowName("VtkApp");
// Important: The interactor must be set prior to enabling the widget.
iren->SetRenderWindow(ren_win);
vtkNew<vtkCamera> cam;
// cam->SetParallelProjection(true);
ren->SetActiveCamera(cam);
vtkNew<vtkCameraOrientationWidget> cam_orient_manipulator;
cam_orient_manipulator->SetParentRenderer(ren);
// Enable the widget.
cam_orient_manipulator->On();
vtkNew<vtkAxesTransformRepresentation> rep;
vtkNew<vtkAxesTransformWidget> trans_widget;
trans_widget->SetInteractor(iren);
trans_widget->SetRepresentation(rep);
vtkNew<vtkInteractorStyleSwitch> style;
style->SetCurrentStyleToTrackballCamera();
iren->SetInteractorStyle(style);
iren->Initialize();
ren_win->Render();
trans_widget->On();
iren->Start();
return EXIT_SUCCESS;
}
```https://gitlab.kitware.com/vtk/vtk/-/issues/18023EvaluatePosition and EvaluateLocation don't commute in vtkLagrange cells2020-10-12T06:54:38-04:00Gonzalo SáezEvaluatePosition and EvaluateLocation don't commute in vtkLagrange cellsAs the title states, the functions `EvaluatePosition` (from physical space to element reference space) and `EvaluateLocation` don't commute for `vtkLagrange` cells (at least for`vtkLagrangeQuadrilateral` and `vtkLagrangeHexahedron`, alth...As the title states, the functions `EvaluatePosition` (from physical space to element reference space) and `EvaluateLocation` don't commute for `vtkLagrange` cells (at least for`vtkLagrangeQuadrilateral` and `vtkLagrangeHexahedron`, although I'm pretty sure that most `vtkHighOrder` cells are concerned).
This happens due to the fact that the `EvaluatePosition` of `vtkLagrange` cells _linearizes_ the physical space to element reference space transform by calling the `EvaluatePosition` of the subcells of the non-linear cell.
This linearization of the problem is exact if all subcells form a uniform cartesian mesh. But if this is not the case, a small error is introduced in `EvaluatePosition`. Therefore, a subsequent call to `EvaluateLocation` using the element reference space coordinates obtained from `EvaluatePosition` won't yield the initial physical space coordinates given to `EvaluatePosition`.
I suppose that this linearization gives good enough results for visualization purposes.
However, for numerical simulation codes which use VTK to compute shape functions or derivatives, the small error introduced in `EvaluatePosition` might be important.
I have coded a _fix_ for `vtkLagrangeQuadrilateral` cells in which the transformation the physical space to element reference space is performed using a Newton solver based on the Jacobian of the transformation of the complete `vtkLagrange` cell. It is important to note that this incurs an increase in the computational cost.
Before submitting an MR to treat this _issue_, I would want to discuss the following subjects
1. Are you willing to _improve_ the current implementation of `EvaluatePosition` for high-order cells?
2. If 1 is true, do you think that it might be worth it to use other function name for the new implementation such as `EvaluatePositionImproved` so that the user is aware that he's calling a more computationally expensive version of `EvaluatePosition`?https://gitlab.kitware.com/vtk/vtk/-/issues/17717Exception in vtkPolyDataNormals when using vtkThreadedCompositeDataPipeline2019-11-07T05:41:15-05:00Bengt RosenbergerException in vtkPolyDataNormals when using vtkThreadedCompositeDataPipelineWe are experiencing a crash in a very simple test application to test the behaviour of *vtkThreadedCompositeDataPipeline*. The same application works fine when using *vtkCompositeDataPipeline*. Repeatedly executing the code below may res...We are experiencing a crash in a very simple test application to test the behaviour of *vtkThreadedCompositeDataPipeline*. The same application works fine when using *vtkCompositeDataPipeline*. Repeatedly executing the code below may result in different exception locations. Changing the number of loops may also change the location. May be a race condition.
VTK was compiled with Visual Studio 2019 (v142) using VTK_SMP_IMPLEMENTATION_TYPE=OpenMP.
We were under the impression that *vtkThreadedCompositeDataPipeline* is supposed to work with every filter that is not composite data aware out of the box.
```
#include <vtkMultiBlockDataSet.h>
#include <vtkSphereSource.h>
#include <vtkTransformFilter.h>
#include <vtkPolyDataNormals.h>
#include <vtkTransform.h>
#include <vtkCompositeDataPipeline.h>
#include <vtkThreadedCompositeDataPipeline.h>
int main()
{
vtkSmartPointer<vtkSphereSource> sphereSource = vtkSmartPointer<vtkSphereSource>::New();
sphereSource->SetPhiResolution(10);
sphereSource->SetThetaResolution(10);
sphereSource->ReleaseDataFlagOff();
sphereSource->Update();
vtkSmartPointer<vtkPolyData> sphere = sphereSource->GetOutput();
vtkSmartPointer<vtkMultiBlockDataSet> multiblock = vtkSmartPointer<vtkMultiBlockDataSet>::New();
multiblock->SetNumberOfBlocks(10);
for (int i = 0; i < 10; ++i)
{
vtkSmartPointer<vtkPolyData> sphere2 = vtkSmartPointer<vtkPolyData>::New();
sphere2->DeepCopy(sphere);
multiblock->SetBlock(i, sphere2);
}
int cells = sphere->GetNumberOfCells();
std::cout << "Cells: " << cells << std::endl;
vtkSmartPointer<vtkThreadedCompositeDataPipeline> compositeExec = vtkSmartPointer<vtkThreadedCompositeDataPipeline>::New();
vtkAlgorithm::SetDefaultExecutivePrototype(compositeExec);
vtkSmartPointer<vtkPolyDataNormals> normalsFilter = vtkSmartPointer<vtkPolyDataNormals>::New();
normalsFilter->SetInputData(multiblock);
std::cout << "Start." << std::endl;
normalsFilter->Update();
vtkSmartPointer<vtkDataObject> obj = normalsFilter->GetOutputDataObject(0);
assert(obj->GetDataObjectType() == VTK_MULTIBLOCK_DATA_SET);
vtkSmartPointer<vtkMultiBlockDataSet> outputMultiblock = vtkMultiBlockDataSet::SafeDownCast(obj);
assert(outputMultiblock != nullptr);
assert(outputMultiblock->GetNumberOfBlocks() == multiblock->GetNumberOfBlocks());
vtkAlgorithm::SetDefaultExecutivePrototype(nullptr);
std::cout << "Done." << std::endl;
std::getchar();
}
```https://gitlab.kitware.com/vtk/vtk/-/issues/17161ExodusReader only reads float data (not double)2018-10-23T12:10:42-04:00Nico SchlömerExodusReader only reads float data (not double)Given a file with `double` precision point coordinate data, e.g., [rectangle_with_hole.e](/uploads/552d68f70c9d9607cc91dc25968597f3/rectangle_with_hole.e), the `vtkExodusIIReader()` only reads the data in `float` precision.
MWE:
```pyth...Given a file with `double` precision point coordinate data, e.g., [rectangle_with_hole.e](/uploads/552d68f70c9d9607cc91dc25968597f3/rectangle_with_hole.e), the `vtkExodusIIReader()` only reads the data in `float` precision.
MWE:
```python
import vtk
reader = vtk.vtkExodusIIReader()
reader.SetFileName('/tmp/rectangle_with_hole.e')
reader.Update()
out = reader.GetOutput()
mesh = out.GetBlock(0).GetBlock(0)
pt_data = mesh.GetPoints().GetData()
print(pt_data)
```
```
vtkFloatArray (0x1f29cf0)
[...]
Data type: float
[...]
```https://gitlab.kitware.com/vtk/vtk/-/issues/19008Explore JavaScript wrappers for VTK through emscripten2023-06-28T11:37:25-04:00Jaswant Panchumarti (Kitware)Explore JavaScript wrappers for VTK through emscriptenVTK can produce binaries for the wasm32 architecture. In order for web-applications to actually make use of these binaries, they can follow 3 approaches listed in increasing order of difficulty:
1. Write application logic in C++ using VT...VTK can produce binaries for the wasm32 architecture. In order for web-applications to actually make use of these binaries, they can follow 3 approaches listed in increasing order of difficulty:
1. Write application logic in C++ using VTK C++. Key functionality is exposed via emscripten bindings that accept or return POD types or a container of those data types. This design is used in [vtkWasmBenchmarks/Cones](https://github.com/Kitware/vtkWasmBenchmarks/blob/main/Cones/Cones.h)
2. Wrap desirable VTK C++ API by hand and consume it in javascript. Ex: [VTK/Examples/Emscripten/Cxx/WrappedMace](https://gitlab.kitware.com/vtk/vtk/-/blob/master/Examples/Emscripten/Cxx/WrappedMace/WrappedMace.cxx)
3. Write webassembly instructions by hand along with javascript to parse the wasm binary and acquire the VTK class and function entry points. For small libraries with <100 functions, this is acceptable. For VTK, it's very tedious to follow this approach.
The purpose of this issue is to flesh out the process of autogenerated javascript wrappers for VTK through `embind` - the binding component of `emscripten` toolchain. Emscripten is widely used to bring C/C++ projects to JS like hdf5, opencascade, ffmpeg, google earth, autocad, Qt and many more, see [Made with WebAssembly](https://madewithwebassembly.com/). All that needs to be done is a JavaScript front-end for the `vtkParse` backend similar to `vtkWrapJava` and `vtkWrapPython`
# Alternatives to emscripten
[Cheerp](https://leaningtech.com/cheerp-3-0-the-most-advanced-c-compiler-for-the-web-now-permissively-licensed/) has built-in garbage collection of C++ objects due to a different memory model. Looks like it has commercial license and not as good of a community support like emscripten.
[nbind](https://github.com/charto/nbind) uses emscripten. It has a different syntax from `embind`. TypeScript definitions are auotmatically generated. However, it seems like `nbind` is now inactive. See [nbind vs embind](https://github.com/emscripten-core/emscripten/issues/8344) for a discussion on the missing features in `nbind`.
Cc: @cory.quammen @sebastien.jourdain @matt-mccormick @will.schroeder @jcfrJaswant Panchumarti (Kitware)Jaswant Panchumarti (Kitware)https://gitlab.kitware.com/vtk/vtk/-/issues/17623export error in CMake Configuring on Windows 10 + VS20172019-06-13T06:18:44-04:00Jamie MacLeodexport error in CMake Configuring on Windows 10 + VS2017When trying to configure VTK 8.2.0 I get an error from CMake:
`CMake Error at CMakeLists.txt:156 (export):
export EXPORT or TARGETS specifier missing.`
which is this line in CMakeLists.txt:
`export(TARGETS ${_vtk_compiletools_targets}...When trying to configure VTK 8.2.0 I get an error from CMake:
`CMake Error at CMakeLists.txt:156 (export):
export EXPORT or TARGETS specifier missing.`
which is this line in CMakeLists.txt:
`export(TARGETS ${_vtk_compiletools_targets}
FILE ${VTK_BINARY_DIR}/VTKCompileToolsConfig.cmake)`
I'm not sure what is going on - hopefully it's an easy fix. In the meanwhile I've successfully built the previous VTK 7.1.1.
Please let me know if more info is wanted to debug!
[CMakeCache.txt](/uploads/692dbce82ce2a145d14dfbb1128d2892/CMakeCache.txt)
[CMakeError.log](/uploads/679bfc1adf906e56cd28862878157335/CMakeError.log)
[CMakeOutput.log](/uploads/9d9a7a0ade5ab5bacd65c2b839783c0c/CMakeOutput.log)https://gitlab.kitware.com/vtk/vtk/-/issues/18339Export external dependencies CMake variables required by "find_package()" i...2022-05-11T00:49:19-04:00Jean-Christophe Fillion-RobinExport external dependencies CMake variables required by "find_package()" into vtk-config associated with VTK build-treeTo drastically streamline the configuration of project indirectly depending on VTK build tree having module like OpenVR enabled, including the relevant CMake variables in the `vtk-config` associated with the build tree should be implemen...To drastically streamline the configuration of project indirectly depending on VTK build tree having module like OpenVR enabled, including the relevant CMake variables in the `vtk-config` associated with the build tree should be implemented.
Two cases:
* For project providing a `<name>-config.cmake` file, the variable `<name>_DIR` should be included
* For project with a `Find<name>.cmake` module shipped with VTK, the relevant `<name>_INCLUDE_DIR`, `<name>_LIBRARY_NAME` and `<name>_OPTION1` should be exported.
Related issues:
* https://gitlab.kitware.com/vtk/vtk/-/issues/18338
* https://gitlab.kitware.com/vtk/vtk/-/issues/18328https://gitlab.kitware.com/vtk/vtk/-/issues/17503Export external dependency variables so projects depending on VTK can find th...2019-01-24T15:05:55-05:00Utkarsh AyachitExport external dependency variables so projects depending on VTK can find those dependencies as wellThe issue manifested on dashboards where tbb was not on default location and VTK build was explicitly told where to find TBB by cmake var. The var is not propogated as a result when building examples against this build of VTK, TBB was no...The issue manifested on dashboards where tbb was not on default location and VTK build was explicitly told where to find TBB by cmake var. The var is not propogated as a result when building examples against this build of VTK, TBB was not found.
cc: @ben.boeckelhttps://gitlab.kitware.com/vtk/vtk/-/issues/18499export_gltf generates invalid gltf2022-03-31T04:22:47-04:00Egil Möllerexport_gltf generates invalid gltfI was instructed [in a pyvista github issue](https://github.com/pyvista/pyvista/issues/2371#issuecomment-1081792744) to open this issue. Linking both issues together.
TL;DR:
When exporting meshes as gltf, the generated gltf ends up bei...I was instructed [in a pyvista github issue](https://github.com/pyvista/pyvista/issues/2371#issuecomment-1081792744) to open this issue. Linking both issues together.
TL;DR:
When exporting meshes as gltf, the generated gltf ends up being invalid, with bad vertice indexing.
Data files:
* [Single cell](/uploads/66e38f041bf57aef98390b41b82d41f6/boreholes-test-small.zip)
* [5 cells](/uploads/2c6c168c94eba15f3e00ab87f87a720f/boreholes-test-larger.zip)
Code to reproduce:
```
import pyvista as pv
b = pv.read("boreholes-test-small.vtk")
c = b.extract_surface()
pl = pv.Plotter()
pl.add_mesh(c)
pl.export_gltf("boreholes-test-small.gltf", save_normals=True, inline_data=True)
```
Errors as reported by the validator built into https://sandbox.babylonjs.com/ for the single cell file:
```
{
"code": "MESH_PRIMITIVE_UNEQUAL_ACCESSOR_COUNT",
"message": "All accessors of the same primitive must have the same count.",
"severity": 0,
"pointer": "/meshes/0/primitives/0/attributes/POSITION"
},
{
"code": "ACCESSOR_INDEX_OOB",
"message": "Indices accessor element at index 1 has value 1 that is greater than the maximum vertex index available (0).",
"severity": 0,
"pointer": "/meshes/0/primitives/0/indices"
}
```
and for the 5 cell file:
```
{
"code": "MESH_PRIMITIVE_UNEQUAL_ACCESSOR_COUNT",
"message": "All accessors of the same primitive must have the same count.",
"severity": 0,
"pointer": "/meshes/0/primitives/0/attributes/POSITION"
},
{
"code": "ACCESSOR_INDEX_OOB",
"message": "Indices accessor element at index 5 has value 5 that is greater than the maximum vertex index available (4).",
"severity": 0,
"pointer": "/meshes/0/primitives/0/indices"
},
{
"code": "ACCESSOR_INDEX_OOB",
"message": "Indices accessor element at index 6 has value 6 that is greater than the maximum vertex index available (4).",
"severity": 0,
"pointer": "/meshes/0/primitives/0/indices"
},
{
"code": "ACCESSOR_INDEX_OOB",
"message": "Indices accessor element at index 7 has value 7 that is greater than the maximum vertex index available (4).",
"severity": 0,
"pointer": "/meshes/0/primitives/0/indices"
},
{
"code": "ACCESSOR_INDEX_OOB",
"message": "Indices accessor element at index 8 has value 8 that is greater than the maximum vertex index available (4).",
"severity": 0,
"pointer": "/meshes/0/primitives/0/indices"
},
{
"code": "ACCESSOR_INDEX_OOB",
"message": "Indices accessor element at index 9 has value 9 that is greater than the maximum vertex index available (4).",
"severity": 0,
"pointer": "/meshes/0/primitives/0/indices"
}
```
System information as per `pyvista.Report()`:
```
--------------------------------------------------------------------------------
Date: Wed Mar 23 10:56:32 2022 CET
OS : Linux
CPU(s) : 8
Machine : x86_64
Architecture : 64bit
RAM : 38.9 GiB
Environment : Jupyter
GPU Vendor : Intel Open Source Technology Center
GPU Renderer : Mesa DRI Intel(R) UHD Graphics (CML GT2)
GPU Version : 4.6 (Core Profile) Mesa 20.0.8
Python 3.8.0 (default, Feb 25 2021, 22:10:10) [GCC 8.4.0]
pyvista : 0.33.3
vtk : 9.0.1
numpy : 1.22.1
imageio : 2.9.0
appdirs : 1.4.4
scooby : 0.5.7
matplotlib : 3.4.1
PyQt5 : 5.15.6
IPython : 7.22.0
scipy : 1.6.3
tqdm : 4.60.0
meshio : 4.4.0
--------------------------------------------------------------------------------
```https://gitlab.kitware.com/vtk/vtk/-/issues/18140Expose InteractionProp using getter on vtkInteractorStyleTrackballActor2021-03-09T05:42:23-05:00Jens Munk HansenExpose InteractionProp using getter on vtkInteractorStyleTrackballActorThis a suggestion for an improvement.
I am working with VTK through Python and I found it quite difficult to move props around in a scene. It would be very convenient if the protected member InteractionProp was exposed an accessible usi...This a suggestion for an improvement.
I am working with VTK through Python and I found it quite difficult to move props around in a scene. It would be very convenient if the protected member InteractionProp was exposed an accessible using a getter on the interface.https://gitlab.kitware.com/vtk/vtk/-/issues/19259Extend `vtksys::DynamicLoader::OpenLibrary` function2024-03-04T09:57:24-05:00Thomas GallandExtend `vtksys::DynamicLoader::OpenLibrary` function`vtkDynamicLoader::OpenLibrary` is a platform-agnostic method that can be used for loading dynamic libraries.
Current version seems limited, at least on windows, because of the exclusive internal usage of `LoadLibraryExW / LoadLibrary...`vtkDynamicLoader::OpenLibrary` is a platform-agnostic method that can be used for loading dynamic libraries.
Current version seems limited, at least on windows, because of the exclusive internal usage of `LoadLibraryExW / LoadLibraryW` that can fail to locate libraries. It can be extended with an option for windows to try other similar methods like `LoadLibraryExA / LoadLibraryA` to open the library when it fails locating a library with the former one.
Following MRs highlighted this need:
https://gitlab.kitware.com/vtk/vtk/-/merge_requests/10514
https://gitlab.kitware.com/vtk/vtk/-/merge_requests/10815https://gitlab.kitware.com/vtk/vtk/-/issues/19133Extend template instantiation for Python wrapping2023-11-02T10:36:16-04:00David GobbiExtend template instantiation for Python wrappingThe Python wrappers can handle C++ class templates, when they are able to guess which instantiations of those templates need to be wrapped. As an example, when array templates such as `vtkSOADataArrayTemplate` are wrapped, Python classes...The Python wrappers can handle C++ class templates, when they are able to guess which instantiations of those templates need to be wrapped. As an example, when array templates such as `vtkSOADataArrayTemplate` are wrapped, Python classes are generated for `vtkSOADataArrayTemplate<double>`, `vtkSOADataArrayTemplate<long long>`, etc. The wrappers do this because they are aware of which types are used by `vtkInstantiateTemplateMacro` (from `vtkType.h`), and they know that VTK uses this macro to instantiate its array templates.
But what happens when the wrappers encounter a class template, but cannot guess how it will be instantiated? A recent example of this is `vtkTemporalAlgorithm` in `CommonExecutionModel`:
```c++
template <class AlgorithmT>
class vtkTemporalAlgorithm : public AlgorithmT
```
Wrapping instances of this template is easy in theory, but when we're wrapping `vtkTemporalAlgorithm.h`, we don't yet know what what `AlgorithmT` might be. We don't know that until we encounter an instantiation, e.g. in `vtkTemporalStatistics.h`:
```c++
#include "vtkPassInputTypeAlgorithm.h"
#include "vtkTemporalAlgorithm.h"
class vtkTemporalStatistics : public vtkTemporalAlgorithm<vtkPassInputTypeAlgorithm>
```
Currently, `vtkTemporalStatistics` is wrapped by using a preprocessor trick to fool the wrappers into seeing the following declaration instead, which removes `vtkTemporalAlgorithm` and inherits directly from `vtkPassInputTypeAlgorithm`:
```c++
class vtkTemporalStatistics : public vtkPassInputTypeAlgorithm
```
For more information on how this trick is implemented, see [these comments in the header file](https://gitlab.kitware.com/vtk/vtk/-/merge_requests/10104/diffs?commit_id=8cfb0c28c956745128de60edc9fa47dd18922720#938aa20d190c39b72e9047e3f3d415e649d2181c_0_45 "New `NO_PRIOR_TEMPORAL_ACCESS` key for in situ"). This trick comes at a cost, because the wrappers miss any APIs that were defined in `vtkTemporalAlgorithm`.
To avoid this trick and its costs, we need to wrap `vtkTemporalAlgorithm<vtkPassInputTypeAlgorithm>` _during_ the wrapping of `vtkTemporalStatistics.h`. In other words, when the wrappers see `vtkTemporalAlgorithm<vtkPassInputTypeAlgorithm>` in `vtkTemporalStatistics.h`, they have to find the definition of `vtkTemporalAlgorithm` in `vtkTemporalAlgorithm.h`, and then generate a wrapper class for `vtkTemporalAlgorithm<vtkPassInputTypeAlgorithm>`. Implementing this would take some work, but it's doable. And it's also a very general answer to the question "how can the wrappers know which template instantiations need to be wrapped?".
As a general solution, this "automated instantiation" would have to handle the situations where the same template instantiation occurs multiple times. Take the simple example of the fictitious instantiation `vtkMyClass<int>`. Even if this instantiation appears multiple times in the same header file, we only want to generate the class wrapper code for it once. This would be easy to do, since `vtkWrapPython.c` would know if the class wrapper for `vtkMyClass<int>` had already been generated. If `vtkMyClass<int>` appears in more than one wrapped header, or perhaps even in different modules, then some kind of global mechanism would be needed to ensure that only one Python class object for `vtkMyClass<int>` is created. Since module-loading occurs at runtime, the Python `vtkMyClass` template object would have to keep a list of which instantiations of this template had been loaded.
Since a substantial (but measurable) amount of work would be needed to resolve this issue, it's worth asking, should we fix it? Currently, there is a documented work-around for `vtkTemporalAlgorithm` (which entails hiding vtkTemporalAlgorithm from the wrappers). But if templated VTK filters become more widespread, then a more general solution (like the one discussed above) might become necessary.https://gitlab.kitware.com/vtk/vtk/-/issues/18274Extend vtkAlgorithm API fo cleaning cache2021-08-12T08:51:25-04:00Timothee ChabatExtend vtkAlgorithm API fo cleaning cacheThe following discussion from !8222 should be addressed:
- [ ] @utkarsh.ayachit started a [discussion](https://gitlab.kitware.com/vtk/vtk/-/merge_requests/8222#note_997368): (+1 comment)
> Can we add a more to the filter to free u...The following discussion from !8222 should be addressed:
- [ ] @utkarsh.ayachit started a [discussion](https://gitlab.kitware.com/vtk/vtk/-/merge_requests/8222#note_997368): (+1 comment)
> Can we add a more to the filter to free up all these locators at end of `RequestData`? I am thinking for insitu cases, we'll soon end up with filters building such acceleration structures that don't get freed up causing memory issue. Having some API to cleanup caches may be a good approach to explore. Doesnt' need to happen in this MR, but something to think about -- maybe it's an API on `vtkAlogorithm` itself.https://gitlab.kitware.com/vtk/vtk/-/issues/18366External rapidjson?2022-03-23T08:31:40-04:00Bruno PaganiExternal rapidjson?Since fides seems to allow it, I’ve tried to build with `-DFIDES_USE_EXTERNAL_RAPIDJSON=ON`. However it fails as such:
```
CMake Error at CMake/vtkModule.cmake:3530 (add_library):
Target "fides" links to target "RapidJSON::RapidJSON" b...Since fides seems to allow it, I’ve tried to build with `-DFIDES_USE_EXTERNAL_RAPIDJSON=ON`. However it fails as such:
```
CMake Error at CMake/vtkModule.cmake:3530 (add_library):
Target "fides" links to target "RapidJSON::RapidJSON" but the target was
not found. Perhaps a find_package() call is missing for an IMPORTED
target, or an ALIAS target is missing?
Call Stack (most recent call first):
ThirdParty/fides/vtkfides/fides/CMakeLists.txt:42 (vtk_module_add_module)
```
Not sure what the issue is exactly, this is beyond my knowledge of CMake.Ben BoeckelBen Boeckelhttps://gitlab.kitware.com/vtk/vtk/-/issues/18367External zfp?2023-04-24T09:35:04-04:00Bruno PaganiExternal zfp?`-DVTK_USE_EXTERNAL=ON` does not set `-DVTK_MODULE_USE_EXTERNAL_VTK_zfp=ON`, which is not a recognized variable anyway. Even setting directly `-DVTK_MODULE_USE_EXTERNAL_vtkzfp=ON` seems without any effect. I guess this is because https:/...`-DVTK_USE_EXTERNAL=ON` does not set `-DVTK_MODULE_USE_EXTERNAL_VTK_zfp=ON`, which is not a recognized variable anyway. Even setting directly `-DVTK_MODULE_USE_EXTERNAL_vtkzfp=ON` seems without any effect. I guess this is because https://gitlab.kitware.com/vtk/vtk/-/blob/master/ThirdParty/zfp/CMakeLists.txt has the `_internal` suffix, but not sure why this is that way.https://gitlab.kitware.com/vtk/vtk/-/issues/19028Fail to load polydata from ASCII .vtk file if any array contain a nan value2023-07-25T11:11:20-04:00Andras LassoFail to load polydata from ASCII .vtk file if any array contain a nan valueIf there is an invalid value in any of the data arrays then the saved an ASCII .vtk file then VTK cannot read the file that it has written.
The invalid value is saved as `-nan(ind)`. When you try to load it with VTK then you get the err...If there is an invalid value in any of the data arrays then the saved an ASCII .vtk file then VTK cannot read the file that it has written.
The invalid value is saved as `-nan(ind)`. When you try to load it with VTK then you get the error: `ERROR: In vtkDataReader.cxx, line 1978\nvtkPolyDataReader (000002D320606C40): Unsupported data type:`
Saving/loading works if .vtp file or binary .vtk file is used.
How to reproduce:
- Download and unzip sample data from https://github.com/lassoan/PublicTestingData/releases/download/data/20230723-VtkFileWithNanLoadFailed.zip
- Load Network-binary.vtk using vtkPolyDataReader
- Save Network-ascii.vtk using vtkPolyDataReader using ASCII format (for convenience, this file is included in the sample data set, too)
- Load the just created Network-ascii.vtk using vtkPolyDataReader => ERROR!
See user error report at: https://discourse.slicer.org/t/error-exporting-and-importing-vtk/30733/5?u=lassoanhttps://gitlab.kitware.com/vtk/vtk/-/issues/18126Failing CI tests2022-07-08T03:56:59-04:00Ben BoeckelFailing CI testsCI tests are currently failing:
### asan and "everything"
- [ ] VTK::FiltersModelingPython-TestImprintFilter2
- [ ] VTK::FiltersModelingPython-TestImprintFilter3
- [x] VTK::RenderingFreeTypeCxx-TestMathTextFonts (fixed in !7654 b...CI tests are currently failing:
### asan and "everything"
- [ ] VTK::FiltersModelingPython-TestImprintFilter2
- [ ] VTK::FiltersModelingPython-TestImprintFilter3
- [x] VTK::RenderingFreeTypeCxx-TestMathTextFonts (fixed in !7654 by installing matplotlib)
- [x] VTK::RenderingVolumePython-gaussian
- [x] VTK::IOChemistryPython-caffeine
- [x] VTK::IOChemistryPython-caffeine_notrailingwhitespaces
- [x] VTK::IOChemistryPython-TestXYZMol
### ubsan
- [ ] VTK::RenderingOpenGL2Cxx-TestGlyph3DMapperPickability
Help tracking down where these started showing up would be helpful. My guess is that the picking is related to !7606 (@paul.lafoix @mwestphal @LucasGandelKitware)
Imprint is likely !7616 (@will.schroeder @cory.quammen @charles.gueunet).
MathTextFonts might be a lack of matplotlib (being fixed in !7654, but the test should be avoided if matplotlib isn't available).
Cc: @utkarsh.ayachit