# How Can I Return Number of Faces in a Mesh?

**URL:** <https://forum.babylonjs.com/t/how-can-i-return-number-of-faces-in-a-mesh/4462>\
**Category:** Questions\
**Created:** [July 12, 2019, 8:12pm UTC](https://forum.babylonjs.com/t/how-can-i-return-number-of-faces-in-a-mesh/4462 "2019-07-12T20:12:27Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![allen-woods](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/allen-woods/32/18167_2.png) [@allen-woods](https://forum.babylonjs.com/u/allen-woods)\
**Post date:** [July 12, 2019, 8:12pm UTC](https://forum.babylonjs.com/t/how-can-i-return-number-of-faces-in-a-mesh/4462/1 "2019-07-12T20:12:27Z")

</div>

Another newbie question,

Is there a built-in way to spit out the number of faces that a mesh has within a scene? If so, how do I use it?

I attempted to return a number from **getTotalVertices()** from the human figure in this playground, but it returned zero instead. I must need to access a nested child mesh somehow:  
[https://www.babylonjs-playground.com/#0K8EYN#0](https://www.babylonjs-playground.com/#0K8EYN#0)

What I suspect is that this mesh is a combo of low poly model and smooth shading to make it appear like a more complex geometry, but I want to be able to study polycount of a given mesh regardless.

---

<div class="post-metadata">

**Author:** ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)\
**Post date:** [July 12, 2019, 8:18pm UTC](https://forum.babylonjs.com/t/how-can-i-return-number-of-faces-in-a-mesh/4462/2 "2019-07-12T20:18:25Z")

</div>

You are right, the Dude is composed a several child meshes:

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/2X/f/f3b85542c2c81771a7b247e2e9a781f175471fb6.png)

On a specific mesh, you can use `mesh.getTotalVertices()` and `mesh.getTotalIndices()`

---

<div class="post-metadata">

**Author:** ![allen-woods](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/allen-woods/32/18167_2.png) [@allen-woods](https://forum.babylonjs.com/u/allen-woods)\
**Post date:** [July 12, 2019, 8:28pm UTC](https://forum.babylonjs.com/t/how-can-i-return-number-of-faces-in-a-mesh/4462/3 "2019-07-12T20:28:14Z")

</div>

Thank you as always for your swift reply @Deltakosh 🙂

I logged a rather high number when I ran this. It reflects a single sub mesh or the entire body of “dude”?

`console.log(dude.getChildMeshes()[0].getTotalIndices()) // Returns 21690`

This playground runs smoothly even though I expected to see some slow down on mobile, so I’m attempting to use it as a test case for poly count in a scene.

---

<div class="post-metadata">

**Author:** ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)\
**Post date:** [July 12, 2019, 10:09pm UTC](https://forum.babylonjs.com/t/how-can-i-return-number-of-faces-in-a-mesh/4462/4 "2019-07-12T22:09:47Z")

</div>

It is the number of indices per mesh. Number of faces or triangles = indices / 3

---

<div class="post-metadata">

**Author:** ![jerome](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/jerome/32/22_2.png) [@jerome](https://forum.babylonjs.com/u/jerome)\
**Post date:** [July 13, 2019, 6:22am UTC](https://forum.babylonjs.com/t/how-can-i-return-number-of-faces-in-a-mesh/4462/5 "2019-07-13T06:22:28Z")

</div>

[https://doc.babylonjs.com/how\_to/how\_to\_use\_facetdata#what-is-a-mesh-facet](https://doc.babylonjs.com/how_to/how_to_use_facetdata#what-is-a-mesh-facet)

[https://doc.babylonjs.com/how\_to/how\_to\_use\_facetdata](https://doc.babylonjs.com/how_to/how_to_use_facetdata)
