For the past few months I had be using the same .svg file, and changing my code. This poses a problem: “Does my code work on all files, or just this file?” I tested my code on a couple different files, and I got an answer: “It works… sometimes”. This week was dedicated to fixing bugs that did not show themselves on my original file.
My GUI made it very easy to change parameters and the file I was editing; however, it was not very quick. Every time I edited the code, I would have to close the program, run it again, select a file, enter in the values, hit run, then open the .svg file and check if my edit was successful. This was time consuming, so I copied the program and removed the GUI to expedite the process.
One of the problems I encountered when changing files was the connecting of two endpoints. I think I had done some math wrong, or something. When I ran the program, multiple lines would connect seemingly random endpoints in strange ways. I ended up rewriting the code for endpoints with my previous code as a guideline. This worked great. Another problem I encountered was dealing with piecewise paths, or paths that are not straight lines. The problem here was there were many different points on the line and it was difficult to connect the lines to the correct set of points. It would take a lot of time and energy to fix. I made the decision to put this off until I am more free.
I fixed some other little things in the code, and it works for .svg files with mostly straight lines. I will eventually try to make it even more general, but that is a large task to undertake. At this point, my code can be called “completed,” there are many other things I can do to make it more polished, but it serves its purpose well.