# How to detect concave point?

**URL:** <https://forums.unrealengine.com/t/how-to-detect-concave-point/403576>\
**Category:** Rendering\
**Tags:** vertex, point, unreal-engine, Spline, question\
**Created:** [September 2, 2017, 10:46pm UTC](https://forums.unrealengine.com/t/how-to-detect-concave-point/403576 "2017-09-02T22:46:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Slavq](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Slavq](https://forums.unrealengine.com/u/Slavq)\
**Post date:** [September 2, 2017, 10:46pm UTC](https://forums.unrealengine.com/t/how-to-detect-concave-point/403576/1 "2017-09-02T22:46:04Z")

</div>

Let me explain on the picture:

 ![211982-howtodetectconcavepoints.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/e/2/de2c56616193de99353186d0e6a045346b0639e7.png)

Let’s say that all the points are distributed on spline, just like it’s shown in the image.

My first idea is to calculate a convex shape for all these points and then check if point is inside. But I haven’t figured that out yet. Maybe there is a better solution.  
I’ll appreciate any help.

---

<div class="post-metadata">

**Author:** ![Slavq](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Slavq](https://forums.unrealengine.com/u/Slavq)\
**Post date:** [September 5, 2017, 10:30am UTC](https://forums.unrealengine.com/t/how-to-detect-concave-point/403576/2 "2017-09-05T10:30:12Z")

</div>

It’s possible by using one of the convex hull algorithms like Gift Wrapping or Graham Scan. Here is one of the examples: [Convex Hull | Set 1 (Jarvis's Algorithm or Wrapping) - GeeksforGeeks](http://www.geeksforgeeks.org/convex-hull-set-1-jarviss-algorithm-or-wrapping/)

By using an algorithm like that you can create a convex hull that consists of a set of points. All the other points will be concave.
