[Bug] vtkPlanes: a change to the plane points or normals does not update the clip filters
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 78/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- javascript
調査の方向性
点と法線が公開されている Sources/Common/DataModel/Planes/index.js:290 から始め、vtkPlanes が変更時刻をどのように報告するかを調べてください。Issue の再現例では vtkClipPolyData を通じて古い出力が示されています。MTime の動作を更新した後に実行し、xmin after が 0.5 であることを確認してください。また、Issue によると暗黙関数の MTime に依存する vtkCutter についても、同じ動作を確認してください。
索引モデルが issue の本文から書いたものです。
説明
Bug description
Sources/Common/DataModel/Planes/index.js:290 gives access to points and
normals through macro.setGet. vtkPlanes does not override getMTime.
If you move a plane with a change to these arrays and call their
modified(), the vtkPlanes MTime does not change. vtkClipPolyData and
vtkCutter use only the MTime of the implicit function, so they keep their
old output.
Steps to reproduce
- Run this code:
import vtkPoints from '@kitware/vtk.js/Common/Core/Points';
import vtkDataArray from '@kitware/vtk.js/Common/Core/DataArray';
import vtkPlanes from '@kitware/vtk.js/Common/DataModel/Planes';
import vtkPolyData from '@kitware/vtk.js/Common/DataModel/PolyData';
import vtkClipPolyData from '@kitware/vtk.js/Filters/Core/ClipPolyData';
const points = vtkPoints.newInstance();
points.setData(new Float32Array([0, 0, 0]), 3);
const normals = vtkDataArray.newInstance({
numberOfComponents: 3,
values: new Float32Array([1, 0, 0]),
});
const planes = vtkPlanes.newInstance();
planes.setPoints(points);
planes.setNormals(normals);
const quad = vtkPolyData.newInstance();
quad.getPoints().setData(
new Float32Array([-1, -1, 0, 1, -1, 0, 1, 1, 0, -1, 1, 0]),
3
);
quad.getPolys().setData(new Uint32Array([4, 0, 1, 2, 3]));
const clip = vtkClipPolyData.newInstance({ clipFunction: planes });
clip.setInputData(quad);
console.log('xmin before', clip.getOutputData().getBounds()[0]);
// Move the plane from x = 0 to x = 0.5.
points.setPoint(0, 0.5, 0, 0);
points.modified();
console.log('xmin after', clip.getOutputData().getBounds()[0]);
Detailed Behavior
The output is:
xmin before 0
xmin after 0
A new filter with the plane at x = 0.5 gives xmin 0.5. The old filter does
not execute again.
Expected Behavior
vtkPlanes.getMTime() includes the MTime of the points and the normals. The
filter executes again and xmin after is 0.5.
Environment
- vtk.js version: master (
67328bc3ef) - Browsers: Chromium (Playwright, Vitest 5 browser mode)
- OS: Windows 11
- 主要言語
- JavaScript
- スター
- 1.5k
- フォーク
- 428
- 平均マージ
- 5日 9時間
- マージ済み PR(30日)
- 22
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Kitware/vtk-js のほかの issue
-
type: bug 🐞
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 2 日以内に返信
-
type: bug 🐞
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
メンテナーはふだん 2 日以内に返信
-
type: bug 🐞
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 2 日以内に返信
-
type: bug 🐞
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 2 日以内に返信
-
type: bug 🐞
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
メンテナーはふだん 2 日以内に返信
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
hypothesis/client#7592 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
fingerprintjs/fingerprintjs#1235 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
complexity: trivial documentation help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
dunia-hub/stellar-402-live#47 ·
メンテナーはふだん 1 日以内に返信