VTK issueshttps://gitlab.kitware.com/vtk/vtk/-/issues2020-10-10T17:49:55-04:00https://gitlab.kitware.com/vtk/vtk/-/issues/18024ImageWarp: Warnings in VTK regarding number of points != zero2020-10-10T17:49:55-04:00Andrew MacleanImageWarp: Warnings in VTK regarding number of points != zeroI have been modernising/updating the vtk examples and this example seems to be highlighting an inconsistency in VTK:
- [ImageWarp](https://ajpmaclean.github.io/web-test/site/Cxx/Images/ImageWarp/)
I remember many years ago translatin...I have been modernising/updating the vtk examples and this example seems to be highlighting an inconsistency in VTK:
- [ImageWarp](https://ajpmaclean.github.io/web-test/site/Cxx/Images/ImageWarp/)
I remember many years ago translating this from the original TCL example, however it hasn’t been tested for at least three years.
Whilst an image is produced, lots of warnings like this are issued:
``` text
2020-10-09 08:09:30.569 ( 0.616s) [ ] vtkMergeFilter.cxx:389 WARN| vtkMergeFilter (000001DE2221EE10): Scalars for cell data cannot be merged because the number of cells in the input geometry do not match the number of cell scalars 65025 != 0
2020-10-09 08:09:30.709 ( 0.756s) [ ] vtkMergeFilter.cxx:400 WARN| vtkMergeFilter (000001DE2221EE10): Vectors for point data cannot be merged because the number of points in the input geometry do not match the number of point vectors 65536 != 0
```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/18020vtkPlotEdges is not available in VTK2020-10-31T12:46:19-04:00Phil ChiuvtkPlotEdges is not available in VTKThis is the same as #12378, an ancient issue which was closed by bot.
Original description is below.
> The vtkPlotEdges class is not available via the VTK libraries, but only through ParaView itself (currently located at /ParaView-3.10...This is the same as #12378, an ancient issue which was closed by bot.
Original description is below.
> The vtkPlotEdges class is not available via the VTK libraries, but only through ParaView itself (currently located at /ParaView-3.10.1/Servers/Filters). It would be very useful if this class, and any other that is currently ParaView only, could be added to the VTK distribution, so it/they can be used outwith of ParaView.
And some discussion here:
https://public.kitware.com/pipermail/paraview/2011-July/022252.html
Is it still this easy? I understand this issue lies somewhere in between ParaView and VTK development.https://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/18013Update third-party packages2020-09-25T11:27:55-04:00Cory Quammencory.quammen@kitware.comUpdate third-party packagesFind which third-party packages need to be updated and update them.Find which third-party packages need to be updated and update them.https://gitlab.kitware.com/vtk/vtk/-/issues/18012Python: Unable to set background when using vtkGraphLayoutView2020-09-23T18:06:18-04:00Andrew MacleanPython: Unable to set background when using vtkGraphLayoutViewIf you look at: https://ajpmaclean.github.io/web-test/site/Cxx/Graphs/VisualizeGraph/ it is easy to set the background and window title.
If you add:
``` python
graphLayoutView.GetRenderer().SetBackground(colors.GetColor3d('SaddleBrow...If you look at: https://ajpmaclean.github.io/web-test/site/Cxx/Graphs/VisualizeGraph/ it is easy to set the background and window title.
If you add:
``` python
graphLayoutView.GetRenderer().SetBackground(colors.GetColor3d('SaddleBrown').GetData())
graphLayoutView.GetRenderer().SetBackground2(colors.GetColor3d('Wheat').GetData())
graphLayoutView.GetRenderWindow().SetWindowName('VisualizeGraph')
```
after line 18 in https://ajpmaclean.github.io/web-test/site/Python/Graphs/VisualizeGraph/ this error message is returned: `TypeError: SetBackground argument %Id: %V`.
As a side issue this code in VTKExamples has never been updated or run since 2017 when Bill created the site! I am going through the whole VTK examples site modernising the code, fixing bugs and improving some of the images!https://gitlab.kitware.com/vtk/vtk/-/issues/18011Feature request support for <g> group name tag for OBJImporter2020-09-22T07:34:51-04:00Kane BorgFeature request support for <g> group name tag for OBJImporterI have posted this [related issue](https://stackoverflow.com/q/63827487/11016602) in stackoverflow, as the <g> group name tag is a useful reference to access for ifc (Building Standard) conversions to obj. Since the group gets a persiste...I have posted this [related issue](https://stackoverflow.com/q/63827487/11016602) in stackoverflow, as the <g> group name tag is a useful reference to access for ifc (Building Standard) conversions to obj. Since the group gets a persistent GUID that can be re-referenced.
An alternative or a parallel feature to aid ifc usability of vtk's features is to handle the "name" tag in a glb file eg; "name":"3rPX_Juz59peXXY6wDJl18", but I am unsure if this handle is already possible. If it is already implemented, I would appreciate some direction on how to access it.
Both OBJ formats and GTLF formats are created using [IfcConvert](http://ifcopenshell.org/ifcconvert)
OBJ to test
[AC20-FZK-Haus_guids.mtl](/uploads/8e70b29f123fde280561966770428aa1/AC20-FZK-Haus_guids.mtl)
[AC20-FZK-Haus_guids.obj](/uploads/931fd845169a9849db98f7e9155540f8/AC20-FZK-Haus_guids.obj)
GLB to test
[AC20-FZK-Haus.glb](/uploads/d0f283d5499dae882e36d133e7463dab/AC20-FZK-Haus.glb)https://gitlab.kitware.com/vtk/vtk/-/issues/18010Confusing doc in vtkExtractBlock.h2020-09-21T03:25:15-04:00Yasushi SaitoConfusing doc in vtkExtractBlock.hhttps://gitlab.kitware.com/edf/vtk/-/blob/c716c151eb77b5dc1e9c1ae975052f6b073f067b/Filters/Extraction/vtkExtractBlock.h#L45
The doc first says preorder traversal, but it then says inorder traversal. I think preorder is the correct answe...https://gitlab.kitware.com/edf/vtk/-/blob/c716c151eb77b5dc1e9c1ae975052f6b073f067b/Filters/Extraction/vtkExtractBlock.h#L45
The doc first says preorder traversal, but it then says inorder traversal. I think preorder is the correct answer. There are a couple more places in the VTK codebase that mention inorder (e.g., vtkXMLMultiBlockDataReader.h). I suspect they are all preorder.https://gitlab.kitware.com/vtk/vtk/-/issues/18009vtkDIYDataExchanger: compatibility with other data types2020-09-22T08:38:05-04:00Gonzalo SáezvtkDIYDataExchanger: compatibility with other data typesHi everyone,
The function `vtkDIYDataExchanger::AllToAll` is very useful as it significantly eases data communication between MPI processes as it implements `MPI_AllToAllv` with very easy to use interface (it automatically computes the ...Hi everyone,
The function `vtkDIYDataExchanger::AllToAll` is very useful as it significantly eases data communication between MPI processes as it implements `MPI_AllToAllv` with very easy to use interface (it automatically computes the `recvCounts` array).
However, it lacks support for datatypes different from `vtkDataSet`, I suppose that this is due to issues with the serialization process of other classes. This issue can be seen in the filter `vtkOverlappingCellsDetector` which has some DIY boilerplate code to exchange Bounding Boxes between MPI processors which could be avoided if one adds support for other datatypes to `vtkDIYDataExchanger::AllToAll`.
I have tried to rewrite the same function `vtkDIYDataExchanger::AllToAll` for other objects such as `vtkDataArray` but I quickly run into errors.
I am willing to add support through MR for datatypes different from `vtkDataSet` to `vtkDIYDataExchanger::AllToAll`, however I would appreciate if anyone could give me any insight if the current serialization capabilities of VTK and DIY allow to do so?
Thank youhttps://gitlab.kitware.com/vtk/vtk/-/issues/18008Configuring with invalid value associated with VTK_BUILD_TESTING option incor...2020-09-16T16:44:09-04:00Jean-Christophe Fillion-RobinConfiguring with invalid value associated with VTK_BUILD_TESTING option incorrectly reports ENABLE_TESTSError message below should reported that argument for option `VTK_BUILD_TESTING` are incorrect and not option `ENABLE_TESTS`
Observed with https://gitlab.kitware.com/vtk/vtk/-/commit/a1625689667d769135ab71c2291c3fca672ad776
```
cmake -...Error message below should reported that argument for option `VTK_BUILD_TESTING` are incorrect and not option `ENABLE_TESTS`
Observed with https://gitlab.kitware.com/vtk/vtk/-/commit/a1625689667d769135ab71c2291c3fca672ad776
```
cmake -DVTK_BUILD_TESTING:STRING=YES .
CMake Error at CMake/vtkModule.cmake:563 (message):
The `ENABLE_TESTS` argument must be one of `ON`, `OFF`, `WANT`, or
`DEFAULT`. Received `YES`.
Call Stack (most recent call first):
CMakeLists.txt:270 (vtk_module_scan)
```https://gitlab.kitware.com/vtk/vtk/-/issues/18002numpy_interface.dataset_adapter vtkPolydata issue: getting vtkLine cells2020-09-11T04:34:13-04:00bisteknumpy_interface.dataset_adapter vtkPolydata issue: getting vtkLine cellsHello,
it appears that getting cells in vtkPolydata with `cells = dsa.WrapDataObject(self).Polygons` is limited to vtkPolygon cells (including e.g. vtkTriangle cells). However vtkPolydata can also be used to represent polylines composed...Hello,
it appears that getting cells in vtkPolydata with `cells = dsa.WrapDataObject(self).Polygons` is limited to vtkPolygon cells (including e.g. vtkTriangle cells). However vtkPolydata can also be used to represent polylines composed of vtkLine cells, but in this case the `Polygons` method returns a void array.
This is a problem in some application!
Thanks very much!https://gitlab.kitware.com/vtk/vtk/-/issues/18001Logging leaks to other parts (vtk9.0.1)2020-09-10T04:03:17-04:00JensgwLogging leaks to other parts (vtk9.0.1)It is possible to redirect VTK output to a file, using e.g.:
```
/** Redirect VTK log to a file */
output = new vtkFileOutputWindow();
output.SetFileName(currentFilePath);
vtkOutputWindow outputWindow = new vtkOutputWindow();
outputWin...It is possible to redirect VTK output to a file, using e.g.:
```
/** Redirect VTK log to a file */
output = new vtkFileOutputWindow();
output.SetFileName(currentFilePath);
vtkOutputWindow outputWindow = new vtkOutputWindow();
outputWindow.SetInstance(output);
outputWindow.Delete();
```
This worked fine with VTK-8.2. However sinc VTK-9 the redirected messages also appear on the console (windows) or
end up in the .xsessions-error (linux). A sample message looks like this:
`2020-09-04 15:30:32.611 ( 116.523s) [ 28E36700]vtkDemandDrivenPipeline:668 ERR| vtkCompositeDataPipeline (0x7f91a5cb32e0): Input port 0 of algorithm `
To be clear, I am not talkign about the message itself, I am talking about the redirection "leaking" to other parts.https://gitlab.kitware.com/vtk/vtk/-/issues/17999VTK 9.0.1 error C2679 in vtkDataReader.cxx when compiling with Visual Studio ...2020-09-11T09:30:52-04:00Andreas-SchniertshauerVTK 9.0.1 error C2679 in vtkDataReader.cxx when compiling with Visual Studio 2019 16.7.2VTK\IO\Legacy\vtkDataReader.cxx(292,22): error C2679: binary '>>': no operator found which takes a right-hand operand of type 'char []' (or there is no acceptable conversion)VTK\IO\Legacy\vtkDataReader.cxx(292,22): error C2679: binary '>>': no operator found which takes a right-hand operand of type 'char []' (or there is no acceptable conversion)https://gitlab.kitware.com/vtk/vtk/-/issues/17997Unable to allocate memory in vtkGenericDataArray.txx when loading large .vtp ...2020-09-03T15:40:25-04:00Ming JinUnable to allocate memory in vtkGenericDataArray.txx when loading large .vtp file, after compiling with EmscriptenHi,
This is sort of a follow-up question to Issue #17995 (also relevant: [https://github.com/Kitware/vtk-js/issues/1562](https://github.com/Kitware/vtk-js/issues/1562)).
I have a large .vtp file that I'm trying to load in a frontend w...Hi,
This is sort of a follow-up question to Issue #17995 (also relevant: [https://github.com/Kitware/vtk-js/issues/1562](https://github.com/Kitware/vtk-js/issues/1562)).
I have a large .vtp file that I'm trying to load in a frontend with javascript, and I am trying to use VTK/C++ as a WebAssembly component.
Here's some example code that I have been experimenting with to load and render the .vtp file using WebGL:
```
#include "vtkXMLPolyDataReader.h"
#include "vtkSmartPointer.h"
#include "vtkPolyDataMapper.h"
#include "vtkActor.h"
#include "vtkRenderer.h"
#include "vtkSDL2OpenGLRenderWindow.h"
#include "vtkSDL2RenderWindowInteractor.h"
int main ( int argc, char *argv[] )
{
using namespace std;
string filename = "./example.vtp";
// Read all the data from the file
vtkSmartPointer<vtkXMLPolyDataReader> reader =
vtkSmartPointer<vtkXMLPolyDataReader>::New();
reader->SetFileName(filename.c_str());
reader->Update();
// Visualize
vtkSmartPointer<vtkPolyDataMapper> mapper =
vtkSmartPointer<vtkPolyDataMapper>::New();
mapper->SetInputConnection(reader->GetOutputPort());
vtkSmartPointer<vtkActor> actor =
vtkSmartPointer<vtkActor>::New();
actor->SetMapper(mapper);
vtkSmartPointer<vtkRenderer> renderer =
vtkSmartPointer<vtkRenderer>::New();
vtkSmartPointer<vtkSDL2OpenGLRenderWindow> renderWindow =
vtkSmartPointer<vtkSDL2OpenGLRenderWindow>::New();
renderWindow->AddRenderer(renderer);
vtkSmartPointer<vtkSDL2RenderWindowInteractor> renderWindowInteractor =
vtkSmartPointer<vtkSDL2RenderWindowInteractor>::New();
renderWindowInteractor->SetRenderWindow(renderWindow);
renderer->AddActor(actor);
renderer->SetBackground(.3, .6, .3); // Background color green
renderWindow->Render();
renderWindowInteractor->Start();
return EXIT_SUCCESS;
}
```
I have managed to package/preload example.vtp (~6 million grids, over 500MB), and am getting the following errors (on Firefox 80.0:
```
ERROR: In /work/src/Common/Core/vtkGenericDataArray.txx, line 389 ReadPolyData.js:2270:16
vtkFloatArray (0x58b768): Unable to allocate 155551200 elements of size 4 bytes. ReadPolyData.js:2270:16
<empty string> ReadPolyData.js:2270:16
exception thrown: 5814304 ReadPolyData.js:13325:10
Uncaught 5814304 ReadPolyData.js:13329:5
```
On Chrome, it's slightly different:
```
ReadPolyData.js:2270 ERROR: In /work/src/Common/Core/vtkGenericDataArray.txx, line 389
put_char @ ReadPolyData.js:2270
ReadPolyData.js:2270 vtkLongLongArray (0x58c728): Unable to allocate 155551200 elements of size 8 bytes.
put_char @ ReadPolyData.js:2270
ReadPolyData.js:2270
put_char @ ReadPolyData.js:2270
ReadPolyData.js:13325 exception thrown: 5819304
callMain @ ReadPolyData.js:13325
ReadPolyData.js:223 Uncaught 5819304
```
And the error is at this line in the C++ code:
```
reader->Update();
```
It appears that the error is not on the WebGL part yet, and already vtkXMLPolyDataReader is having trouble loading the poly data.
I tried to dig through the source code in vtkXMLPolyDataReader. As I am not very familiar with VTK, especially for IO/model loading, I can't quite figure out this error. Could you shed some light on how the IO works here? How does `vtkAlgorithm::Update()` lead to the conversion into vtkDataArray types? What is the workflow like?
Thanks!https://gitlab.kitware.com/vtk/vtk/-/issues/17996VTK-9.0.1 crashes on code that was fine with VTK-8.22024-01-14T22:59:36-05:00JensgwVTK-9.0.1 crashes on code that was fine with VTK-8.2Hi there,
some code regarding polydata filtering worked perfectly fine with VTK-8.2 but since the update to VTK-9.0.1 vtk crashes in some specific cases. What data do you need to track this down?
Cheers Jens
Error msg on Linux:
```
#...Hi there,
some code regarding polydata filtering worked perfectly fine with VTK-8.2 but since the update to VTK-9.0.1 vtk crashes in some specific cases. What data do you need to track this down?
Cheers Jens
Error msg on Linux:
```
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007ff27a828623, pid=2829, tid=2874
#
# JRE version: OpenJDK Runtime Environment GraalVM CE 20.2.0 (11.0.8+10) (build 11.0.8+10-jvmci-20.2-b03)
# Java VM: OpenJDK 64-Bit Server VM GraalVM CE 20.2.0 (11.0.8+10-jvmci-20.2-b03, mixed mode, sharing, tiered, jvmci, jvmci compiler, compressed oops, g1 gc, linux-amd64)
# Problematic frame:
# C [libvtkCommonDataModel.so+0x2cf623] vtkPolyData::InsertNextCell(int, int, long long const*)+0x103
```https://gitlab.kitware.com/vtk/vtk/-/issues/17993vtkBalloonWidget.SetTimerDuration() is broken in Java2020-08-31T08:21:49-04:00Petr MatoušekvtkBalloonWidget.SetTimerDuration() is broken in JavaIt is not possible to adjust the timer duration for the vtkBalloonWidget in an application using Java wrapper. Calling
vtkBalloonWidget.SetTimerDuration(delay)
has no effect. Regardless the value of the delay, the balloon info is shown...It is not possible to adjust the timer duration for the vtkBalloonWidget in an application using Java wrapper. Calling
vtkBalloonWidget.SetTimerDuration(delay)
has no effect. Regardless the value of the delay, the balloon info is shown immediately after the mouse moves above the prop having the balloon assigned.
I think that this behavior is caused by the vtkCanvas implementation that uses javax.swing.Timer to invoke private inner DelayAction that invokes TimerEvent on the associated renderer interactor. This leads to vtkHoverWidget::HoverAction which causes balloon info to show up before the original vtkHoverWidget timer expires.
To see an example have a look at https://gitlab.kitware.com/snippets/2301
The timer duration is set to 500ms but balloon info show up immediately after the mouse is above the prop. Try to uncomment the throw statement in the timer() method (line 96) and explore the stack trace of the thrown exception. It is clear that the timer event the widget receives comes from the vtkCanvas code.https://gitlab.kitware.com/vtk/vtk/-/issues/17991Rendering degenerate triangle strips can cause a crash2020-08-28T11:09:33-04:00David ThompsonRendering degenerate triangle strips can cause a crashSome of a customer's polydatas end up with a single point and a triangle strip. Polydata with 1 point will pass the first test in `vtkCompositeMapperHelper2::AppendOneBufferObject`, which returns if `poly->GetNumberOfPoints()` is 0. A po...Some of a customer's polydatas end up with a single point and a triangle strip. Polydata with 1 point will pass the first test in `vtkCompositeMapperHelper2::AppendOneBufferObject`, which returns if `poly->GetNumberOfPoints()` is 0. A polydata can then squeeze through to `vtkOpenGLIndexBufferObject::AppendStripIndexBuffer` and underflow the calculation of `triCount`.
```c++
vtkSmartPointer<vtkPolyData> poly = vtkSmartPointer<vtkPolyData>::New();
vtkSmartPointer<vtkCellArray> triangleStrips = vtkSmartPointer<vtkCellArray>::New();
vtkSmartPointer<vtkPoints> points = vtkSmartPointer<vtkPoints>::New();
vtkSmartPointer<vtkTriangleStrip> strip = vtkSmartPointer<vtkTriangleStrip>::New();
points->InsertNextPoint(0.0, 0.0, 0.0);
strip->GetPointIds()->InsertId(0, 0);
triangleStrips->InsertNextCell(strip);
poly->SetPoints(points);
poly->SetStrips(triangleStrips);
vtkSmartPointer<vtkXMLPolyDataWriter> writer = vtkSmartPointer<vtkXMLPolyDataWriter>::New();
writer->SetInputData(poly);
writer->SetFileName("/your/path/to/bad_poly.vtp");
writer->Write();
```
fyi: @chart3388https://gitlab.kitware.com/vtk/vtk/-/issues/17990VTK Polyhedron contour is incoherent with other cell type2022-12-05T07:38:08-05:00Mathieu Westphal (Kitware)VTK Polyhedron contour is incoherent with other cell typeContouring a polyhedron on its edge has not the samebehavior as with other celltype.
- run ParaView
- Open [polyhedral-sliceY0-holes-2.vtu](/uploads/fc4768594a4964edccaeb04d19a050c4/polyhedral-sliceY0-holes-2.vtu)
- Slice in Y == 0
- Th...Contouring a polyhedron on its edge has not the samebehavior as with other celltype.
- run ParaView
- Open [polyhedral-sliceY0-holes-2.vtu](/uploads/fc4768594a4964edccaeb04d19a050c4/polyhedral-sliceY0-holes-2.vtu)
- Slice in Y == 0
- There are holes
- Tetrahedralize the dataset
- Slice in Y == 0
- No holes
![image](/uploads/49010c972b2902f404c726308657129b/image.png)
<details><summary>Original issue, now fixed </summary>
Consider this dataset : [poly.vtu](/uploads/cdd054be2b0d98243400ac5d2fcff49d/poly.vtu), slicing it on the top or on the bottom is different with or without a tetrahedralize.
Step to reproduce (with ParaView) :
* Open ParaView
* Open poly.vtu, Apply
* Add a slice filter, Y axis, Y coord: 5, Apply
* No slice is produced
* Y coord: -5, Apply,
* Slice is produced
* Remove slice
* Add Tetrahedralize
* Add a slice filter, Y axis, Y coord: 5, Apply
* Slice is produced
* Y coord: -5, Apply,
* no slice is produced
So the results are inverted when using a polyhedron. This can case holes when slicing through datasets containings mixed cell types including polyhedrons, eg : [threecells.vtu](/uploads/3f6906a217f790466bb19ae88a380e1c/threecells.vtu).
Slicing on Y==0 will produce an empty slice when it clearly should have at least produce half a slice.
![image](/uploads/dbd6f312dfc33ae3ad6fef048bba030e/image.png)
</details>https://gitlab.kitware.com/vtk/vtk/-/issues/17988Cannot run WebAssembly examples with rendering2020-08-26T17:41:38-04:00Ming JinCannot run WebAssembly examples with renderingHi, I have been following the instructions for buidling WebAssembly examples:
https://gitlab.kitware.com/vtk/vtk/-/tree/master/Examples/Emscripten/Cxx
Everything compiles fine, but when I try to run the examples (e.g. Cone) in the w...Hi, I have been following the instructions for buidling WebAssembly examples:
https://gitlab.kitware.com/vtk/vtk/-/tree/master/Examples/Emscripten/Cxx
Everything compiles fine, but when I try to run the examples (e.g. Cone) in the webserver, nothing is rendered, and I get the following error messages in Firefox:
```
Error: WebGL warning: <SetDimensions>: Failed to create WebGL context: WebGL creation failed:
* tryNativeGL
* Exhausted GL driver options. Cone.js:6305:20
ERROR: In /work/src/Rendering/OpenGL2/vtkSDL2OpenGLRenderWindow.cxx, line 276 Cone.js:2217:13
vtkSDL2OpenGLRenderWindow (0x579ab0): Unable to create SDL2 opengl context Cone.js:2217:13
Cone.js:2217:13
TypeError: GLctx is undefined
Cone.js:8140:22
exception thrown: TypeError: GLctx is undefined,emscriptenWebGLGet@http://localhost:8000/Cone/Cone.js:8140:22
_glGetIntegerv@http://localhost:8000/Cone/Cone.js:10804:7
__ZN21vtkTextureUnitManager10InitializeEv@http://localhost:8000/Cone/Cone.wasm:wasm-function[2555]:0x968a7
__ZN14vtkOpenGLState10InitializeEP21vtkOpenGLRenderWindow@http://localhost:8000/Cone/Cone.wasm:wasm-function[1980]:0x71ffa
__ZN21vtkOpenGLRenderWindow15OpenGLInitStateEv@http://localhost:8000/Cone/Cone.wasm:wasm-function[1673]:0x640ab
__ZN21vtkOpenGLRenderWindow10OpenGLInitEv@http://localhost:8000/Cone/Cone.wasm:wasm-function[1672]:0x6407a
__ZN25vtkSDL2OpenGLRenderWindow10InitializeEv@http://localhost:8000/Cone/Cone.wasm:wasm-function[2605]:0x977ad
__ZN21vtkOpenGLRenderWindow5StartEv@http://localhost:8000/Cone/Cone.wasm:wasm-function[1612]:0x617bb
__ZN29vtkSDL2RenderWindowInteractor10InitializeEv@http://localhost:8000/Cone/Cone.wasm:wasm-function[2945]:0xab9ba
__ZN15vtkRenderWindow6RenderEv@http://localhost:8000/Cone/Cone.wasm:wasm-function[3484]:0xd5f1b
__ZN21vtkOpenGLRenderWindow6RenderEv@http://localhost:8000/Cone/Cone.wasm:wasm-function[1594]:0x60fdc
_main@http://localhost:8000/Cone/Cone.wasm:wasm-function[491]:0x12b0d
vtkApp/Module._main@http://localhost:8000/Cone/Cone.js:12258:33
callMain@http://localhost:8000/Cone/Cone.js:13216:15
doRun@http://localhost:8000/Cone/Cone.js:13277:23
run@http://localhost:8000/Cone/Cone.js:13292:5
runCaller@http://localhost:8000/Cone/Cone.js:13193:19
removeRunDependency@http://localhost:8000/Cone/Cone.js:1488:7
receiveInstance@http://localhost:8000/Cone/Cone.js:1611:5
receiveInstantiatedSource@http://localhost:8000/Cone/Cone.js:1622:5
```
Slightly different error message in Chrome, but also complaining about being "Unable to create SDL2 opengl context":
```
Cone.js:2217 ERROR: In /work/src/Rendering/OpenGL2/vtkSDL2OpenGLRenderWindow.cxx, line 276
put_char @ Cone.js:2217
write @ Cone.js:2150
write @ Cone.js:3487
doWritev @ Cone.js:4299
_fd_write @ Cone.js:4652
___wasi_fd_write @ Cone.js:4661
___stdio_write @ Cone.wasm:0x3b3b74
___fwritex @ Cone.wasm:0x3b6507
_fwrite @ Cone.wasm:0x3ba220
__ZNSt3__211__stdoutbufIcE6xsputnEPKcl @ Cone.wasm:0x3d1882
__ZNSt3__216__pad_and_outputIcNS_11char_traitsIcEEEENS_19ostreambuf_iteratorIT_T0_EES6_PKS4_S8_S8_RNS_8ios_baseES4_ @ Cone.wasm:0x14121
__ZNSt3__224__put_character_sequenceIcNS_11char_traitsIcEEEERNS_13basic_ostreamIT_T0_EES7_PKS4_m @ Cone.wasm:0x13f80
__ZN15vtkOutputWindow11DisplayTextEPKc @ Cone.wasm:0x2f4023
__ZN15vtkOutputWindow16DisplayErrorTextEPKc @ Cone.wasm:0x2f413f
__Z31vtkOutputWindowDisplayErrorTextPKciS0_P9vtkObject @ Cone.wasm:0x2f44fa
__ZN25vtkSDL2OpenGLRenderWindow10InitializeEv @ Cone.wasm:0x9778b
__ZN21vtkOpenGLRenderWindow5StartEv @ Cone.wasm:0x617bb
__ZN29vtkSDL2RenderWindowInteractor10InitializeEv @ Cone.wasm:0xab9ba
__ZN15vtkRenderWindow6RenderEv @ Cone.wasm:0xd5f1b
__ZN21vtkOpenGLRenderWindow6RenderEv @ Cone.wasm:0x60fdc
_main @ Cone.wasm:0x12b0d
Module._main @ Cone.js:12258
callMain @ Cone.js:13216
doRun @ Cone.js:13277
run @ Cone.js:13292
runCaller @ Cone.js:13193
removeRunDependency @ Cone.js:1488
receiveInstance @ Cone.js:1611
receiveInstantiatedSource @ Cone.js:1622
Promise.then (async)
(anonymous) @ Cone.js:1643
Promise.then (async)
instantiateAsync @ Cone.js:1641
createWasm @ Cone.js:1668
(anonymous) @ Cone.js:12126
(anonymous) @ (index):29
Cone.js:2217 vtkSDL2OpenGLRenderWindow (0x579ab0): Unable to create SDL2 opengl context
put_char @ Cone.js:2217
write @ Cone.js:2150
write @ Cone.js:3487
doWritev @ Cone.js:4299
_fd_write @ Cone.js:4652
___wasi_fd_write @ Cone.js:4661
___stdio_write @ Cone.wasm:0x3b3b74
___fwritex @ Cone.wasm:0x3b6507
_fwrite @ Cone.wasm:0x3ba220
__ZNSt3__211__stdoutbufIcE6xsputnEPKcl @ Cone.wasm:0x3d1882
__ZNSt3__216__pad_and_outputIcNS_11char_traitsIcEEEENS_19ostreambuf_iteratorIT_T0_EES6_PKS4_S8_S8_RNS_8ios_baseES4_ @ Cone.wasm:0x14121
__ZNSt3__224__put_character_sequenceIcNS_11char_traitsIcEEEERNS_13basic_ostreamIT_T0_EES7_PKS4_m @ Cone.wasm:0x13f80
__ZN15vtkOutputWindow11DisplayTextEPKc @ Cone.wasm:0x2f4023
__ZN15vtkOutputWindow16DisplayErrorTextEPKc @ Cone.wasm:0x2f413f
__Z31vtkOutputWindowDisplayErrorTextPKciS0_P9vtkObject @ Cone.wasm:0x2f44fa
__ZN25vtkSDL2OpenGLRenderWindow10InitializeEv @ Cone.wasm:0x9778b
__ZN21vtkOpenGLRenderWindow5StartEv @ Cone.wasm:0x617bb
__ZN29vtkSDL2RenderWindowInteractor10InitializeEv @ Cone.wasm:0xab9ba
__ZN15vtkRenderWindow6RenderEv @ Cone.wasm:0xd5f1b
__ZN21vtkOpenGLRenderWindow6RenderEv @ Cone.wasm:0x60fdc
_main @ Cone.wasm:0x12b0d
Module._main @ Cone.js:12258
callMain @ Cone.js:13216
doRun @ Cone.js:13277
run @ Cone.js:13292
runCaller @ Cone.js:13193
removeRunDependency @ Cone.js:1488
receiveInstance @ Cone.js:1611
receiveInstantiatedSource @ Cone.js:1622
Promise.then (async)
(anonymous) @ Cone.js:1643
Promise.then (async)
instantiateAsync @ Cone.js:1641
createWasm @ Cone.js:1668
(anonymous) @ Cone.js:12126
(anonymous) @ (index):29
Cone.js:2217
put_char @ Cone.js:2217
write @ Cone.js:2150
write @ Cone.js:3487
doWritev @ Cone.js:4299
_fd_write @ Cone.js:4652
___wasi_fd_write @ Cone.js:4661
___stdio_write @ Cone.wasm:0x3b3b74
___fwritex @ Cone.wasm:0x3b6507
_fwrite @ Cone.wasm:0x3ba220
__ZNSt3__211__stdoutbufIcE6xsputnEPKcl @ Cone.wasm:0x3d1882
__ZNSt3__216__pad_and_outputIcNS_11char_traitsIcEEEENS_19ostreambuf_iteratorIT_T0_EES6_PKS4_S8_S8_RNS_8ios_baseES4_ @ Cone.wasm:0x14121
__ZNSt3__224__put_character_sequenceIcNS_11char_traitsIcEEEERNS_13basic_ostreamIT_T0_EES7_PKS4_m @ Cone.wasm:0x13f80
__ZN15vtkOutputWindow11DisplayTextEPKc @ Cone.wasm:0x2f4023
__ZN15vtkOutputWindow16DisplayErrorTextEPKc @ Cone.wasm:0x2f413f
__Z31vtkOutputWindowDisplayErrorTextPKciS0_P9vtkObject @ Cone.wasm:0x2f44fa
__ZN25vtkSDL2OpenGLRenderWindow10InitializeEv @ Cone.wasm:0x9778b
__ZN21vtkOpenGLRenderWindow5StartEv @ Cone.wasm:0x617bb
__ZN29vtkSDL2RenderWindowInteractor10InitializeEv @ Cone.wasm:0xab9ba
__ZN15vtkRenderWindow6RenderEv @ Cone.wasm:0xd5f1b
__ZN21vtkOpenGLRenderWindow6RenderEv @ Cone.wasm:0x60fdc
_main @ Cone.wasm:0x12b0d
Module._main @ Cone.js:12258
callMain @ Cone.js:13216
doRun @ Cone.js:13277
run @ Cone.js:13292
runCaller @ Cone.js:13193
removeRunDependency @ Cone.js:1488
receiveInstance @ Cone.js:1611
receiveInstantiatedSource @ Cone.js:1622
Promise.then (async)
(anonymous) @ Cone.js:1643
Promise.then (async)
instantiateAsync @ Cone.js:1641
createWasm @ Cone.js:1668
(anonymous) @ Cone.js:12126
(anonymous) @ (index):29
Cone.js:13238 exception thrown: TypeError: Cannot read property 'getParameter' of undefined,TypeError: Cannot read property 'getParameter' of undefined
at emscriptenWebGLGet (http://localhost:8000/Cone/Cone.js:8140:28)
at _glGetIntegerv (http://localhost:8000/Cone/Cone.js:10804:7)
at __ZN21vtkTextureUnitManager10InitializeEv (http://localhost:8000/Cone/Cone.wasm:wasm-function[2555]:0x968a7)
at __ZN14vtkOpenGLState10InitializeEP21vtkOpenGLRenderWindow (http://localhost:8000/Cone/Cone.wasm:wasm-function[1980]:0x71ffa)
at __ZN21vtkOpenGLRenderWindow15OpenGLInitStateEv (http://localhost:8000/Cone/Cone.wasm:wasm-function[1673]:0x640ab)
at __ZN21vtkOpenGLRenderWindow10OpenGLInitEv (http://localhost:8000/Cone/Cone.wasm:wasm-function[1672]:0x6407a)
at __ZN25vtkSDL2OpenGLRenderWindow10InitializeEv (http://localhost:8000/Cone/Cone.wasm:wasm-function[2605]:0x977ad)
at __ZN21vtkOpenGLRenderWindow5StartEv (http://localhost:8000/Cone/Cone.wasm:wasm-function[1612]:0x617bb)
at __ZN29vtkSDL2RenderWindowInteractor10InitializeEv (http://localhost:8000/Cone/Cone.wasm:wasm-function[2945]:0xab9ba)
at __ZN15vtkRenderWindow6RenderEv (http://localhost:8000/Cone/Cone.wasm:wasm-function[3484]:0xd5f1b)
callMain @ Cone.js:13238
doRun @ Cone.js:13277
run @ Cone.js:13292
runCaller @ Cone.js:13193
removeRunDependency @ Cone.js:1488
receiveInstance @ Cone.js:1611
receiveInstantiatedSource @ Cone.js:1622
Promise.then (async)
(anonymous) @ Cone.js:1643
Promise.then (async)
instantiateAsync @ Cone.js:1641
createWasm @ Cone.js:1668
(anonymous) @ Cone.js:12126
(anonymous) @ (index):29
Cone.js:8140 Uncaught (in promise) TypeError: Cannot read property 'getParameter' of undefined
at emscriptenWebGLGet (Cone.js:8140)
at _glGetIntegerv (Cone.js:10804)
at __ZN21vtkTextureUnitManager10InitializeEv (:8000/Cone/Cone.wasm:wasm-function[2555]:0x968a7)
at __ZN14vtkOpenGLState10InitializeEP21vtkOpenGLRenderWindow (:8000/Cone/Cone.wasm:wasm-function[1980]:0x71ffa)
at __ZN21vtkOpenGLRenderWindow15OpenGLInitStateEv (:8000/Cone/Cone.wasm:wasm-function[1673]:0x640ab)
at __ZN21vtkOpenGLRenderWindow10OpenGLInitEv (:8000/Cone/Cone.wasm:wasm-function[1672]:0x6407a)
at __ZN25vtkSDL2OpenGLRenderWindow10InitializeEv (:8000/Cone/Cone.wasm:wasm-function[2605]:0x977ad)
at __ZN21vtkOpenGLRenderWindow5StartEv (:8000/Cone/Cone.wasm:wasm-function[1612]:0x617bb)
at __ZN29vtkSDL2RenderWindowInteractor10InitializeEv (:8000/Cone/Cone.wasm:wasm-function[2945]:0xab9ba)
at __ZN15vtkRenderWindow6RenderEv (:8000/Cone/Cone.wasm:wasm-function[3484]:0xd5f1b)
```
Are there any known issues with SDL2?
Thanks!https://gitlab.kitware.com/vtk/vtk/-/issues/17985Wrongly using libxml2 APIs can cause DoS2020-08-27T09:44:24-04:00Zero0one1Wrongly using libxml2 APIs can cause DoSHi, developers:
We found a few bugs in the source code(version 10e139ec41).
According to the [libxml2 Documentation](http://www.xmlsoft.org/html/libxml-tree.html) , it's up to the caller to free the returned memory of `xmlNodeGetConten...Hi, developers:
We found a few bugs in the source code(version 10e139ec41).
According to the [libxml2 Documentation](http://www.xmlsoft.org/html/libxml-tree.html) , it's up to the caller to free the returned memory of `xmlNodeGetContent()` with `xmlFree()`. If missing the `xmlFree()`, it might cause a DoS.
This bug results in memory leak. In some cases, the memory consumption might be huge, which may cause the process to corrupt.
There are two places related to this issue.
1. `ThirdParty/libxml2/vtklibxml2/relaxng.c:5306`
```cpp
5283 static xmlRelaxNGDefinePtr
5284 xmlRelaxNGParseNameClass(xmlRelaxNGParserCtxtPtr ctxt, xmlNodePtr node,
5285 xmlRelaxNGDefinePtr def)
...
5305 if (IS_RELAXNG(node, "name")) {
5306 val = xmlNodeGetContent(node);
5307 xmlRelaxNGNormExtSpace(val);
5308 if (xmlValidateNCName(val, 0)) {
...
5318 ret->name = val;
...
5416 return (ret);
5417 }
```
The returned `val` is assigned to `ret->name`, and `ret` is returned by `xmlRelaxNGParseNameClass` function. `xmlRelaxNGParseNameClass` function is called at line 5259, and the returned value is not handled or freed, which causes information leakage.
```cpp
5259 if (xmlRelaxNGParseNameClass(ctxt, child, cur) != NULL) {
```
2. `ThirdParty/libxml2/vtklibxml2/relaxng.c:3597`
```cpp
3536 static xmlRelaxNGDefinePtr
3537 xmlRelaxNGParseValue(xmlRelaxNGParserCtxtPtr ctxt, xmlNodePtr node)
3538 {
...
3596 } else if (def != NULL) {
3597 def->value = xmlNodeGetContent(node);
3598 if (def->value == NULL) {
3599 xmlRngPErr(ctxt, node, XML_RNGP_VALUE_NO_CONTENT,
3600 "Element <value> has no content\n", NULL, NULL);
...
3616 return (def);
3617 }
```
The returned `def->value` of libxml2 API is returned by this function `xmlRelaxNGParseValue`.
Then, `xmlRelaxNGParseValue` is called at line 4985 by function `xmlRelaxNGParsePattern` and `def` is returned.
Next, `xmlRelaxNGParsePattern` is called at line 5569 by function `xmlRelaxNGParsePatterns` and `def` is returned.
Finally, `xmlRelaxNGParsePatterns` is called at line 4646
```cpp
4645 def->content =
4646 xmlRelaxNGParsePatterns(ctxt, node->children, 0);
```
If line 4561 is true, `def` is not handled or freed.
```cpp
4651 if (ctxt->grammar->defs == NULL) {
4652 xmlRngPErr(ctxt, node, XML_RNGP_DEFINE_CREATE_FAILED,
4653 "Could not create definition hash\n", NULL, NULL);
4654 ret = -1;
```