Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 13 additions & 10 deletions Sources/Common/DataModel/IncrementalOctreePointLocator/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,14 @@
return [pntIdx, dist2];
};

publicAPI.findClosestPointInSphere = (point, radius2, maskNode, refDist2) => {
publicAPI.findClosestPointInSphere = (
point,
radius2,
maskNode,
minDist2,
refDist2
) => {
let pointIndx = -1;
let minDist2 = Number.MAX_VALUE;

const nodesBase = [];
nodesBase.push(model.octreeRootNode);
Expand Down Expand Up @@ -112,7 +117,7 @@
);

if (tempDist2 < minDist2) {
minDist2 = tempDist2;

Check warning on line 120 in Sources/Common/DataModel/IncrementalOctreePointLocator/index.js

View workflow job for this annotation

GitHub Actions / Check and lint PR

eslint(no-param-reassign)

Assignment to function parameter 'minDist2'.

Check warning on line 120 in Sources/Common/DataModel/IncrementalOctreePointLocator/index.js

View workflow job for this annotation

GitHub Actions / ubuntu-24.04 / node 22 / chromium

eslint(no-param-reassign)

Assignment to function parameter 'minDist2'.

Check warning on line 120 in Sources/Common/DataModel/IncrementalOctreePointLocator/index.js

View workflow job for this annotation

GitHub Actions / ubuntu-24.04 / node 22 / firefox

eslint(no-param-reassign)

Assignment to function parameter 'minDist2'.
pointIndx = tempPntId;
}
}
Expand Down Expand Up @@ -346,8 +351,7 @@
publicAPI.isInsertedPointForNonZeroTolerance = (x) => {
// minDist2 // min distance to ALL existing points
// elseDst2 // min distance to other nodes (inner boundaries)
let dist2Ext; // min distance to an EXTended set of nodes
let pntIdExt;

Check warning on line 354 in Sources/Common/DataModel/IncrementalOctreePointLocator/index.js

View workflow job for this annotation

GitHub Actions / Check and lint PR

eslint(no-unused-vars)

Variable 'pntIdExt' is declared but never used.

Check warning on line 354 in Sources/Common/DataModel/IncrementalOctreePointLocator/index.js

View workflow job for this annotation

GitHub Actions / ubuntu-24.04 / node 22 / chromium

eslint(no-unused-vars)

Variable 'pntIdExt' is declared but never used.

Check warning on line 354 in Sources/Common/DataModel/IncrementalOctreePointLocator/index.js

View workflow job for this annotation

GitHub Actions / ubuntu-24.04 / node 22 / firefox

eslint(no-unused-vars)

Variable 'pntIdExt' is declared but never used.

// the target leaf node always exists there since the root node of the
// octree has been initialized to cover all possible points to be inserted
Expand All @@ -371,13 +375,12 @@

if (elseDst2 < model.insertTolerance2) {
// one or multiple closer points might exist in the neighboring nodes
// TODO: dist2Ext
pntIdExt = publicAPI.findClosestPointInSphereWithTolerance(
x,
model.insertTolerance2,
leafContainer,
dist2Ext
);
const [pntIdExt, dist2Ext] =
publicAPI.findClosestPointInSphereWithTolerance(
x,
model.insertTolerance2,
leafContainer
);

if (dist2Ext < minDist2) {
minDist2 = dist2Ext;
Expand Down
13 changes: 6 additions & 7 deletions Sources/Common/DataModel/Triangle/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -483,12 +483,11 @@ function vtkTriangle(publicAPI, model) {
}
outObj.evaluation = 1;
} else {
let t;
if (closestPoint) {
if (weights[1] < 0.0 && weights[2] < 0.0) {
dist2Point = vtkMath.distance2BetweenPoints(x, pt3);
dist2Line1 = vtkLine.distanceToLine(x, pt1, pt3, t, closestPoint1);
dist2Line2 = vtkLine.distanceToLine(x, pt3, pt2, t, closestPoint2);
dist2Line1 = vtkLine.distanceToLine(x, pt1, pt3, closestPoint1);
dist2Line2 = vtkLine.distanceToLine(x, pt3, pt2, closestPoint2);
if (dist2Point < dist2Line1) {
outObj.dist2 = dist2Point;
closest = pt3;
Expand All @@ -505,8 +504,8 @@ function vtkTriangle(publicAPI, model) {
}
} else if (weights[2] < 0.0 && weights[0] < 0.0) {
dist2Point = vtkMath.distance2BetweenPoints(x, pt1);
dist2Line1 = vtkLine.distanceToLine(x, pt1, pt3, t, closestPoint1);
dist2Line2 = vtkLine.distanceToLine(x, pt1, pt2, t, closestPoint2);
dist2Line1 = vtkLine.distanceToLine(x, pt1, pt3, closestPoint1);
dist2Line2 = vtkLine.distanceToLine(x, pt1, pt2, closestPoint2);
if (dist2Point < dist2Line1) {
outObj.dist2 = dist2Point;
closest = pt1;
Expand All @@ -523,8 +522,8 @@ function vtkTriangle(publicAPI, model) {
}
} else if (weights[1] < 0.0 && weights[0] < 0.0) {
dist2Point = vtkMath.distance2BetweenPoints(x, pt2);
dist2Line1 = vtkLine.distanceToLine(x, pt2, pt3, t, closestPoint1);
dist2Line2 = vtkLine.distanceToLine(x, pt1, pt2, t, closestPoint2);
dist2Line1 = vtkLine.distanceToLine(x, pt2, pt3, closestPoint1);
dist2Line2 = vtkLine.distanceToLine(x, pt1, pt2, closestPoint2);
if (dist2Point < dist2Line1) {
outObj.dist2 = dist2Point;
closest = pt2;
Expand Down
6 changes: 3 additions & 3 deletions Sources/Filters/General/ClipClosedSurface/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ function vtkClipClosedSurface(publicAPI, model) {
/**
* Take three colors as doubles, and convert to unsigned char.
*
* @param {Number} color1
* @param {Number} color2
* @param {Number} color3
* @param {Number[3]} color1
* @param {Number[3]} color2
* @param {Number[3]} color3
* @param {Number[3][3]} colors
*/
function createColorValues(color1, color2, color3, colors) {
Expand Down
4 changes: 2 additions & 2 deletions Sources/Filters/General/ContourTriangulator/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -1822,8 +1822,8 @@ export function vtkCCSFindCuts(
points.getPoint(outerPoly[k], q1);
points.getPoint(innerPoly[j], q2);

let u;
let v;
let u = [];
let v = [];
if (
vtkLine.intersection(p1, p2, q1, q2, u, v) ===
vtkLine.IntersectionState.YES_INTERSECTION
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import * as vtkMath from 'vtk.js/Sources/Common/Core/Math';

import WebworkerPromise from 'webworker-promise';

// eslint-disable-next-line import/no-unresolved, import/default
import ComputeHistogramWorker from './ComputeHistogram.worker';

/* eslint-disable no-continue */
Expand Down
1 change: 0 additions & 1 deletion Sources/Rendering/OpenGL/CellArrayBufferObject/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { vec3 } from 'gl-matrix';

import macro from 'vtk.js/Sources/macros';
import vtkBufferObject from 'vtk.js/Sources/Rendering/OpenGL/BufferObject';
import vtkCellArray from 'vtk.js/Sources/Common/Core/CellArray';
import { ObjectType } from 'vtk.js/Sources/Rendering/OpenGL/BufferObject/Constants';
import { Representation } from 'vtk.js/Sources/Rendering/Core/Property/Constants';
import {
Expand Down
2 changes: 1 addition & 1 deletion Sources/Rendering/OpenGL/Texture/supportsNorm16Linear.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ function supportsNorm16Linear() {
}

return r === g && g === b && r !== 0;
} catch (e) {
} catch {
return false;
}
}
Expand Down