# THREE.RegionGeometry: Angle based face and edge search

**URL:** <https://discourse.threejs.org/t/three-regiongeometry-angle-based-face-and-edge-search/14436>\
**Category:** Showcase\
**Tags:** geometry\
**Created:** [April 20, 2020, 6:47am UTC](https://discourse.threejs.org/t/three-regiongeometry-angle-based-face-and-edge-search/14436 "2020-04-20T06:47:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Click\_Clock\_Boom](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/click_clock_boom/32/9687_2.png) [@Click\_Clock\_Boom](https://discourse.threejs.org/u/Click_Clock_Boom)\
**Post date:** [April 20, 2020, 6:47am UTC](https://discourse.threejs.org/t/three-regiongeometry-angle-based-face-and-edge-search/14436/1 "2020-04-20T06:47:22Z")

</div>

This solves a limitation that EdgesGeometry has. EdgesGeometry can’t be used to find cluster of faces and the proper edges associated with them based on a threshold angle.

 ![region](https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/2X/8/8f348e69dc6a81f6d084832edcba598695ab06e8.jpeg)

Source: [https://github.com/bytezeroseven/THREE.RegionGeometry](https://github.com/bytezeroseven/THREE.RegionGeometry)  
Demo: [https://bytezeroseven.github.io/THREE.RegionGeometry/](https://bytezeroseven.github.io/THREE.RegionGeometry/)

The geometry adds `Face3.regionIndex` for interactivity. The faces of a region can be accessed using `RegionGeometry.regions[Face3.regionIndex]` .

The regions and edges can be updated using `RegionGeometry.update( thresholdAngle )` .

I use it for flood filling the faces in my paint app.

[https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/2X/c/cb13f1747220a5e4c0b50a1edb4d9be47e6d62e0.mp4](https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/2X/c/cb13f1747220a5e4c0b50a1edb4d9be47e6d62e0.mp4)
