@kitware/vtk.js 31.0.3 → 31.0.5

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.
@@ -36,9 +36,12 @@ function begin(splitMode) {
36
36
 
37
37
  function faceMap(str) {
38
38
  const idxs = str.split('/').map(i => Number(i));
39
- const vertexIdx = idxs[0] - 1;
40
- const textCoordIdx = idxs[1] ? idxs[1] - 1 : vertexIdx;
41
- const vertexNormal = idxs[2] ? idxs[2] - 1 : vertexIdx;
39
+ let vertexIdx = idxs[0] - 1;
40
+ vertexIdx = vertexIdx < 0 ? vertexIdx + 1 + data.v.length / 3 : vertexIdx;
41
+ let textCoordIdx = idxs[1] ? idxs[1] - 1 : vertexIdx;
42
+ textCoordIdx = textCoordIdx < 0 ? textCoordIdx + 1 + data.vt.length / 2 : textCoordIdx;
43
+ let vertexNormal = idxs[2] ? idxs[2] - 1 : vertexIdx;
44
+ vertexNormal = vertexNormal < 0 ? vertexNormal + 1 + data.vn.length / 3 : vertexNormal;
42
45
  return [vertexIdx, textCoordIdx, vertexNormal];
43
46
  }
44
47
 
@@ -342,7 +342,7 @@ function vtkMapper(publicAPI, model) {
342
342
  return true;
343
343
  };
344
344
  publicAPI.canUseTextureMapForColoring = (scalars, cellFlag) => {
345
- if (cellFlag) {
345
+ if (cellFlag && !(model.colorMode === ColorMode.DIRECT_SCALARS)) {
346
346
  return true; // cell data always use textures.
347
347
  }
348
348
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kitware/vtk.js",
3
- "version": "31.0.3",
3
+ "version": "31.0.5",
4
4
  "description": "Visualization Toolkit for the Web",
5
5
  "keywords": [
6
6
  "3d",