Speaker A
In this video, I'm going to show you how I create string art and reveal the secrets behind it. This technique is a fascinating way to turn an image into art using just nails and strings. The working principle of the algorithm is quite simple, so bear with me. I will attempt to explain it now. First, we will need a grayscale target image that we want to recreate. Besides that, a blank white canvas where the algorithm will draw our strings. As the first step, we calculate the difference between the images pixel by pixel. This is done by subtracting the pixel intensity values of the two images at the same index, taking their absolute value, and then summing them up. As a result, we obtain an integer that serves as the baseline for measuring improvements as strings are added. Then, we will need to place a couple of hundred imaginary nails on our canvas like this. A grid arrangement is not the most sophisticated, but it will be good enough for now. Next, we select a random nail as the starting position. From the starting nail, we draw a line to one of the neighboring nails within a specified range. This range represents the maximum allowed length for any single string segment. Since this is an iterative process, at each step we repeatedly draw a line from the current nail to a neighboring nail, recalculate the difference between the images, divide the result by the corresponding line length, and store the result. When no valid nail positions remain within the range, we evaluate the stored results by selecting the nail that minimizes the difference compared to our baseline value. Now that we have the second nail, we simply update our baseline value to the current one and repeat the iterations until no further improvements can be made. And that's basically it. But of course, the devil is in the details. The result can be significantly improved, for example, by positioning the nails in a way that better resembles the original image. At one point, my friend joined the project and took on the task of developing the software while I focused on building the hardware. Speaking of the software, it's plain and simple to use. We just load an image, specify the dimensions of the target string art, set the nail count, and hit optimize. The software generates the drilling and thread plans as well as the simulation data. We also created a Blender project that utilizes the simulation data to create ray-traced images and videos. This way, we can get an idea of how our string art will look in reality. To bring all this to life, I had to build a CNC machine specifically for creating string art. There's a separate video you can watch that explains how I made it. The maximum work area of the machine is 500 by 500 millimeters. Once the workboard was securely mounted in the machine, I began running the drilling program. This process took approximately 50 minutes to complete. Then, I had to clean the sawdust off the board. The most exhausting part came next, where I had to hammer 500 nails into the pre-drilled holes. I have 3D printed a small tool that won't let the nail go deeper into the workboard than needed. Some of the nails had imperfections, so I had to straighten them before continuing. This is the result of two and a half hours of hammering. After this, I needed to set up the CNC machine for the threading work. I admit that I over-engineered the thread supply mechanism. However, I wanted to ensure that nothing would be damaged in case of a collision. Before we find out what's happening next, it's time for a quick ad from the video sponsor, which is PCBWay. PCBWay is a one-stop shop for PCB manufacturing, assembly, and other types of manufacturing services, including CNC machining, sheet metal fabrication, 3D printing, and injection molding. This December, PCBWay is spreading the holiday spirit with their special Christmas event running from December 12th to December 31st, which includes free coupons to save on your next PCB project, a free prototype for Christmas-themed design, and if you have shopped with PCBWay before, you get two chances to open their exciting mystery boxes. Visit PCBWay.com and take advantage of these festive offers before they're gone. I put the link in the description. And now the threading process begins. It's incredibly satisfying to watch as the design gradually takes shape. The feeder tube glides nicely around the nails with precision. Occasionally, it may brush against a nail, but the springy design of the feeder ensures it can handle these minor interactions with ease. Another type of string art, often referred to as polar or circular, is less favored by us due to its inherent limitations. One significant drawback of circular string art is the inability to freely place nails and strings in areas that would solely enhance the design. Additionally, the strings often have to span across the entire circle, limiting finer control over the placement and contributing details. It's more beneficial to have a versatile machine capable of handling standard CNC tasks as well. By the way, the CNC controller software we use is called Candle, and it's completely free. If you would like to experiment with the Blender simulation, you can download the files from my GitHub. The link is in the description. Finally, I encourage you to leave a comment if you have any questions. Please don't forget to drop a like and subscribe to the channel so you won't miss my upcoming videos. Thank you for watching, and I will see you in the next one.