# How to obtain the size of a mesh and transformnode

**URL:** <https://forum.babylonjs.com/t/how-to-obtain-the-size-of-a-mesh-and-transformnode/40492>\
**Category:** Questions\
**Created:** [May 4, 2023, 9:43am UTC](https://forum.babylonjs.com/t/how-to-obtain-the-size-of-a-mesh-and-transformnode/40492 "2023-05-04T09:43:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![491667914](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/491667914/32/31500_2.png) [@491667914](https://forum.babylonjs.com/u/491667914)\
**Post date:** [May 4, 2023, 9:43am UTC](https://forum.babylonjs.com/t/how-to-obtain-the-size-of-a-mesh-and-transformnode/40492/1 "2023-05-04T09:43:00Z")

</div>

I want to generate a plane of the same size as the given mesh node. What should I do to know the size of mesh and transformnode.

In this playground, it is evident that the size of the box is different from that of the plane

> **[Babylon.js Playground](https://playground.babylonjs.com/#ZJGX2C%232)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL 3D scenes

---

<div class="post-metadata">

**Author:** ![491667914](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/491667914/32/31500_2.png) [@491667914](https://forum.babylonjs.com/u/491667914)\
**Post date:** [May 4, 2023, 9:45am UTC](https://forum.babylonjs.com/t/how-to-obtain-the-size-of-a-mesh-and-transformnode/40492/2 "2023-05-04T09:45:01Z")

</div>

What I mean by size is that the length and width are the same as mesh or transformnode

---

<div class="post-metadata">

**Author:** ![YouJ](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/youj/32/21196_2.png) [@YouJ](https://forum.babylonjs.com/u/YouJ)\
**Post date:** [May 4, 2023, 1:58pm UTC](https://forum.babylonjs.com/t/how-to-obtain-the-size-of-a-mesh-and-transformnode/40492/3 "2023-05-04T13:58:22Z")

</div>

Hello,

I think this might be specific to the type of mesh you are using. In your case, you are using a cube. boundingInfo.diagonalLength returns the largest diagonal from the furthest corners of the cube. Using math, we can extract the side value of the cube from this diagonal by dividing it by the square root of 3.

Check out the playground, where the plane’s height and width is the same as that of the cube. You just need to move the plane to see it. Hope this helps and solves your problem!

> **[Babylon.js Playground](https://playground.babylonjs.com/#ZJGX2C%233)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL 3D scenes

---

<div class="post-metadata">

**Author:** ![carolhmj](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/carolhmj/32/25918_2.png) [@carolhmj](https://forum.babylonjs.com/u/carolhmj)\
**Post date:** [May 4, 2023, 4:14pm UTC](https://forum.babylonjs.com/t/how-to-obtain-the-size-of-a-mesh-and-transformnode/40492/4 "2023-05-04T16:14:26Z")

</div>

You should use extendSize instead, here’s an example: [Babylon.js Playground (babylonjs.com)](https://playground.babylonjs.com/#ZJGX2C#4)

---

<div class="post-metadata">

**Author:** ![491667914](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/491667914/32/31500_2.png) [@491667914](https://forum.babylonjs.com/u/491667914)\
**Post date:** [May 5, 2023, 6:26am UTC](https://forum.babylonjs.com/t/how-to-obtain-the-size-of-a-mesh-and-transformnode/40492/5 "2023-05-05T06:26:43Z")

</div>

Thank you for your answers. I fully understand this question ❤
