@kitware/vtk.js 34.6.0 → 34.8.0
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/Common/Core/Math/index.js +12 -1
- package/Common/Core/Math.d.ts +24 -18
- package/Common/Core/Math.js +1 -1
- package/Common/DataModel/Polygon.d.ts +13 -0
- package/Common/DataModel/Polygon.js +29 -2
- package/Common/DataModel/Triangle.js +8 -13
- package/Filters/Core/Cutter.js +1 -0
- package/Filters/General/ShrinkPolyData.d.ts +85 -0
- package/Filters/General/ShrinkPolyData.js +317 -0
- package/Filters/General.js +2 -0
- package/Filters/Sources/ArcSource.d.ts +244 -0
- package/Filters/Sources/ArcSource.js +138 -0
- package/Filters/Sources/EllipseArcSource.d.ts +212 -0
- package/Filters/Sources/EllipseArcSource.js +159 -0
- package/Filters/Sources/PlatonicSolidSource/Constants.d.ts +12 -0
- package/Filters/Sources/PlatonicSolidSource/Constants.js +12 -0
- package/Filters/Sources/PlatonicSolidSource.d.ts +109 -0
- package/Filters/Sources/PlatonicSolidSource.js +149 -0
- package/Filters/Sources.js +6 -0
- package/IO/Misc/OBJWriter.d.ts +103 -0
- package/IO/Misc/OBJWriter.js +237 -0
- package/IO/Misc.js +2 -0
- package/Interaction/Style/InteractorStyleManipulator.js +75 -2
- package/Proxy/Representations/GlyphRepresentationProxy.js +3 -0
- package/Rendering/Core/Camera.d.ts +3 -3
- package/Rendering/Core/Camera.js +33 -3
- package/Rendering/Core/ColorTransferFunction/CssFilters.js +1 -1
- package/Rendering/Core/ColorTransferFunction.js +1 -1
- package/Rendering/Core/Coordinate.js +1 -1
- package/Rendering/Core/CubeAxesActor.js +1 -1
- package/Rendering/Core/ImageMapper.js +1 -1
- package/Rendering/Core/Renderer.js +1 -1
- package/Rendering/Core/ScalarBarActor.js +1 -1
- package/Rendering/Core/TextActor.js +1 -1
- package/Rendering/Core/VolumeProperty.js +1 -1
- package/Rendering/OpenGL/PolyDataMapper2D.js +1 -1
- package/Rendering/OpenGL/Texture.js +1 -1
- package/Widgets/Widgets3D/AngleWidget.js +1 -1
- package/Widgets/Widgets3D/ResliceCursorWidget/behavior.js +1 -1
- package/Widgets/Widgets3D/ResliceCursorWidget/helpers.js +1 -1
- package/index.d.ts +6 -0
- package/package.json +1 -1
|
@@ -258,6 +258,16 @@ function normalize(x) {
|
|
|
258
258
|
}
|
|
259
259
|
return den;
|
|
260
260
|
}
|
|
261
|
+
function normalize4D(x) {
|
|
262
|
+
const den = norm(x, 3);
|
|
263
|
+
if (den !== 0.0) {
|
|
264
|
+
x[0] /= den;
|
|
265
|
+
x[1] /= den;
|
|
266
|
+
x[2] /= den;
|
|
267
|
+
x[3] /= den;
|
|
268
|
+
}
|
|
269
|
+
return den;
|
|
270
|
+
}
|
|
261
271
|
function perpendiculars(x, y, z, theta) {
|
|
262
272
|
const x2 = x[0] * x[0];
|
|
263
273
|
const y2 = x[1] * x[1];
|
|
@@ -2171,6 +2181,7 @@ var vtkMath$1 = /*#__PURE__*/Object.freeze({
|
|
|
2171
2181
|
cross: cross,
|
|
2172
2182
|
norm: norm,
|
|
2173
2183
|
normalize: normalize,
|
|
2184
|
+
normalize4D: normalize4D,
|
|
2174
2185
|
perpendiculars: perpendiculars,
|
|
2175
2186
|
projectVector: projectVector,
|
|
2176
2187
|
dot2D: dot2D,
|
|
@@ -2256,4 +2267,4 @@ var vtkMath$1 = /*#__PURE__*/Object.freeze({
|
|
|
2256
2267
|
'default': vtkMath
|
|
2257
2268
|
});
|
|
2258
2269
|
|
|
2259
|
-
export {
|
|
2270
|
+
export { createArray as $, rowsToMat3 as A, degreesFromRadians as B, ldexp as C, xyz2rgb as D, areEquals as E, clampValue as F, arrayRange as G, getMajorAxisIndex as H, createUninitializedBounds as I, normalize4D as J, identity as K, multiplyMatrix as L, floor as M, isInf as N, rgb2hsv as O, rgb2lab as P, lab2rgb as Q, round as R, normalize2D as S, nearestPowerOfTwo as T, multiply3x3_vect3 as U, getSparseOrthogonalMatrix as V, areBoundsInitialized as W, floatRGB2HexCode as X, isPowerOfTwo as Y, angleBetweenVectors as Z, signedAngleBetweenVectors as _, areMatricesEqual as a, isNaN as a$, Pi as a0, ceil as a1, min as a2, max as a3, arrayMin as a4, arrayMax as a5, ceilLog2 as a6, factorial as a7, binomial as a8, beginCombination as a9, quaternionToMatrix3x3 as aA, roundNumber as aB, matrix3x3ToQuaternion as aC, multiplyQuaternion as aD, orthogonalize3x3 as aE, diagonalize3x3 as aF, singularValueDecomposition3x3 as aG, luFactorLinearSystem as aH, luSolveLinearSystem as aI, estimateMatrixCondition as aJ, solveHomogeneousLeastSquares as aK, solveLeastSquares as aL, hex2float as aM, lab2xyz as aN, xyz2lab as aO, rgb2xyz as aP, computeBoundsFromPoints as aQ, clampAndNormalizeValue as aR, getScalarTypeFittingRange as aS, getAdjustedScalarRange as aT, extentIsWithinOtherExtent as aU, boundsIsWithinOtherBounds as aV, pointIsWithinBounds as aW, solve3PointCircle as aX, inf as aY, negInf as aZ, isFinite as a_, nextCombination as aa, randomSeed as ab, getSeed as ac, gaussian as ad, multiplyScalar2D as ae, multiplyAccumulate2D as af, outer as ag, projectVector as ah, dot2D as ai, projectVector2D as aj, gaussianAmplitude as ak, gaussianWeight as al, outer2D as am, norm2D as an, rowsToMat4 as ao, columnsToMat4 as ap, columnsToMat3 as aq, LUFactor3x3 as ar, LUSolve3x3 as as, linearSolve3x3 as at, multiply3x3_mat3 as au, transpose3x3 as av, invert3x3 as aw, identity3x3 as ax, isIdentity as ay, isIdentity3x3 as az, roundVector as b, floatToHex2 as b0, float2CssRGBA as b1, clampVector as c, dot as d, distance2BetweenPoints as e, vtkMath as f, solveLinearSystem as g, hsv2rgb as h, isNan as i, cross as j, add as k, normalize as l, multiplyAccumulate as m, norm as n, determinant2x2 as o, invertMatrix as p, jacobiN as q, radiansFromDegrees as r, subtract as s, perpendiculars as t, uninitializeBounds as u, vtkMath$1 as v, jacobi as w, multiplyScalar as x, random as y, determinant3x3 as z };
|
package/Common/Core/Math.d.ts
CHANGED
|
@@ -203,7 +203,7 @@ export function getSeed(): number;
|
|
|
203
203
|
export function random(minValue: number, maxValue: number): number;
|
|
204
204
|
|
|
205
205
|
/**
|
|
206
|
-
*
|
|
206
|
+
* Add two 3-vectors.
|
|
207
207
|
* @param {Vector3} a The first 3D vector.
|
|
208
208
|
* @param {Vector3} b The second 3D vector.
|
|
209
209
|
* @param {Vector3} out The output 3D vector.
|
|
@@ -215,7 +215,7 @@ export function random(minValue: number, maxValue: number): number;
|
|
|
215
215
|
export function add(a: Vector3, b: Vector3, out: Vector3): Vector3;
|
|
216
216
|
|
|
217
217
|
/**
|
|
218
|
-
*
|
|
218
|
+
* Substract two 3-vectors.
|
|
219
219
|
* @param {Vector3} a The first 3D vector.
|
|
220
220
|
* @param {Vector3} b The second 3D vector.
|
|
221
221
|
* @param {Vector3} out The output 3D vector.
|
|
@@ -227,7 +227,7 @@ export function add(a: Vector3, b: Vector3, out: Vector3): Vector3;
|
|
|
227
227
|
export function subtract(a: Vector3, b: Vector3, out: Vector3): Vector3;
|
|
228
228
|
|
|
229
229
|
/**
|
|
230
|
-
*
|
|
230
|
+
* Multiply a 3-vector by a scalar.
|
|
231
231
|
* @param {Vector3} vec
|
|
232
232
|
* @param {Number} scalar
|
|
233
233
|
* @example
|
|
@@ -238,7 +238,7 @@ export function subtract(a: Vector3, b: Vector3, out: Vector3): Vector3;
|
|
|
238
238
|
export function multiplyScalar(vec: Vector3, scalar: number): Vector3;
|
|
239
239
|
|
|
240
240
|
/**
|
|
241
|
-
*
|
|
241
|
+
* Multiply a 3-vector by a scalar.
|
|
242
242
|
* @param {Vector2} vec
|
|
243
243
|
* @param {Number} scalar
|
|
244
244
|
* @example
|
|
@@ -249,7 +249,7 @@ export function multiplyScalar(vec: Vector3, scalar: number): Vector3;
|
|
|
249
249
|
export function multiplyScalar2D(vec: Vector2, scalar: number): Vector2;
|
|
250
250
|
|
|
251
251
|
/**
|
|
252
|
-
*
|
|
252
|
+
* Multiply two 3-vectors.
|
|
253
253
|
* @param {Vector3} a
|
|
254
254
|
* @param {Vector3} b
|
|
255
255
|
* @param {Number} scalar
|
|
@@ -267,7 +267,7 @@ export function multiplyAccumulate(
|
|
|
267
267
|
): Vector3;
|
|
268
268
|
|
|
269
269
|
/**
|
|
270
|
-
*
|
|
270
|
+
* Multiply two 2-vectors.
|
|
271
271
|
* @param {Vector2} a
|
|
272
272
|
* @param {Vector2} b
|
|
273
273
|
* @param {Number} scalar
|
|
@@ -285,7 +285,7 @@ export function multiplyAccumulate2D(
|
|
|
285
285
|
): Vector2;
|
|
286
286
|
|
|
287
287
|
/**
|
|
288
|
-
*
|
|
288
|
+
* Dot product of two 3-vectors.
|
|
289
289
|
* @param {Vector3} x
|
|
290
290
|
* @param {Vector3} y
|
|
291
291
|
* @example
|
|
@@ -312,17 +312,23 @@ export function outer(x: Vector3, y: Vector3, out_3x3: Matrix3x3): void;
|
|
|
312
312
|
export function cross(x: Vector3, y: Vector3, out: Vector3): Vector3;
|
|
313
313
|
|
|
314
314
|
/**
|
|
315
|
-
*
|
|
316
|
-
* @param {Number[]} x
|
|
317
|
-
* @param {Number} n
|
|
315
|
+
* Compute the norm of a vector.
|
|
316
|
+
* @param {Number[]} x The vector to compute the norm of.
|
|
317
|
+
* @param {Number} [n] The number of components to consider (default is 3).
|
|
318
318
|
*/
|
|
319
|
-
export function norm(x: number[], n
|
|
319
|
+
export function norm(x: number[], n?: number): number;
|
|
320
320
|
|
|
321
321
|
/**
|
|
322
322
|
* Normalize in place. Returns norm.
|
|
323
|
-
* @param {
|
|
323
|
+
* @param {Number[]} x The vector to normalize.
|
|
324
324
|
*/
|
|
325
|
-
export function normalize(x:
|
|
325
|
+
export function normalize(x: number[]): number;
|
|
326
|
+
|
|
327
|
+
/**
|
|
328
|
+
* Normalize in place. Returns norm.
|
|
329
|
+
* @param {Number[]} x The vector to normalize.
|
|
330
|
+
*/
|
|
331
|
+
export function normalize4D(x: number[]): number;
|
|
326
332
|
|
|
327
333
|
/**
|
|
328
334
|
* Given a unit vector v1, find two unit vectors v2 and v3 such that v1 cross v2 = v3
|
|
@@ -339,10 +345,10 @@ export function perpendiculars(
|
|
|
339
345
|
): void;
|
|
340
346
|
|
|
341
347
|
/**
|
|
342
|
-
*
|
|
343
|
-
* @param {Vector3} a
|
|
344
|
-
* @param {Vector3} b
|
|
345
|
-
* @param {Vector3} projection
|
|
348
|
+
* Project vector `a` onto vector `b` and returns the result in projection vector.
|
|
349
|
+
* @param {Vector3} a The first 3D vector.
|
|
350
|
+
* @param {Vector3} b The second 3D vector.
|
|
351
|
+
* @param {Vector3} projection The projection 3D vector.
|
|
346
352
|
*/
|
|
347
353
|
export function projectVector(
|
|
348
354
|
a: Vector3,
|
|
@@ -351,7 +357,7 @@ export function projectVector(
|
|
|
351
357
|
): boolean;
|
|
352
358
|
|
|
353
359
|
/**
|
|
354
|
-
*
|
|
360
|
+
* Compute the dot product of two 2D vectors.
|
|
355
361
|
* @param {Vector2} x
|
|
356
362
|
* @param {Vector2} y
|
|
357
363
|
*/
|
package/Common/Core/Math.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import 'seedrandom';
|
|
2
2
|
import '../../macros2.js';
|
|
3
3
|
import './Math/Constants.js';
|
|
4
|
-
export {
|
|
4
|
+
export { ar as LUFactor3x3, as as LUSolve3x3, a0 as Pi, k as add, Z as angleBetweenVectors, W as areBoundsInitialized, E as areEquals, a as areMatricesEqual, a5 as arrayMax, a4 as arrayMin, G as arrayRange, a9 as beginCombination, a8 as binomial, aV as boundsIsWithinOtherBounds, a1 as ceil, a6 as ceilLog2, aR as clampAndNormalizeValue, F as clampValue, c as clampVector, aq as columnsToMat3, ap as columnsToMat4, aQ as computeBoundsFromPoints, $ as createArray, I as createUninitializedBounds, j as cross, f as default, B as degreesFromRadians, o as determinant2x2, z as determinant3x3, aF as diagonalize3x3, e as distance2BetweenPoints, d as dot, ai as dot2D, aJ as estimateMatrixCondition, aU as extentIsWithinOtherExtent, a7 as factorial, b1 as float2CssRGBA, X as floatRGB2HexCode, b0 as floatToHex2, M as floor, ad as gaussian, ak as gaussianAmplitude, al as gaussianWeight, aT as getAdjustedScalarRange, H as getMajorAxisIndex, aS as getScalarTypeFittingRange, ac as getSeed, V as getSparseOrthogonalMatrix, aM as hex2float, h as hsv2rgb, K as identity, ax as identity3x3, aY as inf, aw as invert3x3, p as invertMatrix, a_ as isFinite, ay as isIdentity, az as isIdentity3x3, N as isInf, a$ as isNaN, i as isNan, Y as isPowerOfTwo, w as jacobi, q as jacobiN, Q as lab2rgb, aN as lab2xyz, C as ldexp, at as linearSolve3x3, aH as luFactorLinearSystem, aI as luSolveLinearSystem, aC as matrix3x3ToQuaternion, a3 as max, a2 as min, au as multiply3x3_mat3, U as multiply3x3_vect3, m as multiplyAccumulate, af as multiplyAccumulate2D, L as multiplyMatrix, aD as multiplyQuaternion, x as multiplyScalar, ae as multiplyScalar2D, T as nearestPowerOfTwo, aZ as negInf, aa as nextCombination, n as norm, an as norm2D, l as normalize, S as normalize2D, J as normalize4D, aE as orthogonalize3x3, ag as outer, am as outer2D, t as perpendiculars, aW as pointIsWithinBounds, ah as projectVector, aj as projectVector2D, aA as quaternionToMatrix3x3, r as radiansFromDegrees, y as random, ab as randomSeed, O as rgb2hsv, P as rgb2lab, aP as rgb2xyz, R as round, aB as roundNumber, b as roundVector, A as rowsToMat3, ao as rowsToMat4, _ as signedAngleBetweenVectors, aG as singularValueDecomposition3x3, aX as solve3PointCircle, aK as solveHomogeneousLeastSquares, aL as solveLeastSquares, g as solveLinearSystem, s as subtract, av as transpose3x3, u as uninitializeBounds, aO as xyz2lab, D as xyz2rgb } from './Math/index.js';
|
|
@@ -60,6 +60,19 @@ export function pointInPolygon(
|
|
|
60
60
|
normal: Vector3
|
|
61
61
|
): PolygonIntersectionState;
|
|
62
62
|
|
|
63
|
+
/**
|
|
64
|
+
* Compute the centroid of a polygon.
|
|
65
|
+
* @param {Array<number>} poly - Array of point indices for the polygon
|
|
66
|
+
* @param {vtkPoints} points - vtkPoints instance
|
|
67
|
+
* @param {Vector3} [centroid] - Optional output array (length 3)
|
|
68
|
+
* @returns {Vector3} The centroid as [x, y, z]
|
|
69
|
+
*/
|
|
70
|
+
export function computeCentroid(
|
|
71
|
+
poly: Array<number>,
|
|
72
|
+
points: TypedArray,
|
|
73
|
+
centroid?: Vector3
|
|
74
|
+
): Vector3;
|
|
75
|
+
|
|
63
76
|
/**
|
|
64
77
|
* Method used to decorate a given object (publicAPI+model) with vtkPolygon characteristics.
|
|
65
78
|
*
|
|
@@ -187,6 +187,32 @@ function getNormal(poly, points, normal) {
|
|
|
187
187
|
return normalize(normal);
|
|
188
188
|
}
|
|
189
189
|
|
|
190
|
+
/**
|
|
191
|
+
* Compute the centroid of a polygon.
|
|
192
|
+
* @param {Array<number>} poly - Array of point indices for the polygon
|
|
193
|
+
* @param {vtkPoints} points - vtkPoints instance
|
|
194
|
+
* @param {Vector3} [centroid] - Optional output array (length 3)
|
|
195
|
+
* @returns {Vector3} The centroid as [x, y, z]
|
|
196
|
+
*/
|
|
197
|
+
function computeCentroid(poly, points) {
|
|
198
|
+
let centroid = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [0, 0, 0];
|
|
199
|
+
centroid[0] = 0;
|
|
200
|
+
centroid[1] = 0;
|
|
201
|
+
centroid[2] = 0;
|
|
202
|
+
const n = poly.length;
|
|
203
|
+
const p = [];
|
|
204
|
+
for (let i = 0; i < n; i++) {
|
|
205
|
+
points.getPoint(poly[i], p);
|
|
206
|
+
centroid[0] += p[0];
|
|
207
|
+
centroid[1] += p[1];
|
|
208
|
+
centroid[2] += p[2];
|
|
209
|
+
}
|
|
210
|
+
centroid[0] /= n;
|
|
211
|
+
centroid[1] /= n;
|
|
212
|
+
centroid[2] /= n;
|
|
213
|
+
return centroid;
|
|
214
|
+
}
|
|
215
|
+
|
|
190
216
|
// ----------------------------------------------------------------------------
|
|
191
217
|
// Static API
|
|
192
218
|
// ----------------------------------------------------------------------------
|
|
@@ -195,7 +221,8 @@ const STATIC = {
|
|
|
195
221
|
PolygonWithPointIntersectionState,
|
|
196
222
|
pointInPolygon,
|
|
197
223
|
getBounds,
|
|
198
|
-
getNormal
|
|
224
|
+
getNormal,
|
|
225
|
+
computeCentroid
|
|
199
226
|
};
|
|
200
227
|
|
|
201
228
|
// ----------------------------------------------------------------------------
|
|
@@ -384,4 +411,4 @@ var vtkPolygon$1 = {
|
|
|
384
411
|
...STATIC
|
|
385
412
|
};
|
|
386
413
|
|
|
387
|
-
export { vtkPolygon$1 as default, extend, getBounds, getNormal, newInstance };
|
|
414
|
+
export { computeCentroid, vtkPolygon$1 as default, extend, getBounds, getNormal, newInstance };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { m as macro } from '../../macros2.js';
|
|
1
|
+
import { m as macro, T as TYPED_ARRAYS } from '../../macros2.js';
|
|
2
2
|
import vtkCell from './Cell.js';
|
|
3
|
-
import { d as dot, j as cross, l as normalize, m as multiplyAccumulate, e as distance2BetweenPoints, o as determinant2x2, p as invertMatrix } from '../Core/Math/index.js';
|
|
3
|
+
import { d as dot, j as cross, l as normalize, m as multiplyAccumulate, e as distance2BetweenPoints, o as determinant2x2, s as subtract, p as invertMatrix } from '../Core/Math/index.js';
|
|
4
4
|
import vtkLine from './Line.js';
|
|
5
5
|
import vtkPlane from './Plane.js';
|
|
6
6
|
|
|
@@ -590,21 +590,16 @@ function vtkTriangle(publicAPI, model) {
|
|
|
590
590
|
* @param {Number[]} derivs - The derivatives.
|
|
591
591
|
*/
|
|
592
592
|
publicAPI.derivatives = (subId, pcoords, values, dim, derivs) => {
|
|
593
|
-
const x0 =
|
|
594
|
-
const x1 =
|
|
595
|
-
const x2 =
|
|
596
|
-
model.points.getPoint(0, x0);
|
|
597
|
-
model.points.getPoint(1, x1);
|
|
598
|
-
model.points.getPoint(2, x2);
|
|
593
|
+
const x0 = model.points.getPoint(0);
|
|
594
|
+
const x1 = model.points.getPoint(1);
|
|
595
|
+
const x2 = model.points.getPoint(2);
|
|
599
596
|
const n = [];
|
|
600
597
|
const v10 = [];
|
|
601
598
|
const v20 = [];
|
|
602
599
|
const v = [];
|
|
603
600
|
computeNormal(x0, x1, x2, n);
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
v[i] = x2[i] - x0[i];
|
|
607
|
-
}
|
|
601
|
+
subtract(x1, x0, v10);
|
|
602
|
+
subtract(x2, x0, v);
|
|
608
603
|
cross(n, v10, v20);
|
|
609
604
|
const lenX = normalize(v10); // check for degenerate triangle
|
|
610
605
|
|
|
@@ -629,7 +624,7 @@ function vtkTriangle(publicAPI, model) {
|
|
|
629
624
|
const J = [v1[0] - v0[0], v1[1] - v0[1], v2[0] - v0[0], v2[1] - v0[1]];
|
|
630
625
|
|
|
631
626
|
// Compute inverse Jacobian (expects flat array)
|
|
632
|
-
const JI =
|
|
627
|
+
const JI = macro.newTypedArray(TYPED_ARRAYS.Float64Array, 4);
|
|
633
628
|
invertMatrix(J, JI, 2); // returns flat array [JI00, JI01, JI10, JI11]
|
|
634
629
|
|
|
635
630
|
// Compute derivatives
|
package/Filters/Core/Cutter.js
CHANGED
|
@@ -257,6 +257,7 @@ function vtkCutter(publicAPI, model) {
|
|
|
257
257
|
const name = pointData.getArrayName(arrayIdx);
|
|
258
258
|
const array = vtkDataArray.newInstance({
|
|
259
259
|
name,
|
|
260
|
+
dataType: pointData.getArrayByIndex(arrayIdx).getDataType(),
|
|
260
261
|
values: newPointData[name],
|
|
261
262
|
numberOfComponents: pointData.getArrayByIndex(arrayIdx).getNumberOfComponents()
|
|
262
263
|
});
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { DesiredOutputPrecision } from './../../Common/DataModel/DataSetAttributes';
|
|
2
|
+
import { vtkAlgorithm, vtkObject } from './../../interfaces';
|
|
3
|
+
import { Vector3 } from './../../types';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
export interface IShrinkPolyDataInitialValues {
|
|
9
|
+
shrinkFactor?: number;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
type vtkShrinkPolyDataBase = vtkObject & vtkAlgorithm;
|
|
13
|
+
|
|
14
|
+
export interface vtkShrinkPolyData extends vtkShrinkPolyDataBase {
|
|
15
|
+
/**
|
|
16
|
+
* Expose methods
|
|
17
|
+
* @param inData
|
|
18
|
+
* @param outData
|
|
19
|
+
*/
|
|
20
|
+
requestData(inData: any, outData: any): void;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Get the shrink factor.
|
|
24
|
+
*/
|
|
25
|
+
getShrinkFactor(): number;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Set the shrink factor.
|
|
29
|
+
* @param {Number} shrinkFactor
|
|
30
|
+
*/
|
|
31
|
+
setShrinkFactor(shrinkFactor: number): boolean;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Shrink two points towards their midpoint by a shrink factor.
|
|
35
|
+
* @param {Vector3} p1 - The [x, y, z] coordinates of the first point
|
|
36
|
+
* @param {Vector3} p2 - The [x, y, z] coordinates of the second point
|
|
37
|
+
* @param {number} shrinkFactor - The shrink factor (0.0 to 1.0)
|
|
38
|
+
* @param {Number[]} [shrunkPoints] - Optional array to store the shrunk points
|
|
39
|
+
* @returns {Number[]} Array containing the two new points
|
|
40
|
+
*/
|
|
41
|
+
shrinkLine(
|
|
42
|
+
p1: Vector3,
|
|
43
|
+
p2: Vector3,
|
|
44
|
+
shrinkFactor: number,
|
|
45
|
+
shrunkPoints?: Number[]
|
|
46
|
+
): Number[];
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Method used to decorate a given object (publicAPI+model) with vtkShrinkPolyData characteristics.
|
|
51
|
+
*
|
|
52
|
+
* @param publicAPI object on which methods will be bounds (public)
|
|
53
|
+
* @param model object on which data structure will be bounds (protected)
|
|
54
|
+
* @param {IShrinkPolyDataInitialValues} [initialValues] (default: {})
|
|
55
|
+
*/
|
|
56
|
+
export function extend(
|
|
57
|
+
publicAPI: object,
|
|
58
|
+
model: object,
|
|
59
|
+
initialValues?: IShrinkPolyDataInitialValues
|
|
60
|
+
): void;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Method used to create a new instance of vtkShrinkPolyData.
|
|
64
|
+
* @param {IShrinkPolyDataInitialValues} [initialValues] for pre-setting some of its content
|
|
65
|
+
*/
|
|
66
|
+
export function newInstance(
|
|
67
|
+
initialValues?: IShrinkPolyDataInitialValues
|
|
68
|
+
): vtkShrinkPolyData;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* vtkShrinkPolyData shrinks cells composing a polygonal dataset (e.g.,
|
|
72
|
+
* vertices, lines, polygons, and triangle strips) towards their centroid. The
|
|
73
|
+
* centroid of a cell is computed as the average position of the cell points.
|
|
74
|
+
* Shrinking results in disconnecting the cells from one another. The output
|
|
75
|
+
* dataset type of this filter is polygonal data.
|
|
76
|
+
*
|
|
77
|
+
* During execution the filter passes its input cell data to its output. Point
|
|
78
|
+
* data attributes are copied to the points created during the shrinking
|
|
79
|
+
* process.
|
|
80
|
+
*/
|
|
81
|
+
export declare const vtkShrinkPolyData: {
|
|
82
|
+
newInstance: typeof newInstance;
|
|
83
|
+
extend: typeof extend;
|
|
84
|
+
};
|
|
85
|
+
export default vtkShrinkPolyData;
|