VTK issueshttps://gitlab.kitware.com/vtk/vtk/-/issues2021-08-20T16:00:28-04:00https://gitlab.kitware.com/vtk/vtk/-/issues/18273Allow Python path objects for filenames2021-08-20T16:00:28-04:00Carlos A. Michelén StröferAllow Python path objects for filenamesThe different readers (e.g. STL, VTK, etc.) only accept a string path. It would be a good addition to accept path objects from the `pathlib` Python standard library.
The following is a minimal example:
```python
from pathlib import Pa...The different readers (e.g. STL, VTK, etc.) only accept a string path. It would be a good addition to accept path objects from the `pathlib` Python standard library.
The following is a minimal example:
```python
from pathlib import Path
import vtk
reader = vtk.vtkSTLReader()
path = Path()
filename = path / "mesh.stl"
reader.SetFileName(filename)
```
which gives the error:
```python
TypeError: SetFileName argument 1: string or None required
```https://gitlab.kitware.com/vtk/vtk/-/issues/18280SMP backend changes from MR 8052 crash under windows Release2021-08-18T17:01:54-04:00Ken MartinSMP backend changes from MR 8052 crash under windows ReleaseThe new changes for backends in SMP https://gitlab.kitware.com/vtk/vtk/-/merge_requests/8052 are crashing on windows static release builds with SMP set to sequential.
At VTK dcc4f8967e everything is fine but at ef4f4956d0e76eef2630e65249...The new changes for backends in SMP https://gitlab.kitware.com/vtk/vtk/-/merge_requests/8052 are crashing on windows static release builds with SMP set to sequential.
At VTK dcc4f8967e everything is fine but at ef4f4956d0e76eef2630e65249bf3e0f99f5aad2 it breaks (after the new SMP backend code) It also breaks on master as of August 18th. The crash is an attempt to read 0x0000000 Sample stack trace below.
![image](/uploads/1cee6ac5132e1c73deddafcddd81d279/image.png)
Contact @ken-martin for how to reproduce as it is not a simple vtk test.https://gitlab.kitware.com/vtk/vtk/-/issues/18277Build Error in vtkLoopSubdivisionFilter.cxx2021-08-18T07:20:25-04:00Chabir AkramyarBuild Error in vtkLoopSubdivisionFilter.cxxHey guys!
After following https://vtk.org/Wiki/VTK/Building/Linux and trying to `make `in my build folder I get the following error in Building CXX object Filters/Modeling/CMakeFiles/FiltersModeling.dir/vtkLoopSubdivisionFilter.cxx:
![i...Hey guys!
After following https://vtk.org/Wiki/VTK/Building/Linux and trying to `make `in my build folder I get the following error in Building CXX object Filters/Modeling/CMakeFiles/FiltersModeling.dir/vtkLoopSubdivisionFilter.cxx:
![image](/uploads/1fd75b4b3a23d7b1ffe68114f9daf1af/image.png)
/usr/include/c++/10/bits/basic_ios.tcc:41: confused by earlier errors, bailing out
make[2]: *** [Filters/Texture/CMakeFiles/FiltersTexture.dir/build.make:121: Filters/Texture/CMakeFiles/FiltersTexture.dir/vtkTextureMapToPlane.cxx.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:6473: Filters/Texture/CMakeFiles/FiltersTexture.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
Thanks in advance for helping!https://gitlab.kitware.com/vtk/vtk/-/issues/18120Support PEP 519 (fspath) in wrapped SetFileName methods2021-08-11T08:50:45-04:00David GobbiSupport PEP 519 (fspath) in wrapped SetFileName methodsPython 3.6 adds the fspath (file system path) protocol described by [PEP 519](https://www.python.org/dev/peps/pep-0519). By supporting this protocol in VTK's SetFileName() methods, we could make those methods accept Path objects, in addi...Python 3.6 adds the fspath (file system path) protocol described by [PEP 519](https://www.python.org/dev/peps/pep-0519). By supporting this protocol in VTK's SetFileName() methods, we could make those methods accept Path objects, in addition to strings, without requiring the user to manually convert the Path to string.
For example, Python's open() method accepts either string objects or Path objects (as of Python 3.6), and this change would make VTK's SetFileName() method behave similarly.
See [support-for-pathlib](https://discourse.vtk.org/t/support-for-pathlib) for additional discussion.https://gitlab.kitware.com/vtk/vtk/-/issues/18271Error in vtkRotationFilter for triangle strips2021-08-05T07:56:43-04:00Tiffany ChhimError in vtkRotationFilter for triangle stripsApplying vtkRotationFilter to triangle strips with an even number of cells causes an error.
The associated conditional block does not appear to be necessary.Applying vtkRotationFilter to triangle strips with an even number of cells causes an error.
The associated conditional block does not appear to be necessary.Tiffany ChhimTiffany Chhimhttps://gitlab.kitware.com/vtk/vtk/-/issues/18160ExodusII reader having problems with 18 node prisms/wedge2021-08-04T16:16:21-04:00Andrew BauerExodusII reader having problems with 18 node prisms/wedgeThere are two issues here. The first is that the 18 node prism/wedge is being read in as a 6 node cell. Can see by looking at one_prism18.e with ncdump that it is indeed an 18 node cell. For two_prism18.e the connectivity seems to be wro...There are two issues here. The first is that the 18 node prism/wedge is being read in as a 6 node cell. Can see by looking at one_prism18.e with ncdump that it is indeed an 18 node cell. For two_prism18.e the connectivity seems to be wrong. See the discussion at https://github.com/libMesh/libmesh/issues/2882#issuecomment-805862325.
Note that both files are completely open and can be added as test files if needed.
[two_prism18.e](/uploads/1228e40d81b891f840cb331484dd14d0/two_prism18.e)
[one_prism18.e](/uploads/6320e05dbdd36e53cfc738244376500f/one_prism18.e)https://gitlab.kitware.com/vtk/vtk/-/issues/18258vtkLineSource point coordinates Z can not work on Axial plane in vtkImageViewer22021-08-03T10:29:43-04:00glistarvtkLineSource point coordinates Z can not work on Axial plane in vtkImageViewer2When I draw line on Axial plane in vtkImageviewer2 for example from (10,10,100) to (20,20,100), but the line display 100 lines from (10,10,1) to (20,20,100). when z>100,it does not display, it is right.When I draw line on Axial plane in vtkImageviewer2 for example from (10,10,100) to (20,20,100), but the line display 100 lines from (10,10,1) to (20,20,100). when z>100,it does not display, it is right.https://gitlab.kitware.com/vtk/vtk/-/issues/18262Detecting visible mesh faces in a scene rendered outside of VTK2021-08-03T10:28:57-04:00aa-tomDetecting visible mesh faces in a scene rendered outside of VTKHi,
I'm currently attempting to select all faces of a mesh visible to a camera in a scene rendered through Qt & Ogre. Ogre doesn't seem to provide much in the way of this, and I'm already loading the mesh into a vtkPolyData object from ...Hi,
I'm currently attempting to select all faces of a mesh visible to a camera in a scene rendered through Qt & Ogre. Ogre doesn't seem to provide much in the way of this, and I'm already loading the mesh into a vtkPolyData object from an STL file, so I figured I could build a vtkRenderer using the attributes from Ogre, then use a vtkHardwareSelector to get the visible faces there.
I've thrown together some code which I believe should work, however I am getting a color buffer depth error when calling the vtkHardwareSelector::Select() method.
The code in question is shown below. `mesh_` is an attribute containing the vtkPolyData object, which is loading fine:
```
std::vector<int> Mesh::getVisibleFacesInRange(Ogre::Viewport* viewport, double radius, double click_x, double click_y)
{
std::vector<int> result;
//TODO: Pull out into Ogre Viewport -> VTK Renderer helper
ROS_INFO("Building VTK Renderer");
Ogre::Camera* camera = viewport->getCamera();
Ogre::Matrix4 ogre_world;
camera->getWorldTransforms(&ogre_world);
double world[16];
for (int i = 0; i < 4; i++)
{
for (int j = 0; j < 4; j++)
{
world[(i * 4) + j] = ogre_world[i][j];
}
}
vtkRenderer* renderer = vtkRenderer::New();
vtkCamera* vtk_camera = renderer->MakeCamera();
vtk_camera->SetModelTransformMatrix(world);
Ogre::Vector3 position = camera->getPosition();
double pos[3] = {position.x, position.y, position.z};
vtk_camera->SetPosition(pos);
Ogre::Vector3 up_vec = camera->getUp();
double up[3] = {up_vec.x, up_vec.y, up_vec.z};
vtk_camera->SetViewUp(up);
Ogre::Vector3 focal_point = position + camera->getDirection();
double focal[3] = {focal_point.x, focal_point.y, focal_point.z};
vtk_camera->SetFocalPoint(focal);
vtk_camera->SetViewAngle(camera->getFOVy().valueDegrees());
vtk_camera->SetFocalDistance(camera->getFocalLength());
renderer->SetActiveCamera(vtk_camera);
vtkRenderWindow* window = vtkRenderWindow::New();
window->AddRenderer(renderer);
window->SetSize(viewport->getWidth(), viewport->getHeight());
renderer->Clear();
vtkPolyDataMapper* mapper = vtkPolyDataMapper::New();
mapper->SetInputData(mesh_);
mapper->Update();
vtkActor* actor = vtkActor::New();
actor->SetMapper(mapper);
renderer->AddActor(actor);
window->Render();
ROS_INFO("Built VTK Renderer");
vtkOpenGLHardwareSelector* selector = vtkOpenGLHardwareSelector::New();
selector->SetFieldAssociation(vtkDataObject::FieldAssociations::FIELD_ASSOCIATION_CELLS);
selector->SetRenderer(renderer);
selector->SetArea(click_x - radius, click_y - radius, click_x + radius, click_y + radius);
vtkSelection* selection = vtkSelection::New();
ROS_INFO("Selecting visible cells");
selection = selector->Select();
...
}
```
Along with the logs:
```
[ INFO] [1626871024.589000972]: Built VTK Renderer
[ INFO] [1626871024.589327747]: Selecting visible cells
2021-07-21 13:37:04.589 ( 8.983s) [ 7662AA80]vtkHardwareSelector.cxx:279 ERR| vtkOpenGLHardwareSelector (0x55fdd906b1c0): Color buffer depth must be at least 8 bit. Currently: 1, 0, 2109690372
```
Apologies for the messy code and unfamiliarity with VTK. I'd much appreciate any help, and if there is a cleaner way of achieving this I'd love to hear it :slightly_smiling_face:https://gitlab.kitware.com/vtk/vtk/-/issues/18269Exception in vtkSMPTols.h2021-08-02T21:59:15-04:00Andrew MacleanException in vtkSMPTols.hIn running tests for vtk-examples, some examples are showing in Windows MSVC:
``` text
Unhandled exception at 0x00007FFE949EF84D (vtkCommonDataModel-9.0d.dll) in XMLPUnstructuredGridWriter.exe: Stack cookie instrumentation code detected...In running tests for vtk-examples, some examples are showing in Windows MSVC:
``` text
Unhandled exception at 0x00007FFE949EF84D (vtkCommonDataModel-9.0d.dll) in XMLPUnstructuredGridWriter.exe: Stack cookie instrumentation code detected a stack-based buffer overrun.
```
In Linux I am getting a **stack smashing detected** error.
This is happening at line 247 of vtkSPMPTools.h
``` C++
template <typename Functor>
static void For(vtkIdType first, vtkIdType last, vtkIdType grain, Functor& f)
{
typename vtk::detail::smp::vtkSMPTools_Lookup_For<Functor>::type fi(f);
fi.For(first, last, grain);
}
```
In the case of the IO tests when running the vtk-example tests, these are the ones that fail:
``` text
376:IO-WriteVTU
385:IO-WriteXMLLinearCells
387:IO-XMLPUnstructuredGridWriter
```
WriteVTU: first = 0, last = 1, grain = 0<br>
WriteXMLLinearCells: first = 0, last = 1, grain = 0<br>
XMLPUnstructuredGridWriter: first = 0, last = 38, grain = 0
Other examples are also failing, with the same message.
The code is quite simple for these examples e.g. [WriteVTU](https://kitware.github.io/vtk-examples/site/Cxx/IO/WriteVTU/)https://gitlab.kitware.com/vtk/vtk/-/issues/18268numpy.bool is deprecated2021-07-29T11:36:46-04:00James Wrightnumpy.bool is deprecatedThe usage of `numpy.bool` has been deprecated as of Numpy 1.20. Instead, it's recommended to either use the built in python `bool` or use the numpy scalar `numpy.bool_`.
```python
~/.local/src/miniconda3/lib/python3.9/site-packages/vtkm...The usage of `numpy.bool` has been deprecated as of Numpy 1.20. Instead, it's recommended to either use the built in python `bool` or use the numpy scalar `numpy.bool_`.
```python
~/.local/src/miniconda3/lib/python3.9/site-packages/vtkmodules/util/numpy_support.py in get_vtk_to_numpy_typemap()
72 def get_vtk_to_numpy_typemap():
73 """Returns the VTK array type to numpy array type mapping."""
---> 74 _vtk_np = {vtkConstants.VTK_BIT:numpy.bool,
75 vtkConstants.VTK_CHAR:numpy.int8,
76 vtkConstants.VTK_SIGNED_CHAR:numpy.int8,
~/.local/src/miniconda3/lib/python3.9/site-packages/numpy/__init__.py in __getattr__(attr)
285 pass
286 else:
--> 287 warnings.warn(msg, DeprecationWarning, stacklevel=2)
288 return val
289
DeprecationWarning: `np.bool` is a deprecated alias for the builtin `bool`. To silence this warning, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_
` here.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
```
Not sure which is preferable in this context though. `bool` would be the direct replacement and prevent any compatibility issues with previous versions of numpy (I'm not sure when `np.bool_` was introduced, maybe it's always been there).
Supposedly, `bool` is the same size as `int` (so normally 4 bytes), while the [`numpy.bool_` is only one byte long](https://numpy.org/devdocs/reference/arrays.scalars.html#numpy.bool_). So using the lower memory footprint may be desirable. But I can't seem to "prove" that there is any difference in the memory allocation, as `np.ones(100, dtype=bool).nbytes` and `np.ones(100, dtype=np.bool_).nbytes` both return with 100 bytes.David GobbiDavid Gobbihttps://gitlab.kitware.com/vtk/vtk/-/issues/18267vtkGeometryFilter and vtkDataSetSurfaceFilter fail to process vtkMultiBlockDa...2021-07-27T16:22:04-04:00Douglas BrennanvtkGeometryFilter and vtkDataSetSurfaceFilter fail to process vtkMultiBlockDataSets that contain a mix of vtkPolyData and vtkUnstructuredGrid datavtkGeometryFilter and vtkDataSetSurfaceFilter fail to process vtkMultiBlockDataSets that contain a mix of vtkPolyData and vtkUnstructuredGrid data. The filters work correctly when passed homogeneous data sets.vtkGeometryFilter and vtkDataSetSurfaceFilter fail to process vtkMultiBlockDataSets that contain a mix of vtkPolyData and vtkUnstructuredGrid data. The filters work correctly when passed homogeneous data sets.https://gitlab.kitware.com/vtk/vtk/-/issues/18048Name conflict of AllValues with libX11 and Xutil.h2021-07-26T19:12:13-04:00rlalikName conflict of AllValues with libX11 and Xutil.hWhile compiling opencascade-7.5.0 against vtk-9.0.1 I encountered following errors:
```
[10/13] /usr/bin/x86_64-pc-linux-gnu-g++ -DHAVE_FFMPEG -DHAVE_GLES2 -DHAVE_VTK -DOCC_CONVERT_SIGNALS -DTKIVtkDraw_EXPORTS -DVTK_OPENGL2_BACKEND -Iin...While compiling opencascade-7.5.0 against vtk-9.0.1 I encountered following errors:
```
[10/13] /usr/bin/x86_64-pc-linux-gnu-g++ -DHAVE_FFMPEG -DHAVE_GLES2 -DHAVE_VTK -DOCC_CONVERT_SIGNALS -DTKIVtkDraw_EXPORTS -DVTK_OPENGL2_BACKEND -Iinclude/opencascade -isystem /usr/include/freetype2 -isystem /usr/include/vtk-9.0 -std=c++0x -march=haswell -O2 -pipe -fexceptions -fPIC -Wall -Wextra -s -DNo_Exception -fPIC -MD -MT src/TKIVtkDraw/CMakeFiles/TKIVtkDraw.dir/__/IVtkDraw/IVtkDraw_Interactor.cxx.o -MF src/TKIVtkDraw/CMakeFiles/TKIVtkDraw.dir/__/IVtkDraw/IVtkDraw_Interactor.cxx.o.d -o src/TKIVtkDraw/CMakeFiles/TKIVtkDraw.dir/__/IVtkDraw/IVtkDraw_Interactor.cxx.o -c /var/tmp/portage/sci-libs/opencascade-7.5.0/work/occt-V7_5_0/src/IVtkDraw/IVtkDraw_Interactor.cxx
FAILED: src/TKIVtkDraw/CMakeFiles/TKIVtkDraw.dir/__/IVtkDraw/IVtkDraw_Interactor.cxx.o
/usr/bin/x86_64-pc-linux-gnu-g++ -DHAVE_FFMPEG -DHAVE_GLES2 -DHAVE_VTK -DOCC_CONVERT_SIGNALS -DTKIVtkDraw_EXPORTS -DVTK_OPENGL2_BACKEND -Iinclude/opencascade -isystem /usr/include/freetype2 -isystem /usr/include/vtk-9.0 -std=c++0x -march=haswell -O2 -pipe -fexceptions -fPIC -Wall -Wextra -s -DNo_Exception -fPIC -MD -MT src/TKIVtkDraw/CMakeFiles/TKIVtkDraw.dir/__/IVtkDraw/IVtkDraw_Interactor.cxx.o -MF src/TKIVtkDraw/CMakeFiles/TKIVtkDraw.dir/__/IVtkDraw/IVtkDraw_Interactor.cxx.o.d -o src/TKIVtkDraw/CMakeFiles/TKIVtkDraw.dir/__/IVtkDraw/IVtkDraw_Interactor.cxx.o -c /var/tmp/portage/sci-libs/opencascade-7.5.0/work/occt-V7_5_0/src/IVtkDraw/IVtkDraw_Interactor.cxx
In file included from /usr/include/GL/glx.h:31,
from /var/tmp/portage/sci-libs/opencascade-7.5.0/work/occt-V7_5_0/src/IVtkDraw/IVtkDraw_Interactor.cxx:22:
/usr/include/vtk-9.0/vtkDataArray.h:602:8: error: expected identifier before numeric constant
602 | struct AllValues
| ^~~~~~~~~
/usr/include/vtk-9.0/vtkDataArray.h:602:8: error: expected unqualified-id before numeric constant
/usr/include/vtk-9.0/vtkGenericDataArray.h:417:37: error: expected identifier before numeric constant
417 | bool DoComputeVectorRange(A*, R[2], AllValues);
| ^~~~~~~~~
/usr/include/vtk-9.0/vtkGenericDataArray.h:417:37: error: expected ‘,’ or ‘...’ before numeric constant
/usr/include/vtk-9.0/vtkGenericDataArray.h:519:37: error: expected identifier before numeric constant
519 | bool DoComputeVectorRange(A*, R[2], AllValues);
| ^~~~~~~~~
/usr/include/vtk-9.0/vtkGenericDataArray.h:519:37: error: expected ‘,’ or ‘...’ before numeric constant
/usr/include/vtk-9.0/vtkGenericDataArray.h:551:1: error: expected identifier before numeric constant
551 | VTK_DECLARE_VALUERANGE_VALUETYPE(long)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/vtk-9.0/vtkGenericDataArray.h:551:1: error: expected ‘,’ or ‘...’ before numeric constant
/usr/include/vtk-9.0/vtkGenericDataArray.h:551:1: error: expected identifier before numeric constant
551 | VTK_DECLARE_VALUERANGE_VALUETYPE(long)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/vtk-9.0/vtkGenericDataArray.h:551:1: error: expected ‘,’ or ‘...’ before numeric constant
/usr/include/vtk-9.0/vtkGenericDataArray.h:551:1: error: expected identifier before numeric constant
551 | VTK_DECLARE_VALUERANGE_VALUETYPE(long)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/vtk-9.0/vtkGenericDataArray.h:551:1: error: expected ‘,’ or ‘...’ before numeric constant
/usr/include/vtk-9.0/vtkGenericDataArray.h:551:1: error: expected identifier before numeric constant
551 | VTK_DECLARE_VALUERANGE_VALUETYPE(long)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/vtk-9.0/vtkGenericDataArray.h:551:1: error: expected ‘,’ or ‘...’ before numeric constant
/usr/include/vtk-9.0/vtkGenericDataArray.h:552:1: error: expected identifier before numeric constant
552 | VTK_DECLARE_VALUERANGE_VALUETYPE(unsigned long)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/vtk-9.0/vtkGenericDataArray.h:552:1: error: expected ‘,’ or ‘...’ before numeric constant
/usr/include/vtk-9.0/vtkGenericDataArray.h:552:1: error: expected identifier before numeric constant
552 | VTK_DECLARE_VALUERANGE_VALUETYPE(unsigned long)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/vtk-9.0/vtkGenericDataArray.h:552:1: error: expected ‘,’ or ‘...’ before numeric constant
/usr/include/vtk-9.0/vtkGenericDataArray.h:552:1: error: expected identifier before numeric constant
552 | VTK_DECLARE_VALUERANGE_VALUETYPE(unsigned long)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/vtk-9.0/vtkGenericDataArray.h:552:1: error: expected ‘,’ or ‘...’ before numeric constant
/usr/include/vtk-9.0/vtkGenericDataArray.h:552:1: error: expected identifier before numeric constant
552 | VTK_DECLARE_VALUERANGE_VALUETYPE(unsigned long)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/vtk-9.0/vtkGenericDataArray.h:552:1: error: expected ‘,’ or ‘...’ before numeric constant
/usr/include/vtk-9.0/vtkGenericDataArray.h:553:1: error: expected identifier before numeric constant
553 | VTK_DECLARE_VALUERANGE_VALUETYPE(long long)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/vtk-9.0/vtkGenericDataArray.h:553:1: error: expected ‘,’ or ‘...’ before numeric constant
/usr/include/vtk-9.0/vtkGenericDataArray.h:553:1: error: expected identifier before numeric constant
553 | VTK_DECLARE_VALUERANGE_VALUETYPE(long long)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/vtk-9.0/vtkGenericDataArray.h:553:1: error: expected ‘,’ or ‘...’ before numeric constant
/usr/include/vtk-9.0/vtkGenericDataArray.h:553:1: error: expected identifier before numeric constant
553 | VTK_DECLARE_VALUERANGE_VALUETYPE(long long)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/vtk-9.0/vtkGenericDataArray.h:553:1: error: expected ‘,’ or ‘...’ before numeric constant
/usr/include/vtk-9.0/vtkGenericDataArray.h:553:1: error: expected identifier before numeric constant
553 | VTK_DECLARE_VALUERANGE_VALUETYPE(long long)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/vtk-9.0/vtkGenericDataArray.h:553:1: error: expected ‘,’ or ‘...’ before numeric constant
/usr/include/vtk-9.0/vtkGenericDataArray.h:554:1: error: expected identifier before numeric constant
554 | VTK_DECLARE_VALUERANGE_VALUETYPE(unsigned long long)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/vtk-9.0/vtkGenericDataArray.h:554:1: error: expected ‘,’ or ‘...’ before numeric constant
/usr/include/vtk-9.0/vtkGenericDataArray.h:554:1: error: expected identifier before numeric constant
554 | VTK_DECLARE_VALUERANGE_VALUETYPE(unsigned long long)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/vtk-9.0/vtkGenericDataArray.h:554:1: error: expected ‘,’ or ‘...’ before numeric constant
/usr/include/vtk-9.0/vtkGenericDataArray.h:554:1: error: expected identifier before numeric constant
554 | VTK_DECLARE_VALUERANGE_VALUETYPE(unsigned long long)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/vtk-9.0/vtkGenericDataArray.h:554:1: error: expected ‘,’ or ‘...’ before numeric constant
/usr/include/vtk-9.0/vtkGenericDataArray.h:554:1: error: expected identifier before numeric constant
554 | VTK_DECLARE_VALUERANGE_VALUETYPE(unsigned long long)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/vtk-9.0/vtkGenericDataArray.h:554:1: error: expected ‘,’ or ‘...’ before numeric constant
/usr/include/vtk-9.0/vtkGenericDataArray.h:555:1: error: expected identifier before numeric constant
555 | VTK_DECLARE_VALUERANGE_ARRAYTYPE(vtkDataArray, double)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/vtk-9.0/vtkGenericDataArray.h:555:1: error: expected ‘,’ or ‘...’ before numeric constant
/usr/include/vtk-9.0/vtkGenericDataArray.h:555:1: error: expected identifier before numeric constant
555 | VTK_DECLARE_VALUERANGE_ARRAYTYPE(vtkDataArray, double)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/vtk-9.0/vtkGenericDataArray.h:555:1: error: expected ‘,’ or ‘...’ before numeric constant
/usr/include/vtk-9.0/vtkGenericDataArray.txx: In member function ‘bool vtkGenericDataArray<DerivedT, ValueTypeT>::ComputeScalarValueRange(vtkGenericDataArray<DerivedT, ValueTypeT>::ValueType*)’:
/usr/include/vtk-9.0/vtkGenericDataArray.txx:1195:64: error: expected unqualified-id before numeric constant
1195 | static_cast<DerivedT*>(this), ranges, vtkDataArrayPrivate::AllValues{}, Supported{});
| ^~~~~~~~~
/usr/include/vtk-9.0/vtkGenericDataArray.txx: In member function ‘bool vtkGenericDataArray<DerivedT, ValueTypeT>::ComputeVectorValueRange(vtkGenericDataArray<DerivedT, ValueTypeT>::ValueType*)’:
/usr/include/vtk-9.0/vtkGenericDataArray.txx:1205:63: error: expected unqualified-id before numeric constant
1205 | static_cast<DerivedT*>(this), range, vtkDataArrayPrivate::AllValues{}, Supported{});
| ^~~~~~~~~
[11/13] /usr/bin/x86_64-pc-linux-gnu-g++ -DHAVE_FFMPEG -DHAVE_GLES2 -DHAVE_VTK -DOCC_CONVERT_SIGNALS -DTKIVtkDraw_EXPORTS -DVTK_OPENGL2_BACKEND -Iinclude/opencascade -isystem /usr/include/freetype2 -isystem /usr/include/vtk-9.0 -std=c++0x -march=haswell -O2 -pipe -fexceptions -fPIC -Wall -Wextra -s -DNo_Exception -fPIC -MD -MT src/TKIVtkDraw/CMakeFiles/TKIVtkDraw.dir/__/IVtkDraw/IVtkDraw.cxx.o -MF src/TKIVtkDraw/CMakeFiles/TKIVtkDraw.dir/__/IVtkDraw/IVtkDraw.cxx.o.d -o src/TKIVtkDraw/CMakeFiles/TKIVtkDraw.dir/__/IVtkDraw/IVtkDraw.cxx.o -c /var/tmp/portage/sci-libs/opencascade-7.5.0/work/occt-V7_5_0/src/IVtkDraw/IVtkDraw.cxx
FAILED: src/TKIVtkDraw/CMakeFiles/TKIVtkDraw.dir/__/IVtkDraw/IVtkDraw.cxx.o
/usr/bin/x86_64-pc-linux-gnu-g++ -DHAVE_FFMPEG -DHAVE_GLES2 -DHAVE_VTK -DOCC_CONVERT_SIGNALS -DTKIVtkDraw_EXPORTS -DVTK_OPENGL2_BACKEND -Iinclude/opencascade -isystem /usr/include/freetype2 -isystem /usr/include/vtk-9.0 -std=c++0x -march=haswell -O2 -pipe -fexceptions -fPIC -Wall -Wextra -s -DNo_Exception -fPIC -MD -MT src/TKIVtkDraw/CMakeFiles/TKIVtkDraw.dir/__/IVtkDraw/IVtkDraw.cxx.o -MF src/TKIVtkDraw/CMakeFiles/TKIVtkDraw.dir/__/IVtkDraw/IVtkDraw.cxx.o.d -o src/TKIVtkDraw/CMakeFiles/TKIVtkDraw.dir/__/IVtkDraw/IVtkDraw.cxx.o -c /var/tmp/portage/sci-libs/opencascade-7.5.0/work/occt-V7_5_0/src/IVtkDraw/IVtkDraw.cxx
In file included from /var/tmp/portage/sci-libs/opencascade-7.5.0/work/occt-V7_5_0/src/InterfaceGraphic/InterfaceGraphic.hxx:39,
from include/opencascade/InterfaceGraphic.hxx:1,
from /var/tmp/portage/sci-libs/opencascade-7.5.0/work/occt-V7_5_0/src/Aspect/Aspect_DisplayConnection.hxx:24,
from include/opencascade/Aspect_DisplayConnection.hxx:1,
from /var/tmp/portage/sci-libs/opencascade-7.5.0/work/occt-V7_5_0/src/OpenGl/OpenGl_GraphicDriver.hxx:22,
from include/opencascade/OpenGl_GraphicDriver.hxx:1,
from /var/tmp/portage/sci-libs/opencascade-7.5.0/work/occt-V7_5_0/src/IVtkDraw/IVtkDraw.cxx:34:
/usr/include/vtk-9.0/vtkDataArray.h:602:8: error: expected identifier before numeric constant
602 | struct AllValues
| ^~~~~~~~~
/usr/include/vtk-9.0/vtkDataArray.h:602:8: error: expected unqualified-id before numeric constant
/usr/include/vtk-9.0/vtkGenericDataArray.h:417:37: error: expected identifier before numeric constant
417 | bool DoComputeVectorRange(A*, R[2], AllValues);
| ^~~~~~~~~
/usr/include/vtk-9.0/vtkGenericDataArray.h:417:37: error: expected ‘,’ or ‘...’ before numeric constant
/usr/include/vtk-9.0/vtkGenericDataArray.h:519:37: error: expected identifier before numeric constant
519 | bool DoComputeVectorRange(A*, R[2], AllValues);
| ^~~~~~~~~
/usr/include/vtk-9.0/vtkGenericDataArray.h:519:37: error: expected ‘,’ or ‘...’ before numeric constant
/usr/include/vtk-9.0/vtkGenericDataArray.h:551:1: error: expected identifier before numeric constant
551 | VTK_DECLARE_VALUERANGE_VALUETYPE(long)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/vtk-9.0/vtkGenericDataArray.h:551:1: error: expected ‘,’ or ‘...’ before numeric constant
/usr/include/vtk-9.0/vtkGenericDataArray.h:551:1: error: expected identifier before numeric constant
551 | VTK_DECLARE_VALUERANGE_VALUETYPE(long)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/vtk-9.0/vtkGenericDataArray.h:551:1: error: expected ‘,’ or ‘...’ before numeric constant
/usr/include/vtk-9.0/vtkGenericDataArray.h:551:1: error: expected identifier before numeric constant
551 | VTK_DECLARE_VALUERANGE_VALUETYPE(long)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/vtk-9.0/vtkGenericDataArray.h:551:1: error: expected ‘,’ or ‘...’ before numeric constant
/usr/include/vtk-9.0/vtkGenericDataArray.h:551:1: error: expected identifier before numeric constant
551 | VTK_DECLARE_VALUERANGE_VALUETYPE(long)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/vtk-9.0/vtkGenericDataArray.h:551:1: error: expected ‘,’ or ‘...’ before numeric constant
/usr/include/vtk-9.0/vtkGenericDataArray.h:552:1: error: expected identifier before numeric constant
552 | VTK_DECLARE_VALUERANGE_VALUETYPE(unsigned long)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/vtk-9.0/vtkGenericDataArray.h:552:1: error: expected ‘,’ or ‘...’ before numeric constant
/usr/include/vtk-9.0/vtkGenericDataArray.h:552:1: error: expected identifier before numeric constant
552 | VTK_DECLARE_VALUERANGE_VALUETYPE(unsigned long)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/vtk-9.0/vtkGenericDataArray.h:552:1: error: expected ‘,’ or ‘...’ before numeric constant
/usr/include/vtk-9.0/vtkGenericDataArray.h:552:1: error: expected identifier before numeric constant
552 | VTK_DECLARE_VALUERANGE_VALUETYPE(unsigned long)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/vtk-9.0/vtkGenericDataArray.h:552:1: error: expected ‘,’ or ‘...’ before numeric constant
/usr/include/vtk-9.0/vtkGenericDataArray.h:552:1: error: expected identifier before numeric constant
552 | VTK_DECLARE_VALUERANGE_VALUETYPE(unsigned long)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/vtk-9.0/vtkGenericDataArray.h:552:1: error: expected ‘,’ or ‘...’ before numeric constant
/usr/include/vtk-9.0/vtkGenericDataArray.h:553:1: error: expected identifier before numeric constant
553 | VTK_DECLARE_VALUERANGE_VALUETYPE(long long)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/vtk-9.0/vtkGenericDataArray.h:553:1: error: expected ‘,’ or ‘...’ before numeric constant
/usr/include/vtk-9.0/vtkGenericDataArray.h:553:1: error: expected identifier before numeric constant
553 | VTK_DECLARE_VALUERANGE_VALUETYPE(long long)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/vtk-9.0/vtkGenericDataArray.h:553:1: error: expected ‘,’ or ‘...’ before numeric constant
/usr/include/vtk-9.0/vtkGenericDataArray.h:553:1: error: expected identifier before numeric constant
553 | VTK_DECLARE_VALUERANGE_VALUETYPE(long long)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/vtk-9.0/vtkGenericDataArray.h:553:1: error: expected ‘,’ or ‘...’ before numeric constant
/usr/include/vtk-9.0/vtkGenericDataArray.h:553:1: error: expected identifier before numeric constant
553 | VTK_DECLARE_VALUERANGE_VALUETYPE(long long)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/vtk-9.0/vtkGenericDataArray.h:553:1: error: expected ‘,’ or ‘...’ before numeric constant
/usr/include/vtk-9.0/vtkGenericDataArray.h:554:1: error: expected identifier before numeric constant
554 | VTK_DECLARE_VALUERANGE_VALUETYPE(unsigned long long)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/vtk-9.0/vtkGenericDataArray.h:554:1: error: expected ‘,’ or ‘...’ before numeric constant
/usr/include/vtk-9.0/vtkGenericDataArray.h:554:1: error: expected identifier before numeric constant
554 | VTK_DECLARE_VALUERANGE_VALUETYPE(unsigned long long)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/vtk-9.0/vtkGenericDataArray.h:554:1: error: expected ‘,’ or ‘...’ before numeric constant
/usr/include/vtk-9.0/vtkGenericDataArray.h:554:1: error: expected identifier before numeric constant
554 | VTK_DECLARE_VALUERANGE_VALUETYPE(unsigned long long)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/vtk-9.0/vtkGenericDataArray.h:554:1: error: expected ‘,’ or ‘...’ before numeric constant
/usr/include/vtk-9.0/vtkGenericDataArray.h:554:1: error: expected identifier before numeric constant
554 | VTK_DECLARE_VALUERANGE_VALUETYPE(unsigned long long)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/vtk-9.0/vtkGenericDataArray.h:554:1: error: expected ‘,’ or ‘...’ before numeric constant
/usr/include/vtk-9.0/vtkGenericDataArray.h:555:1: error: expected identifier before numeric constant
555 | VTK_DECLARE_VALUERANGE_ARRAYTYPE(vtkDataArray, double)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/vtk-9.0/vtkGenericDataArray.h:555:1: error: expected ‘,’ or ‘...’ before numeric constant
/usr/include/vtk-9.0/vtkGenericDataArray.h:555:1: error: expected identifier before numeric constant
555 | VTK_DECLARE_VALUERANGE_ARRAYTYPE(vtkDataArray, double)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/vtk-9.0/vtkGenericDataArray.h:555:1: error: expected ‘,’ or ‘...’ before numeric constant
/usr/include/vtk-9.0/vtkGenericDataArray.txx: In member function ‘bool vtkGenericDataArray<DerivedT, ValueTypeT>::ComputeScalarValueRange(vtkGenericDataArray<DerivedT, ValueTypeT>::ValueType*)’:
/usr/include/vtk-9.0/vtkGenericDataArray.txx:1195:64: error: expected unqualified-id before numeric constant
1195 | static_cast<DerivedT*>(this), ranges, vtkDataArrayPrivate::AllValues{}, Supported{});
| ^~~~~~~~~
/usr/include/vtk-9.0/vtkGenericDataArray.txx: In member function ‘bool vtkGenericDataArray<DerivedT, ValueTypeT>::ComputeVectorValueRange(vtkGenericDataArray<DerivedT, ValueTypeT>::ValueType*)’:
/usr/include/vtk-9.0/vtkGenericDataArray.txx:1205:63: error: expected unqualified-id before numeric constant
1205 | static_cast<DerivedT*>(this), range, vtkDataArrayPrivate::AllValues{}, Supported{});
|
```
It took me a while to find out and using clang gave me better output, here is part of it:
```
error: expected unqualified-id
/usr/include/vtk-9.0/vtkGenericDataArray.h:551:1: error: expected parameter declarator
VTK_DECLARE_VALUERANGE_VALUETYPE(long)
^
/usr/include/vtk-9.0/vtkGenericDataArray.h:544:3: note: expanded from macro 'VTK_DECLARE_VALUERANGE_VALUETYPE'
VTK_DECLARE_VALUERANGE_ARRAYTYPE(vtkAOSDataArrayTemplate<ValueType>, ValueType) \
^
/usr/include/vtk-9.0/vtkGenericDataArray.h:530:31: note: expanded from macro 'VTK_DECLARE_VALUERANGE_ARRAYTYPE'
ArrayType*, ValueType[2], vtkDataArrayPrivate::AllValues); \
^
/usr/include/vtk-9.0/vtkGenericDataArray.h:551:1: error: expected ')'
/usr/include/vtk-9.0/vtkGenericDataArray.h:544:3: note: expanded from macro 'VTK_DECLARE_VALUERANGE_VALUETYPE'
VTK_DECLARE_VALUERANGE_ARRAYTYPE(vtkAOSDataArrayTemplate<ValueType>, ValueType) \
^
/usr/include/vtk-9.0/vtkGenericDataArray.h:530:52: note: expanded from macro 'VTK_DECLARE_VALUERANGE_ARRAYTYPE'
ArrayType*, ValueType[2], vtkDataArrayPrivate::AllValues); \
^
/usr/include/X11/Xutil.h:73:20: note: expanded from macro 'AllValues'
#define AllValues 0x000F
^
/usr/include/vtk-9.0/vtkGenericDataArray.h:551:1: note: to match this '('
/usr/include/vtk-9.0/vtkGenericDataArray.h:544:3: note: expanded from macro 'VTK_DECLARE_VALUERANGE_VALUETYPE'
VTK_DECLARE_VALUERANGE_ARRAYTYPE(vtkAOSDataArrayTemplate<ValueType>, ValueType) \
^
/usr/include/vtk-9.0/vtkGenericDataArray.h:529:65: note: expanded from macro 'VTK_DECLARE_VALUERANGE_ARRAYTYPE'
extern template VTKCOMMONCORE_EXPORT bool DoComputeVectorRange(
```
In the end there is a conflict of the names with Xutil.h from libX11. I solved my problem with renaming AllValues -> vtkAllValues. Maybe you could consider having this or similar change in your code.Vicente Boleavicente.bolea@kitware.comVicente Boleavicente.bolea@kitware.comhttps://gitlab.kitware.com/vtk/vtk/-/issues/18264Improve vtkTriangle intersection with coplanar line2021-07-26T10:37:43-04:00Tiffany ChhimImprove vtkTriangle intersection with coplanar lineCurrently the function vtkTriangle::IntersectWithLine returns 0 (no intersection) if the line is coplanar to the triangle, even if there is intersection.
```
// Build triangle
double pt0[3] = { 0, 0, 0 };
double pt1[3] = { 0, 10, 0 };
d...Currently the function vtkTriangle::IntersectWithLine returns 0 (no intersection) if the line is coplanar to the triangle, even if there is intersection.
```
// Build triangle
double pt0[3] = { 0, 0, 0 };
double pt1[3] = { 0, 10, 0 };
double pt2[3] = { 0, 0, 10 };
vtkNew<vtkTriangle> coplanarTriangle;
coplanarTriangle->GetPoints()->SetPoint(0, pt0);
coplanarTriangle->GetPoints()->SetPoint(1, pt1);
coplanarTriangle->GetPoints()->SetPoint(2, pt2);
// Define line extremities with first extremity inside
double ext1[3] = { 0, 1, 5 };
double ext2[3] = { 0, 11, 5 };
double t;
double x[3];
double pcoords[3];
int subId;
// Function returns 0
int result = coplanarTriangle->IntersectWithLine(ext1, ext2, dEpsilon, t, x, pcoords, subId);
```
A suggestion could be that instead, if there is coplanarity, the function should first verify whether there is intersection to return the correct output, and the intersecting point should be defined as the point on the triangle closest to the first extremity of the line.Tiffany ChhimTiffany Chhimhttps://gitlab.kitware.com/vtk/vtk/-/issues/18239_vtk.vtkOpenGLHardwareSelector selection leak2021-07-07T10:24:33-04:00Alex Kaszynski_vtk.vtkOpenGLHardwareSelector selection leakGetting leaks with the selection from `vtkOpenGLHardwareSelector` with dev wheels `vtk==9.0.20210612.dev0` on Windows 64-bit Python 3.9:
```
vtkDebugLeaks has detected LEAKS!
Class "vtkTypeInt64Array" has 16 instances still around.
Class...Getting leaks with the selection from `vtkOpenGLHardwareSelector` with dev wheels `vtk==9.0.20210612.dev0` on Windows 64-bit Python 3.9:
```
vtkDebugLeaks has detected LEAKS!
Class "vtkTypeInt64Array" has 16 instances still around.
Class "vtkInformationVector" has 15 instances still around.
Class "vtkMatrix3x3" has 2 instances still around.
Class "class vtkBuffer<__int64>" has 25 instances still around.
Class "vtkMatrix4x4" has 9 instances still around.
Class "vtkIdList" has 10 instances still around.
Class "vtkIdTypeArray" has 9 instances still around.
Class "vtkCellArray" has 8 instances still around.
Class "class vtkBuffer<unsigned char>" has 1 instance still around.
Class "vtkInformationIntegerValue" has 64 instances still around.
Class "vtkInformationExecutivePortValue" has 2 instances still around.
Class "vtkInformation" has 48 instances still around.
Class "vtkInformationExecutivePortVectorValue" has 1 instance still around.
Class "vtkCommand or subclass" has 1 instance still around.
Class "vtkInformationIterator" has 4 instances still around.
Class "class vtkBuffer<float>" has 2 instances still around.
Class "vtkFloatArray" has 2 instances still around.
Class "vtkTransform" has 4 instances still around.
Class "vtkUnsignedCharArray" has 1 instance still around.
Class "vtkCompositeDataPipeline" has 3 instances still around.
Class "vtkUniformInternals" has 3 instances still around.
Class "vtkTimerLog" has 2 instances still around.
Class "vtkOpenGLIndexBufferObject" has 10 instances still around.
Class "vtkOpenGLVertexArrayObject" has 10 instances still around.
Class "vtkOpenGLCellToVTKCellMap" has 1 instance still around.
Class "vtkOpenGLVertexBufferObjectGroup" has 1 instance still around.
Class "vtkOpenGLPolyDataMapper" has 1 instance still around.
Class "vtkAlgorithmOutput" has 2 instances still around.
Class "vtkInformationStringValue" has 1 instance still around.
Class "vtkEmptyCell" has 1 instance still around.
Class "vtkFieldData" has 2 instances still around.
Class "vtkPointData" has 1 instance still around.
Class "vtkCellData" has 1 instance still around.
Class "class vtkBuffer<double>" has 1 instance still around.
Class "vtkDoubleArray" has 1 instance still around.
Class "vtkPoints" has 2 instances still around.
Class "vtkPolyData" has 1 instance still around.
Class "vtkTrivialProducer" has 1 instance still around.
Class "vtkStreamingDemandDrivenPipeline" has 1 instance still around.
Class "vtkDataSetMapper" has 1 instance still around.
Class "vtkLookupTable" has 1 instance still around.
Class "vtkOpenGLActor" has 1 instance still around.
Class "vtkOpenGLProperty" has 1 instance still around.
Class "vtkInformationStringVectorValue" has 1 instance still around.
Class "vtkDataSetSurfaceFilter" has 1 instance still around.
Class "vtkInformationDoubleVectorValue" has 3 instances still around.
Class "vtkOpenGLUniforms" has 3 instances still around.
Class "vtkOpenGLShaderProperty" has 1 instance still around.
Class "vtkDataSetAttributes" has 1 instance still around.
Class "vtkAssemblyPath" has 1 instance still around.
Class "vtkAssemblyNode" has 1 instance still around.
Class "CellMap" has 1 instance still around.
Class "vtkAssemblyPaths" has 1 instance still around.
Class "vtkSelection" has 1 instance still around.
Class "vtkSelectionNode" has 1 instance still around.
Class "vtkInformationDoubleValue" has 1 instance still around.
Class "class vtkBuffer<int>" has 1 instance still around.
Class "vtkIntArray" has 1 instance still around.
```
Code to produce
```py
selector = vtk.vtkOpenGLHardwareSelector()
selector.SetFieldAssociation(vtk.vtkDataObject.FIELD_ASSOCIATION_CELLS)
selector.SetRenderer(renderer_())
selector.SetArea(x0, y0, x1, y1)
selection = selector.Select()
```
Issue resolved with:
```
selection.UnRegister(selection)
```
Seems that when selection goes out of scope in Python it's not unregistered.https://gitlab.kitware.com/vtk/vtk/-/issues/18074No python39 wheels available2021-07-02T05:43:10-04:00Daniel ScheiermannNo python39 wheels availableOn archlinux the current python version is 3.9.
I want to use vtk in a python package and it should be also available for those users.
Sadly there are no wheel build with python3.9.
To make the install process easier I build it myself an...On archlinux the current python version is 3.9.
I want to use vtk in a python package and it should be also available for those users.
Sadly there are no wheel build with python3.9.
To make the install process easier I build it myself and would like to provide the build. I would be happy, if you could add it to PyPI.https://gitlab.kitware.com/vtk/vtk/-/issues/18250Issue when importing vtk2021-07-01T05:16:53-04:00RamisayIssue when importing vtkHi,
I have an issue when trying to read some HDF5 files using vtk,
When I try to import vtk using python : import vtk, it gives me the following error:
```
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-pac...Hi,
I have an issue when trying to read some HDF5 files using vtk,
When I try to import vtk using python : import vtk, it gives me the following error:
```
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/vtkmodules/vtkCommonCore.py", line 5, in <module>
from .vtkCommonCorePython import *
ImportError: libvtkCommonCorePython36D-8.2.so.1: cannot open shared object file: No such file or directory
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.6/site-packages/vtk.py", line 32, in <module>
all_spec.loader.exec_module(all_m)
File "/usr/local/lib/python3.6/site-packages/vtkmodules/all.py", line 7, in <module>
from .vtkCommonCore import *
File "/usr/local/lib/python3.6/site-packages/vtkmodules/vtkCommonCore.py", line 9, in <module>
from vtkCommonCorePython import *
ModuleNotFoundError: No module named 'vtkCommonCorePython'
```
Any help regarding that?
Thank you .https://gitlab.kitware.com/vtk/vtk/-/issues/18248Disable debug leaks in Python wheels2021-06-30T16:34:00-04:00Ben BoeckelDisable debug leaks in Python wheelsReported [on Discourse](https://discourse.vtk.org/t/vtk-9-0-2/6107/2).Reported [on Discourse](https://discourse.vtk.org/t/vtk-9-0-2/6107/2).9.0.3Ben BoeckelBen Boeckelhttps://gitlab.kitware.com/vtk/vtk/-/issues/18244Nearest neighbour interpolation2021-06-28T09:54:24-04:00nfisdnfNearest neighbour interpolationI seem to be getting a linear interpolation output even when trying to use Nearest neighbour.
**Code:**
```
#!/usr/bin/env python3
import vtk
from vtk.util.numpy_support import vtk_to_numpy, numpy_to_vtk
import numpy as np
def vtkToN...I seem to be getting a linear interpolation output even when trying to use Nearest neighbour.
**Code:**
```
#!/usr/bin/env python3
import vtk
from vtk.util.numpy_support import vtk_to_numpy, numpy_to_vtk
import numpy as np
def vtkToNumpy(data):
np_arr = vtk_to_numpy(data.GetPointData().GetScalars())
dims = data.GetDimensions()
numpy_data = np_arr.reshape(dims[2], dims[1], dims[0])
numpy_data = numpy_data.transpose(2, 1,0)
return numpy_data
def numpyToVTK(data):
flat_data_array = data.transpose(2,1,0).flatten()
vtk_data_array = numpy_to_vtk(flat_data_array)
vtk_data = numpy_to_vtk(num_array=vtk_data_array, deep=True, array_type=vtk.VTK_UNSIGNED_CHAR)
img = vtk.vtkImageData()
img.GetPointData().SetScalars(vtk_data)
img.SetDimensions(data.shape)
img.SetOrigin([0, 0, 0])
img.SetSpacing([1, 1, 1])
return img
def main():
img = np.zeros((5, 5, 5), dtype=np.uint16)
img[1:4, 1:4, 1:3] = 5
img[2:4, 2:4, 4:9] = 11
vtkImg = numpyToVTK(img)
resample = vtk.vtkImageResample()
resample.SetInputData(vtkImg)
resample.SetInterpolationModeToNearestNeighbor()
resample.InterpolateOff()
resample.SetBackgroundColor([0, 0, 0, 0])
resample.SetBackgroundLevel(0)
resample.SetOutputSpacing([0.5, 0.5, 0.5])
resample.Update()
resampleNpImg = vtkToNumpy(resample.GetOutput())
print("\nOriginal size", vtkImg.GetDimensions())
print("Original center", vtkImg.GetOrigin())
print("Original spacing", vtkImg.GetSpacing())
print("\nResampled size", resample.GetOutput().GetDimensions())
print("Resampled center", resample.GetOutput().GetCenter())
print("Resampled spacing", resample.GetOutput().GetSpacing())
print("\noriginalImg", np.unique(img), "\n\n", img)
print("\nresampleNpImg", np.unique(resampleNpImg), "\n\n", resampleNpImg)
if __name__ == "__main__":
main()
```
**Output:**
```
Original size (5, 5, 5)
Original center (0.0, 0.0, 0.0)
Original spacing (1.0, 1.0, 1.0)
Resampled size (9, 9, 9)
Resampled center (2.0, 2.0, 2.0)
Resampled spacing (0.5, 0.5, 0.5)
originalImg [ 0 5 11]
[[[ 0 0 0 0 0]
[ 0 0 0 0 0]
[ 0 0 0 0 0]
[ 0 0 0 0 0]
[ 0 0 0 0 0]]
[[ 0 0 0 0 0]
[ 0 5 5 0 0]
[ 0 5 5 0 0]
[ 0 5 5 0 0]
[ 0 0 0 0 0]]
[[ 0 0 0 0 0]
[ 0 5 5 0 0]
[ 0 5 5 0 11]
[ 0 5 5 0 11]
[ 0 0 0 0 0]]
[[ 0 0 0 0 0]
[ 0 5 5 0 0]
[ 0 5 5 0 11]
[ 0 5 5 0 11]
[ 0 0 0 0 0]]
[[ 0 0 0 0 0]
[ 0 0 0 0 0]
[ 0 0 0 0 0]
[ 0 0 0 0 0]
[ 0 0 0 0 0]]]
resampleNpImg [ 0 1 3 5 6 11]
[[[ 0 0 0 0 0 0 0 0 0]
[ 0 0 0 0 0 0 0 0 0]
[ 0 0 0 0 0 0 0 0 0]
[ 0 0 0 0 0 0 0 0 0]
[ 0 0 0 0 0 0 0 0 0]
[ 0 0 0 0 0 0 0 0 0]
[ 0 0 0 0 0 0 0 0 0]
[ 0 0 0 0 0 0 0 0 0]
[ 0 0 0 0 0 0 0 0 0]]
[[ 0 0 0 0 0 0 0 0 0]
[ 0 1 1 1 1 1 0 0 0]
[ 0 1 3 3 3 1 0 0 0]
[ 0 1 3 3 3 1 0 0 0]
[ 0 1 3 3 3 1 0 0 0]
[ 0 1 3 3 3 1 0 0 0]
[ 0 1 3 3 3 1 0 0 0]
[ 0 1 1 1 1 1 0 0 0]
[ 0 0 0 0 0 0 0 0 0]]
[[ 0 0 0 0 0 0 0 0 0]
[ 0 1 3 3 3 1 0 0 0]
[ 0 3 5 5 5 3 0 0 0]
[ 0 3 5 5 5 3 0 0 0]
[ 0 3 5 5 5 3 0 0 0]
[ 0 3 5 5 5 3 0 0 0]
[ 0 3 5 5 5 3 0 0 0]
[ 0 1 3 3 3 1 0 0 0]
[ 0 0 0 0 0 0 0 0 0]]
[[ 0 0 0 0 0 0 0 0 0]
[ 0 1 3 3 3 1 0 0 0]
[ 0 3 5 5 5 3 0 0 0]
[ 0 3 5 5 5 3 0 1 3]
[ 0 3 5 5 5 3 0 3 6]
[ 0 3 5 5 5 3 0 3 6]
[ 0 3 5 5 5 3 0 3 6]
[ 0 1 3 3 3 1 0 1 3]
[ 0 0 0 0 0 0 0 0 0]]
[[ 0 0 0 0 0 0 0 0 0]
[ 0 1 3 3 3 1 0 0 0]
[ 0 3 5 5 5 3 0 0 0]
[ 0 3 5 5 5 3 0 3 6]
[ 0 3 5 5 5 3 0 6 11]
[ 0 3 5 5 5 3 0 6 11]
[ 0 3 5 5 5 3 0 6 11]
[ 0 1 3 3 3 1 0 3 6]
[ 0 0 0 0 0 0 0 0 0]]
[[ 0 0 0 0 0 0 0 0 0]
[ 0 1 3 3 3 1 0 0 0]
[ 0 3 5 5 5 3 0 0 0]
[ 0 3 5 5 5 3 0 3 6]
[ 0 3 5 5 5 3 0 6 11]
[ 0 3 5 5 5 3 0 6 11]
[ 0 3 5 5 5 3 0 6 11]
[ 0 1 3 3 3 1 0 3 6]
[ 0 0 0 0 0 0 0 0 0]]
[[ 0 0 0 0 0 0 0 0 0]
[ 0 1 3 3 3 1 0 0 0]
[ 0 3 5 5 5 3 0 0 0]
[ 0 3 5 5 5 3 0 3 6]
[ 0 3 5 5 5 3 0 6 11]
[ 0 3 5 5 5 3 0 6 11]
[ 0 3 5 5 5 3 0 6 11]
[ 0 1 3 3 3 1 0 3 6]
[ 0 0 0 0 0 0 0 0 0]]
[[ 0 0 0 0 0 0 0 0 0]
[ 0 1 1 1 1 1 0 0 0]
[ 0 1 3 3 3 1 0 0 0]
[ 0 1 3 3 3 1 0 1 3]
[ 0 1 3 3 3 1 0 3 6]
[ 0 1 3 3 3 1 0 3 6]
[ 0 1 3 3 3 1 0 3 6]
[ 0 1 1 1 1 1 0 1 3]
[ 0 0 0 0 0 0 0 0 0]]
[[ 0 0 0 0 0 0 0 0 0]
[ 0 0 0 0 0 0 0 0 0]
[ 0 0 0 0 0 0 0 0 0]
[ 0 0 0 0 0 0 0 0 0]
[ 0 0 0 0 0 0 0 0 0]
[ 0 0 0 0 0 0 0 0 0]
[ 0 0 0 0 0 0 0 0 0]
[ 0 0 0 0 0 0 0 0 0]
[ 0 0 0 0 0 0 0 0 0]]]
```
The output should only contain *5*s and *11*s with Nearest neighbour method. Tried using *InterpolateOff* too, but same result. Are there any other flags I need to set to get an output with only *[5, 11]*?https://gitlab.kitware.com/vtk/vtk/-/issues/18245VTK_DATA_ROOT hard coded to source directory in VTK9 ??2021-06-28T05:12:30-04:00beewVTK_DATA_ROOT hard coded to source directory in VTK9 ??I am wondering if there is a way to transfer the Exerternal data in the build directory to the install directory. In vtk8 I could just copy over the ExternalData folder, but in vtk9 the SHA/MD5 files are no longer in objects but in the f...I am wondering if there is a way to transfer the Exerternal data in the build directory to the install directory. In vtk8 I could just copy over the ExternalData folder, but in vtk9 the SHA/MD5 files are no longer in objects but in the file .ExternalData, moreover, its location seems to be hardcoded to src_directory/.ExteternalData so all the links in build_directory/ExternalData/testing are broken if source directory are deleted.
I tried to change the ExternalData_OBJECT_STORES paths in VTKData_config.cmake to relative paths or the absolute path to the install directory but make just ignores them. Moving SHA from .ExternalData to build_directort/ExternalData/objects also doesn't help. make just ignores them.
Is there a way to change this? This seems very strange that you have to keep the source and build directory after make install and keeping all the junks in there.
OS is Ubuntu Linuxhttps://gitlab.kitware.com/vtk/vtk/-/issues/18243Keep the scene horizontal2021-06-24T04:51:50-04:00Ali ZAKARIAali.zakaria@outlook.comKeep the scene horizontalHello,
I am using vtkInteractorStyleTrackballCamera, and I want to always keep the scene horizontal and avoid situations where the scene tilts:
![image](/uploads/695b12528d38a84d4db5ce266dd5ee1b/image.png)
Is there a simple way to ach...Hello,
I am using vtkInteractorStyleTrackballCamera, and I want to always keep the scene horizontal and avoid situations where the scene tilts:
![image](/uploads/695b12528d38a84d4db5ce266dd5ee1b/image.png)
Is there a simple way to achieve that please ?