# How to get all faces of cube in newest version?

**URL:** <https://discourse.threejs.org/t/how-to-get-all-faces-of-cube-in-newest-version/59862>\
**Category:** Questions\
**Tags:** faces, geometry\
**Created:** [January 2, 2024, 10:52am UTC](https://discourse.threejs.org/t/how-to-get-all-faces-of-cube-in-newest-version/59862 "2024-01-02T10:52:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![hunghaui2310](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/hunghaui2310/32/43456_2.png) [@hunghaui2310](https://discourse.threejs.org/u/hunghaui2310)\
**Post date:** [January 2, 2024, 10:52am UTC](https://discourse.threejs.org/t/how-to-get-all-faces-of-cube-in-newest-version/59862/1 "2024-01-02T10:52:02Z")

</div>

When I get all faces from BoxGeometry, it’s seem deprecated in the newest version.  
I means, faces is undefined in this case:

```javascript
const geometry = new THREE.BoxGeometry( 1, 1, 1 );
const mesh = new THREE.Mesh( geometry, new THREE.MeshStandardMaterial() );
mesh.name = 'Box';
const faces = mesh.geometry.faces // undefined

```

How can get all faces of BoxGeometry in the newest version?

---

<div class="post-metadata">

**Author:** ![hofk](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/hofk/32/44944_2.png) [@hofk](https://discourse.threejs.org/u/hofk)\
**Post date:** [January 2, 2024, 11:30am UTC](https://discourse.threejs.org/t/how-to-get-all-faces-of-cube-in-newest-version/59862/2 "2024-01-02T11:30:30Z")

</div>

The new versions only use buffer geometry.  
You have to work with the indices.

```javascript
 const posArray = mesh.geometry.attributes.position.array;
 const indArray = mesh.geometry.index.array;

```

[threejsResources/THREEn/THREEn.js at f7ecc1c0584c475225570dea6f5cd2f32dda96d3 · hofk/threejsResources · GitHub](https://github.com/hofk/threejsResources/blob/f7ecc1c0584c475225570dea6f5cd2f32dda96d3/THREEn/THREEn.js)

See [NumberingHelperExamples](https://hofk.de/main/discourse.threejs/2022/THREEn/NumberingHelperExamples.html)

from the [Collection of examples from discourse.threejs.org](https://discourse.threejs.org/t/collection-of-examples-from-discourse-threejs-org/4315)

* * *

UPDATE  
In this example you can see how to create a buffer geometry yourself. [SkewedRectangularPyramid](https://hofk.de/main/discourse.threejs/2023/SkewedRectangularPyramid/SkewedRectangularPyramid.html)
