Skip to content

Commit 04ece80

Browse files
authored
Merge pull request #3159 from finetjul/imagereslicemapper-snap-sensitivity
fix(imagereslicemapper): be less sensitive for "snapping" to nearest …
2 parents 7109ada + 68acd11 commit 04ece80

File tree

1 file changed

+5
-1
lines changed
  • Sources/Rendering/OpenGL/ImageResliceMapper

1 file changed

+5
-1
lines changed

Sources/Rendering/OpenGL/ImageResliceMapper/index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1246,14 +1246,18 @@ function vtkOpenGLImageResliceMapper(publicAPI, model) {
12461246
shaders.Fragment = FSSource;
12471247
};
12481248

1249+
/**
1250+
* Returns true if the normal is almost axis aligned.
1251+
* Has a side effect to normalize the vector.
1252+
*/
12491253
function isVectorAxisAligned(n) {
12501254
vtkMath.normalize(n);
12511255
const tmpN = [0, 0, 0];
12521256
for (let i = 0; i < 3; ++i) {
12531257
vec3.zero(tmpN);
12541258
tmpN[i] = 1.0;
12551259
const dotP = vtkMath.dot(n, tmpN);
1256-
if (dotP < -0.999 || dotP > 0.999) {
1260+
if (dotP < -0.999999 || dotP > 0.999999) {
12571261
return [true, i];
12581262
}
12591263
}

0 commit comments

Comments
 (0)