It's been two weeks since my almost "apocalyptic" mesh mayhem post that seemed to spell the end for my current line of thought. That, along with Federico's suggestion of a new way to approach the project (more on that later), seemed to toll the end for this way of generating crack patterns. However, all is not lost.
After a discussion with my tutor, a few methods of enclosing the crack patterns were suggested:
Endpoint-Distance Method
For each layer, take all the end points of the crack branches that did not collide with another branch.
For each end point, perform a trigg distance calculation to every other end point and join to the nearest end point.
This method did not work at all. After initial tests and a few attempts to fix it, the problem of two endpoints being exactly the same distance apart meant that my SortedDictionary (a sorted HashMap for any Java coders reading this) wouldn't accept the key every time due to duplication. Endpoints were also joining themselves to the wrong endpoints. The image below shows this method and its failings.
Shrinkwrap Method
This method was suggested by Steve Maddock, my supervisor. Making use of the fact that the crack pattern is grid-based, Steve suggested that I test every row/column from each side to find the point that is furthest out and then join those to make a shrink-wrapped outline of the mesh. However, whilst this will work every time, it doesn't produce the volumes that are needed for meshing, it instead produces a thin skeleton-like model of the crack pattern. So, not very good really. Picture below (please note, the problem with patterns not going to the end points has been fixed, but it still doesn't look much better):
Clockwise Endpoint Method
This method, suggested by my good self, is another method that is very similar to endpoint meshing but uses the angle from the point of impact to the endpoint as its key. It then joins the end points in the order of the angle they come out at. This method works very very well, it produces proper volumes and in pretty much the correct order too. This series of screenshots show front, 3d front and 3d perspective views of a crack pattern joined in this way (note that the pattern in these shots does not join back to itself, the pattern has been modified to do that since):
So, we've got to this stage. Now, for yet another tricky bit:
Volumisation of the areas
So that these enclosed areas can be put into a mesh, they have to be triangulated (and then the adjacency information for each triangle has to be calculated but thankfully that'll be easier). There are a few triangulation algorithms out there (Delauny, Seidel) so my main problem will actually be finding out which area is which! Below is the diagram I've currently got drawn on my white board (taken with phone camera
):

The black lines from the center point are the 'roots' of the crack pattern. All of the blue lines are 'branches' that have spawned during the process. The green lines are the borders of the crack pattern after it has been enclosed. The blue x's are the start points of the branches and the red x's are the end points of all of the branches or roots. Each volume has been labelled 1-12.
My idea for finding the volumes is a kind of 'tracing' algorithm:
Start with root 0; check each point on its path, see if a collision or start point occurred; If that happens then find out which branch/root it was and follow it back to its start/end (dependent on what you found), along the way checking for any other collisions/start points. If found, repeat the above step. Keep doing this until you reach the point on the root where you started tracing from. Take this path, it's one of your volumes. Keep doing this for each start/collision point on the root.
There are a few problems with this, there's no guarentee you'll get all of the volumes (as some don't contain root parts) and also, what happens when you find the edge?! There are also problems with coming back to the root as 4 cracks start at that point. Special cases will be created for all of these points, however, I think in general the algorithm will work. If anyone has a better solution please contact me (as I can't see any other way about it really).
After I've found the volumes I'm going to take a break from working on the fracture generator. I'm going to try and get the actual cracking process working with a simple manually made mesh (two planes in a cross shape). I hope to have some early results from that next week ![]()
That's all for now
![]()
Steve
Currently Listening To: Feeder
Currently Reading: Practical Algorithms for 3D Computer Graphics
Currently Watching: 24 season 5
Currently Eating: pancakes!!!
Score the mens 1s just beat Aberdeen by: 4-1 congrats!




