NetVtk 9.7.1.1
Prefix ReservedSee the version list below for details.
dotnet add package NetVtk --version 9.7.1.1
NuGet\Install-Package NetVtk -Version 9.7.1.1
<PackageReference Include="NetVtk" Version="9.7.1.1" />
<PackageVersion Include="NetVtk" Version="9.7.1.1" />
<PackageReference Include="NetVtk" />
paket add NetVtk --version 9.7.1.1
#r "nuget: NetVtk, 9.7.1.1"
#:package NetVtk@9.7.1.1
#addin nuget:?package=NetVtk&version=9.7.1.1
#tool nuget:?package=NetVtk&version=9.7.1.1
NetVtk
C# bindings for the Visualization Toolkit (VTK) 9.7.1, generated from VTK's headers: VTK's class names, its pipelines as in C++, and IntelliSense shows VTK's documentation.
dotnet add package NetVtk
One AnyCPU package for .NET Framework 3.5 and 4.5+, .NET 6, 8 and 10, and netstandard2.0, with the natives for Windows (x64, x86), Linux (x64) and macOS (arm64). A .NET Framework app gets its architecture's natives in x86\ or x64\; <NetVtkModules>Common;Filters;Rendering</NetVtkModules> ships only those of the libraries an app uses.
using Vtk;
using var cone = new vtkConeSource();
cone.SetResolution(32);
cone.Update();
using var output = cone.GetOutput();
double[] bounds = output.GetBounds();
- Objects:
new vtkConeSource()calls VTK'sNew(). A proxy holds one reference to its object;Dispose(or the garbage collector) releases it. Rendering objects release OpenGL resources when they go: dispose them on the thread that renders, or setVtkFinalizer.Contextto itsSynchronizationContext. - Arrays:
vtkDoubleArray.FromArray(values, 3),ToArray(),CopyFrom(values); on .NET 6+AsSpan()is the array's memory, no copy.ToDoubleArray()converts anyvtkDataArray. - Observers:
AddObserver(vtkCommand_EventIds.ModifiedEvent, (sender, e) => ...),Observe(...)until disposed, or the eventsModifiedEvent,ErrorEvent,WarningEventand an algorithm'sStartEvent,ProgressEvent,EndEvent. A subclass ofvtkCommandworks too. An exception a handler throws comes out of the call that triggered the event, as theInnerExceptionof aVtkException. - Messages:
VtkOutput.Message += (_, e) => ...receives VTK's errors and warnings, which VTK would otherwise show in a window of its own (Windows) or on the console. - Native interop:
NativePointeris thevtkObjectBase*;vtkObjectBase.FromNativePointer<T>(pointer)makes a proxy for one. The SWIG interface files are in the package'sswig/folder.
Documentation
- Guide: pipelines, data, results, rendering and hosting, observers; every example compiles against the package in CI.
- From C++ to C#: how VTK's signatures look in C#, so VTK's own documentation and examples apply.
- Class index: every type, linked to VTK's reference.
- Source and demos, changes.
License
NetVtk is MIT licensed. The IntelliSense documentation holds the doc comments of VTK's headers, and the runtime packages hold VTK's libraries and those it builds in: VTK is BSD-3-Clause. NOTICE, VTK-LICENSE.txt and each runtime package's THIRD-PARTY-NOTICES.txt have the details.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net35 is compatible. net40 was computed. net403 was computed. net45 is compatible. net451 was computed. net452 is compatible. net46 was computed. net461 was computed. net462 is compatible. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETFramework 3.5
- NetVtk.runtime.linux-x64 (>= 9.7.1.1)
- NetVtk.runtime.osx-arm64 (>= 9.7.1.1)
- NetVtk.runtime.win-x64 (>= 9.7.1.1)
- NetVtk.runtime.win-x86 (>= 9.7.1.1)
-
.NETFramework 4.5
- NetVtk.runtime.linux-x64 (>= 9.7.1.1)
- NetVtk.runtime.osx-arm64 (>= 9.7.1.1)
- NetVtk.runtime.win-x64 (>= 9.7.1.1)
- NetVtk.runtime.win-x86 (>= 9.7.1.1)
-
.NETFramework 4.5.2
- NetVtk.runtime.linux-x64 (>= 9.7.1.1)
- NetVtk.runtime.osx-arm64 (>= 9.7.1.1)
- NetVtk.runtime.win-x64 (>= 9.7.1.1)
- NetVtk.runtime.win-x86 (>= 9.7.1.1)
-
.NETFramework 4.6.2
- NetVtk.runtime.linux-x64 (>= 9.7.1.1)
- NetVtk.runtime.osx-arm64 (>= 9.7.1.1)
- NetVtk.runtime.win-x64 (>= 9.7.1.1)
- NetVtk.runtime.win-x86 (>= 9.7.1.1)
-
.NETStandard 2.0
- NetVtk.runtime.linux-x64 (>= 9.7.1.1)
- NetVtk.runtime.osx-arm64 (>= 9.7.1.1)
- NetVtk.runtime.win-x64 (>= 9.7.1.1)
- NetVtk.runtime.win-x86 (>= 9.7.1.1)
-
net10.0
- NetVtk.runtime.linux-x64 (>= 9.7.1.1)
- NetVtk.runtime.osx-arm64 (>= 9.7.1.1)
- NetVtk.runtime.win-x64 (>= 9.7.1.1)
- NetVtk.runtime.win-x86 (>= 9.7.1.1)
-
net6.0
- NetVtk.runtime.linux-x64 (>= 9.7.1.1)
- NetVtk.runtime.osx-arm64 (>= 9.7.1.1)
- NetVtk.runtime.win-x64 (>= 9.7.1.1)
- NetVtk.runtime.win-x86 (>= 9.7.1.1)
-
net8.0
- NetVtk.runtime.linux-x64 (>= 9.7.1.1)
- NetVtk.runtime.osx-arm64 (>= 9.7.1.1)
- NetVtk.runtime.win-x64 (>= 9.7.1.1)
- NetVtk.runtime.win-x86 (>= 9.7.1.1)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on NetVtk:
| Package | Downloads |
|---|---|
|
NetOcc.Vtk
OCCT shapes in VTK scenes: C# bindings for Open CASCADE Technology's TKIVtk (IVtk, IVtkOCC, IVtkVTK, IVtkTools) on NetOcc and NetVtk. IVtkTools_ShapeDataSource feeds a shape into VTK pipelines, IVtkTools_ShapePicker picks its sub-shapes. For .NET Framework 3.5+, .NET 6+ and netstandard2.0, on Windows (x64, x86), Linux (x64) and macOS (arm64). |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 9.7.2.1-next.1 | 50 | 11/27/2026 |
| 9.7.1.1 | 183 | 11/25/2026 |
| 9.7.1.1-next.5 | 57 | 11/24/2026 |
| 9.7.1.1-next.4 | 208 | 10/28/2026 |
| 9.7.1.1-next.3 | 137 | 10/22/2026 |
| 9.7.1.1-next.2 | 95 | 10/22/2026 |
| 9.7.1.1-next.1 | 133 | 10/13/2026 |
### Added
- NetVtk: C# bindings for VTK 9.7.1, generated from VTK's headers: 25 modules (data model, execution model, core, general, geometry, modeling and source filters, legacy, XML and Exodus II readers and writers, a CGNS reader, OpenGL rendering, volume rendering, annotation, interaction), VTK's names in the namespace Vtk, natives for win-x64, win-x86, linux-x64 and osx-arm64, .NET Framework 3.5+, .NET 6+ and netstandard2.0. Typed arrays copy in bulk (FromArray, ToArray, CopyFrom, AsSpan); C# handlers and events observe VTK's events; VtkOutput takes VTK's messages; native pointers in both directions; VTK's documentation comments in IntelliSense; the SWIG interface files ship in swig/, with NetVtkInterop.i for other SWIG bindings.
- Reverse Z: `vtkRenderWindow.SetUseReverseZ` gives a window 32-bit float depth from 1 at the near plane to 0 at the far one, as precise far away as near, so the near plane can come close to the eye in a large scene. It needs OpenGL 4.5 or ARB_clip_control (without, as on macOS's OpenGL 4.1, the window turns it off and warns); `DisplayToWorld` follows it. What handles depth itself follows it too: impostor spheres and tubes, the sphere and stick mappers, 2-D actors and labels, depth peeling, OIT, SSAO, EDL, pickers, widgets and the volume mappers.
- A pointer VTK hands back through a parameter its size hint names is a `ref` C# array of as many elements as the hint's count holds after the call, where it was a `ref IntPtr`: `vtkCellArray.GetCellAtId(id, ref size, ref points)`, `vtkHexahedron.GetFacePoints(face, ref points)`. A pointer parameter such a hint names is a C# array, setters' too (`vtkGraph.SetEdgePoints`).
- `std::vector` parameters and returns are C# arrays, copied both ways: numbers, bools, strings, structs, value classes and VTK objects (by pointer or `vtkSmartPointer`). A parameter C++ writes back, by non-const reference or pointer, is a `ref` array that comes back filled (`vtkUniforms.GetUniform`).
- More fields of VTK's value classes are properties: C arrays and `std::array`s (C# arrays of their length), vectors, structs, value classes and `vtkSmartPointer`s to read and write; C strings, pointers to other classes and other addresses to read. Vectors of value classes are written too.
- The public fields of VTK's value classes are properties: numbers, enums and strings to read and write, VTK objects and vectors of value classes to read. `vtkHardwareSelector_PixelInformation` tells what a pixel shows after `CaptureBuffers`, and `vtkRenderTimerLog_Frame.Events` gives a window's GPU times.
- `Vtk.VtkBuild.Current` names the VTK build NetVtk's natives carry (`9.7.1#2`: VTK's version and the port-version that counts NetVtk's patches), which the port also writes into VTK's headers (`vtkNetVtkBuild.h`). A binding on NetVtk compiles it in with NetVtkInterop.i's `%netvtk_build` and checks it with `VtkBuild.Require` when it loads.
- Windows' render windows, `vtkWin32OpenGLRenderWindow` and `vtkWin32OpenGLDXRenderWindow`. The DX window renders into a texture an application's Direct3D 11 device shares (`SetD3DDeviceContext`, `Lock`/`Unlock` around a render, `BlitToTexture`); several work in one thread, a disposed one lets go of the Direct3D device, and one on a driver without `WGL_NV_DX_interop` reports an error where it would share. Their library, NetVtkWin32, is in the Windows runtime packages only.
- Each runtime package carries sbom/sbom.cdx.json, a CycloneDX SBOM with the data fields of BSI TR-03183-2: every file of the package with its SHA-512, under NetVtk, VTK or the library VTK builds in that it belongs to, each with its creator, version, license and its texts, copyright and source, for an application's own SBOM, where NuGet lists the package alone.
- `NetVtkModules` names the NetVtk libraries an app uses by their modules (`Common;Filters;Rendering`): the build copies those libraries, NetVtkRuntime and the VTK libraries these load only, on .NET Framework and .NET; Common and Rendering take 56 of the 84 files on win-x64 and 55 of the 83 on osx-arm64. Each runtime package lists what its natives load, read from the files at pack time, and keeps what `NetVtkRequiredNative` items name, a binding's natives' imports, with all they load.
### Changed
- On macOS, the NetVtk libraries and VTK's load only the libraries they use, as on Windows and Linux: each NetVtk library loaded 79 of NetVtk.runtime.osx-arm64's 83 files, NetVtkCommon now loads 17 and NetVtkRendering 54.
- A .NET Framework app gets the natives of the architecture it runs as only: `x86\` for PlatformTarget x86 or an AnyCPU exe with Prefer32Bit, `x64\` for x64, the RuntimeIdentifier's without a PlatformTarget, both for AnyCPU; so do the natives a referenced AnyCPU library hands on. With a RuntimeIdentifier, NuGet's second copy of the natives next to the app is left out, which Windows searched first for every library the process loads.
### Fixed
- A hardware selection (`vtkHardwareSelector`) in a multisampled window no longer re-creates the window's render framebuffer twice: a capture is over twice as fast, memory no longer grows with every capture, and a `vtkWin32OpenGLDXRenderWindow` sharing that framebuffer goes on delivering frames.
- A render window, interactor style or widget representation made before any other rendering class gets OpenGL's implementations from VTK's object factory on .NET: such a window had no GPU timer, and a `vtkBoxRepresentation`'s handles drew nothing.
- win-x86: actors show where they are. MSVC's x86 code at /O2 computed `vtkActor`'s bounds wrong (and those of volumes, image slices and assemblies), so VTK culled actors whose bounds weren't symmetric about the origin and reset cameras off the scene; VTK's x86 build is /O2 /Os now.
- NetVtkInterop.i's `%netvtk_build` writes `#include <vtkNetVtkBuild.h>` into the binding's C++, where it wrote `%#include`, which no compiler takes.
- On macOS, a render timer's `FrameReady()` before its window's first render no longer crashes the process: VTK asked OpenGL for its vendor without a context (the VTK port's patch 0006).