Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question How to find the external edges of a 3D mesh?

Discussion in 'General Graphics' started by power_champ, Sep 7, 2023.

  1. power_champ

    power_champ

    Joined:
    Oct 6, 2020
    Posts:
    10
    How would I find the external edges of a complex 3D mesh?

    Am I looking for edges that connect faces with different normals?

    I am generating the meshes myself if that is any help to me.

    Any help appreciated.
     
  2. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,492
    What do you mean by external edges?

    in screen space?
    If screen relative, they are the edges that link forward facing triangles with backfacing triangles, so when the dot product with both the triangle face is crossing zero. If you have uv or other seam, you might not detect the edge if it's on a seam (vertex are duplicated), but you can preprocess to detect duplicated vertex and do the compute on that representation of the mesh.

    In world space?
    I don't know how that would look like, but I'm assuming you have a centroid and want to find edge on the convex shape that enclose the mesh. I would use a support vector strategy to do that, by detecting all vertex inside the convex shape, by using a dot product with max operation from the centroid to all vertex, comparing every centroid to vertex vector to each other.
     
  3. power_champ

    power_champ

    Joined:
    Oct 6, 2020
    Posts:
    10
    Sorry classic case of not understanding the problem space.

    I was trying to bevel some edges that were too close together.

    Thank you for your response though, much appreciated.
     
    neoshaman likes this.