Detect Faces of mesh

Hi All,

I am facing problem to get all the faces of mesh as I have tried updateFacetsData() method and I but I am getting null values.
So please help me to get faces of mesh.Thanks in advance.

Hello please provide a repro so we can help you further :wink:
Make the Best Use of the Forum | Babylon.js Documentation (

Please find the playground link given below:
But u can’t saw the web page view as CORS issue is happening.But my problem statement is simple like if I am loading .glb files I am not able to get VerticesData.So please help me to resolve this issue.

You should follow this guide to make the playground work Using External Assets In the Playground | Babylon.js Documentation

It might be related to the model so having it running will help.

The fact you mentioned glb, i’m thinking you’re trying to call the function on the root node, not the mesh :slight_smile:

Your mesh or meshes contained in your glb, will be children of the root transformNode

1 Like

Thanks @sebavan.
Yes now I have correctify my playground link:

So here I want to find the vertices of my ImportedMesh but I am getting null values.

you do not have a mesh named mesh0 in your scene so you won t find anything.

You should use “object1”

But @sebavan if I am changing my mesh name to object1 then also I am getting null values:

You are not passing the kind of data you want from getVerticesData ? you shoud definitely check the doc: Updating Vertices | Babylon.js Documentation

Sorry @sebavan but again no luck.Please have a look I am calculating the indices but here also I am getting null values :slight_smile:

Now at least everything works but the updateFacetData that fails on this file. @Cedric could you have a look ?

Sure! Let me take a look.

1 Like

@Cedric don’t know if this helps

Adding in forceSharedVertices and then using updateFacetData works



PR is live Check Normals before computing Facets by CedricGuillemet · Pull Request #10569 · BabylonJS/Babylon.js · GitHub


You are the best !!!