@kitware/vtk.js 31.0.4 → 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.
- package/IO/Misc/OBJReader.js +6 -3
- package/package.json +1 -1
package/IO/Misc/OBJReader.js
CHANGED
|
@@ -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
|
-
|
|
40
|
-
|
|
41
|
-
|
|
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
|
|