@kitware/vtk.js 28.11.0 → 28.11.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -17,19 +17,20 @@ const {
17
17
  // Modified to accept type arrays
18
18
  function fastComputeRange(arr, offset, numberOfComponents) {
19
19
  const len = arr.length;
20
- let min;
21
- let max;
20
+ let min = Number.MAX_VALUE;
21
+ let max = -Number.MAX_VALUE;
22
22
  let x;
23
23
  let i;
24
- if (len === 0) {
25
- return {
26
- min: Number.MAX_VALUE,
27
- max: -Number.MAX_VALUE
28
- };
29
- }
30
- min = arr[offset];
31
- max = min;
24
+
25
+ // find first non-NaN value
32
26
  for (i = offset; i < len; i += numberOfComponents) {
27
+ if (!Number.isNaN(arr[i])) {
28
+ min = arr[i];
29
+ max = min;
30
+ break;
31
+ }
32
+ }
33
+ for (; i < len; i += numberOfComponents) {
33
34
  x = arr[i];
34
35
  if (x < min) {
35
36
  min = x;
package/README.md CHANGED
@@ -35,7 +35,7 @@ vtk.js aims to be a subset of VTK and provide 3D rendering using WebGL (+WebGPU)
35
35
  VTK.js is a complete rewrite of VTK/C++ using plain JavaScript (ES6).
36
36
  The focus of the rewrite, so far, has been the rendering pipeline for ImageData and PolyData, the pipeline infrastructure, and frequently used readers (obj, stl, vtp, vti). Some filters are also provided as demonstrations. We are not aiming for vtk.js to provide the same set of filters that is available in VTK/C++, but vtk.js does provide the infrastructure needed to define pipelines and filters.
37
37
 
38
- We have also started to explore a path where you can compile some bits of VTK/C++ into WebAssembly and to enable them to interact with vtk.js. With such interaction, you can pick and choose what you need to extract from VTK and enable it inside your web application. VTK/C++ WebAssembly can even be used for rendering, and examples can be found in [VTK repository](https://github.com/Kitware/VTK/tree/master/Examples/Emscripten/Cxx). Additionally [itk.js](https://insightsoftwareconsortium.github.io/itk-js/index.html) (which is ITK via WebAssembly) also provides proven implementations for several image filters and data readers. There are, however, some additional costs in terms of the size of the WebAssembly file that will have to be downloaded when visiting a VTK or ITK WebAssembly webpage; and we still have some work to do to streamline the vtk.js + VTK WebAssembly integrations.
38
+ We have also started to explore a path where you can compile some bits of VTK/C++ into WebAssembly and to enable them to interact with vtk.js. With such interaction, you can pick and choose what you need to extract from VTK and enable it inside your web application. VTK/C++ WebAssembly can even be used for rendering, and examples can be found in [VTK repository](https://github.com/Kitware/VTK/tree/master/Examples/Emscripten/Cxx). Additionally [itk-wasm](https://github.com/InsightSoftwareConsortium/itk-wasm) (which is ITK via WebAssembly) also provides proven implementations for several image filters and data readers. There are, however, some additional costs in terms of the size of the WebAssembly file that will have to be downloaded when visiting a VTK or ITK WebAssembly webpage; and we still have some work to do to streamline the vtk.js + VTK WebAssembly integrations.
39
39
 
40
40
  In general if you want to stay in the pure JavaScript land, then vtk.js is perhaps the ideal solution for you. We welcome your feedback, including your contributions for new visualization filters, bug fixes, and examples.
41
41
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kitware/vtk.js",
3
- "version": "28.11.0",
3
+ "version": "28.11.1",
4
4
  "description": "Visualization Toolkit for the Web",
5
5
  "keywords": [
6
6
  "3d",