7

I have a 3D mesh which represents a surface with some rough boundaries which I would like to smooth:

Mesh Boundary 1 Mesh boundary 2

I am using a half edge data structure for storing the geometry so I can easily iterate over the boundary edges, vertices and faces. I can also quite easily determine whether a given pair of edges is a convex/concave using a dot and cross product.

What would be the best approach for smoothing the edges out, so they form a continuous, curvy line, rather then the sharp pattern seen in the pictures?

jaho
  • 4,852
  • 6
  • 40
  • 66

1 Answers1

6
  1. compute angle between two neighboring faces

    I call it ada as abs delta angle. If it is bigger then threshold it means this point is edge. You can compute it as max of all angles between all edge lines. In 2D it looks like this:

    ada 2D

    in 3D mesh there is more then 2 lines per point so you have to check all combinations and select the biggest one

    ada=max(abs(acos(n(i).n(j)))
    

    where n(i),n(j) are normal vectors of neighboring faces where i != j

  2. identify problematic zones

    so find points where ada > threshold and create a list of these points

  3. filter this list

    if this point is too far from any other (distance>threshold) then remove it from list to preserve geometric shape

  4. smooth points

    you have to tweak this step to match your needs I would do this:

    find a group of points in the list which are close together and apply some averaging geometric or numeric on them for example:

    pnt(i)=0.5*pnt(i)+0.25*pnt(i-1)+0.25*pnt(i+1)
    

    this can be applied repetitive

    smoothing

    blue and red dots are original points, green dots are smoothed points

Spektre
  • 49,595
  • 11
  • 110
  • 380
  • I've actually skipped the first step. I just iterate over an ordered collection of all boundary vertices and apply the formula you provided in step 4 (with distance threshold) . The result is sufficient for my needs. By changing the number of iterations I can get the edges more or less smooth. Here's the result from the model above: http://oi61.tinypic.com/k0vb5.jpg Thanks. – jaho May 29 '14 at 16:21
  • @Marian you can play with the weights inside formula but the sum has to be 1.0 (also you can add more points to it)... I use this for complex shapes so I need to distinguish between shape edges and sampling errors thats why I need the ada values ... if you have this error on whole shape then there is no point to compute it (but you have to take in mind that overal area/volume of the mesh can shift a little by this kind of averaging)... – Spektre May 29 '14 at 19:17