Hello!

Recently i stumbled upon a problem i seem to haven no clue how to fix ( at least not efficiently ). Basically i am making a procedural 2D mesh generator. One of the features of this mesh generator is to generate randomly deformed cracks that start on the outline of the mesh and then go inwards into the mesh where they slowly come closer and then merge into 1 vertex. For a better idea of what i am talking about you can see the picture below.

as you can see here i have 2 cases of the cracks i was mentioning above, now if you look at the crack on the right, you can see that right and the left side of the crack overlap, this is where the problem lays. How could i deform the vertices relative to the bottom most vertex that connects the crack sides so i would not get any overlapping by the sides of the crack ? My current solution involves adding random integer values to x and y vertex coordinates separately but this doesn’t work on all occasions, as it sometimes overlaps either with the other side of the crack, the triangle below or triangle above.

How could i get rid of this problem ?

Thanks in advance

Dmajster