@kitware/vtk.js 34.15.2 → 34.15.3
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/CONTRIBUTING.md +12 -5
- package/IO/Geometry/IFCImporter.js +29 -35
- package/package.json +1 -1
package/CONTRIBUTING.md
CHANGED
|
@@ -33,7 +33,7 @@ Please follow the coding style:
|
|
|
33
33
|
$ git checkout -b new_feature
|
|
34
34
|
```
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
6. Start hacking. Additional information on how to create class/test/example can be found
|
|
37
37
|
[here](https://kitware.github.io/vtk-js/docs/) in the __Development__ section.
|
|
38
38
|
|
|
39
39
|
```sh
|
|
@@ -41,19 +41,26 @@ Please follow the coding style:
|
|
|
41
41
|
$ git add file1 file2 file3
|
|
42
42
|
```
|
|
43
43
|
|
|
44
|
-
|
|
44
|
+
7. Verify you have correctly formatted code, and that all tests pass:
|
|
45
|
+
|
|
46
|
+
```sh
|
|
47
|
+
$ npm run reformat
|
|
48
|
+
$ npm run test
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
8. Use Commitizen to create commits
|
|
45
52
|
|
|
46
53
|
```sh
|
|
47
54
|
$ npm run commit
|
|
48
55
|
```
|
|
49
56
|
|
|
50
|
-
|
|
57
|
+
9. Push commits in your feature branch to your fork in GitHub:
|
|
51
58
|
|
|
52
59
|
```sh
|
|
53
60
|
$ git push origin new_feature
|
|
54
61
|
```
|
|
55
62
|
|
|
56
|
-
|
|
63
|
+
10. Visit your fork in Github, browse to the "**Pull Requests**" link on the left, and use the
|
|
57
64
|
"**New Pull Request**" button in the upper right to create a Pull Request.
|
|
58
65
|
|
|
59
66
|
For more information see:
|
|
@@ -62,7 +69,7 @@ Please follow the coding style:
|
|
|
62
69
|
If committing changes to `vtk.js@next` or `vtk.js@next-major`, then set your base branch to be `next`
|
|
63
70
|
or `next-major`, respectively. For more info see the section on release channels below.
|
|
64
71
|
|
|
65
|
-
|
|
72
|
+
11. vtk.js uses GitHub for code review and Github Actions to validate proposed patches before they are merged.
|
|
66
73
|
|
|
67
74
|
## Release Channels
|
|
68
75
|
|
|
@@ -40,13 +40,13 @@ function vtkIFCImporter(publicAPI, model) {
|
|
|
40
40
|
const cells = vtkCellArray.newInstance();
|
|
41
41
|
const pointValues = new Float32Array(vertices.length / 2);
|
|
42
42
|
const normalsArray = new Float32Array(vertices.length / 2);
|
|
43
|
-
for (let i = 0; i < vertices.length;
|
|
44
|
-
pointValues[
|
|
45
|
-
pointValues[
|
|
46
|
-
pointValues[
|
|
47
|
-
normalsArray[
|
|
48
|
-
normalsArray[
|
|
49
|
-
normalsArray[
|
|
43
|
+
for (let i = 0, p = 0; i < vertices.length; p += 3) {
|
|
44
|
+
pointValues[p] = vertices[i++];
|
|
45
|
+
pointValues[p + 1] = vertices[i++];
|
|
46
|
+
pointValues[p + 2] = vertices[i++];
|
|
47
|
+
normalsArray[p] = vertices[i++];
|
|
48
|
+
normalsArray[p + 1] = vertices[i++];
|
|
49
|
+
normalsArray[p + 2] = vertices[i++];
|
|
50
50
|
}
|
|
51
51
|
const nCells = indices.length;
|
|
52
52
|
cells.resize(3 * nCells / 3);
|
|
@@ -82,36 +82,30 @@ function vtkIFCImporter(publicAPI, model) {
|
|
|
82
82
|
const normalsArray = new Float32Array(vertices.length / 2);
|
|
83
83
|
const colorArray = new Float32Array(vertices.length / 2);
|
|
84
84
|
if (userMatrix) {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
normalsArray[i / 2] = normal[0];
|
|
96
|
-
normalsArray[i / 2 + 1] = normal[1];
|
|
97
|
-
normalsArray[i / 2 + 2] = normal[2];
|
|
98
|
-
const colorIndex = i / 2;
|
|
99
|
-
colorArray[colorIndex] = color.x;
|
|
100
|
-
colorArray[colorIndex + 1] = color.y;
|
|
101
|
-
colorArray[colorIndex + 2] = color.z;
|
|
85
|
+
for (let i = 0, p = 0; i < vertices.length; p += 3) {
|
|
86
|
+
pointValues[p] = vertices[i++];
|
|
87
|
+
pointValues[p + 1] = vertices[i++];
|
|
88
|
+
pointValues[p + 2] = vertices[i++];
|
|
89
|
+
normalsArray[p] = vertices[i++];
|
|
90
|
+
normalsArray[p + 1] = vertices[i++];
|
|
91
|
+
normalsArray[p + 2] = vertices[i++];
|
|
92
|
+
colorArray[p] = color.x;
|
|
93
|
+
colorArray[p + 1] = color.y;
|
|
94
|
+
colorArray[p + 2] = color.z;
|
|
102
95
|
}
|
|
96
|
+
vtkMatrixBuilder.buildFromRadian().setMatrix(userMatrix).apply(pointValues);
|
|
97
|
+
vtkMatrixBuilder.buildFromRadian().multiply3x3(mat3.fromMat4(mat3.create(), userMatrix)).apply(normalsArray);
|
|
103
98
|
} else {
|
|
104
|
-
for (let i = 0; i < vertices.length;
|
|
105
|
-
pointValues[
|
|
106
|
-
pointValues[
|
|
107
|
-
pointValues[
|
|
108
|
-
normalsArray[
|
|
109
|
-
normalsArray[
|
|
110
|
-
normalsArray[
|
|
111
|
-
|
|
112
|
-
colorArray[
|
|
113
|
-
colorArray[
|
|
114
|
-
colorArray[colorIndex + 2] = color.z;
|
|
99
|
+
for (let i = 0, p = 0; i < vertices.length; p += 3) {
|
|
100
|
+
pointValues[p] = vertices[i++];
|
|
101
|
+
pointValues[p + 1] = vertices[i++];
|
|
102
|
+
pointValues[p + 2] = vertices[i++];
|
|
103
|
+
normalsArray[p] = vertices[i++];
|
|
104
|
+
normalsArray[p + 1] = vertices[i++];
|
|
105
|
+
normalsArray[p + 2] = vertices[i++];
|
|
106
|
+
colorArray[p] = color.x;
|
|
107
|
+
colorArray[p + 1] = color.y;
|
|
108
|
+
colorArray[p + 2] = color.z;
|
|
115
109
|
}
|
|
116
110
|
}
|
|
117
111
|
const nCells = indices.length;
|