# randomPointsInBufferGeometry

**URL:** <https://discourse.threejs.org/t/randompointsinbuffergeometry/33610>\
**Category:** Questions\
**Tags:** geometry\
**Created:** [January 13, 2022, 10:59pm UTC](https://discourse.threejs.org/t/randompointsinbuffergeometry/33610 "2022-01-13T22:59:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![TheCat](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/thecat/32/14556_2.png) [@TheCat](https://discourse.threejs.org/u/TheCat)\
**Post date:** [January 13, 2022, 10:59pm UTC](https://discourse.threejs.org/t/randompointsinbuffergeometry/33610/1 "2022-01-13T22:59:02Z")

</div>

Hi,

There used to be a `randomPointsInBufferGeometry` function in [three.js/examples/jsm/utils/GeometryUtils.js](https://github.com/mrdoob/three.js/blob/92db041e370f241f59aa1ea351b139cc0be997f4/examples/js/utils/GeometryUtils.js#L187), as mentioned by loowee in [this post](https://discourse.threejs.org/t/fill-geometry-with-points/11020) but it’s no longer there.

I’ve looked around in other files, but couldn’t find it. Did I just miss it or has it been removed? If so, is there a reason I should be aware of?

Is there any similar function to randomly fill a volume (not a surface) with points?

Thanks!

---

<div class="post-metadata">

**Author:** ![prisoner849](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/prisoner849/32/535_2.png) [@prisoner849](https://discourse.threejs.org/u/prisoner849)\
**Post date:** [January 14, 2022, 6:42am UTC](https://discourse.threejs.org/t/randompointsinbuffergeometry/33610/2 "2022-01-14T06:42:00Z")

</div>

Hi!  
Approach 1: [How fill a loaded STL mesh ( NOT SIMPLE SHAPES LIKE CUBE ETC) with random particles and animate with this geometry bound in three.js - #6 by prisoner849](https://discourse.threejs.org/t/how-fill-a-loaded-stl-mesh-not-simple-shapes-like-cube-etc-with-random-particles-and-animate-with-this-geometry-bound-in-three-js/4702/6) . Awfully slow, imperfect.  
Approach 2: [Three-mesh-bvh: A plugin for fast geometry raycasting and spatial queries!](https://discourse.threejs.org/t/three-mesh-bvh-a-plugin-for-fast-geometry-raycasting-and-spatial-queries/26394) . Fast, perfect, awesome, easy-to-use.  
Used the second one here: [Sand Nefertiti (three-mesh-bvh)](https://discourse.threejs.org/t/sand-nefertiti-three-mesh-bvh/29098)

---

<div class="post-metadata">

**Author:** ![benjaminpreiss](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/benjaminpreiss/32/25748_2.png) [@benjaminpreiss](https://discourse.threejs.org/u/benjaminpreiss)\
**Post date:** [April 20, 2022, 6:19pm UTC](https://discourse.threejs.org/t/randompointsinbuffergeometry/33610/3 "2022-04-20T18:19:13Z")

</div>

Fascinating. I had a look at the code from sand Nefertiti, but it would help me if you could elaborate on how to fill a mesh with the plugin? Many thanks in advance
