Search Unity

How do I make all vertices in a mesh equidistant from one another?

Discussion in 'Scripting' started by Shiv2k3, Jul 9, 2021.

  1. Shiv2k3

    Shiv2k3

    Joined:
    Jun 30, 2019
    Posts:
    118
    They all doesn't have to be perfectly equidistant but just as long as it's equidistant enough.
    I know that I need to iterate over every vertex in the mesh for every vertex in the mesh using a nested for loop, and than check if the distance from the vertex from the outer loop and the inner loop have a distance less than some threshold. But after that part how can I actually move the vertices so they are "equidistant"?
     
  2. RadRedPanda

    RadRedPanda

    Joined:
    May 9, 2018
    Posts:
    1,648
    Do you have an example? It's kind of hard to grasp what you're trying to do, there's only one 3D shape with vertices all equidistant from each other and that's a triangular pyramid.
     
    Shiv2k3 likes this.
  3. Shiv2k3

    Shiv2k3

    Joined:
    Jun 30, 2019
    Posts:
    118