# Why does the vtkOBJReader add point automatically?

**URL:** https://discourse.vtk.org/t/why-does-the-vtkobjreader-add-point-automatically/9367
**Category:** Support
**Created:** [September 16, 2022, 1:17pm UTC](https://discourse.vtk.org/t/why-does-the-vtkobjreader-add-point-automatically/9367 "2022-09-16T13:17:52Z")
**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: [September 16, 2022, 1:17pm UTC](https://discourse.vtk.org/t/why-does-the-vtkobjreader-add-point-automatically/9367/1 "2022-09-16T13:17:52Z")

</div>

Hello,I have an cube in obj format with content like this:

```auto
o Cube
v 1.000000 1.000000 -1.000000
v 1.000000 -1.000000 -1.000000
v 1.000000 1.000000 1.000000
v 1.000000 -1.000000 1.000000
v -1.000000 1.000000 -1.000000
v -1.000000 -1.000000 -1.000000
v -1.000000 1.000000 1.000000
v -1.000000 -1.000000 1.000000
vn 0.0000 1.0000 0.0000
vn 0.0000 0.0000 1.0000
vn -1.0000 0.0000 0.0000
vn 0.0000 -1.0000 0.0000
vn 0.0000 0.0000 -1.0000
s off
f 1//1 5//1 7//1 3//1
f 4//2 3//2 7//2 8//2
f 8//3 7//3 5//3 6//3
f 6//4 2//4 4//4 8//4
f 2//3 4//3 3//3 1//3
f 6//5 5//5 1//5 2//5

```

Below code:

```auto
#include <vtkOBJReader.h>
#include <vtkNew.h>
#include <vtkCleanPolyData.h>

int main(int, char*[]) {

	auto fileName = "/path/to/above/objFile.obj";

	vtkNew<vtkOBJReader> reader;
	reader->SetFileName(fileName);
	reader->Update();
	auto rawPD = reader->GetOutput();

	std::cout << "Point number before clean: " << rawPD->GetNumberOfPoints() << std::endl << std::endl;

	vtkNew<vtkCleanPolyData> clean;
	clean->SetInputData(rawPD);
	clean->SetTolerance(0.0);
	clean->PointMergingOn();
	clean->Update();

	auto pd=clean->GetOutput();

	std::cout << "Point number after clean: " << pd->GetNumberOfPoints() << std::endl << std::endl;
}

```

Outputs:

```auto
Point number before clean: 24

Point number after clean: 8

```

Why?

---

<div class="post-metadata">

### Author: ![danlipsa](https://discourse.vtk.org/user_avatar/discourse.vtk.org/danlipsa/32/390_2.png) [@danlipsa](https://discourse.vtk.org/u/danlipsa)
#### Post date: [September 16, 2022, 2:05pm UTC](https://discourse.vtk.org/t/why-does-the-vtkobjreader-add-point-automatically/9367/2 "2022-09-16T14:05:11Z")

</div>

Faces 0 and 1 share point 3, but that point has different normals in the two faces (0 and 1). That point is duplicated.  
Same happens for other shared points that have different normals. This is also important (more important) for texture coordinates.

---

<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: [September 16, 2022, 2:12pm UTC](https://discourse.vtk.org/t/why-does-the-vtkobjreader-add-point-automatically/9367/3 "2022-09-16T14:12:56Z")

</div>

Thanks,aren’t these normals for point but for face itself?

---

<div class="post-metadata">

### Author: ![danlipsa](https://discourse.vtk.org/user_avatar/discourse.vtk.org/danlipsa/32/390_2.png) [@danlipsa](https://discourse.vtk.org/u/danlipsa)
#### Post date: [September 16, 2022, 3:00pm UTC](https://discourse.vtk.org/t/why-does-the-vtkobjreader-add-point-automatically/9367/4 "2022-09-16T15:00:18Z")

</div>

They are specified for every point of the face isn’t it?
