Skip to content

Commit 25e9a0e

Browse files
committed
fix(CylinderSource): generate correct normals for directed cylinders
This fixes incorrect normals for capped or directed cylinders
1 parent dfbee4c commit 25e9a0e

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

  • Sources/Filters/Sources/CylinderSource

Sources/Filters/Sources/CylinderSource/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,11 @@ function vtkCylinderSource(publicAPI, model) {
154154
.translate(...model.center.map((c) => c * -1))
155155
.apply(points);
156156

157+
vtkMatrixBuilder
158+
.buildFromRadian()
159+
.rotateFromDirections([0, 1, 0], model.direction)
160+
.apply(normalsData);
161+
157162
const dataset = outData[0]?.initialize() || vtkPolyData.newInstance();
158163
dataset.getPoints().setData(points, 3);
159164
dataset.getPolys().setData(polys, 1);

0 commit comments

Comments
 (0)