# Why is the reversed cell aways shown as black?

**URL:** https://discourse.vtk.org/t/why-is-the-reversed-cell-aways-shown-as-black/7708
**Category:** Support
**Created:** [January 24, 2022, 7:42am UTC](https://discourse.vtk.org/t/why-is-the-reversed-cell-aways-shown-as-black/7708 "2022-01-24T07:42:55Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![AlexLuya](https://discourse.vtk.org/user_avatar/discourse.vtk.org/alexluya/32/4036_2.png) [@AlexLuya](https://discourse.vtk.org/u/AlexLuya)
#### Post date: [January 24, 2022, 7:42am UTC](https://discourse.vtk.org/t/why-is-the-reversed-cell-aways-shown-as-black/7708/1 "2022-01-24T07:42:55Z")

</div>

Hello,I used:

```
cubeActor->GetMapper()->GetInput()->ReverseCell(cellId)

```

to reverse a face of a cube,after reversing,face table of obj changed from

```
f 1/1/1 2/2/2 3/3/3 4/4/4
f 5/5/5 6/6/6 7/7/7 8/8/8
f 9/9/9 10/10/10 11/11/11 12/12/12
f 13/13/13 14/14/14 15/15/15 16/16/16
f 17/17/17 18/18/18 19/19/19 20/20/20 <--------
f 21/21/21 22/22/22 23/23/23 24/24/24

```

to

```
f 1/1/1 2/2/2 3/3/3 4/4/4
f 5/5/5 6/6/6 7/7/7 8/8/8
f 9/9/9 10/10/10 11/11/11 12/12/12
f 13/13/13 14/14/14 15/15/15 16/16/16
f 20/20/20 19/19/19 18/18/18 17/17/17 <-------
f 21/21/21 22/22/22 23/23/23 24/24/24

```

As you can see the 5th record was reversed from 17/18/19/20 to 20/19/18/17 as expected,but the problem is this face always shown as black like this:

 ![Workspace 1_1345](https://discourse.vtk.org/uploads/default/original/2X/c/c6fa957c5b5fcf21faea71f3cc1664c373e17504.png)

even set scalars of {0,0,255} to each cell,the 5th face is still shown as black:

 ![Workspace 1_1346](https://discourse.vtk.org/uploads/default/original/2X/d/dfb0176a4d1019a3aa23d54ad0a6d6f29872696c.png)

Question is

```
How to make the reversed cell to show color correctly?

```

Reversed obj:  
[cube-after-reverse.obj](https://discourse.vtk.org/uploads/short-url/qpl4Ccus03p94AwQS8l4DTUC2AG.obj) (1.0 KB)

---

<div class="post-metadata">

### Author: ![marcomusy](https://discourse.vtk.org/user_avatar/discourse.vtk.org/marcomusy/32/95_2.png) [@marcomusy](https://discourse.vtk.org/u/marcomusy)
#### Post date: [January 24, 2022, 11:08am UTC](https://discourse.vtk.org/t/why-is-the-reversed-cell-aways-shown-as-black/7708/2 "2022-01-24T11:08:06Z")

</div>

You need to flip the normal too.

---

<div class="post-metadata">

### Author: ![AlexLuya](https://discourse.vtk.org/user_avatar/discourse.vtk.org/alexluya/32/4036_2.png) [@AlexLuya](https://discourse.vtk.org/u/AlexLuya)
#### Post date: [January 26, 2022, 9:40am UTC](https://discourse.vtk.org/t/why-is-the-reversed-cell-aways-shown-as-black/7708/3 "2022-01-26T09:40:26Z")

</div>

tried,not work

---

<div class="post-metadata">

### Author: ![marcomusy](https://discourse.vtk.org/user_avatar/discourse.vtk.org/marcomusy/32/95_2.png) [@marcomusy](https://discourse.vtk.org/u/marcomusy)
#### Post date: [January 26, 2022, 1:22pm UTC](https://discourse.vtk.org/t/why-is-the-reversed-cell-aways-shown-as-black/7708/4 "2022-01-26T13:22:16Z")

</div>

The `vtkPolyDataNormals` filter seems to give the expected result. E.g.

```python
import vedo
vedo.Mesh('cube-after-reverse.obj').computeNormals().show(axes=1)

```

 ![Screenshot from 2022-01-26 14-17-53](https://discourse.vtk.org/uploads/default/original/2X/1/1d06ef657ed4ceecf2c349e948c7870c218acacc.png)
