# How can I determine the coordinations of the deepest point of a pit located on a 3D object?

I am trying to find the deepest point of a rough pit located on a rough 3d object. The pit is full of irregular vertices.

• Can you give us a screenshot of the pit? Can't you just go into front view, and wireframe mode and see which vertex is the lowest? – Leander Apr 4 '19 at 15:59
• Thank you @Leander I can go into front view and see vertices as seen in the screenshot below however I am trying to find the exact lowest point of the surface. I am going to make measurements regarding this point for my scientific article so I need to be very precise. drive.google.com/open?id=1muCjhRDHhwo3AnY194BAvkaCpPIdyWhx – Bugri Apr 6 '19 at 16:39

Local minima

Calculus is full of finding maxima and minima of equations. Numerical methods , generally iterative, can be employed to find turning points based from Newton's Method or Gradient Descent to name a couple.

Turning points occur where the derivative (tangent) is zero. Inconveniently the mesh isn't defined as an equation. For every vertex there is a normal, that is perpendicular to the tangent. Vertex selected in "ding" in icosphere test

As a simple test case, for each vertex:

• Create an imaginary plane from coordinate and normal.

• For all vertices of neighbouring faces if the distance to plane is greater than or equal to zero then it is "below" all neighbours and considered a local minimum

• The test is looking at all neighbouring verts being above, for a really rough mesh this may need to be relaxed slightly.

Simple edit mode test script.

import bpy
import bmesh

from mathutils.geometry import distance_point_to_plane as dp2p
context = bpy.context
context.tool_settings.mesh_select_mode = (True, False, False)
ob = context.edit_object
me = ob.data
bm = bmesh.from_edit_mesh(me)
bm.select_flush(True)

for v in bm.verts:
# define "vertex" plane
p_no = v.normal
p_co = v.co
# neighbouring verts
nvs = set(nv for f in v.link_faces for nv in f.verts)
v.select = all(
dp2p(nv.co,p_co,p_no) <= 0
for nv in nvs)

bmesh.update_edit_mesh(me) Result of reversal of test. dp2p(nv.co,p_co,p_no) <= 0 as a useful way to find concavities

Once a point is selected its local depth (depth from surface) could be calculated (estimated) by selecting out from point until distance from plane stops increasing, and choose the max.

As mentioned this is a very simple test. Once a vicinity is known a more robust method like raycasting could be employed.

Do you tried mesh analysis?

The Sharp analysis: And Thickness: • Thanks for helping! – Bugri Apr 18 '19 at 15:38