[Bug] vtkTransform: transformNormals and transformVectors do not mark the output as modified
Los mantenedores suelen responder en 2 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 85/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- javascript
- Área
- backend, performance
Línea de trabajo
Lee Sources/Common/Transform/Transform/index.js, especialmente transformNormals (líneas 234–259) y transformVectors (líneas 281–295); después, comprueba cómo DataArray actualiza su fecha de modificación y los rangos almacenados en caché. Actualiza el estado de modificación de los arrays de salida cuando cambien los valores y verifica que las fechas de modificación avancen y que el rango de la componente y de la normal pase a ser [1, 1].
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Bug description
transformNormals (Sources/Common/Transform/Transform/index.js:234 to
259) and transformVectors (index.js:281 to 295) write the results
directly into outNormals.getData() and outVectors.getData(). They do not
call modified(). The output array keeps its old MTime. Thus the cached
ranges stay old, and the renderers do not upload the array again.
Steps to reproduce
- Run this code:
import vtkDataArray from '@kitware/vtk.js/Common/Core/DataArray';
import vtkTransform from '@kitware/vtk.js/Common/Transform/Transform';
const transform = vtkTransform.newInstance();
transform.rotateZ(90);
const input = vtkDataArray.newInstance({
numberOfComponents: 3,
values: new Float32Array([1, 0, 0]),
});
const normals = vtkDataArray.newInstance({
numberOfComponents: 3,
values: new Float32Array(3),
});
const vectors = vtkDataArray.newInstance({
numberOfComponents: 3,
values: new Float32Array(3),
});
console.log('range before', normals.getRange(1));
const normalsTime = normals.getMTime();
const vectorsTime = vectors.getMTime();
transform.transformNormals(input, normals);
transform.transformVectors(input, vectors);
console.log('normals', Array.from(normals.getData()));
console.log('normals modified', normals.getMTime() > normalsTime);
console.log('vectors modified', vectors.getMTime() > vectorsTime);
console.log('range after', normals.getRange(1));
Detailed Behavior
The output is:
range before [ 0, 0 ]
normals [ 3.422854177870249e-8, 1, 0 ]
normals modified false
vectors modified false
range after [ 0, 0 ]
The y component of the normal is 1, but the range stays [0, 0].
Expected Behavior
The two methods mark the output array as modified when a value changes. The
range of the y component becomes [1, 1].
Environment
- vtk.js version: master (
67328bc3ef) - Browsers: Chromium (Playwright, Vitest 5 browser mode)
- OS: Windows 11
- Lenguaje dominante
- JavaScript
- Estrellas
- 1.5k
- Forks
- 428
- Merge medio
- 5 d 9 h
- PR fusionados (30 d)
- 22
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de Kitware/vtk-js
-
type: bug 🐞
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 2 días
-
type: bug 🐞
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
Los mantenedores suelen responder en 2 días
-
type: bug 🐞
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 2 días
-
type: bug 🐞
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Los mantenedores suelen responder en 2 días
-
type: bug 🐞
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
Los mantenedores suelen responder en 2 días
Todos los issues de Kitware/vtk-js
Issues similares
-
documentation
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
andromarces/agent-loops#1735 ·
Los mantenedores suelen responder en 1 día
-
Undo after deleting a todoAbiertoenhancement good first issue help wanted
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
BinaryBaconLabs/todo-app#32 ·
Los mantenedores suelen responder en 1 día
-
Missing assertions to legacy Cafe Menu block testsPosiblemente ocupada @mariamanbar la tomó hoy. Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
freeCodeCamp/freeCodeCamp#71624 ·
Los mantenedores suelen responder en 1 día
-
Bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
JSPrismarine/JSPrismarine#2915 ·
Los mantenedores suelen responder en 1 día
-
posthog
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
DobermanCore/Doberman-Core#791 ·
Los mantenedores suelen responder en 3 días