# How to detect BodyInstance without mesh

**URL:** <https://forum.techsoft3d.com/t/how-to-detect-bodyinstance-without-mesh/4356>\
**Category:** HOOPS Visualize Web\
**Created:** [February 4, 2025, 8:44pm UTC](https://forum.techsoft3d.com/t/how-to-detect-bodyinstance-without-mesh/4356 "2025-02-04T20:44:51Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![guillaume.robichaud](https://avatars.discourse-cdn.com/v4/letter/g/ec9cab/32.png) [@guillaume.robichaud](https://forum.techsoft3d.com/u/guillaume.robichaud)\
**Post date:** [February 4, 2025, 8:44pm UTC](https://forum.techsoft3d.com/t/how-to-detect-bodyinstance-without-mesh/4356/1 "2025-02-04T20:44:51Z")

</div>

On some occasions, we hit a 3D model with missing meshes. So we keep hitting crashes when trying to instance or simply when trying to get a bounding box. I was wondering if there’s was an easy check we could try on node IDs to test whether they are faulty or not.

 ![image](https://us1.discourse-cdn.com/flex020/uploads/techsoft3d/original/2X/0/0783cd4619246c423783e9d50f8b031fc36397d7.png)

---

<div class="post-metadata">

**Author:** ![guillaume.robichaud](https://avatars.discourse-cdn.com/v4/letter/g/ec9cab/32.png) [@guillaume.robichaud](https://forum.techsoft3d.com/u/guillaume.robichaud)\
**Post date:** [February 4, 2025, 8:46pm UTC](https://forum.techsoft3d.com/t/how-to-detect-bodyinstance-without-mesh/4356/2 "2025-02-04T20:46:54Z")

</div>

Same model with getNodeRealBounding()

 ![image](https://us1.discourse-cdn.com/flex020/uploads/techsoft3d/original/2X/a/ae54de418adb260af7405d58632606a7be9467b8.png)

---

<div class="post-metadata">

**Author:** ![tino](https://avatars.discourse-cdn.com/v4/letter/t/9dc877/32.png) [@tino](https://forum.techsoft3d.com/u/tino)\
**Post date:** [February 4, 2025, 11:39pm UTC](https://forum.techsoft3d.com/t/how-to-detect-bodyinstance-without-mesh/4356/3 "2025-02-04T23:39:50Z")

</div>

Hello @guillaume.robichaud,

So there is not a function that directly confirms if a given `meshData` object is valid (contains geometry).

You can try using a `.catch()`:

```auto
hwv.model.getNodeMeshData(nodeId)
    .then(meshData => {
        console.log('Mesh Data:', meshData);
        // Process the meshData
    })
    .catch(error => {
        console.error('Error fetching node mesh data:', error);
    });

```

Thanks,  
Tino

---

<div class="post-metadata">

**Author:** ![guillaume.robichaud](https://avatars.discourse-cdn.com/v4/letter/g/ec9cab/32.png) [@guillaume.robichaud](https://forum.techsoft3d.com/u/guillaume.robichaud)\
**Post date:** [February 5, 2025, 3:37pm UTC](https://forum.techsoft3d.com/t/how-to-detect-bodyinstance-without-mesh/4356/4 "2025-02-05T15:37:51Z")

</div>

> [@tino](#):
>
> `getNodeMeshData`

The documentation for getNodeMeshData says it returns a MeshDataCopy which is

> A self-contained copy of the data of a single mesh

It feels really inefficient to copy all valid meshes, just to find the faulty ones, especially when the intent is to instance an already loaded part.

---

<div class="post-metadata">

**Author:** ![tino](https://avatars.discourse-cdn.com/v4/letter/t/9dc877/32.png) [@tino](https://forum.techsoft3d.com/u/tino)\
**Post date:** [February 5, 2025, 6:02pm UTC](https://forum.techsoft3d.com/t/how-to-detect-bodyinstance-without-mesh/4356/5 "2025-02-05T18:02:29Z")

</div>

Indeed, it can be an expensive operation. I’ll see about creating a feature request to address this.

Thanks,  
Tino
